PDA

View Full Version : meshop.setVert vs polyOp.setVert


Hobbs
12-15-2008, 08:16 PM
hey guys, quick question.

Basically i'm aligning verts using the normal between verts.

when i used meshop.setVert i get what i want, but if i used polyOp.setVert, things seem to be offset. I'm calling them the exact same way, using the same variables. Could some one explain why i'm getting different results?

here's my function for the setting


fn SetVertPostion index matrix =
(
case (ClassOf obj) of
(
Editable_Poly: ( polyOp.setVert obj index matrix )

Editable_mesh: ( meshOp.setVert obj index matrix )
)
);


i see something about polyOp having a "node:" option, but i'm not sure how that works, or if it applies.

ZeBoxx2
12-15-2008, 08:30 PM
The node: parameter may apply if the polyOp.setVert ends up doing its work in a coordinate system different from meshOp's.. though both take the same parameter and should act the same as long as you use them the same way.

You can try anyway.. just pass it as "node:obj".
( is 'obj' supposed to be a parameter of your function? )

If no luck - can you tell us more about the object you're affecting / post a scene file?

Hobbs
12-15-2008, 08:40 PM
here's a test screen, and a version of my script in the zip file.

both should have their vertex's selection stored...if not, the verts that need to be selected are

23, 28, 29, 30, 24

they are the same object, just one is mesh, and one is poly.

with those verts selected execute the script on both...on my machine, the mesh should operate accordingly, aligning the verts, where the poly will not.

If it works on your guys system, then its something local on mine thats causing the problem.

this is done on max9 sp 2.

ZeBoxx2
12-15-2008, 09:20 PM
your problem actually seems to be in line 18 where you get the vertex positions:

-- original
( return (obj.GetVertex index) )

-- corrected
( return (polyOp.getVert obj index) )

Hobbs
12-15-2008, 09:24 PM
ah, i knew it was something stupid that i did...so i'm assuming GetVertex gets the vert in local coord?

thanks for taking your time out to look into it.

ZeBoxx2
12-15-2008, 09:34 PM
ah, i knew it was something stupid that i did...so i'm assuming GetVertex gets the vert in local coord?
Correct :)

thanks for taking your time out to look into it.
No problem - good luck with the script :)

CGTalk Moderation
12-15-2008, 09:34 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.