PDA

View Full Version : Mirror vertecies.


wamo
06-18-2008, 03:35 PM
Hi Scripters,
i have two spheres in the scene , one is at right and the other is in the left,also a point helper at center:[0,0,0] .
now i'm gonna mirror right sphere's vertecies to the left sphere's vertecies,i've Written a script below,but once i'm evaluating Max crashs :hmm:

i was wondering if you scripters could help me doing this and cleaning my script,scince maybi i've written it right or wrong!.


fn mirrorinfos =
(
right_obj = $right.baseobject
left_obj = $left.baseobject
center_obj = $Point01

rightAr= (polyop.getvertselection right_obj) as array
leftAr= (polyop.getvertselection left_obj) as array

for i =1 to rightAr.count do
(
rpos = polyop.getvert right_obj rightAr[i]
for l = 1 to leftAr.count do
(
lpos = polyop.getvert left_obj leftAr[l]
newpos = polyop.setvert $left leftAr[l] (((Rpos-$Point01.pos)*[-1,1,1])+$Point01.pos)
)
)
)

Regards,
Ehsan.

PEN
06-18-2008, 05:06 PM
I think that you need to call updateMesh, I would have to look what the actual command is.

wamo
06-18-2008, 05:58 PM
I think that you need to call updateMesh, I would have to look what the actual command is.

Paul,
in fact it's inspired from what you did on mirrorverts,but now i have to make it for twe object,insted of one object and it's vertecies.
i used update() too,but it crashs again :hmm: ,can you discribe more Pual?
i realy need it.

decapitator
06-18-2008, 06:26 PM
Wouldnt this be something like: http://www.martijnvanherk.com/page/morphix.html

wamo
06-18-2008, 06:31 PM
Wouldnt this be something like: http://www.martijnvanherk.com/page/morphix.html

dude,noop
becoase i'm trying to write it for a plugin that it lose its property if i use morphix.

CGTalk Moderation
06-18-2008, 06:31 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.