marckury
09-21-2007, 01:33 AM
well yes at last something worked , well as i said im starting to learn some mel and the first thing I wanted to try has been make a manual motionPath, I got something but not the thing I wanted , so I hope someone can help , this is the thing I wrote to attach a cube on a curve with a slider getting curve parameter then with a button to attach the cube on that x y z of curve parameter ,
window -t attachCubeOnPath;
columnLayout;
// min max are the begining and ending of curve parameter
floatSliderGrp -min 0 -max 3 -l curveParameter -field true parameter;
button -c attach -l attach;
proc attach() {
float $curveParameter=`floatSliderGrp -q -value "parameter"`;
float $attachme[]=`pointOnCurve -pr $curveParameter curve1`;
setAttr pCube1.tx $attachme[0];
setAttr pCube1.ty $attachme[1];
setAttr pCube1.tz $attachme[2];
}
showWindow;
Now , the real thing I wanted was make that but while moving the slider , so dont have to press any button , while moving slider cube goes on the path.... how to do it? please dont laugh at my first mel! :deal:
window -t attachCubeOnPath;
columnLayout;
// min max are the begining and ending of curve parameter
floatSliderGrp -min 0 -max 3 -l curveParameter -field true parameter;
button -c attach -l attach;
proc attach() {
float $curveParameter=`floatSliderGrp -q -value "parameter"`;
float $attachme[]=`pointOnCurve -pr $curveParameter curve1`;
setAttr pCube1.tx $attachme[0];
setAttr pCube1.ty $attachme[1];
setAttr pCube1.tz $attachme[2];
}
showWindow;
Now , the real thing I wanted was make that but while moving the slider , so dont have to press any button , while moving slider cube goes on the path.... how to do it? please dont laugh at my first mel! :deal:
