|
How to reload a custom property depends on the types of changes you made to the property. I’ll assuming we’re discussing self installing custom properties.
Custom properties by nature are metadata you attach to a scene element. They don’t do anything active like operators, but you can add events to the UI of the custom property to do things upon user interaction. With that in mind, custom properties are not self updating. That is, if you make a change to a self installing custom property’s code, the changes will not be reflected on the custom properties already deployed. You must do it manually either by reapplying the properties manually in the scenes which use them, or by writing a script which performs the update automatically on scene load.
General workflow of updating a custom property:
If you modify anything in the XSILoadPlugin() or _Define() callbacks, then you are essentially changing the foundation of the custom property. It’s almost equivalent to creating a new custom property from scratch as _Define() is only executed when the custom property is applied to a scene item. Once applied, it’s never evaluated again. In such a case you need to reinstance the custom property in the scene to see the changes (eg: use SceneItem.AddProperty(); ). I would advise running UpdatePlugins() before reinstancing to ensure Softimage acknowledges your latest changes.
If you modify anything in the _DefineLayout(), OnInit() or other custom PPGEvent functions you’ve created, you’re only changing the cosmetic appearance. These parts of the custom property are executed anytime the user interacts with the custom property. In which case all you need to do is right-click in the property’s PPG to the right of it’s name below the PPG’s tabs and choose “Refresh”. This will force the property’s OnInit() to be re-parsed and called to reprocess your PPGLayout.
Finally, if you need to modify the _Define() callback, you could put the logic in your OnInit() function to check the current parameters of the custom property and decide if parameters need to be added or removed, but I would advise against doing it this way in production as it can have some unexpected side effects.
|