PDA

View Full Version : Getting node/object from modifier


LoneRobot
07-15-2009, 11:33 AM
Hello!

if you have a modifier instance (in this case a scripted attribute) in a variable, is there any way of getting which object/node the instance comes from? Refs.dependents will give info pertaining to the instance but not the object/node. I guess the correct way would be to store the node as a weak reference on the attribute, but i wondered if there was a more 'global' method for this. thanks.

PEN
07-15-2009, 01:08 PM
Are you looking for custAttributes.getOwner?

LoneRobot
07-15-2009, 01:36 PM
hi paul

I'm getting the attributeholder when i do that, do I need to do something else to get the object? (Assume when I call getowner, the object is no longer selected)

modinst = $.modifiers[1].posebot
PoseBot:PoseBot
classof modinst
<AttributeDef:PoseBot>
custAttributes.getOwner modinst
EmptyModifier:PoseBot

PEN
07-15-2009, 02:05 PM
Ah yes.

refs.dependentNodes (custAttributes.getOwner theDef)

That should do it.

LoneRobot
07-15-2009, 02:27 PM
that's it! cheers Mr Neale! :applause:

PEN
07-15-2009, 03:43 PM
Was my dad here helping you as well?

LoneRobot
07-15-2009, 04:16 PM
heh heh! I heard he knows more about rigging than you ;)

CGTalk Moderation
07-15-2009, 04:16 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.