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
    • Register
    • Login

    Inherit link transform

    SDK Help
    0
    4
    669
    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

      On 08/05/2018 at 12:48, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R19 
      Platform:    Mac  ;  Mac OSX  ; 
      Language(s) :

      ---------
      Hi,

      Can I make my generator inherit the transform of a linked object, like it's a child of the link?
      Whenever I scale/move/rotate the link, it will follow it.

      I need to do something like the Hair Objet does. It generates it's own geometry, but it acts like it's a child of the object set in the Guides link. When I scale/move/rotate a hair object, nothing happens to the hair or viewport guides, they respond only to the linked object transform.

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

        On 09/05/2018 at 07:13, xxxxxxxx wrote:

        Hi rsodre, thanks for writing us.

        With reference to the issue mentioned, I warmly suggest you to take a look at the Matrix Manual where specifiying object positioning in space using a transformation matrix is properly shown. In the end it should be pretty straightforward once retrieved the transformation matrix of the linked object to use such data in your generator in order to, standing on your words, "follow"it.

        Let me know if any further help is needed.

        Best, Riccardo

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

          On 09/05/2018 at 07:26, xxxxxxxx wrote:

          Hi Riccardo,

          I understand and use the matrices, I'implementing this by on every Execute cycle, I need to read the link, find the source object and copy the matrix to the virtualObject (or contour) generated, stored on another link. Or force to rebuild and copy the matrix, what seems too much.
          Same for the viewport draw.

          This is looking kinda hacky, I wanted to know if there's an easier way to do that.

          There's a private method called SetOrigin that seems to do that, but also need to be called all the time, and I know nobody talks about private methods. 😕

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

            On 09/05/2018 at 08:19, xxxxxxxx wrote:

            Hi rsodre, thanks for following up.

            The way you depicted is the way to go. The BaseObject::SetOrigin() has completely different purposes.

            Best, Riccardo

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