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
    • Recent
    • Tags
    • Users
    • Login

    Position Rotation - of parent

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 436 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 17/01/2014 at 02:51, xxxxxxxx wrote:

      Hi

      I try to Position Objects on a spline and have some issues when the spline is not in the same null object- i try to get the offset by checking all - parent objects - but i have to mention the rotation - have one of you an idea ?

      def GetContainerPosOffset(self, node) :
          parentpos = c4d.Vector(0)
        if node.GetUp() != None:
              parnode = self.GetContainerPosOffset(node.GetUp())
              #print parnode
              parentpos += parnode
          parentpos += node.GetAbsPos()
      	 
          return parentpos
      

      Edit notice NiklasR : fixed code formatting

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

        On 17/01/2014 at 02:59, xxxxxxxx wrote:

        You should prefer GetMg().off over GetAbsPos(). Why not just use GetUpMg()?

        Best,
        -Niklas

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

          On 17/01/2014 at 03:19, xxxxxxxx wrote:

          hey Niklas,

          thanks for your reply -

          your right - it's a better way - but it don`t help me to calculate the right position

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

            On 17/01/2014 at 03:23, xxxxxxxx wrote:

            a nice way to get the world coordinates of a object

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

              On 17/01/2014 at 03:35, xxxxxxxx wrote:

              sorry 
               your right - i red the description of the function -

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