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
    1. Maxon Developers Forum
    2. bstone
    3. Posts
    B
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by bstone

    • RE: Need help getting an old script to work in C4D

      Here are the scripts (original and modified), as well as the c4d file if that is helpful

      https://www.dropbox.com/sh/vwnkj9x08b9dg0k/AACWhSoQV4rYo3ECMkNIZ2Kda?dl=0

      posted in Cinema 4D SDK
      B
      bstone
    • RE: Need help getting an old script to work in C4D

      Thank you, by adding the "import c4d" at the beginning of the script and "c4d." in front of the lines below, that solved the issues with the
      StopAllThreads()
      CallCommand(12410) # record

      However, now line 16 says:
      line 16, in <module>
      c4d.SetFrame(user_start_time) # Set the current frame of the time slider
      AttributeError: module 'c4d' has no attribute 'SetFrame'

      posted in Cinema 4D SDK
      B
      bstone
    • RE: Need help getting an old script to work in C4D

      When I try that, I get an error that says "NameError: name 'c4d' is not defined"

      posted in Cinema 4D SDK
      B
      bstone
    • Need help getting an old script to work in C4D

      Hey all, I found this post from 11+ years ago by a user named
      "bandini" that has a bit of code to bake animations. I am trying to update the code so that it works with the current version of C4D. Any help would be appreciated! Thanks!

      https://forums.cgsociety.org/t/holy-grail-bake-mograph-objects-to-keyframes/1296975/10

      This is what I've converted so far but I am receiving an error on line 11 that says:
      in <module>
      while current_frame <= user_end_time:
      NameError: name 'StopAllThreads' is not defined

      Here is the "updated" script that is giving me the error

      user_start_time = 0
      user_end_time = 90
      
      fps = doc.GetFps()
      bake_start_time = doc.GetTime()  # needed to initialize a BaseTime object
      
      doc.SetTime(bake_start_time)  # set the time slider to the user's start time
      current_frame = doc.GetTime().GetFrame(fps)
      
      while current_frame <= user_end_time:
          StopAllThreads()
          CallCommand(12410)  # record
          user_start_time += 1
          doc.SetFrame(user_start_time)  # Set the current frame of the time slider
          redraw = DrawViews(DA_STATICBREAK)
          EventAdd(EVENT_ANIMATE)
          if redraw:
              current_frame = doc.GetTime().GetFrame(fps)
      
      posted in Cinema 4D SDK python
      B
      bstone