Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    I need help with this Python code

    Cinema 4D SDK
    2
    3
    440
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Fowdy
      last edited by m_adam

      What I want to do with this code is when i turn on the User Data (Boolean) of the Python Tag, it hits the "Record Animated":
      import c4d

      def main():
          pass  #put in your code here
          
          onoff = op[c4d.ID_USERDATA, 1]
          print ("userdataXD: ", onoff)
          if onoff == 1:
              c4d.CallCommand(202665) # Record Animated
      

      For some reason the call command for Record Animated does not work (but in theory it should; I am new at this so this might sound newbie to most of you guys)
      Thank you

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi, this is not possible since CallCommand is the thing called when you click on an icon to do an operation so its wrap undo creation and so on, which are step not allowed in a thread and since the executing of tags are threaded, this is not possible. For more information about threading in Cinema 4D please read Threading Information.

        And to be honest I don't really see any workaround for you, which doesn't require some plugins or some kind of complicated hack.

        Since it's a follow up from Record Keyframe of Object's property when it changes (Python; is it possible?) I will wait until you answer to the previous one because maybe this will already fix your issue.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • M
          m_adam
          last edited by

          Without more information, from your side, I've set up your topic as solved but feel free to re-open it.

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • First post
            Last post