PDA

View Full Version : Moving many vertices with ONE call?


f97ao
01-09-2005, 11:53 PM
I need to move many vertices to different positions, and I don't want the object to update before this happens.

Right now the only thing I have found is the Set command, but it only works at ONE vertice at a time. If I have to move 1000 vertices on a very big object this will take several minutes!

Does anyone have any clues how I could do this faster.

/Andreas

Cthulhu
01-10-2005, 03:00 PM
couldn't you just select the vertices and move them directly with 'move obj.selectedVerts [x,y,z]' ?
as long as you are just moving, this should work..

f97ao
01-10-2005, 06:05 PM
That shouldn't work. The problem is that all the vertices have to move to *individual positions.
Your example would move all the vertices with *one offset x,y,z, correct?

So what I would like is a command like this
polyOp.moveToPos #(1,2,3) #(pos1,pos2,pos3)

Where posn=[x1,y1,z1)

I fear that I may be forced to create an maxScript extention for this command, but I'm not very good with manipulating geometry in max c++ :(
/Andreas

Cthulhu
01-10-2005, 06:47 PM
oh, ok, i see, that's right, it wouldn't work with individual positions..
maybe you can try to not use the polyop.setVert command, but to directly set the position with $.verts[n].pos = pos, it's a little faster than the polyop, but i guess not fast enough for you...
and does the object also update if you disable SceneRedraw and close the command panel?
or flag the object to the foreground?
just some ideas..

f97ao
01-10-2005, 09:32 PM
Yea, the object still updates if i disable scene redraw. flagging i haven't tried.

This is a very tricky problem. When the user has finished chaninging the detail area i want to update the "real" vertices on the big object. The detail area may be pretty big, sometimes 1000 faces. I tried moving i think 1000 faces on a 160k object and on my machine it took 30 seconds. So you can imagine what would happen if the detail area is 10k faces and the object is 1mil. That would be uhm 30*10*10=3000seconds....
To move this amount of vertices should really not be a problem. Most modifiers in max do it easily, like the noise modifier for example.

Hm, I wonder where exactly the maxScript code for polygon operations are. It would be great if I could see the polyOp.move and polyOp.setVert commands in c++. Then it should be a piece of cake to make some new maxScript commands. Does anyone have a clue?

/Andreas

Cthulhu
01-11-2005, 03:09 PM
Hm, I wonder where exactly the maxScript code for polygon operations are. It would be great if I could see the polyOp.move and polyOp.setVert commands in c++. Then it should be a piece of cake to make some new maxScript commands. Does anyone have a clue?

/Andreas yeah, that would be pretty cool, i also would like to change some functions, but i don't think they are accessible.. maybe bobo knows something about it..

Cthulhu
04-11-2005, 08:23 PM
Hi Andreas,

don't know if you are still looking for a way to do this, but I just browsed through ScriptSpot and the max script extensions, and there is this Avguard Extension from Larry Minton which has a function to move multiple vertices at once (and a lot other cool stuff), maybe you can check this out!

CGTalk Moderation
04-11-2005, 08:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.