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
geromueller
Posts: 2
Joined: Thu Aug 28, 2014 9:35 pm

Convex Decomposition with HACD in Blender

Post by geromueller »

Hello!

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: https://bitbucket.org/geromueller/mesh_ ... b6b79f.zip
Repository: https://bitbucket.org/geromueller/mesh_ ... omposition

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

Gero
Last edited by geromueller on Wed Oct 22, 2014 7:21 pm, edited 1 time in total.
Flix
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 setup.py 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/addon_utils.py", line 299, in enable
    mod = __import__(module_name)
  File "~/.config/blender/2.71/scripts/addons/mesh_convex_decomposition.py", line 2, in <module>
    from hacd_decompose import decompose
ImportError: ~/.config/blender/2.71/scripts/addons/hacd_decompose.so: 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