This addon shows various self-installed custom operators that "constrain" objects together. For example one object may influence the rotation or position of another object in the scene. This sort of operator is common when building rigs and are an alternative to the Constraint, Expression and Proxy Parameter features of Softimage. A Custom Operator is best suitable for cases where the logic of the relationship between the objects is complex such that it can't be described by a simple fcurve or expression statement.
CenterOp_Basic
This is a straightforward example, that sets the position of a Null
to the average of the position of 3 other objects. In many cases an
operator deals with a fixed number of inputs and a single output as
shown in this example.
CenterOp_Simple
The simple CenterOp Plugin builds on the basic example, but it is
more flexible and powerful. Rather than a hard-coded number of
inputs it supports any number of inputs. It also offers a special
custom command "ApplyCenterOp_Simple" that makes it easier to
create the operator and its output Null with a single API call.
CenterOp_Dynamic
This is the most advanced CenterOp variation, which lets you
connect addition input objects even after the operator has been
created. Rather than building a separate input port for each input
object as is done in the Simple example, it uses a single input
port but allows an unlimited number of instances of the port to be
created (via the PortGroup concept). There are two commands,
ApplyCenterOp_Dynamic to create the operator and make the initial
connections and AddInputsToCenterOp to attach additional inputs to
an existing instance of the operator. Because it requires more code
to create this type of operator it is only recommended for
operators that really need to be fully dynamic.
SurfConstrainOp
This is a Python example which creates an operator that constrains
the kinematic global position of a 3D object (the constrained) to a
surface. The constrained object position is based on the closest
position of an other 3D object (the controller) to the surface
object.
SpringOp_Cpp
This is a classic scripted operator example, ported into a C++
self-installed operator.
CSCenterOp
The JScript simple CenterOp plug-in ported to C#.
Location | |
Files |
CenterOp_Basic.js
CenterOp_Dynamic.js
CenterOp_Simple.js
SurfaceConstrainOp.py
SpringOp_cpp.cpp
CSCenterOp.cs
|
To install the example
Connect to the Softimage SDK workgroup at %XSISDK_ROOT%\examples\workgroup.
To view the help page for an example
To run the DemoCenterOp_Basic example
To run the DemoCenterOp_Simple example
To run the DemoCenterOp_Dynamic example
To run the SurfaceConstrainOp example
To run the SpringOp example
To run the CSCenterOp example
Softimage SDK includes a compiled version of SpringOp_Cpp. If you want to modify the code, you can rebuild the example by following these instructions.
To build the example on Windows
Open an Softimage command prompt, and type devenv to start Visual Studio .NET.
Starting Visual Studio .NET from an Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).
Tip To load the SpringOp_Cpp project from the command line, type:
devenv cppsrc_SpringOp\SpringOp_Cpp.vcproj
To build the example on Linux
In a shell (tcsh) window, type:
source $XSI_HOME/.xsi_<xsi_version>
Change directories to
cppsrc_SpringOp
To remove all intermediate files before building the example, run this command:
gmake clean
To compile the example, run this command:
gmake
Softimage SDK includes a compiled version of CSCenterOp. If you want to modify the code, you can rebuild the example by following these instructions.
To build the example on Windows
Open an Softimage command prompt, and type devenv to start Visual Studio .NET.
Starting Visual Studio .NET from an Softimage command prompt ensures that environment variables such as XSI_HOME are set (otherwise you'll get build and link errors).
Tip To load the CSCenterOp project from the command line, type:
devenv cssrc_CenterOp/CSCenterOp.csproj
This example uses the following keywords:
Operator CustomOperator OperatorContext JScript Python