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

    GetPosition object in new world

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 231 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 03/05/2014 at 04:25, xxxxxxxx wrote:

      Hi! Sorry my bad English

      I am looking for the location of the object, on the new coordinate system

      import c4d
      from c4d import gui, modules
      from c4d.modules import snap
      #Welcome to the world of Python

      def main() :
          world = snap.GetWorkplaneObject(doc)
          matrix = world.GetMg()
          rotation = world.GetAbsRot()

      old_pos = op.GetAbsPos()
          new_pos = old_pos-matrix.off
          
          print new_pos
          
          
      if __name__=='__main__':
          main()

      old_pos-matrice.off works for all offset plans, but not rotated...

      If I have an offsett rotated plane, how do I get my object's position in the new world coordinate? 
      thanks!

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

        On 03/05/2014 at 11:03, xxxxxxxx wrote:

        GetAbsPath != absolute Position.

        Please take a look at the Python C4D documentation. At the bottom of the c4d.Matrix reference page there is a chapter called "The Matrix has you". I hope this helps to clearify a few things.

        Bye, s_rath

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

          On 03/05/2014 at 11:21, xxxxxxxx wrote:

          thanks s_rath...  I had already read the c4d. matrix but I did not understand...

          You can you explain better?

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