Download and n_loc blog:http://3desque.wordpress.com/2011/03/20/n_loc/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
3. Python-import nLoc.py.
4. Draw a nurbsCurve or create a polyCube make sure they are selected
loc = nLoc.nLoc()
Other usage examples:Example 1:
#no arguments needed if you have a valid selection
loc = nLoc()
loc.create() Example 2:
#tell the class which curves and/or meshes to use
loc = nLoc(curves = ["curve1", "curve2"], meshes = ["pCube1"], name = "locName")
loc.create() Example 3:
#use a preset
loc = nLoc(preset = "solidCube")
loc.create() Example 4:
#use a preset and change the orientation
loc = nLoc(preset = "solidCube", presetOrientation = [0, 90, 0])
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.
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 trueNOTE2:
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.
Edit1: Fixed a typo in one of the examples.