DefineInfo
 
 
 

DefineInfo


Description

Allows you to define information about your custom shader definition. For example, this is where you can assign it a ShaderDef.Category so that it will appear in the Preset Manager.

This callback is fired after the shader plug-in loaded (that is, after XSILoadPlugin returns).


Applies To

Custom Shaders


Syntax

public class <plugin-item_name>
{
        public bool DefineInfo( Context in_context )
        {
                ...
        }
}
CStatus <plugin-item_name>_DefineInfo( CRef& in_context ) 
{ 
        ... 
}
function <plugin-item_name>_DefineInfo( in_context ) 
{ 
        ... 
}
def <plugin-item_name>_DefineInfo( in_context ):
        ...
Function <plugin-item_name>_DefineInfo( in_context )
        ...
End Function
sub <plugin-item_name>_DefineInfo 
{ 
        my $in_context = shift; 
}

<plugin-item-name> is a special string constructed from the plug-in name, the name specified in the call to PluginRegistrar.RegisterShader, and the major and minor version numbers, with any spaces converted to underscores. For example, if you register a shader definition in a plug-in called "MyPlugin" with the shader class name "My Shader", and the version number 1.0, the callback function names start with "MyPlugin_My_Shader_1_0".


Parameters

Parameter Language Type Description
in_context Scripting and C# Context Use the Context.GetAttribute method to get basic information, such as Category, DisplayName, etc.
C++ CRef& Use the Context.GetAttribute method to get basic information, such as Category, DisplayName, etc.

Context Attributes

Attribute Get/Set Description
ClassName Returns a String or CString The class name of the shader. This is used to build the ShaderDef.ProgID with the parser name and version number in this form: "ParserName.ClassName.MajorVersion.MinorVersion".
MajorVersion Returns a Long or ULONG The major version of the shader definition. This is used to build the ShaderDef.ProgID with the parser name, class name and minor version number in this form: "ParserName.ClassName.MajorVersion.MinorVersion".
MinorVersion Returns a Long or ULONG The minor version of the shader definition. This is used to build the ShaderDef.ProgID with the parser name, class name and major version number in this form: "ParserName.ClassName.MajorVersion.MinorVersion".
Category Returns a String or CString The category to use in the Preset Manager.
DisplayName Returns a String or CString The display name to use in the Preset Manager.
Errors Returns a String or CString The parser can output parse errors.
Warnings Returns a String or CString The parser can output parse warnings.
{XXXX-XXXX-XXXX-XXXX} or simple string attribute name Sets a String or CString You can set a custom shader attribute in the ShaderDef by setting a string repesenting a GUID or the name of any attribute.

Example

SICALLBACK UtShaderPlugin_ColorShare_1_0_DefineInfo( CRef& in_ctxt )
{
        XSI::Context ctxt(in_ctxt);
        
        // Setting the location and appearance of the shader definition in the preset manager
        ctxt.PutAttribute( L"Category", L"UtShaderPlugin" );
        ctxt.PutAttribute( L"DisplayName", L"Color Share UtShaderPlugin" );

        // Setting a user attribute
        ctxt.PutAttribute( L"{F2EF07FE-1B57-4245-BF08-F5556212BFDF}", L"User data" );

        return CStatus::OK;
}

See Also