[Maya] DDConvexHull - Convex Hull Plugin (shameless plug)

Hey all! Longtime lurker here…

Over the past couple of months, I’ve been working on a plug-in for Maya that allows users to easily create mathematically convex hulls around their meshes in Maya (primarily for collision creation). I’ve released the source as well as few example scripts up on github here:

DDConvexHull Github Page
Download v1.0 as Zip

It should be as pipeline agnostic as possible, and is covered under the MIT license - which means your legal team should no problem with you using it (or even modifying it). Let me know what you think!

will check this out, seems usefull for makeing props for game enignes.

so how does the ussage work, since it dosnt provide a command, and just a node?

Hi passerby, thanks for asking! Please check out this wiki page:
https://github.com/digitaldestructo/DDConvexHull/wiki/Usage

Basically, you connect the output of one or more meshes into the inputs of the hull node. Then connect the output of the hull node into inMesh attribute of an empty mesh node.

You can use the included scripts and attribute editor for the to do the above, or you can write your own script and put it into your pipeline however you like. There is example code for both.

Also you may be interested in the attribute reference:
https://github.com/digitaldestructo/DDConvexHull/wiki/Attribute-Reference

Hope that helps!

thanks, works like a charm.

in cases where i want multiple hulls for one mesh to better fit the mesh, would i just do a componet connection too, than use multiple ddConvexHull nodes and multiple output meshes?

Yes, thats exactly what you would do.

BTW, after your last post, I updated the utils script to add a “createHull” function. Not having that function was an oversight on my behalf (I guess I was just too excited to get it out to folks!) :slight_smile:

You can snag the updated version here:

One last thing, if you don’t delete your history, that mesh will update as you move your object around. If you do delete your history, you’ll lose the dynamic updates, but the resultant hull will still be cached and saved in the mesh nodes.

Let me know if you have other questions or feedback (or if you want to contribute)!
-J

ya don’t think i will directly change it being more of a python guy not a c++ guy, but i might work it into some scripts i use for export to various game engines.

if i did so, would you care if i bundled the binary for it? and credit you or would you rather i just put a link to it in the readme?

Go ahead and bundle away! A few requests:

  • Put a link to the github repo in the readme, and credit Jonathan Tilden
  • Mention in the Readme that DDConvexHull is covered under the MIT License (which basically says do what you want with it)
  • Post back a link to your bundle (if you can) so we can all check it out!

I hope you’ve found the plug-in useful!

ya will be a while till i get to it, since im really busy lately, but will do all of that for you.

Would i need to compile for each Maya version? like would the build i made today for 2012 still work with 2013 or 2014 when it comes out?

No unfortunately, with compiled plugins, you have to link against each maya version :(. The scripts should be agnostic.

Python plugins you don’t have to, but this probably to slow to execute as a python plugin.

I have an open issue to make it a bit easier to support multiple versions with minimum fuss, but I haven gotten around to it just yet.

ah, well since it is under mit and non comercial, i could prolly just download 2011 and 2013 from the autodesk student site, to build against.

Thank you very much for sharing this. Any chance someone can compile a binary for Maya 2014? I don’t have a Visual Studio environment here to build my own. Thanks!

Ya I can make you a build when I get back home during the week for you?

2014 64bit?

[QUOTE=passerby;22531]Ya I can make you a build when I get back home during the week for you?

2014 64bit?[/QUOTE]

Yep, 2014 64bit. Much appreciated. Thanks!

Hey, I found someone in our shop who compiled this for me. Thank you again for your offer. It’s working great. Thanks!

thats great, since while i was working on some unrealscript i hosed my vs2010 install with a add-on, so was going to take me a while to get it going again.

if i can get permission from the plugin maker, i may compile for 2014 64bit and 2012 64bit and host builds of it.

Here’s a quick shelf button Python script that will make a single convex hull from the selected meshes (or faces). Requires ddConvexHull to be installed on your system.

import maya.cmds as cmds
import DDConvexHullUtils

selection = cmds.ls(sl=True, l=True)

# Create the nodes
convexHullNode = cmds.createNode('DDConvexHull')
outputMeshNode = cmds.createNode('mesh', n='outputHullShape')

# Connect the input object(s) to the hull node
DDConvexHullUtils.addObjects(convexHullNode, objects=selection)

    
# Connect the output of the hull to the input of the outputMeshNode
cmds.connectAttr('%s.output' % convexHullNode, '%s.inMesh' % outputMeshNode)

can this create hulls around selected components? In other words, could I use this to attach 3 convex hulls to a single mesh that is concave?

edit: nvm, re-read the thread more closely and saw this has already been answered.

Bump.
Could you release this as a built plugin? I do not have Visual Studio.

what version do you need nightshade? i have a few compiled ones.

also i can likely compile for 2015 64bit without too much trouble