Download
Design your own locator!
Description:
N_loc is a maya locator that does not use predefined shapes.
Instead, using the provided nLoc.py, you can create any shape
using either your own presets, or simply objects (curves and/or meshes)
in your scene.
You can create an n_loc out of any number of curves and/or
meshes. As far as meshes goes though, keep in mind that
only quads and triangles are supported, nGons will be skipped.
Quick start:
1. Copy nLoc.py to your PYTHONPATH
2. Load the plugin (n_loc.mll on windows or n_loc.so on linux)
3. Python-import nLoc.py.
4. Draw a nurbsCurve or create a polyCube and make sure they are selected
5. Run:
import nLoc
loc = nLoc.nLoc()
loc.create()
Other usage examples:
Example 1: #tell the class which curves and/or meshes to use
loc = n_loc(curves = ["curve1", "curve2"], meshes = ["pCube1"], name = "locName")
loc.create()
Example 2: #use a preset
loc = nLoc(preset = "solidCube")
loc.create()
Example 3: #use a preset and change the orientation
loc = nLoc(preset = "solidCube", presetOrientation = [0, 90, 0])
loc.create()
NOTE1: Most importantly, because this locator is
not using static, predefined position values I need to store
these into attributes on the node itself, just like a nurbsCurve or
mesh would do.
In order to keep the computation to a minimum, these attributes
are being cached and the only way to refresh an n_loc is by
turning on the update attribute, which will re-compute
all attributes, including the boundingBox.
Don’t forget to turn it back off!!!
You will need to update each time you…:
1. change any of the lines, quads or tris attributes
2. change the localPosition and/or localScale attributes AND the useLocalOffset attribute is true
NOTE2: You can always extend the shape by adding
lines, quads or tris attributes and do an update, but if you need to
remove any of these, you’re better off recreating the node
NOTE3: Constantly reading the localPosition and
localScale attributes slows things down a little bit if you have a large
number of n_locs in the scene, so turn on the useLocalOffset attribute
only if you need it
Package contains:
1. Source code
2. Compiled plugins for Maya 2011 win32, win64 and linux64
3. Creation tools
Enjoy and drop me a line if you have any questions.