Hi again Dr. Sassi
Sorry for bothering you again with this, but I need help with this code:
——————————————————
import c4d
#Welcome to the world of Python
def main():
pass #put in your code here
onoff = op[c4d.ID_USERDATA, 1]
if onoff == 1:
c4d.CallCommand(202665) # Record Animated
——————————————————-
This is applied on a Python Tag with a User Data (Boolean). I am new to this C4D Python coding (but I have good grasp of the coding basics). I feel like in theory this works, but the “c4d.CallCommand(202665) (call command for record animated) does not seem to work when I turn on the User Data (Boolean). I tried soloing the line using the standalone Python script (written from Script Manager), and it works just fine:
——————- Code from Script Manager that works———————-
import c4d
from c4d import gui
# Welcome to the world of Python
# Script state in the menu or the command palette
# Return True or c4d.CMD_ENABLED to enable, False or 0 to disable
# Alternatively return c4d.CMD_ENABLED|c4d.CMD_VALUE to enable and check/mark
#def state():
# return True
# Main function
def main():
c4d.CallCommand(202665) # Record Animated
# Execute main()
if __name__==‘__main__’:
main()
———————————————————————————————————-
I have tried everything I can, and this is my last resort. I really did not want to bother you, but I want to learn where this code went wrong. The first code above did not have any errors. I even used some print () codes to see, but it works just fine, just the call command does not work.
Thanks for reading