metaball for maya
by Ozgur Yilmaz (gromit)
Description :
Metaball for maya is a metaball surface generator. Current version uses locators as source positions, next versions will use both locators, polygon vertices or particles as source. I developed it for fun and to enhance my maya API knowledge, you can use it freely, I will be updating the code. Current version supports maya 7.0, 8.0 and 8.5.
Release Notes :
v1.0.1 - 07.07.2007
- added metaball plugin for Maya 7.0 and Maya 8.0
- added install command to createMetaball mel script
- added icons for commands createMetaball, addMetaballHandle, removeMetaballHandle
- added the source code, I didn't clean the code, so there is alot commented out lines, alot dirty codes
v1.0.0.alpha.build 1152 - 05.07.2007
- it is the first public release, so it will crash alot ( though I did alot debuging )...
Installation :
- if maya is on, close it...
- put metaball.mll to maya's plug-ins directory ( ex: C:Program FilesAutodeskMaya8.5binplug-ins )
- put createMetaball.mel to one of maya's script directory ( ex: My Documentsmayascripts )
- put icons in to the icons folder ( ex: C:Program FilesAutodeskMaya 8.5icons )
- open maya
- use installMetaball to create the shelf buttons
Usage :
after installing the script by using installMetaball command:
- to create the metaball surface
- select createMetaball from shelf
- it will create one locator and the metaball surface, which is a mesh
- if you move the locator the metaball surface will move with it
- to add another locator/metaballHandle:
- select the metaball surface
- select addMetaballHandle from shelf
- add as many locator as you want or maya crashes ( I didn't made a stress test yet )
- to remove locator/metaballHandle:
- select the metaball handles that you want to delete
- select removeMetaballHandle from the shelf
- to see how the metaball surface created from scratch:
- select the metaball surface
- from the channelBox find the metaball1 node in history, open it
- set "Max Iterations" attribute to 0
- select the "Max Iterations" labal
- while holding the middle mouse button drag to right on the viewport
- the metaball surface will be created as you drag
Attributes :
- radius : specifies the metaball radius for one locator
- threshold : specifies the value where the implicit function will be drawn
-
tesselation method :
0 - uses Adaptive Triangulation Algorithm
1 - uses Adaptive Edge Spining Algorithm
( this setting is obsolete, it will always use adaptive triangulation algorithm ) -
max triangle size :
defines the ratio which will be used as the max triangle size
maxTriangleSize * Radius * 0.15 is the maxTriangle size
maxTriangleSize also effects the min triangle size inside the code -
use view position :
it will be added in future releases, simply it will use the cameras view point for LOD purposes -
max iteration :
this limits the iteration to a maximum value, I mainly use it for debuging, use a value which will be enough to close the metaball surface ( in future releases I will remove this attribute ) -
accuracy :
this is the value which is used in finding the metaball surface for every vertex genereted
1 means 1e-(2+1) = 0.001
2 means 1e-(2+2) = 0.0001
3 means 1e-(2+3) = 0.00001
... and so on
I suggest to use 5 for accuracy, lower values will generate good surfaces in genereal but sometimes metaball surface will not be closed -
neighbour weight :
this value is used in edgeLength calculation
0 will use the edge length from curvature calculation
1 will use the edge length by taking the mean value of the neighbours to the vertex
between 0 and 1 it will mixes the values
I suggest using 0 for this value but values between 0-0.5 will generate better result sometimes
Known Issues :
- maya will crash if threshold is set to 0 or 1 or near to them , between 0.25 and 0.75 is good...
- maya will crash if radius is set to much low ( around 0.01 )
- with low accuracy values below 5 the metaball surface will not close
- tesselation method is obsolete
- use view position attribute is obsolete
- there will always be an untriagulated hole on the metaball surface ignore it, I will close this final triangle in the code later
Please use the Feature Requests to give me ideas.
Please use the Support Forum if you have any questions or problems.
Please rate and review in the Review section.