PDA

View Full Version : Xpresso: Parenting thru nodes


C.Smith
08-15-2007, 04:34 AM
How can I parent 2 objects purely whithin Xpresso/coffeeNode? Obviously I can parent them in the OM or use a constraint but I'm hoping to do it by code or node.

I assume it somehow relates to getting one object to work in the other object's space with some kind of Matrix manipulation. But I could be way off.

Thanks all.

-CS

EDIT: Well nevermind. Good Ol' fashinoed Matrix Multiplication works. I knew posting the question would make me finally figure it out.

Srek
08-15-2007, 06:53 AM
Maybe check the Xpresso pool on this, i created COFFEE nodes for local / global conversion of vectors and points. They are only calling the standard Matrix multiplications, but are handy if you don't want to create the stuff yourself.
Cheers
Björn

LucentDreams
08-15-2007, 07:47 AM
could also consider using a parenting constraint. no code needed, doesn't change the actual hierarchies but creates the behaviour of being a child.

C.Smith
08-15-2007, 02:43 PM
Thanks, guys.

Lucent: I wanted to avoid constraints because I am making public Xpresso tools and I try to avoid anything that needs modules.

Srek/Bjorn: First of all thankyou for making those Xpresso nodes for all of us. I played with those for a while and couldn't quite get them to do what I was looking for. Not to say they don't, I just couldn't quite figure it out. However I did end up using your "Generate Matrix" in a "Parent" node I made.

The inputs are ParentPos and ParentRot into a Generate Matrix node. Same with a CHild Pos and Rot input that goes into a Gen Matrix node. The outputs of those GenMatrix nodes go into a simple Math node set to mult and Matrix. The output of that goes to an output port for the child. I also added a MatrixtoVect for the offset (pos) and a Matrix to HPB (vector out) for the child rotations. It's possible, I just recreated one of your nodes, but wasn't sure. But this works perfectly.

bobtronic
08-15-2007, 02:46 PM
Lucent: I wanted to avoid constraints because I am making public Xpresso tools and I try to avoid anything that needs modules.

You don't need any module for the constraints. They are part of the Cinema4D core.

cheers,
Bob

C.Smith
08-15-2007, 02:53 PM
You don't need any module for the constraints. They are part of the Cinema4D core.

Bob

Ah, didn't know that. I've only ever owned the Studio Bundle, but since the constraint tag comes up in the Character tag menu I assumed it only came with MOCCA.

LucentDreams
08-15-2007, 07:32 PM
most of the character menu comes in core. basically the OLD IK, muscles morphs and cloth are in mocca

I've proposed renaming it comma (Cloth, Old ik, Muscles, Morphs, Animation tools)

CGTalk Moderation
08-15-2007, 07:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.