spPaint3d is an object placement tool, very similar to geometryPaint from Maya. It is entirely raycast based, so it doesn't expect any UVs from the target surfaces, thus it doesn't allow for any kind of follicle-like functionality. See Features for more details.
I've written this tool mainly because I couldn't find a decent enough way to use the standard geometryPaint script for my particular workflow. I couldn't do what I needed to with its inherent limitations (both from the surface UVs and the grid). However, if geometryPaint was not an hindrance to you, then there's little chance you'll find this script useful.
I come from a 3DS Max background a long time ago and I have used the awesome AdvancedPainter script for years in my workflow. I work as a production environment game artist and I was increasingly frustrated that I couldn't find a decent object placement script with a similar workflow in Maya. So it's no big surprise the script from Herman Saksono (and the one from Neil Blevins to some extent) was a major inspiration while working on this Maya version.
Hopefully this script will be useful to others than myself. Feel free to send me some email if you happen to use it and like it (or not).
Maya 2011 Note: Qt changed a lot of stuff, and without too much surprise a lot of things are currently broken (vanilla 2011 pre-service pack). A few features are sort of broken because of this, place mode is the most affected, but things should work, kind of.
Thanks to Julien Lefebvre and Gabriel Charest for helping me debug all this.
Thanks to Rick Gilliland for his help regarding Python & Maya API and for pointing me in the right direction following Maya 2011 crash extravaganza.
And thanks also to the people who sent me bug report and suggestion emails.
Tool Configuration
Options are accessed from the Options button from the main UI window.
For now, there is very little options, but hopefully this window will grow with time. Also, for now, it is not necessary to run the setup, the script will assume default behavior if options are not set.
- It is possible to configure the script to duplicate new objects with or without preserving the input connections of the original source object.
NOTE: this option is only useful when the script is set to duplicate mode in the main script interface window.
- Surface Normals option configure the way the script will orient the created object onto the target surface. Depending on the neighboring edges soft/hard mode the actual normal at the intersection point may not be the normal of the actual triangle. The Force hard normal option forces the script to disregard the edges and compute a straight up normal of the triangle at the intersection point. This mode is particularly useful while placing decal or dirt objects on surfaces.
- Flux control option will let the user decide which method is best suited to control the frequency of the creation of new objects. More often than not, this option will remain set on Distance.
- Hierarchy Management offers 3 different ways for the script to sort the objects it creates.
Single paint session group: all the created objects will all be sorted into the same group while the script is running.
Stroke group: each paint stroke will create its group containing all the objects created during that stroke.
Source group: created objects will be sorted with their source name.
- Place mode rotate increment configures the amount of degrees applied to the rotation of the object while using the Place mode and pressing shift.
- Continuous transform force the object to be transformed again with random values each time the mouse is moved while using the Place mode. If not activated, random values will be fetched only after each object creation.
- Realtime rampFX is a development feature that may be dangerous to use, especially on slow computers. It forces the script to recompute all the transforms for all the objects created within the same stroke event. Only works for Paint mode.
Brush Geometry - Source Objects
This is where the script will look at for duplicating geometry on the paint surfaces (ie: the brush geometry).
The script only let polygon objects and locators be added to the list. The source objects can be anywhere in the DAG hierarchy as long as this hierarchy is kept relatively simple. Also they can be anywhere in the world. Make sure to add all the objects you need in this list before starting painting.
The script is not very permitting at this time regarding weird DAG hierarchies and won't allow objects with ambiguous DAG path to be added to this list.
Note: if source objects are buried in a hierarchy, any parent node with non-frozen transform will most probably cause the generated objects to be misplaced. This is a known issues.
Transform Setup
This is where the user can setup the various random factors the script will use for each instance it will create.
- At any moment (even while painting), the user can decide to (de)activate the transform, thus preventing the various variables to affect the generated objects transformation.
- The rotation is represented on a standard degree notation. Most of the time the user will probably want to use the rotation along the Z axis while using the align to surface mode for example.
- The scale is based on the Maya notation (1 being the scale of the object before the script randomized the new value).
Note that if the original object already has been scaled and its transform not frozen, the original scale value will be multiplied with the random value so the instanced geometry won't reset back to the object original matrix.
The uniform scale option should be self explanatory (when this option is On, settings from X will be used for Y and Z).
Distribution Objects
This is the list of the objects the script will paint onto (ie: the landscape). The script only allow for polygon objects to be inserted in this list.
Paint Options
This is where lies some late options for generating the new objects.
- Flux control options can be either set on Distance or Timer in the setup options.
The distance threshold represent the minimum distance from the previous generated object before another one is allowed to be created. The distance value is using the scene units.
The timer mode uses a sensitivity slider to allow the user to regulate the flux at which the script generates new objects. The closer the slider value to zero the less 'downtime' there will be between the creation of two new objects. Although the slider goes from 0 to 0.2, the slider value can be manually set up to 1. Useful only for Paint mode.
- Up Offset allows the user to specify the distance the created object will be moved from the surface. Works for both Paint and Place mode.
- Ramp FX is an option to use the transform values as transform boundaries for the created objects within the same stroke. The created objects will be transformed as a ramp between the min and max values entered in the script UI.
Note: with the current version, when using rampFX with rotate values, objects won't be aligned to the surface normal anymore even if the align to surface option is active.
RampFX only works for the Paint mode at the moment.
- Jitter allows for the created objects to be randomly scattered on the tangent grid at the intersection point. If the values are too big, the objects may either be floating or going through the intersected surface as the jitter won't recompute intersections to follow different surface normals.
If you happen to run into any bugs, please let me know and I'll do my best to fix it.
Version Requirement:
- Requires a python-enabled Maya (8.5+) (If necessary, adjust your PYTHONPATH environment variable).
- Developed on Maya 2009 & 2011 64bit, but it should work from Maya 8.5 and up.
- From version 2011.0 onward, attempts will be made to keep the script backward compatible, but it won't be actively maintened for earlier version than 2011.
- The script is supposed to work for all platforms, let me know if you happen to have any issues with the script on either Mac or Linux platform as I am unable to test myself.
Contact email: spaviot @ gmail . com
Download URL: http://www.creativecrash.com/maya/downloads/scripts-plugins/utility-external/misc/c/sppaint3d