expression affectation

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Foudou
Posts: 19
Joined: March 27th, 2009, 1:54 am

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
Image
FrenchEnglish inside.
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

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
Foudou
Posts: 19
Joined: March 27th, 2009, 1:54 am

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.
Image
FrenchEnglish inside.
Post Reply