[Closed] PolyOp.Attach issues
Hi all!
Working on a small personal project where I need to import some objects. These objects are generally made up of “parts” which form the larger element.
Because, most of the time, I only want to work on the final element (not the separate parts), I attach and weld them together.
The problem I am running into is that when welding several thousand parts, the attach function tends to run quite slow…something like several minutes for 8k+ parts.
To be brutally honest, this not a big issue (although I have several thousand objects to import) as I just let my script run while I’m not there and let it chug away, but I would like to find ways to steam line and improve the functionality of the script.
The welding and attachment must happen at the end of the process, it can’t run as part of “part” importation…thought about that
Any ideas would be welcome
Cheers
Shane
What format do you import in in what max version. Obj import has an option to just merge as 1 object… Have you searched the forum, I seem to remember there are some threads about this…
-Johan
The files are simply plain text and I have to reconstruct the poly information manually…
These then create a bunch of objects, that have texturing information (basic color) applied to them.
Then, I attach and weld the elements all together…
Or something along those lines…
Shane
What about clustering… build smaller attached groups, and then attach the bigger grouped objects…?!
-Johan
Btw, do you do your loops in an “with undo off” context? Undo buffer can grow big with these type of operations.
-Johan
Hi Johan!
Yeah, everything is done in a “undo off” context, that’s a real handy hint
I’ll have to investigate the original file format requirements a little deeper. It might be possible to bind the smaller elements together as they are been built, but I need to make sure this is correct within the context of the import.
The original format was really only for display purposes and because I want to interact with the logical “top” element as it was a single entity, it is giving some minor grieve.
Also, the sub elements may have additional transformation and texturing (color material) applied to them, so I tend to want to preserve this information if I can…
It’s been a while since I looked at it and the fact it works at all is somewhat surprising so this is really, only a minor issue.
I’m also looking at different ways to cache the elements to help make it faster, that might work in the long run to improve the speed as well.
Cheers for the ideas
Shane