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
    • Register
    • Login

    read active render data

    Cinema 4D SDK
    python
    2
    2
    523
    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.
    • M
      murph7andrew
      last edited by s_bach

      Hi all,
      I'm developing a plugin for c4d that will need to retrieve various information from the currently loaded scene then export that data to a json that can later be retrieved. I've tried a few different methods of doing this, but no luck yet. The information i'm trying to get is: from frame, to frame, and the base of the filename(not present in the code below).

              doc = documents.GetActiveDocument()
              rd = doc.GetActiveRenderData()
              fromSlice = rd[c4d.RDATA_FRAMEFROM]
              toSlice = rd[c4d.RDATA_FRAMETO]
      

      any guidance would be appreciated, thanks in advance 🙂

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by

        Hello and welcome,

        when creating a new post, please use tags and the Q&A system. See Read Before Posting.

        I tried your code in a R20 script and it seems to work perfectly fine:

        rd = doc.GetActiveRenderData()
        
        if rd is None:
            return
        
        fromSlice = rd[c4d.RDATA_FRAMEFROM]
        toSlice = rd[c4d.RDATA_FRAMETO]
        
        fps = doc.GetFps()
        
        print(fromSlice.GetFrame(fps))
        print(toSlice.GetFrame(fps)
        

        What exactly is not working for you? In what context do you execute your code?

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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