[Closed] maxscript does not run when rendering a sequence of frames
Hello,
I have a maxscript that changes a textarea depending on the radius of a dummy object (cylinder).
q=($dimMNcontrol.radius*25.4) --dimMNcontrol is the dummy cylinder
r=formattedPrint q format:".2f mm"
$dimMN.text=r --dimMN is the text field
This works fine in the viewport and renders ok in single frames but when I render a sequence or active segment, the code does not run. This problem happens when rendering on my own computer and with Backburner.
Any suggestions are appreciated, thanks!
(3ds Max Design 2009, creativity extension, sp1)
Jason
Where did you place the script? Is it a scripted controller or a callback script?
Martijn
Hi Martijn,
The script was placed on a dummy object using the expression editor. So there were 2 dummy objects, one to hold the script and one to animate the upper/lower limits. Roundabout method perhaps.
My co-worker actually just got this working by running the script in the text field’s Kerning property and animating the Leading to the desired values. This gets around using dummy objects.
$dim_Text.text=formattedPrint($dim_Text.Leading*25.4) format:".1f" as string+" mm"
This works however I’d be interested to know why essentially the same code doesn’t work using my original method when rendering a sequence.
Jason
As Martijn said you need a callback or some time context, otherwise it is executed on the first frame and that is it.
-Eric
Hi Jason,
this is a validity interval issue – have a look here, it might help you!
http://forums.cgsociety.org/showthread.php?f=98&t=684033&highlight=validity+interval
http://forums.cgsociety.org/showthread.php?f=98&t=656094&highlight=validity+interval