python or coffee script

Forum for: Modelling, Texturing, Animation, Composting and the whole general usage of Cinema4D.

Moderators: Arkimed, natas, visualtricks, cappellaiomatto

Post Reply
  • Advertising
AltoFlash
Posts: 14
Joined: Thu Mar 15, 2018 6:45 am

python or coffee script

Post 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
User avatar
visualtricks
Moderatore
Posts: 3561
Joined: Thu Sep 23, 2004 5:13 pm
Location: Pistoia

Re: python or coffee script

Post 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.
  • Advertising
Post Reply