./dso$HOME/houdiniX.Y/dso$HOME/Library/Preferences/houdini/X.Y/dso (only on Mac OSX)/Users/Shared/houdini/X.Y/dso (only on Mac OSX)$HSITE/houdiniX.Y/dso$HFS/houdini/dso When Houdini finds a plugin library, it locates and executes hook functions in the library which are responsible for registering custom HDK code with the interface.
To find out .so plugins have been attached to Houdini you can run the hscript dsoinfo command.
Here is a complete list of those registration functions:
| Category | Function | Description |
| Channel Operators (CHOPs) | newChopOperator () | Add custom channel operators. Example: CHOP/CHOP_Stair.C. |
| Clips | CLregisterClipReader () CLregisterClipWriter () | Register readers.writers to import/export clips in custom file formats. |
| Compositing Operators (COPs) | newCop2Operator () | Add custom compositing operators. Example: COP2/COP2_PixelAdd.C. |
| Dynamics Operators (DOPs) | newDopOperator () | Add custom dynamics operators. Example: DOP/DOP_GroundAndApply.C. |
| Dynamic Simulations | initializeSIM () | Add new SIM_Data constructors to the data factory. Example: SIM/SIM_GasAdd.C. |
| Expressions/Commands | CMDextendLibrary () | Add new commands to the hscript expression and scripting languages. Example: expr/command.C. |
| Handles | newOpHandleBinding () newOpHandleLink () | Register custom operator-handles that can be bound to node parameters. |
| Houdini Object Model (HOM) | HOMextendLibrary () | Add commands to existing HOM classes or to the hou module. Example: HOM/ObjNode_setSelectable.C. |
| Image Formats | newIMGFormat () | Add new image file formats to be supported by Houdini. Example: IMG/IMG_Raw.C. |
| Modeling States | newModelState () | Add new modeling states to the viewport. Example: SOP/MSS_CustomBrushState.C. |
| Object Operators (OBJs) | newObjectOperator () | Add custom object operators. Example: OBJ/OBJ_Shake.C. |
| Output Driver Operators (ROPs) | newDriverOperator () | Add custom output drivers or ROP nodes. Example: ROP/ROP_Dumper.C. |
| Particle Operators (POPs) | newPopOperator () | Add custom particle operators. Example: POP/POP_SpotLight.C. |
| Render File Formats | IFDnewRenderDefinition () | Add a new instantaneous frame description (IFD) file format to be supported by output drivers. This has been deprecated in favour of SOHO. |
| Shader Clerks | newShopClerk () | Create new shader clerks. This function is deprecated in favour of using SOHO to evaluate clerks. |
| Shader Operators (SOPs) | newShopOperator () | Add custom shader operators. |
| Surface Operators (SOPs) | newSopOperator () | Add custom surface operators. Example: SOP/SOP_Star.C. |
| VEX Operators (VOPs) | newVopOperator () | Add custom VEX operators. Example: VOP/VOP_Switch.C. |
| Viewport Handles | newHandle () | Add custom viewport state handles. |
| Viewport Rendering | newRenderHook () newRenderOption () | Enhance the Houdini viewport by adding new options and hooks to the render pipeline. |
| Viewport Selectors | newSelector () | Add custom states for selecting objects or geometry in the viewport. Example: SOP/MSS_BrushHairLenSelector.C. |
Note that every Houdini application loads plugin libraries found in the Houdini Search Path. For example, if you create a custom material shader and build it into a plugin library, then your shader will be loaded not only by Houdini, but also by Mantra and any other tool which uses materials.
/usr/local/lib for your custom plugins, then set HOUDINI_DSO_PATH to /usr/local/lib. You can use the ':' character (';' on Windows) to separate multiple paths. Additionally, you can use the '@' character to refer to expansion of the HOUDINI_PATH environment variable.For example:
export HOUDINI_DSO_PATH="/usr/local/lib:@/custom_plugins"
will force Houdini to search for plugins in the following folders:
/usr/local/lib $HIP/custom_plugins $HOME/houdiniX.Y/custom_plugins$HOME/Library/Preferences/houdini/X.Y/custom_plugins (only on Mac OSX)/Users/Shared/houdini/X.Y/custom_plugins (only on Mac OSX)$HSITE/houdiniX.Y/custom_plugins$HFS/houdini/custom_plugins Furthermore, there are also the HOUDINI_IMAGE_DSO_PATH and HOUDINI_AUDIO_DSO_PATH environment variables. HOUDINI_IMAGE_DSO_PATH specifies the paths to search for plugin image readers/writers while HOUDINI_AUDIO_DSO_PATH specifies the paths to search for plugin audio readers/writers. All other types of plugins should be installed somewhere in HOUDINI_DSO_PATH.
To find out which directories will be searched, use hconfig. Type `hconfig -ap` in a command-line shell and it will output a description and a list of search directories for each Houdini path variable.
cd $HFS/toolkit/samples/SOP hcustom SOP_Star.C
hcustom generates SOP_Star.so and installs it into $HOME/houdiniX.Y/dso. That's it! The SOP Star is now available for use. To verify this, open Houdini and drop down a Geometry object. Dive into the geometry and press TAB in the Network Editor. Now if you type "Star" the HDK Star operator should appear. Press ENTER and click on the network to drop down a SOP Star node. You have now built, loaded and used your first Houdini plugin!
Of course your own HDK plugin library will probably be more complex than SOP_Star.so. In which case using the Makefiles from $HFS/toolkit/makefiles is recommended over using hcustom to compile and build your code. For more information, see Compiling with Makefiles
If you look at the source code of SOP/SOP_Star.C, you will notice that it defines the newSopOperator function:
void newSopOperator(OP_OperatorTable *table) { table->addOperator( new OP_Operator("hdk_star", // Internal name "Star", // UI name SOP_Star::myConstructor, // How to build the SOP SOP_Star::myTemplateList, // My parameters 0, // Min # of sources 0, // Max # of sources SOP_Star::myVariables, // Local variables OP_FLAG_GENERATOR) // Flag it as generator ); }
When Houdini loads SOP_Star.so, it locates this function and executes it to add a the hdk_star operator to Houdini's internal list of SOPs.
newSopOperator, or any of the other hook functions for that matter.
| Support File | Search Path | Example Destination |
| Operator Icon (*.svg) | HOUDINI_UI_ICON_PATH | $HOME/houdiniX.Y/config/Icons |
| Help Card (*.txt) | HOUDINI_PATH/help | $HOME/houdiniX.Y/help/<path/to/helpcard> |
| Help Card Icon (*.png) | HOUDINI_PATH/help | $HOME/houdiniX.Y/help/<path/to/helpcard> |
On Mac OSX, you should install the support files into $HOME/Library/Preferences/houdini/X.Y instead of $HOME/houdiniX.Y.
For more information on how to write help documentation for your custom operators, please see HDK > Houdini Operators > Building Custom Operators > Help.
For more information on how to create an operator icon, please see HDK > Houdini Operators > Building Custom Operators > Icon.
The hdk_star operator in the SOP Star example has a corresponding icon (SOP_hdk_star.svg) and help files (hdk_star.txt, SOP_hdk_star.png). However, you have probably already noticed that after installing the example using hcustom, no icon or help card appeared in Houdini. That is because hcustom only installs the plugin library, not any of the support files. You need to manually copy the additional files into the Houdini Search Path in order for them to be put into action. Assuming that you have installed SOP_Star.so into $HOME/houdiniX.Y/dso, here is what you can do next:
SOP_hdk_star.svg to $HOME/houdiniX.Y/config/Icons.hdk_star.txt to $HOME/houdiniX.Y/help/nodes/sop.SOP_hdk_star.png to $HOME/houdiniX.Y/help/nodes/sop.Now you have a fully-supported HDK SOP Star example installed!
For example, in a bash shell on Linux, you can do:
export SESI_TAGINFO="Produced by: Side Effects Software"
hcustom SOP_Star.C
Here is an example of how you could add licensing to the SOP/SOP_Star.C sample:
#include <UT/UT_Exit.h> static void dsoExit(void *) { // Return the checked out license. // You must implement returnLicense()! returnLicense(); } void newSopOperator(OP_OperatorTable *table) { // Check out a license. // You must implement checkoutLicense()! if (!checked_out_license && checkoutLicense()) { // Register a callback which is invoked when Houdini quits. UT_Exit::addExitCallback(dsoExit); checked_out_license = true; } table->addOperator( new OP_Operator("hdk_star", // Internal name "Star", // UI name SOP_Star::myConstructor, // How to build the SOP SOP_Star::myTemplateList, // My parameters 0, // Min # of sources 0, // Max # of sources SOP_Star::myVariables, // Local variables OP_FLAG_GENERATOR) // Flag it as generator ); }
1.5.9