Now you see it, now you don’t. Digital assets in XSI.

June 15th, 2006 by Andy Nicholas - Viewed 13831 times -

Sometimes when you’re trying your hardest to put together a rig that the animators won’t break, you wish that XSI had something like Houdini’s digital assets. In case you haven’t come across Houdini yet, “Digital Assets” are a way of encapsulating a group of objects and hiding everything except for certain items that you choose.

So as an example, you could create a Digital Asset of an apple. In the interface that you create, you would maybe expose a control to change the color of the apple. In fact, to make it even easier, it might just be a slider that controls the color to go from green to red. You could call that control “Ripeness” if you want. You could also add a slider for controlling the size.

If you now give this asset to another artist, the only way they can change the apple is for them to use the controls you have provided. This means that they won’t be able to make the apple turn blue (accidentally or otherwise).

In a large pipeline, this can prove to be extremely useful. It means that if the TD knows what they’re doing, they can deploy assets in production which won’t get broken or changed in an unexpected way later on. Obviously, care must be taken not to take this paradigm too far and to over encapsulate the object making that asset inflexible. So research and planning for an asset’s role in the pipeline is vital to make sure that the right level of control is applied.

So how can we create Digital Assets in XSI? Natively, they aren’t supported. What do we need? We just need a way to store our asset, a method of presenting certain parameters of our choice to the user, and a way of hiding objects from various XSI editors (Explorer, etc.).

The obvious choice for storing our asset is to use an XSI model. Each model represents a unique namespace for objects and they are XSI’s current method of asset encapsulation (albeit limited).

The second one is also easy. Proxy parameters enable us to provide another location to change any parameter we want. We can also use conventional parameters and then link to them using expressions. While this method might not be quite as nice as a fully customized interface, it will do for this article. Other options might include using an HTML page to display controls to drive parameters, or an ActiveX control, etc.

So that just leaves us with hiding objects from the various XSI editors. To do that we use this:

obj.SetCapabilityFlag( siNotInspectable, true);

The SetCapabilityFlag() method can be found on the ProjectItem object, which occurs near the top of the class hierarchy of the SDK. This means that a large number of objects support this method, including mesh objects, operators, clips, materials, properties, clusters, and many others. In addition, the parameter object also has this method, despite not inheriting from the ProjectItem object.

So here’s an example implementation of the apple Digital Asset.

The apple asset

In the end, I put in four controls.

Asset PPG Controls

The Deform parameter drives the amplitude of a push operator connected to a weight map to add variation to the shape of the apple. Since I didn’t lock the weightmap, you can still modify it using the weight paint brush to change the shape.

The Ripeness parameter drives an expression to control the color in the render tree (you need to render the apple to see the color change). Note that I had to use a “Vector Share” via a “Vector To Color” to drive the diffuse color, as XSI doesn’t let you put expressions on color parameters.

The Size parameter uses some basic rigging to change the size of the apple without changing the size of the stalk.

And finally, the Resolution parameter directly drives the Geometry Approximation to alter the subdivision level.

After hiding all the properties that I didn’t want the user to see, it looks like this in Explorer:

View of asset in explorer

Note that I’ve set the Explorer view to show “Local Properties” so that we don’t see any inherited properties that would otherwise appear there in italics.

To hide the various properties that I didn’t want to see, I used a simple script that can be run from “Model->Get Property->Digital Asset Tools->Pick Objects to Not Inspect“. You can download this script below. When you run the tool, you pick items in Explorer that you want to hide with the left mouse button. Right click to finish and see them disappear. Note that I haven’t supplied a tool to make things re-appear again, so make sure you know what you’re doing!

Okay, so this all seems great. However there are a few gotchas that you have to be aware of:

  • Once you’ve hidden something, you’ll have to use scripting to get it back again. There’s no other way.
  • Don’t try to hide shared properties (e.g. ambient, the Scene_Root’s material, etc.) as it will hide all instances of that property. For example, if you hide the shared ambient property, you’ll find that the “Ambient” button in the Render toolbar won’t show the PPG to let you edit it.
  • Only hide an actual object when you’re certain it’s not needed. In my example, if the user selects the Apple mesh and presses H, they can always unhide it by selecting it in Explorer and pressing H again. If you’ve hidden the actual object from the Explorer too, then the only way to get it back is to use the “Unhide All Objects” from the Display menu.
  • Hiding individual parameters can be great for hiding them from editors such as the graph editor. BUT, be very aware that you’ll no longer be able to access that parameter from scripting using many of the conventional methods. This may well break numerous common operations in XSI, so make sure you research the implications of what you’re doing. You have been warned!
    (In fact, you can still access the parameter to unhide it again, but you have to do it by pushing it’s name into the Items property of an XSICollection)
  • Duplicating the DigitalAsset model with Ctrl-D will lose any expressions that you’ve set up, unless you’ve enabled “Copy Animation” in the Duplicate Options. This can cripple your Digital Asset if it relies on expressions to do some of the work.

The most important thing to note, is that (to my knowledge) this technique has not been production tested inside XSI yet. This is a fairly non-standard way of working in XSI, and it isn’t something that Softimage would be expecting you to do. Hence there may be other gotchas that I’ve not found yet that could invalidate this way of working.

Having said that, it’s definitely a cool technique, and I hope that this or a similar type of workflow will be acknowledged or supported by XSI in the future.

I’ve uploaded the asset as an XSI 5.0 model (both the unhidden and the final versions of the asset), as well as the script for making your objects and properties hidden. To install it, you need to copy the script to your user/application/plugins folder.

(Disclaimer: I’ve given fair warning during this article about the dangers of hiding things, so I accept no responsibility for any losses you may incur! Please take care.)

3 Responses to “Now you see it, now you don’t. Digital assets in XSI.”

  1. Hey Andy,

    Thanks a lot for the tips. I toyed a little with the SetCapabilityFlag, I can see how it could be used to hide things from the reckless users. I wasn”t aware of these features, thanks a lot for discussing them.


  2. ajlan altug says:

    Unfortunately, attribute and operation disabling in XSI needs some more work. Locking nodes don’t function the way one fancies they should. One good example for a working system would be from Maya where any node can be locked from it’s root level on down, or attributes for that matter. In XSI however, if you are in need of say locking a camera in place. you have to resort to locking it on all levels, not some. So, after doing so, if you want to leave, say rotoscoping free, you don’t have the option… In my experience at least…


  3. David says:

    I normally just hid unwanted objects with a group and removed all parameters from the keyable parameters panel. This worked quite well, and still left some flexibility to add or remove parameters for animation. :P