Dear. MAXON's SDK Team
I use R21 on microsoft windows with python.
I have threads that how to get object's position and material color on all time line.
below my simple source code.
import c4d # import Cinema 4D module
doc = c4d.documents.GetActiveDocument() # Cinema 4D active document
number_of_sphere = 10 # [Set] sphere number
frames_count = 2600 # [Set] frames counter
for i in range(0, number_of_sphere):
for f in range(0, frames_count):
doc.SetTime(c4d.BaseTime(f, doc[c4d.DOCUMENT_FPS]))
c4d.EventAdd()
obj = doc.SearchObject('Sphere_' + str(i))
# get object position
x = int(obj.GetMg().off.x)
y = int(obj.GetMg().off.y)
z = int(obj.GetMg().off.z)
# get object color
r = int(obj[c4d.ID_BASEOBJECT_COLOR].x * 255)
g = int(obj[c4d.ID_BASEOBJECT_COLOR].y * 255)
b = int(obj[c4d.ID_BASEOBJECT_COLOR].z * 255)
print(obj.GetName() + ", Frame = " + str(f) + ", (X,Y,Z) = " + str(x) + "," + str(y) + "," + str(z) + ", RGB = " + str(r) + "," + str(g) + "," + str(b))
Please, guide to me for method of this.
Cheers,
MAXON's SDK Team