Notifications
Clear all

[Closed] custAttributes.getOwner bug ?

I keep getting only the classof my object instead of the actual node when i use the custAttributes.[font=Courier New]getOwner <attrib_def>[/font]

according to the manual it should return the node/object that has the CA applied:
[font=Courier New][/font]
[left] [/left]
[left]custAttributes.getOwner <attrib_def>[/left]

[left]Returns the object the custom attribute is applied to.[/left]
[left] [/left]
[left]Anyone had the same experience ?[/left]

2 Replies

It just looks that way, but it is correct.

Example:

*Create a Plane.
*Go to Main menu>Animation>Parameter Editor
*Add a Float Spinner to the Base Object of the Plane
*Get the custom attribute definition and get its owner:
a = custAttributes.getOwner ($.custom_attributes)
Plane

*Now “Plane” appears to be the class, but it is the BASE OBJECT the Custom Attribute was assigned to. If you ask for dependencies, you will get

refs.dependents a
#($Plane:Plane01 @ [6.999789,-5.098870,0.000000], ReferenceTarget:NodeSelection, ReferenceTarget:Animatable, ReferenceTarget:Animatable)

*The first element of the array is the NODE the OBJECT with the CA is assigned to.
*If you would instance the plane, you will have the custom attribute in two different nodes (as Instances use the SAME BASE OBJECT which has the single CA definition!)

refs.dependents a
#($Plane:Plane02 @ [-84.970345,-5.098870,0.000000], ReferenceTarget:NodeSelection, ReferenceTarget:Animatable, $Plane:Plane01 @ [6.999789,-5.098870,0.000000], ReferenceTarget:Animatable)

I don’t know what your specific case was, but I assume you saw something like that.
When the MXS Reference speaks of Objects, it means objects in the general programming meaning and not Scene Objects (usually referred to as “Scene Nodes” or just “Nodes”).

Hope this helps…

Hi Bobo,

Thankyou for the great explanation.

I wanted a way to tell the CA to wich assembly it is applied without using $ (if i have selected more than one assembly with the same CA).

The reason why I want this, is when I merge or clone the assembly containing the CA i need a way to reinitialize the CA to include references to the cloned objects within the assembly.

I guess this is the way to go when I want to manipulate the objects contained in the assembly via the CA UI elements – or am I way off target here ?

/thanks

btw: Just finished the maxscript for the masses DVD – Great work…