ScriptSpot

Forum topic · General Scripting

Custom Attributes Owner

By SugaR · 2016-06-29

Description

Hi everyone

I'm trying without success to access the object owner of a CA within its parameters or the on create event...
What I don't understand is that I can access the owner object within the rollout with this :

obj = (refs.dependents (custAttributes.getOwner this))[1]

but it doesn't work either on the parameters block or the on create event...

Does anyone knows how to ?
Thanks in advance

Comments (3)

barigazy · 2016-06-29

Use it like this

ca= attributes caData
(
fn getNode = (refs.dependentnodes (custattributes.getowner this) firstonly:on)
rollout rol "Test"
(
button printNode "PrintNode"
on printNode pressed do format "%\n" (getNode())
)
)
d = Dummy isselected:on
custAttributes.add d ca
max modify mode

barigazy · 2016-06-29

I mean like fn ;)

SugaR · 2016-06-29

well works perfectly thanks :)