im pretty new to MEL so please be patient with my query. So here it goes -
when i execute this line -
joint1.rotateZ = sin ( time )*10 ;
with the script editor it givs me error saying " invalid use of maya object time " but works perfect when i put the same line in the expression editor.
Why is this?
I also could not find " time " command in the maya mel refrence ? why is that ?
1)
You can directly assign to an attribute, like "joint1.rotateZ = sin ( time )*10 ;" only inside an expression - but not in script editor. In script editor, u have to use "setAttr".
2)
Use "currentTime" command in place of "frame" (or "time") in script editor.
so, ur script shud b:
int $fram = currentTime -q;
setAttr "joint1.rotateZ" (sin($fram/(float)24)*10);
//Divide by 24 to calculate time if frames/sec = 24