Page 1 of 1

expression affectation

Posted: April 15th, 2009, 12:03 pm
by Foudou
The return of me! :P

This time, it's for adding an expression to rotation in a 3D Layer.

It works for zRotation, but i have a "read only" error for the xRotation and z Rotation, when i want to had an expression with my script.

This is my code

Code: Select all

		if (Premier) {
		myText.position = [360,288];
		myText.anchorPoint.expression = ExpressionTexteAncrage;
		First Option //myText.xRotation.expression.setValue(ExpressionTexteRX);
		First Option //myText.yRotation.expression.setValue(ExpressionTexteRY);
		myText.zRotation.expression = ExpressionTexteRotation;
		myText.scale.expression = ExpressionTexteEchelle;
		myText.orientation.setValue([0,0,0]);
		} else {
		myText.parent = myComp.layer(2);
		myText.position.expression = ExpressionTextePosition;
		myText.anchorPoint.expression = ExpressionTexteAncrage;
		Second Option //myText.transform.xRotation.expression = ExpressionTexteRX;
		Second Option //myText.transform.yRotation.expression = ExpressionTexteRY;
		myText.zRotation.expression = ExpressionTexteRotation;
		myText.scale.expression = ExpressionTexteEchelle;
		myText.orientation.setValue([0,0,0]);
		}
A classic equal or setValue doesn't work except for zRotation.

If somebody have any idea!

Thanks

Re: expression affectation

Posted: April 15th, 2009, 2:36 pm
by Dan Ebberts
Try it this way:

myText.property("Transform").property("X Rotation").expression = ExpressionTexteRX;


Or even better, use the match name:


myText.property("ADBE Transform Group").property("ADBE Rotate X").expression = ExpressionTexteRX;


Dan

Re: expression affectation

Posted: April 15th, 2009, 9:56 pm
by Foudou
It works!

Script is so weird sometimes, you think that you have understand and new strange "words" appear.

Thanks Dan, i'm a huge fan of your work on motion script, everything is useful!

See you on the next problem.