[Closed] custAttributes.getOwner
This always confused me.
defs=custAttributes.getSceneDefs() --Get the scene defs
custAttributes.getDefSource defs[1] --Get the source, this works.
custAttributes.getOwner defs[1] --Get the owner, this doesn't work.
So getOwner doesn’t work in this case but the help says it needs the same parameter passed to it as getDefSource.
This is what is needed.
defs=custAttributes.getSceneDefs() --Get the scene defs
defInsts=custAttributes.getDefInstances --Get the instances then get the owner.
custAttributes.getOwner defInsts[1]
Makes sense but the help doesn’t make any sense unless I’m missing something.
the mxs says not true about custAttributes.getOwner method. it needs MSCustAttrib.
so you do everything the right way:
for attrDef in custAttributes.getSceneDefs() do
(
format "caDef:% :
" attrDef
for attr in (custAttributes.getDefInstances attrDef) do
(
format " ca:% owner:%
" attr (custAttributes.getOwner attr)
)
)
hi Paul, Denis
Thanks for this info – It’s always confused me when getowner keeps saying :
custAttributes.getOwner requires MAXCustAttrib
Ideally i’d like to be able to get this MAXCustAttrib class from an attributedef without using getinstances, possible? i though that perhaps custAttributes.getDefClass <attrib_def> would yield this, but no, it seems to return the same as the argument.
To be honest, I’ve always hacked my way around these functions rather than feeling that I understand these differences, i’m sure that i’m not alone.