Notifications
Clear all

[Closed] Is there a way to expose custom attributes?

Is there a way to expose the attributes inside an attribute holder,
so that I can verify how to target them with scripts?
showProperties appears to be for some other purpose…


myObject.modifiers[1]
EmptyModifier:Attribute Holder

showProperties myObject.modifiers[1]
false

4 Replies

I would go with something along the lines of

for def in (custattributes.getDefs myObject.modifiers[1]) do
	print (getPropNames def)

how about exposing the definitions in the source script -the Parameter block and rollout block, etc?

basically: is there away to select an object that has scripted ca’s and see the script itself?

and what about updating the ca?

Sure there is – the .source property of the def itself, for example (don’t feel discouraged and look in the reference, much faster than waiting for reply). Anyway, here’s a stupid snippet, changing all integer types to floats:

for def in (custAttributes.getDefs $) do
 	custAttributes.redefine def (substituteString def.source "#integer" "#float")

beautiful, thank you so much.

I did check the docs, but learn best by example,
and the docs did not make clear (to me) what to portion of the object path I needed to apply .source to.

so I was trying

$.modifiers[1].source

instead of first getting the def itself
and then seeking the def.source

for def in (custAttributes.getDefs $.modifiers[1]) do
 	print def.source