Page 1 of 1

python or coffee script

Posted: Mon Apr 01, 2019 9:51 pm
by AltoFlash
HI, i'm trying to write a script that changes an object's visibility depending on which frame the animation is on, so i thought i may use a scripting tag attached to each object, and rename each object to the frame they should turn on and use a higher/equal comparison between the object name and the current frame

i tried some COFFEE and seems pretty easy to use, but then i found out it's being deprecated, so i think python may be a better choice.

so far i managed to batch rename objects, so the script i need would be something like this:

set variables with frame number and object name
convert object name to integer type
if frame number >= object name, then visibility=100, else, visibility=0

but since i'm really new to python coding, i'm having a hard time coming up with the actual code.

could someone please write it for me, so i can learn from the snippet? thanks in advance

Re: python or coffee script

Posted: Tue Apr 02, 2019 11:01 am
by visualtricks
Hi, you should elaborate a bit what you are aiming for, what's the ultimate goal of the script, as it may have more solutions. I made a script while ago that takes a group of object and make each one visible for 1 frame only. You may have a look here and see if it fits your needs.