Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    animation range start/end

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 536 Views
    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.
    • H Offline
      Helper
      last edited by

      On 31/01/2017 at 13:24, xxxxxxxx wrote:

      Hi,

      I'm new to python in c4d. I am trying to load an image sequence and have the footage automatically calculate and set Timing to Range, and update the Range Start and Range End to match Movie Start Frame and Movie End Frame.

      everything goes as planned until it comes time to set Range Start/End. If I print my variables I get...

      start = shader[c4d.BITMAPSHADER_TIMING_FROM]
          end = shader[c4d.BITMAPSHADER_TIMING_TO]
          start1 = shader[c4d.BITMAPSHADER_TIMING_RANGEFROM]
          end1 = shader[c4d.BITMAPSHADER_TIMING_RANGETO]

      print start
          print end
          print start1
          print end1

      my result is:

      1
          65
          <c4d.BaseTime object at 0x000000000E1AF0D8
          <c4d.BaseTime object at 0x000000000E1AF0D8

      I am very confused by this. it seems as though something in python is broken. I would expect the final two results to still be integers, the default 0 and 120. I cant find anything in the sdk and I cant find any other information on line.

      please help

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 01/02/2017 at 01:59, xxxxxxxx wrote:

        As is written you get a basetime, which is a class who store a timing. For more information read.
        https://developers.maxon.net/docs/py/2023_2/modules/c4d/BaseTime/index.html

        If you want to get a frame

        start1.GetFrame(doc.GetFps())
        

        If you want to set a frame

        fps_number = 10
        buffer_time = c4d.BaseTime(fps_number, doc.GetFps())
        shader[c4d.BITMAPSHADER_TIMING_RANGEFROM] = buffer_time
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 01/02/2017 at 02:44, xxxxxxxx wrote:

          Hi Eric,

          welcome to the Plugin Café forums 🙂

          gr4ph0s pretty much said everything. I just want to add a link to the C++ BaseTime manual, as it might contain some additional information worth reading for Python programmers as well.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 01/02/2017 at 09:44, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            As is written you get a basetime, which is a class who store a timing. If you want to set a frame

            buffer_time = c4d.BaseTime(fps_number, doc.GetFps())   
            shader[c4d.BITMAPSHADER_TIMING_RANGEFROM] = buffer_time
            

            Thank you! That was it. I still have not fully wrapped my head around it, but it worked.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 01/02/2017 at 10:14, xxxxxxxx wrote:

              Wow! the C++ documentation is like a real sdk! It already helped figure out how to add ao into render settings! Thank you!

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