Inherit link transform

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

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


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.

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

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. :/

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