CustomTools
 
 
 

Custom Tool Examples

This addon shows various self-installing custom tools.

AddSmoothEdgeLoopTool
This sample is the Model > Modify > Poly. Mesh > Add Smooth Edge Loop Tool that is shipped with Softimage.

SpotLightCreateTool
This sample demonstrates how to create a custom spotlight creation tool.

PickTestTool
This sample demonstrates how to use picking to identify objects under the cursor.

SnapTestTool
This sample demonstrates how to use snapping to identify objects under the cursor.

AnnotationTool
This sample demonstrates how to use a custom tool to pick and launch URL strings from an annotation object.

BoxTransformTool
This sample demonstrates how to create a complex manipulator-style tool that uses highlighting, shortcut keys, context menus and on-screen controls.

BoneCreateTool
This sample is the Model > Create > Skeleton > Draw Bones tool that is shipped with Softimage.

Example Files

Location
AddSmoothEdgeLoopTool Files
AddSmoothEdgeLoopTool.cpp
SpotLightCreateTool Files
SpotLightCreateTool.cpp
PickTestTool Files
PickTestTool.cpp
SnapTestTool Files
SnapTestTool.cpp
AnnotationTool Files
AnnotationTool.cpp
BoxTransformTool Files
BoxTransformTool.cpp
Constants.h
BBox.h
BBox.cpp
BoxTransformToolDelegate.h
ToolHandle.h
ToolHandle.cpp
TranslateToolHandle.h
TranslateToolHandle.cpp
ScaleToolHandle.h
ScaleToolHandle.cpp
RotateToolHandle.h
RotateToolHandle.cpp
RotateStickToolHandle.h
RotateStickToolHandle.cpp
RotateWheelToolHandle.h
RotateWheelToolHandle.cpp
DimensionToolHandle.h
DimensionToolHandle.cpp
ButtonToolHandle.h
ButtonToolHandle.cpp
ToolButton.h
ToolButton.cpp
BoneCreateTool Files
BoneCreateTool.cpp

Running the Examples

To run the AddSmoothEdgeLoopTool example

  • Activate the tool using Model > Modify > Poly. Mesh > Add Smooth Edge Loop Tool or by running the AddSmoothEdgeLoopTool command from the command prompt. Tools can also be assigned shortcut keys from the Keyboard Mapping dialog. (they appear under the Custom Script Commands group)
  • Select a mesh and activate the tool. Click and drag on an edge to add a parallel loop to the selected edge. Edge loops added using this tool automatically follow the surface curvature of the mesh. Middle click on an edge to split the selected edge in half. The last split operator can be inspected from the tool's right click context menu where curvature continuity and other parameters can be modified.

To run the SpotLightCreateTool example

  • Activate the tool using Get > Primitive > Light > SpotLight Tool or by running the SpotLightCreateTool command from the command prompt. Tools can also be assigned shortcut keys from the Keyboard Mapping dialog. (they appear under the Custom Script Commands group)
  • Click and drag in the 3D view on the grid to set the interest and set the spotlight's position. At any point during dragging hold the shift key and drag upwards to set the spotlight's elevation.
  • When finished release the mouse button and the spotlight creation will be finalized. The tool will then exit since this is a one-shot creation tool.

To run the PickTestTool example

  • Activate the tool by running the PickTestTool command from the command prompt. Tools can also be assigned shortcut keys from the Keyboard Mapping dialog. (they appear under the Custom Script Commands group)
  • Create a mesh object. Activate the tool and move the mouse over the mesh and the tool will display the object or point under the cursor. Use the right-mouse button context menu to change the picking options.

To run the SnapTestTool example

  • Activate the tool by running the SnapTestTool command from the command prompt. Tools can also be assigned shortcut keys from the Keyboard Mapping dialog. (they appear under the Custom Script Commands group)
  • Create a mesh object. Activate the tool and move the mouse over the mesh and the tool will display the closest snap target to the cursor.

To run the AnnotationTool example

  • Activate the tool by running the AnnotationTool command from the command prompt. Tools can also be assigned shortcut keys from the Keyboard Mapping dialog. (they appear under the Custom Script Commands group)
  • Create an annotation object by clicking on the Model toolbar menu Get|Primitives|Annotation. Enter this string in the text edit control: http://softimage.wiki.softimage.com. Activate the tool and move the mouse over the object, click on the URL.

To run the BoxTransformTool example

  • Activate the tool using Get > Transform > Box Transform Tool or by running the BoxTransformTool command from the command prompt. Tools can also be assigned shortcut keys from the Keyboard Mapping dialog. (they appear under the Custom Script Commands group)
  • Select or create a 3D object and activate the tool. A box is displayed with various manipulators that highlight as the mouse moves over them.
  • To translate grab one of the small handles on the box and it will translate the object parallel to the visible grid. Holding down <Shift> and clicking will constrain the translation along the bounding box axis that best matches the mouse drag direction.
  • To rotate use either the wheel or the stick handles. The stick handle automatically snaps to the closest rotation axis based on the mouse drag direction.
  • To switch from translate to scaling mode use the on-screen buttons, context menu or the <Tab> shortcut key. The scaling handles will scale along the closest bounding box axis based on the mouse drag direction. Holding down <Shift> will enable uniform scaling along all three axes. Note:When multiple objects with different orientations are selected then the only scaling option is uniform.
  • Clicking on the dimension labels allows the object to be scaled numerically.
  • The box transform tool works in local space unless multiple objects are selected with differing orientations. In this situation it will use global space.

To run the BoneCreateTool example

  • Activate the tool using Model > Create > Skeleton > Draw Bones or by running the BoneCreateTool command from the command prompt. Tools can also be assigned shortcut keys from the Keyboard Mapping dialog. (they appear under the Custom Script Commands.
  • Click and drag in the scene to position the root of the bone. Click and drag again to define the tip of the bone. Subsequent clicks will append a new bone from the tip of the previous bone. Middle click to end the current chain creation. Right click to exit the tool.
  • Hold down control to turn on snapping.

Building the Examples

Use the following instructions to build the CustomTool samples.

To build the AddSmoothEdgeLoopTool example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a 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 AddEdgeLoopTool project from the command line, type:

    devenv cppsrc_addsmoothedgelooptool\AddSmoothEdgeLoopTool.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the SpotLightCreateTool example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a 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 SpotLightCreateTool project from the command line, type:

    devenv cppsrc_spotlightcreatetool\SpotLightCreateTool.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the PickTestTool example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a 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 PickTestTool project from the command line, type:

    devenv cppsrc_picktesttool\PickTestTool.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the SnapTestTool example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a 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 SnapTestTool project from the command line, type:

    devenv cppsrc_snaptesttool\SnapTestTool.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the AnnotationTool example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a 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 AnnotationTool project from the command line, type:

    devenv cppsrc_annotationtool\AnnotationTool.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the BoxTransformTool example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a 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 BoxTransformTool project from the command line, type:

    devenv cppsrc_boxtransformtool\BoxTransformTool.vcproj
    
  2. In Visual Studio .NET, open the project file .vcproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the BoneCreateTool example on Windows

  1. Open a Softimage command prompt, and type devenv to start Visual Studio .NET.

    Starting Visual Studio .NET from a 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 BoneCreateTool project from the command line, type:

    devenv cppsrc_bonecreatetool\BoneCreateTool.vcxproj
    
  2. In Visual Studio .NET, open the project file .vcxproj.
  3. Select a configuration (Release or Debug) and build the DLL.

To build the AddSmoothEdgeLoopTool example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_addsmoothedgelooptool
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the SpotLightCreateTool example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_spotlightcreatetool
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the PickTestTool example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_picktesttool
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the SnapTestTool example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_snaptesttool
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the AnnotationTool example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_annotationtool
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the BoxTransformTool example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_boxtransformtool
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

To build the BoneCreateTool example on Linux

  1. In a shell (tcsh) window, type:

    source $XSI_HOME/.xsi_<xsi_version>
    
  2. Change directories to

    cppsrc_bonecreatetool
    
  3. To remove all intermediate files before building the example, run this command:

    gmake clean
    
  4. To compile the example, run this command:

    gmake
    

Keywords

This example uses the following keywords:

ToolContext C++