Expression not updating on time change

Expression not updating on time change

chaneyx
Advocate Advocate
1,728 Views
5 Replies
Message 1 of 6

Expression not updating on time change

chaneyx
Advocate
Advocate

I would expect my expression to update everytime there is a time change as per the docs "By default, an expression also executes whenever the current animation time or frame changes"

 

But this MEL expression only prints once : 

int $f = frame;

print $f;

 

Here is the output : 

90// Result: expression1 //
currentTime 54 ;
currentTime 39 ;

 

Is this a bug? 

 

0 Likes
Accepted solutions (2)
1,729 Views
5 Replies
Replies (5)
Message 2 of 6

rajasekaransurjen
Collaborator
Collaborator

Hi,

In Time Slider preferences Select Play Every Frame.Capture2.JPG

0 Likes
Message 3 of 6

chaneyx
Advocate
Advocate

That is my setting. It still does not work. 

 

Thank you, 

Chris 

0 Likes
Message 4 of 6

chaneyx
Advocate
Advocate

Definitely a bug with the "Serial" and "Parallel" evaluation mode in 2019. It does not occur when the evaluation mode is set to "DG" in 2019. It does not occur in 2018.

 

Another odd behavior is when the expression is first created or edited, it executes the print statement for every frame on the time slider. So if I have a playback range of 1-120, it prints 120 times. This only occurs when another object is included in the expression as shown below. 

 

currentTime 47 ;
expression -e -s "ry = frame; \nprint \"S\";" -o pSphere1 -ae 1 -uc all expression1;
S// Result: expression1 //
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

0 Likes
Message 5 of 6

tony.su
Autodesk Support
Autodesk Support
Accepted solution

Please switch to DG, the print will work. I report this issue to our develop team.

 

Screen Shot 2019-05-27 at 4.54.04 PM.png



Tony Su
Product Support
0 Likes
Message 6 of 6

chaneyx
Advocate
Advocate
Accepted solution

Tony, 

 

Thanks for the info. Marko S. also assisted me. Disabling the cached playback had some success with the other modes as well. 

 

Chris 

0 Likes