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. jhpark
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    jhpark

    @jhpark

    0
    Reputation
    10
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    jhpark Unfollow Follow

    Latest posts made by jhpark

    • how to get object's position and material color on all time line?

      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

      posted in Cinema 4D SDK python windows r21
      J
      jhpark