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

    move the axis ??

    PYTHON Development
    0
    3
    626
    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
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 01/04/2011 at 04:58, xxxxxxxx wrote:

      Hi.

      I want to move the axis of the object in a script.
      What should be carried out in what way?

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 01/04/2011 at 05:56, xxxxxxxx wrote:

        I don't know a comfortable way to solve this. You have to move the points of the Object, instead of the axis itself, and then move the hole object (including the axis of course ;] ) again in that negative direction..

        Try this example 😉

        import c4d  
        from   c4d import gui  
          
        def err_message() :  
          gui.MessageDialog("Please enter a vector!")  
          
          
        def main() :  
          vec       = gui.InputDialog("X Axis Offset","c4d.Vector(0,100,0)")  
          
          try: vec  = eval(vec)  
          except: pass  
          if not isinstance(vec,c4d.Vector) :   
              err_message()  
              return False  
          
          print     "Axis Offset: %s" % vec  
          points    = op.GetAllPoints()  
          
          for i in range(len(points)) :  
              points[i] = points[i]+(vec*(-1))  
          op.SetAbsPos(op.GetAbsPos()+vec)  
          op.SetAllPoints(points)  
          op.Message(c4d.MSG_UPDATE)  
          c4d.EventAdd()  
          return True  
          
        if __name__=='__main__':  
          main()
        

        Greets, nux

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 01/04/2011 at 20:58, xxxxxxxx wrote:

          Thanks Nux

          'll try this way!

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