I start a new session of Max and type into the Listener:
custAttributes.getScenedefs()
It returns:
#()
Ok, sweet. There are no definitions in the scene.
Then, I run this piece of code:
if selection.count == 1 and selection[1].baseobject.custAttributes.count == 0 then
(
if sceneDataCADef == undefined do
(
sceneDataCADef = attributes sceneDataCA version:1 attribID:#(0x61e9ff5f, 0x63784819)
(
parameters main rollout:params
( note type:#string ui:et_note default:"" )
rollout params "Scene Data Parameters"
( edittext et_note "Note: " )
)
)
custAttributes.add selection[1].baseobject sceneDataCADef
)
else false
This returns:
false
I type in to the Listener again:
custAttributes.getScenedefs()
It now returns:
#(<AttributeDef:sceneDataCA>)
What the eff is going on? The very first line of the code:
selection.count == 1 and selection[1].baseobject.custAttributes.count == 0
evaluates FALSE! Why does it continue to create an Attribute Definition when the very first line of the code should be telling it to stop?
Any ideas?
Thanks!