Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / Reloading Custom Property ?
  RSS 2.0 ATOM  

Reloading Custom Property ?
Rate this thread
 
49566
 
Permlink of this thread  
avatar
  • Location: Toronto, Ontario
  • Total Posts: 1006
  • Joined: 07 June 2009 05:56 PM

How do you reload a custom property, after editing a script?

I was informed that there should be a ’re-load‘ option when holding CTRL+SHIFT+RMB, all that appears is refresh & install. I don’t want to re-install the custom property otherwise I loose what I have on the property ?



Replies: 0
avatar

Click Refresh.



Replies: 0
avatar

Tried that, didn’t work.



Replies: 0
avatar

When you assign a custom property to an object, you create an instance of the custom property.

When you edit the property, somehow, you edit the self-install plugin, not the instance so no modification is transmitted to the instance. The refresh therefore is not propagating the changes to the instance.

How then, do you pass the edited script to the instance. I have tried right-click > edit on the instance and still the main property is being edited, so refresh has not effect.

The only way I found is to delete the instance and create a new instance, then the changes are being seen and recognised, but all the link settings and expressions are lost.

Ctrl+Shift+RMB bring the “install” option but it wants a spdl file.

I tried to reload using this method:

Reload is similar to using the “Refresh” option found on the context menu of Property Page (when Ctrl and Shift keys are held down). Note: It is only necessary to call this method if the SPDL file has changed on disk during an XSI session. If a Property Page is already inspecting the object it will not be updated until it is closed and reopened.

Again, this method is for spdl file, not self-install plugins. How do we do it then and not lose the work already done?

Thanks Stephen for your help!



Replies: 0
avatar

Generally, Refresh is enough to show you your changes to the PPG layout or to load new callbacks.

What changes are you making to the custom property?



Replies: 0
avatar

Making a slider non-inspectable.



Replies: 0
avatar

FalconCrest 19 November 2010 07:16 AM

Making a slider non-inspectable.

yeah, refresh won’t work for that



Replies: 0
avatar

What options do I have ?



Replies: 0
avatar
  • mantom
  • Posted: 25 November 2010 09:50 AM

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.



Replies: 0
avatar

Since a custom property once loaded is a instance, there is no way to make a define layout function ‘non-inspectable’ without re-loading the entire custom property and loosing whatever was applied to that custom property ! Thanks for that info !



Replies: 0