Houdini HDK Plugins With XCode/Eclipse IDE for Mac OS

   3799   1   2
User Avatar
Member
148 posts
Joined: March 2016
Offline
First, this work is freshmeat and I have been working with XCode IDE for about two hours max. I tried to minimize the things you need to do if you want to use the XCode IDE if you want to develop plugins using that technology. It maybe possible to reduce these steps further but this worked for me (so far).

1) The compiler flags

-DUT_DSO_TAGINFO=\“test\” -DVERSION=\“15.0.446\” -D_GNU_SOURCE -DMBSD -DMBSD_COCOA -DMBSD_INTEL -DAMD64 -fPIC -DSIZEOF_VOID_P=8 -DFBX_ENABLED=1 -DOPENCL_ENABLED=1 -DOPENVDB_ENABLED=1 -DSESI_LITTLE_ENDIAN -DENABLE_THREADS -DUSE_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -c -mmacosx-version-min=10.9 -DGCC4 -DGCC3 -Wno-deprecated -std=c++11 -isystem /Library/Frameworks/Houdini.framework/Versions/Current/Resources/toolkit/include -Wall -W -Wno-parentheses -Wno-sign-compare -Wno-reorder -Wno-uninitialized -Wunused -Wno-unused-parameter -Wno-unused-local-typedefs -O2 -DMAKING_DSO

2) The Linker flags

-flat_namespace
-undefined suppress
-fobjc-gc
-framework OpenGL

3) The process

a) Startup xcode and choose File->New->Project
b) Select OS X Framework & Library and choose Library and select next
c) Fill in the options for your project making sure the frame work is selected to be “None (Plain C/C++ Library)” and type is selected to be the default “Dynamic”, then click next
d) Create the Project folder somewhere (desktop or where ever) and copy the plugin C++ source files into it.
e) Create a new group called sources and add the source files (you actually don't have to do this. Its to keep things organized, like creating the missing “scene” folder in the Houdini project folder).
f) Go to Build Phases tab and double click compiler flags and paste in the compiler flags above in item (1) for each C++ .cpp/.C file in the Compile Sources list. Type enter to close the compiler flags menu box.
g) Goto Build Settings and scroll down to Linking. Open up Other Linker Flags tab and paste in the Linker flags in (2) above.

Type command B to build. Thats it.

Track down where XCode put the resulting .dylib plugin file and copy it to the folder ~/Library/Preferences/houdini/15.0/dso, (Note the HDK documentation on where to copy this is wrong for Mac OS, SESI was alerted).

Startup Houdini and use your plugin like you normally would. If you want to create an icon and help text for your plugin do so as follows for the Mac Os.

The current Houdini documentation for the plugin help file installation on the Mac (as of v 15, build 434) is wrong since the folder referenced in the Houdini documentation does not exist and must be created. I have also elaborated on the procedure:

Plugin Help File

CREATE the folder $HOME/Library/Preferences/houdini/X.Y/help/nodes/OPTYPE
where X.Y is the Houdini major and minor version numbers respectively and OPTYPE is the operator context in lowercase such as sop. If you are unsure of the help organization, startup Houdini, create an instance of your plugin and click on the plugin help button either by right clicking the plugin instance and clicking help or equivalently select the plugin, type P to get the parameters window for the plugin and then click the question mark help button in the upper right hand corner of the plugin parameter window. The help browser started by Houdini will say the page is missing but provide you where it should be.

Plugin Icon

Again the Houdini documentation is incorrect since the environment variable HOUDINI_UI_ICON_PATH is undefined. In contrast to the Houdini documentation, the icon can be a PNG file as well as an SVG file. The Houdini documentation is also wrong in that it states missing operator icons will have their name printed out to the shell when Houdini starts up. I have not found this to be true and reported it to SESI. Correctly: The icon filename corresponds to the table and name of the new operator. Then, by default, Houdini will use that icon for the operator. For example, if we have a new object operator named hdk_lamp, then the corresponding icon will be OBJ_hdk_lamp.svg. The SVG icon should be 200x200 pixels at 300 dpi and the PNG icon 48x48 pixels at 90 dpi. The higher resolution SVG icon obviously will have a better presentation. Houdini appears to cache the icons so if you change the icon it may still show up as the old icon, which was my experience.

This was done with version Houdini 15.0.434 for Mac OS, Mac OS version 10.11.4, XCode version 7.3 (build 7D175), with command line tools installed.

Notes:

1) When I installed the full XCode 7.3 the above process seemed not to work until I re-installed the XCode command line tools. I don't know if this was a fluke or something I did earlier that required it.
2) Some of the flags like the 64 bit intel architecture flags are already accounted for by XCode, which is why they are absent from the compiler flags (1)
3) The UT_DSO_TAGINFO can be anything as far as I can see, as long as its there.
4) The VERSION is the Houdini version
5) isystem must point to the current Houdini toolkit include folder.
6) This has only been tested minimally with the HDK for the HOM.

Comments and suggestions welcome.

Finally, this works for me. There is no warranty that it will work for you, i.e. your mileage may vary.

The more I work with Houdini to create a behavioral VFX synthesis system the better I like it, everything works as advertised and it rarely crashes, although the documentation could be a little better (correction, Houdini documentation could be a great deal better, its currently very bad).

Houdini rocks for everything, including organic modeling once you set it up correctly. I like it better than anything else I have used for creating character faces.


THIS PROCEDURE WILL WORK WITH ECLIPSE WITH THE FOLLOWING MODIFICATIONS

1) The compiler flags are set in the Preprocessor section and must have the leading “-D” removed as shown below. The compiler is automatically set for level 03 optimization so -O2 can be removed (or reset using the optimization menu).

UT_DSO_TAGINFO=\“test\” -DVERSION=\“15.0.434\” -D_GNU_SOURCE -DMBSD -DMBSD_COCOA -DMBSD_INTEL -arch x86_64 -DAMD64 -fPIC -DSIZEOF_VOID_P=8 -DFBX_ENABLED=1 -DOPENCL_ENABLED=1 -DOPENVDB_ENABLED=1 -DSESI_LITTLE_ENDIAN -DENABLE_THREADS -DUSE_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -c -mmacosx-version-min=10.9 -DGCC4 -DGCC3 -Wno-deprecated -std=c++11 -isystem /Library/Frameworks/Houdini.framework/Versions/15.0.434/Resources/toolkit/include -Wall -W -Wno-parentheses -Wno-sign-compare -Wno-reorder -Wno-uninitialized -Wunused -Wno-unused-parameter -Wno-unused-local-typedefs -DMAKING_DSO

2) The Linker flags are the same and they should be inserted by clicking the Miscellaneous Linker settings option and pasted into where it says “Linker flags”.

-flat_namespace
-undefined suppress
-fobjc-gc
-framework OpenGL

3) The Library search path for Houdini must be specified using the Library search path menu option (i.e. -L)

/Library/Frameworks/Houdini.framework/Versions/15.0.434/Libraries/

Notes: Do not use the compiler Includes paths menu item to specify the Houdini includes path. Use the -isystem directive.


I would advise using the Eclipse IDE over the XCode IDE for two reasons. First, XCode is optimized for “apps” and not for C++ development so you have to specify the compiler flags for each and every source file (correction: if you shift select the source files in build phases compiler flags and then left click, you can set flags for all files). This is not true for Eclipse, which provides a much more developer friendly environment for C++. Second, XCode crashes a great deal and Eclipse does not.

This post is also on my permanent blog: http://fvg.com/the-lars-wood-blog.html [fvg.com]

VR

Lars
Lars Wood
Future Vision Guide
Advanced Research And Development
User Avatar
Member
34 posts
Joined: July 2015
Offline
Thanks Lars do you happen to know the process on Sierra.

If I try using hcustom I have the following error:

`clang: error: unknown argument: ‘-fobjc-gc’`

And in XCode 9.1 using your instructions (updating new H16 include location and version):

`error: invalid argument ‘-std=c++11’ not allowed with ‘C/ObjC’`

Thanks!!
  • Quick Links