Jump to content

FBX or DWG export for max import?


Brian Cassil
 Share

Recommended Posts

Dave Stewart did some research on what the best batch sizes are for attaching via script if anyone cares to adapt it to their code: It sped my time up by a *LOT* will post the results once i re-stabilize.

 

Teaser: 2.6million faces in 2601 teapots -> 108seconds to collapse down.

 

I came across this thread awhile ago that I think linked back to Dave's research. If you haven't read it yet, it may be helpful also.

 

http://forums.cgsociety.org/showthread.php?f=98&t=635477&highlight=attach+loop

Link to comment
Share on other sites

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

Yea i saw that earlier.. Here's his script translated into attaching the current selection Its only a partial solution so far, it simplifies the number of objects vastly however.. (2500object selection collapses down to 64objects in something like 18 seconds.)

 

Works fairly quick, depending on polycount of the objects you're attaching.

 

adapting that to help with the revit fbx monstrosity shouldn't be hard.

Link to comment
Share on other sites

based on what i've seen in this thread, i'm using the following workflow for fbx:

 

  1. import fbx
  2. run autoedges script to remove triangulation
  3. run layers by materials script to sort objects into layers.
  4. freeze all layers and turn on one layer at a time to collapse using quick collapse script (fyi, be sure set each layer active that your unfreezing due to the script putting the collapsed object on your active layer)

i think assigning the quickcollapse script to a hotkey will definately speed up the process. It will still be tedius going through one layer at a time.

 

does this sound about right?

Link to comment
Share on other sites

That is essentially what I do, except I haven't tested Dave's script with it. I was using a blur script before, that attaches everything that is currently selected. It worked fairly decent, but doesn't take into account RAM usage, so I always needed to keep a really close eye on that.

 

i've always had ram issues merging the "metal - aluminum" layer which ends up being all the window mullions on a particular project i'm working on. 2332 objects merged to 1 in about a minute without crashing.

 

We did just get machines with 16 gigs of ram now though so i'm not sure if that's what's helping or the script.

Edited by shaunph78
the word layers to objects
Link to comment
Share on other sites

Well, so far my collapse by material looks like its chugging away nicely at a 10million poly scene.. thats more or less solid in the wireframe mode heh. looks to be holding steady at 2.1g of ram use too. It was 1.7 just to open the file.

 

On the plus side, script works to collapse.. on the minus side, just going en-masse by material on a large scene isn't going to cut it.

 

Although its jumped up to 6g swap file use once the collapse finished, i guess since it killed a lot of the instancing. Hmmmm. oh the testing.

 

I've got a tweak for the material -> layers script too that speeds it up when there are huge amounts of geometry.. i'll throw that up later~

 

Also.. the layer thing in the QuickCollapse shouldn't be a problem.. i just didn't think of that!

Link to comment
Share on other sites

  • 2 months later...
based on what i've seen in this thread, i'm using the following workflow for fbx:

 

  1. import fbx
  2. run autoedges script to remove triangulation
  3. run layers by materials script to sort objects into layers.
  4. freeze all layers and turn on one layer at a time to collapse using quick collapse script (fyi, be sure set each layer active that your unfreezing due to the script putting the collapsed object on your active layer)

i think assigning the quickcollapse script to a hotkey will definately speed up the process. It will still be tedius going through one layer at a time.

 

does this sound about right?

 

Sorry about the late reply to this thread. I was wondering where you got the 'layers by materials' script. Any chance you could post it here?

Link to comment
Share on other sites

Thanks for the quick reply. I thought that was the script before however whenever i run it max says there's a problem with the addnode line:

 

for o in obj where o.material.name == m.name do (layer.addnode o)

 

and there is no change to the layers. Any ideas?

Link to comment
Share on other sites

Thanks for the quick reply. I thought that was the script before however whenever i run it max says there's a problem with the addnode line:

 

for o in obj where o.material.name == m.name do (layer.addnode o)

 

and there is no change to the layers. Any ideas?

 

Try putting everything on layer 0, delete all of the other layers, and then run it. I think that error pops up when it is trying to create a layer the same ass one that already exists.

Link to comment
Share on other sites

I don't know if the end result is exactly the same, as I haven't had much time to play with it, but Autodesk has a script for "removing visible edges from imported FBX models." It's described in the help file for the FBX 2010.0 plugin under "Revit Architecture to 3ds Max workflow". I gave it a go and it removed all the extra visible edges quite quickly. Using the autoEdge script from Jon Seagull took about 50 minutes to complete on a model with 6000+ objects at a rate of about 2 objects per second. This one was done in 40 seconds. Copy and paste it into a new MaxScript, select all of your objects, and then do a CTRL-E to run it.

 

(

-- do this in a local scope so I don't pollute the global scope.

function setVisibilityEdges obj =

(

	local edgeSelSet = #()

	-- Go through all faces

	local numFaces = obj.numfaces

	for faceIndex = 1 to numFaces do

	(	

		-- And for every one of the 3 edges

		for edgeIndex = 1 to 3 do 

		(

			--collect the edge

			append edgeSelSet ( ((faceIndex-1)*3) + edgeIndex )

		)

	)

	-- Select all visible edges

	meshop.autoedge obj edgeSelSet 5 type:#setclear 

)

--==============================================

-- Start of the runtime script

--==============================================

local timestart = timestamp()

-- turn off undo during this operation.

with undo off

(

	local editMeshArray = #()

	for obj in Selection do

	(

		if (classof obj == Editable_Mesh) do

		(

			-- collect all the edit meshes first, because the

			-- user could have selected some helper objects too, which we

			-- don't want to process.

			append editMeshArray obj

		)

	)

	-- we don't need to hold the selection anymore, clear it out.

	clearselection()

			-- Array of object handles that have already had their edges hidden

	local allReadyProcessed = #()

	-- iterate through all selected edit meshes...

	for editMeshobj in editMeshArray do

	(

		local found = (FindItem allReadyProcessed editMeshobj.handle) > 0

		if (not found) then

		(

			setVisibilityEdges editMeshobj

			append allReadyProcessed editMeshobj.handle				-- Mark all the instances as processed too!

			InstanceMgr.GetInstances editMeshobj &repeatArray

			if (repeatArray.count > 0) then

			(

				-- mark them as processed by adding their handle to the array

				for repeat in repeatArray do

				(

					append allReadyProcessed repeat.handle

				)

			)

		)

	)

)

redrawviews()

local timeend = timestamp()

format "Total time: % (seconds)\n" ((timeend - timestart)/1000.0))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...