Notifications
Clear all
[Closed] morphing problem
Dec 11, 2011 10:30 pm
Hello,
im creating a simple morphing function. The fn takes two shapes and an in between number of iterations. The problem is with the command WM3_MC_BuildFromNode
it doesnt add the target object. But when i click -after the evaluation- manually the Reload Morph Target the target exists. Anyone know if im doing something wrong ?
fn morpheR_v1 objectA objectB numOfIterations=
(
clearlistener();
--Variables
local myClone,metatopisi,morphElement,morphValue,mV,d,a,gaps
myMod = Morpher();
if (convertToMesh objectA).numverts == (convertToMesh objectB).numverts then
(
max modify mode(
if objectA.modifiers[1] != myMod do addModifier objectA myMod;--add the morpher modifier
WM3_MC_BuildFromNode objectA.morpher 1 objectB;--add the target shape:shapeB to the channel-index 1
)
redrawviews();
morphElement = objectA;
morphValue = 95/numOfIterations as float;--morphing percentage
mV = morphValue;
d = distance morphElement objectB;
a = (numOfIterations*17.5);
gaps = numOfIterations+1;
metatopisi = (d-a)/gaps + 17.5;--the distance between each hybrid shape
for i in 1 to numOfIterations do
(
myClone = copy morphElement;
myClone.name = objectA.name + "clone" + i as string;
myClone.wirecolor = objectA.wirecolor;
WM3_MC_SetValue myClone.morpher 1 mV;
myClone.pos += [0,metatopisi,0];
mV += morphValue;
morphElement = myClone;
)
)
else messagebox "Cannot perform morphing. Check vertices." title:"morpheR_v1";
)
1 Reply
Dec 11, 2011 10:30 pm
ok, nevermind got it.
If someone has the same problem remember to add after the line WM3_MC_BuildFromNode
the following. <objectA>.modifiers[#Morpher].Autoload_of_targets = 1