animation range start/end

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

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/Cinema4DPythonSDK/html/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

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

Hi Eric,

welcome to the Plugin Café forums :slightly_smiling_face:

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.

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.

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!