HDK
|
There are several support files that can accompany an operator. The most common one is an icon, but there are also command, geometry, and help files. These files are placed in various subdirectories of a Houdini configuration directory, which for local users is typically
but on Mac it can be
So, for example, the dynamic libraries that implement custom operators are placed in the dso
subdirectory:
You can supply an icon file whose name corresponds to the table and name of the new operator. Then, by default, Houdini will use that icon for that operator. For example, in if the new object operator name is "hdk_lamp", then the corresponding icon is "OBJ_hdk_lamp.png". The custom icon files should be placed in the config/Icons
subdirectory of the Houdini configuration directory:
You can also explicitly assign an icon to an operator with OP_Operator::setIconName() and then the icon file does not need to correspond to the operator name.
Sometimes you may wish to supply a custom geometry to represent your new object operator. The geometry files are stored in the geo
subdirectory
By default, Houdini looks for geometry files in this subdirectory, if it has not found it in other default places such as $HFS/houdini/geo
.
When a new operator node is instantiated in Houdini, Houdini searches for the default creation script and invokes it if it finds one. The script that corresponds to the operator has the same file name as the operator. For example, the script file "hdk_lamp.cmd" corresponds to the "hdk_lamp" operator. The object operator creation scripts are placed in the scripts/obj/
subdirectory:
The toolkit sample comes with an example of the creation scripts for the OBJ_Lamp.C source code. The example is very simple because it only registers a new operator type with an old factory function and an old parameter list owned by the OBJ_Light node:
However, there is also an hdk_lamp.cmd file that comes with this example.
Houdini will invoke this script for each newly instantiated node of type "hdk_lamp". The "hdk_lamp" operator is exactly the same as the standard "light" which is implemented by OBJ_Light, but the creation script configures it in its own way. The main difference is the new representation geometry, defined in deflamp.bgeo that also comes with this example. It is a very simple example script, but the hdk_lamp.cmd could be more complex if it set different parameter values or created a larger SOP network within the lamp node.