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

    Can I make a hierarchy of nulls inside a Python Generator behave like on in OM?

    Cinema 4D SDK
    s26 python
    2
    3
    573
    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.
    • S
      SweepingMotion
      last edited by

      I created a hierarchy inside a python generator, but I would like it to behave like one in OM - so if I rotate one null, all the ones below rotate with it. Is this possible?

      1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov
        last edited by

        Hi @SweepingMotion ,

        It's a duplicate of your other thread Why won't my python generator update? R2024?

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • S
          SweepingMotion
          last edited by

          @i_mazlov sorry I thought I deleted this post as I solved the issue.

          Anyway to anyone who stumbles upon this question here's how I solved it:

          for i,pt in enumerate(points_list[::-1]):
          
              off = c4d.Vector(distance * i,0,0 )
              mg = pt.GetMg()
              mg.off = off
              print(rotation.x)
              rm = c4d.utils.HPBToMatrix(rotation)
              pt.SetMg(mg * rm)
          

          So basically if the objects are inserted in the hierarchy and you start from the last one with the transformations this will work just like in the OM.

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