Notifications
Clear all

[Closed] Custom Attribute Parameter Default value access?

Is there any way to access the default value you specify for a custom attribute parameter after you’ve applied the custom attribute to an object?

For instance, I have a bunch of custom attributes assigned to controls in my rig, and they look like this:

attributes ca_config (
 	parameters config_params (
 		caBlend type:#float default:1.0
 		anotherVal type:#float default:2.0
 	)
 )

… and I want to go back later and set these parameters to their respective default values. I probably don’t want to try to strip and reapply the CA’s because they likely have something dependent on them (expression controller, paramwire, etc).

1 Reply

Hi Richard,

I would probably add a floatTab as an additional parameter, this could be populated with the default values (or even a hardcoded array as default) when the attribute is added to the rig object. Then, it can be iterated over in order to provide the reset values for your rig. You can use getpropnames to get all the parameter block data, check the count against the reset tab count, and set the property as part of the loop.