Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Inherit link transform

Author
Message
  Topic Search Topic Search
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Topic: Inherit link transform
    Posted: 2018 May 08 at 12:48pm

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.

Back to Top
knickknack View Drop Down
Forum Moderator
Forum Moderator


Joined: 2016 Jul 01
Location: Italy
Online Status: Offline
Posts: 268
Direct Link To This Post Posted: 2018 May 09 at 7:13am
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
MAXON Computer GmbH
SDK Support Team
Back to Top
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 91
Direct Link To This Post Posted: 2018 May 09 at 7:26am
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. :/

Back to Top
knickknack View Drop Down
Forum Moderator
Forum Moderator


Joined: 2016 Jul 01
Location: Italy
Online Status: Offline
Posts: 268
Direct Link To This Post Posted: 2018 May 09 at 8:19am
Hi rsodre, thanks for following up.

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

Best, Riccardo


Edited by knickknack - 2018 May 09 at 8:19am
MAXON Computer GmbH
SDK Support Team
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.