Convex Decomposition with HACD in Blender

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Post Reply
Posts: 2
Joined: Thu Aug 28, 2014 9:35 pm

Convex Decomposition with HACD in Blender

Post by geromueller »


I just took the time to create a first version of a HACD binding to Blender. Select the object you want to be decomposed and select "ConvexDecomposition" (hit Space to get the function prompt). It creates a new object for each created convex hull.

It is the work of one evening, so bugs are to be expected. You can post bugs and feature request here, on bitbucket or per Email.

Direct Download: ...
Repository: ... omposition

UPDATE: i updated to the more recent version of HACD from googlecode!

Last edited by geromueller on Wed Oct 22, 2014 7:21 pm, edited 1 time in total.
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Convex Decomposition with HACD in Blender

Post by Flix »

I'm not an Python or a Blender expert at all, so I don't know what's going on (maybe it's something I've messed up myself).

However following your instructions (python install --install-lib=~/.config/blender/2.71/scripts/addons/),
everything seems to work, until I try to enable the addon in the Blender's addons page.
It can't be enabled, and I get the following error:

Code: Select all

Traceback (most recent call last):
  File "./blender-2.71-linux-glibc211-x86_64/2.71/scripts/modules/", line 299, in enable
    mod = __import__(module_name)
  File "~/.config/blender/2.71/scripts/addons/", line 2, in <module>
    from hacd_decompose import decompose
ImportError: ~/.config/blender/2.71/scripts/addons/ undefined symbol: Py_InitModule4_64
I'm using Ubuntu 14.04 - 64 bit
Any idea ?

P.S. I didn't know that C++ code can be called from a Blender Python script.

[Edt:] SOLVED. I had to install libpython3-dev.
By default the C++ files were compiled by including /usr/include/python2.7.
By switching them to /usr/include/python3.4 made it work.

The reported error was not very explanatory :roll: .
Post Reply