This class represents a Factory class and is used to create certain types of objects.
using namespace XSI; Application app; Factory factory = app.GetFactory(); CString strCode = L"function MyOperator_Update( ctx, Out, InPosY ) { Out.Value = InPosY.Value; }"; CustomOperator op = factory.CreateScriptedOp( L"MyOperator", strCode, L"JScript" ); Model root = app.GetActiveSceneRoot(); CStatus st; Null null1; st = root.AddNull(L"MyNull1", null1); Null null2; st = root.AddNull(L"MyNull2", null2); op.AddOutputPort(null1.GetParameter( L"PosX" )); op.AddInputPort(null2.GetParameter( L"PosY" )); op.Connect();
#include <xsi_factory.h>
Public Member Functions | |
Factory () | |
~Factory () | |
Factory (const CRef &in_ref) | |
Factory (const Factory &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Factory & | operator= (const Factory &in_obj) |
Factory & | operator= (const CRef &in_ref) |
CRef | CreateObject (const CString &name, CStatus *pst=0) |
CRef | CreateObjectFromPreset (const CString &presetname, const CString &family=L"", CStatus *pst=0) |
CRef | CreateObjectFromFile (const CString &in_filename, CStatus *out_st=0) |
CRef | CreateScriptedOp (const CString &name=L"", const CString &code=L"", const CString &language=L"", CStatus *pst=0) |
CRef | CreateScriptedOpFromFile (const CString &name, const CString &filename, const CString &language=L"", CStatus *pst=0) |
CRef | CreateParamDef (const CString &in_scriptname, CValue::DataType in_type, INT in_capabilities, const CString &in_name, const CString &in_description, const CValue &in_default, const CValue &in_min, const CValue &in_max, const CValue &in_suggestedmin, const CValue &in_suggestedmax, CStatus *pst=0) |
CRef | CreateParamDef (const CString &in_scriptname, CValue::DataType in_type, const CValue &in_default, const CValue &in_min, const CValue &in_max, CStatus *pst=0) |
CRef | CreateParamDef (const CString &in_scriptname, CValue::DataType in_type, const CValue &in_default, CStatus *pst=0) |
CRef | CreateFCurveParamDef (const CString &in_scriptname, CStatus *pst=0) |
CRef | CreateGridParamDef (const CString &in_scriptname, CStatus *pst=0) |
CRef | CreateTimeTransport (CStatus *pst=0) |
CRef | CreateICENodeDef (const CString &in_name, const CString &in_description=CString(), CStatus *pst=0) |
CRef | CreateShaderDef (const CString &in_parserName, const CString &in_className, ULONG in_major, ULONG in_minor) |
CStatus | RemoveShaderDef (const CRef &in_shaderdef) |
CRef | CreateShaderParamDefOptions () |
Factory | ( | ) |
Default constructor.
~Factory | ( | ) |
Default destructor.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from SIObject.
siClassID GetClassID | ( | ) | const [virtual] |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
Creates an XSI object from a type name. This function can be used to create a temporary CustomProperty that is not connected to the scene. It can also be used to instantiated a new instance of a Self-Installed CustomOperator.
name | Type name. In the case of a Self-Installed CustomProperty or CustomOperator this is the name as provided in PluginRegistrar::RegisterProperty and PluginRegistrar::RegisterOperator. |
pst | The return status (optional). |
CRef CreateObjectFromPreset | ( | const CString & | presetname, |
const CString & | family = L"" , |
||
CStatus * | pst = 0 |
||
) |
Creates an object from a preset and optional preset family name.
presetname | Preset name. |
family | Preset family name. |
pst | The return status (optional). |
Creates an object from a preset file. The preset filename can be relative or partially complete for example you can find the Shear operator by specifying Operators\Shear
. If the preset is not found in the users folder then the users addon, workgroup, workgroup addon and factory locations will be searched in that order.
in_filename | The filename of the preset. |
out_st | The return status (optional). |
CRef CreateScriptedOp | ( | const CString & | name = L"" , |
const CString & | code = L"" , |
||
const CString & | language = L"" , |
||
CStatus * | pst = 0 |
||
) |
Creates a scripted version of a CustomOperator object with the code specified (a runtime scripted operator). To create a Self-Installed Custom Operator use Factory::CreateObject instead.
name | The name of the operator. |
code | The implementation code. |
language | The implementation language. |
pst | The return status (optional). |
CRef CreateScriptedOpFromFile | ( | const CString & | name, |
const CString & | filename, | ||
const CString & | language = L"" , |
||
CStatus * | pst = 0 |
||
) |
Creates a scripted version of a CustomOperator object with the logic in an associated script file.
name | The name of the operator. |
filename | The file where the operator is implementated. |
language | The implementation language. |
pst | The return status (optional). |
CRef CreateParamDef | ( | const CString & | in_scriptname, |
CValue::DataType | in_type, | ||
INT | in_capabilities, | ||
const CString & | in_name, | ||
const CString & | in_description, | ||
const CValue & | in_default, | ||
const CValue & | in_min, | ||
const CValue & | in_max, | ||
const CValue & | in_suggestedmin, | ||
const CValue & | in_suggestedmax, | ||
CStatus * | pst = 0 |
||
) |
Creates a parameter definition (simplified API for creating parameters of type long, double, etc.).
Parameter definitions contain the definition of a parameter from which you can create new parameters on the fly for one or more property sets or operators. For example, you may want to use a double with the same min/max range and use it on multiple property sets or you may simply want a quick way to add parameters to a runtime custom operator. You can create new parameter definitions from the Factory class.
By default the parameter is persistable and animatable with the exception of string parameters which are not animatable. The recommended parameter types are: siString, siBool, siInt4, siUByte, and siDouble.
The supported types are: siString, siBool, siDouble, siFloat, siInt4, siInt2, siUInt4, siUInt2, siByte, siUByte.
in_scriptname | The script name for the new Parameter object. |
in_type | The data type of the new Parameter object. |
in_capabilities | The capabilities of the parameter. This is a mask of siCapabilities values and is used to determine whether the parameter is read-only or animatable etc. |
in_name | The name of the Parameter object. This is the string that will be displayed in the scene explorer. |
in_description | Description of the custom parameter. If specified, this is a more descriptive name that will appear as the parameter label when the customer property is inspected. For example, the long name of a parameter might be a user friendly "Use Light Color as Energy" while the name is a more script friendly "use_color" |
in_default | The default value of the custom parameter. A default value is required for parameter types other than siString and siBool. |
in_min | Minimum value of the custom parameter. A value is required for parameter types other than siString and siBool. |
in_max | Maximum value of the custom parameter. A value is required for parameter types other than siString and siBool. |
in_suggestedmin | Suggested minimum value of the custom parameter. The minimum value will be used if this parameter is not specified. The suggested minimum should be equal or larger than the minimum. This value is used to configure the range of UI controls. |
in_suggestedmax | Suggested maximum value of the custom parameter. The maximum value will be used if this parameter is not specified. The suggested maximum should be equal or smaller than the Maximum. This value is used to configure the range of UI controls. |
pst | The return status (optional). |
CRef CreateParamDef | ( | const CString & | in_scriptname, |
CValue::DataType | in_type, | ||
const CValue & | in_default, | ||
const CValue & | in_min, | ||
const CValue & | in_max, | ||
CStatus * | pst = 0 |
||
) |
Creates a parameter definition (simplified API for creating parameters of type long, double, etc.).
Parameter definitions contain the definition of a parameter from which you can create new parameters on the fly for one or more property sets or operators. For example, you may want to use a double with the same min/max range and use it on multiple property sets or you may simply want a quick way to add parameters to a runtime custom operator. You can create new parameter definitions from the Factory class.
By default the parameter is persistable and animatable with the exception of string parameters which are not animatable. The recommended parameter types are: siString, siBool, siInt4, siUByte, and siDouble.
The supported types are: siString, siBool, siDouble, siFloat, siInt4, siInt2, siUInt4, siUInt2, siByte, siUByte
in_scriptname | The script name for the new Parameter object. |
in_type | The data type of the new Parameter object. |
in_default | The default value of the custom parameter. A default value is required for parameter types other than siString and siBool. |
in_min | Minimum value of the custom parameter. A value is required for parameter types other than siString and siBool. |
in_max | Maximum value of the custom parameter. A value is required for parameter types other than siString and siBool. |
pst | The return status (optional). |
CRef CreateParamDef | ( | const CString & | in_scriptname, |
CValue::DataType | in_type, | ||
const CValue & | in_default, | ||
CStatus * | pst = 0 |
||
) |
Creates a parameter definition (simplified API for creating parameters of type long, double, etc.).
Parameter definitions contain the definition of a parameter from which you can create new parameters on the fly for one or more property sets or operators. For example, you may want to use a double with the same min/max range and use it on multiple property sets or you may simply want a quick way to add parameters to a runtime custom operator. You can create new parameter definitions from the Factory class.
By default the parameter is persistable and animatable with the exception of string parameters which are not animatable. The recommended parameter types are: siString, siBool, siInt4, siUByte, and siDouble.
The supported types are: siString, siBool, siDouble, siFloat, siInt4, siInt2, siUInt4, siUInt2, siByte, siUByte
in_scriptname | The script name for the new Parameter object. |
in_type | The data type of the new Parameter object. |
in_default | The default value of the custom parameter. A default value is required for parameter types other than siString and siBool. |
pst | The return status (optional). |
Creates an FCurve parameter definition for use with the CustomProperty or CustomOperator. An FCurve of this type is often called a Profile Curve because, unlike most FCurves, this curve does not animate any parameter, but instead is available for use in any fashion the plug-in developer or user wishes.
Unlike parameters that have simple types like an Integer or a String, this Parameter is an instance of an FCurve. It uses units of Frames for its X axis, but because it does not directly animate any object this axis can actually be interpreted in any fashion. An example use of an FCurve parameter can be found on the bulgeop Bulge operator .
You can access the FCurve object via Parameter::GetValue. This should not be confused with the function for retrieving an FCurve that is animating a basic parameter (Parameter::GetSource).
In order to view the FCurve on the Property Page for the CustomProperty or CustomOperator, use PPGLayout::AddFCurve.
in_scriptname | The script name for the new Parameter object. |
pst | The return status (optional). |
Creates a GridData parameter definition for use with the CustomProperty or CustomOperator. The grid is a convenient way to store 1- or 2-dimensional arrays and the user can view and edit this data via ::siControlGrid (see ::siPPGControlType enum).
To change the contents of the grid via scripting use the GridData object, which is accessible via Parameter::GetValue.
To include the GridData in the Property Page of the CustomProperty or CustomOperator, use the PPGLayout::AddItem.
in_scriptname | The ICENode script name. |
pst | The return status (optional). |
Create a connection with time transport service. This will be initialized with the current time setting; which is normally defined by the project's play control property. Call the TimeTransport::SetTimeContext() method change the time context used by the time transport.
CRef CreateICENodeDef | ( | const CString & | in_name, |
const CString & | in_description = CString() , |
||
CStatus * | pst = 0 |
||
) |
Creates an ICENodeDef object, which defines a custom ICENode.
in_name | The ICENode type name. |
in_description | The ICENode type description name. If empty, the in_name value is used. |
pst | The return status (optional). |
CRef CreateShaderDef | ( | const CString & | in_parserName, |
const CString & | in_className, | ||
ULONG | in_major, | ||
ULONG | in_minor | ||
) |
Creates a new shader definition. Softimage shader definitions can be accessed via either Application::GetShaderDefinitions or by ShaderDef::GetProgID via Application::GetShaderDef.
ProgID
which is built from the four specified components. For more information, see cus_shaders_ProgID Instantiating Shader Definitions and the ProgID "Softimage"
or the name of a parser already registered. in_parserName | Name of the parser for the new shader definition. This is basically a dummy string, since shader definitions created with this function are not defined by either plug-ins or parsers. |
in_className | Name of the shader class. If you don't specify a UI name for the shader definition, this is the name that appears on the shader node when instantiated in the render tree. |
in_major | Major version number ('2' in v2.5) |
in_minor | Minor version number ('5' in v2.5) |
Removes an existing shader definition.
in_shaderdef | A reference to the ShaderDef to remove. |
CRef CreateShaderParamDefOptions | ( | ) |
Creates a shader parameter definition options.