Crazy Homeless Guy Posted March 13, 2009 Share Posted March 13, 2009 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 More sharing options...
Dave Buchhofer Posted March 13, 2009 Share Posted March 13, 2009 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 More sharing options...
Crazy Homeless Guy Posted March 13, 2009 Share Posted March 13, 2009 Thanks, now I have a Dave Buchhofer directory in my script library. Link to comment Share on other sites More sharing options...
Dave Buchhofer Posted March 16, 2009 Share Posted March 16, 2009 Last giveaway for a while http://buchhofer.com/upload/files/Scripts/QuickCollapse.ms works on Selected Objects, Collapses completely to 1 object, and set up in a struct for easy adding to other scripts. have fun eh? Link to comment Share on other sites More sharing options...
Shaun Hamm Posted March 16, 2009 Share Posted March 16, 2009 based on what i've seen in this thread, i'm using the following workflow for fbx: import fbxrun autoedges script to remove triangulationrun layers by materials script to sort objects into layers.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 More sharing options...
Crazy Homeless Guy Posted March 16, 2009 Share Posted March 16, 2009 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. Link to comment Share on other sites More sharing options...
Shaun Hamm Posted March 16, 2009 Share Posted March 16, 2009 (edited) 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 March 17, 2009 by shaunph78 the word layers to objects Link to comment Share on other sites More sharing options...
Dave Buchhofer Posted March 16, 2009 Share Posted March 16, 2009 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 More sharing options...
bderrick Posted June 5, 2009 Share Posted June 5, 2009 based on what i've seen in this thread, i'm using the following workflow for fbx: import fbxrun autoedges script to remove triangulationrun layers by materials script to sort objects into layers.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 More sharing options...
Dave Buchhofer Posted June 5, 2009 Share Posted June 5, 2009 http://www.cgarchitect.com/vb/32059-fbx-dwg-export-max-import-5.html#post243877 Link to comment Share on other sites More sharing options...
bderrick Posted June 5, 2009 Share Posted June 5, 2009 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 More sharing options...
Crazy Homeless Guy Posted June 5, 2009 Share Posted June 5, 2009 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 More sharing options...
bderrick Posted June 9, 2009 Share Posted June 9, 2009 Perfect thanks that worked. One last question: why is it better to use an fbx file rather than a dwg file from Revit? DWG files are so much smaller than fbx files. Link to comment Share on other sites More sharing options...
Dave Buchhofer Posted June 9, 2009 Share Posted June 9, 2009 Depends on how your file is organized.. if you are working with a file that has materials already reasonably applied in revit then you go FBX, if you are working with a file with no materials, but a sensibile layer scheme, then you go DWG. Link to comment Share on other sites More sharing options...
Scott Dombrowski Posted June 11, 2009 Share Posted June 11, 2009 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now