An humble Maya Python API tutorial to voxelize your geometry.

237 views
Skip to first unread message

Dorian FEVRIER

unread,
Mar 17, 2013, 5:23:12 PM3/17/13
to python_in...@googlegroups.com
Hy all!

I've just over a very little (but I think fun) tutorial about how to reproduce geometry voxelization using Maya Python API.

It could be more optimized etc but I've done this quickly, just for fun, and would like to share with you.


The second version is more opimized and work with animation.

Regards,

Dorian

PS: For french, a french version:

Manuel Macha

unread,
Mar 17, 2013, 8:51:18 PM3/17/13
to python_in...@googlegroups.com
Very nice. Thanks for sharing!

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To post to this group, send email to python_in...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Daz

unread,
Mar 19, 2013, 11:11:05 AM3/19/13
to python_in...@googlegroups.com, Dorian FEVRIER
Wow thanks! I'm all over it ! :)

Ravi Jagannadhan

unread,
Mar 19, 2013, 11:11:52 AM3/19/13
to python_in...@googlegroups.com, Dorian FEVRIER
There should be some way of using this to make better minecraft models....


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To post to this group, send email to python_in...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

Justin Israel

unread,
Mar 19, 2013, 4:14:33 PM3/19/13
to python_in...@googlegroups.com, Dorian FEVRIER
Nice tutorial

I have one suggestion about the usage of the voxelIdList
If you are using it as a lookup for the hash of previously seen items, using a list is going to be progressively slower and slower over time as the list grows, because doing "x in list" is O(n) complexity. You might want to use a set():

##
voxelIdSet = set()
...
if cubeId in voxelIdSet :
    continue
else:
    voxelIdSet.add(cubeId)
##

A set is O(1) complexity, so doing "x in set" will instantly find the item by its hash, as opposed to have to scan the entire list looking for an equality match.

Dorian FEVRIER

unread,
Mar 19, 2013, 4:57:33 PM3/19/13
to Justin Israel, python_in...@googlegroups.com
Amazing! I've learn something today!

Thanks a lot!

I will add this! :)

Regards,

Dorian


De : Justin Israel <justin...@gmail.com>
À : python_in...@googlegroups.com
Cc : Dorian FEVRIER <fevrier...@yahoo.fr>
Envoyé le : Mardi 19 mars 2013 21h14
Objet : Re: [Maya-Python] Re: An humble Maya Python API tutorial to voxelize your geometry.
Reply all
Reply to author
Forward
0 new messages