Notifications
Clear all

[Closed] script slowdown on making polys

 JHN

Chris, crap, that’s a shame… ! Never thought of vert order… I know Martijn van Herk once made a tool to “realign” the vert order of an object with another one… don’t know if that’s something you can use here…

-Johan

double post

double post

Sorry for all the double posts… nothing posted until a day later so I kept trying…

Hi I am having a most similar problem and I would be very interested in a solution. I have a script that extrudes polys in a loop and it starts chugging really bad when the face count gets even moderately high. Around 30k like 3rd Dementia said is very very slow. I have done everything else to optimize it but it still can be very slow.

By looking at how an Editable Poly Mesh is structured (MNMesh in sdk), it stores a bunch of int arrays and Tab<int> arrays to get the relations between verts, edges and faces. Every time you add a polygon with ‘polyOp.createPolygon’ all these arrays have to be updated or incremented. In the latest case, since standard arrays aren’t dynamic structures in C++, they are completely rewritten somewhere else, where a chunk of contiguous memory big enough to store each of them found. I guess the increasing time for each operation depends on this, and can’t find a way to avoid it by MaxScript. Anyway, I hope to be wrong.

I think that sounds like what I’m running into. Is there really no way around this bottleneck?

I have been trying to think of a way to implement JHN’s trick for splitting the mesh but I need to have every poly available as the next possible extrusion so I cannot think of how to get it to work without constantly reattaching and detaching things.

I really hope someone can share some kind of magic here.

Page 2 / 2