Categorizing Effects Shaders in the Preset Manager

 
 
 

You specify categories to make your effects shaders accessible from the preset manager and Nodes menu in the render tree. You can create your own categories, or you can add your shaders to the existing Softimage categories, but you can only specify one category for each shader.

To further refine how your shaders appear in the preset manager, you can use special syntax in the category string to group shaders together and/or specify subcategories (nesting them).

If your effects file does not contain a category string, it will be displayed in the default Realtime > HLSL or Realtime > CgFX categories.

For the curious minded, the realtime shaders category and subcategories are defined in the RTShaderCategories.js file located in the \Addons\RTUserTools\Application\Plugins folder. You can create a similar user plug-in to add any other shaders you want, and to anywhere in the preset manager and Node menu that you'd like. You can even start from a clean slate by setting the environment variable XSI_NO_DEFAULT_SHADERS.

Editing Categories in Effects Files

If you are using the realtime shader wizard to code a custom effects file, you can specify a category (and subcategories if needed) in the Category field on the Information tab.

If your custom effects file does not include any categorization, you can edit your effects file and enter the category string directly. To do this you can use the Softimage shader code editor (choose View Rendering/Texturing Shader Code Editor from the main menu), or you can use any text editor for that matter.

If you want to place your custom effects shader in a different category, you can edit the shader and enter the category string from within the render tree. To do this, drag your preset from the preset manager into the render tree workspace. Then, right-click the node and select Edit Shader to open the shader code editor.

Once you have finished editing the effects file in the shader code editor, click Validate to check your code and then Apply your changes. To update the preset manager you may have to restart Softimage.

Defining Custom Categories and Subcategories

The category string should be added at the beginning of the effects file, as follows:

string Category = "MyCategory/MySubcategory";

Specifying Subcategories

string Category = "MyCategory/MySubcategory/MyOtherSubcategory";

You specify a subcategory using a forward slash (/) preceding each nested level (of subcategory). You can nest an unlimited number of levels deep, although it is recommended for clarity and usability to only use up to two levels of depth.

Grouping Items in Categories

string Category = "MyCategory@200/MySubcategory@100";

To group items, you indicate group membership by the @ symbol followed by a number that identifies the group. It is best to use multiples of 100, to give maximum flexibility for interceding groups. For example, suffixing @100 to the Category name for three out of five shaders means that those three will appear after the other two, and each of the two groups will be automatically sorted in alphabetical order. If you then added another set of shaders with the group indicator of @200, those will appear at the end. Each grouping is indicated in the preset manager by a standard menu separator.