n_mirrorComponents

Download

Given a list of mesh components (as a valid selection or by
using the components argument), this class will return and/or
select the mirror components.

ARGUMENTS:
components = poly verts, faces or edges (I will expand to nurbs soon)
tolerance = error threshold for the search mechanism. The lower this value, the more precise the results,
but also the more prone to error in the case the mesh is not perfectly symmetrical
axis = 0 for x, 1 for y and 2 for z. No need to specify positive or negative
absolute = if True, the search will occur in world space
doSelect = should we select what we find? You may not always want this…
addToSelection = if True, the class returns a list of both initial components and mirroredComponents

USAGE:
#copy this file to your PYTHONPATH
from n_mirrorComponents import n_mirrorComponents

#Just return the results
#create a poly sphere and select a few verts, then run
mc = n_mirrorComponents()
mc.doIt()
print mc.mirroredComponents

#Select and return the results,
#specify some arguments
mc = n_mirrorComponents(axis = 0, doSelect = 1, addToSelection = 1)
mc.doIt()

#use a predefined components list instead of a selection
myList = ["pSphere1.vtx[258]", "pSphere1.vtx[238]"]
mc = n_mirrorComponents(components = myList, doSelect = 1)
mc.doIt()

NOTE1: Currently only poly meshes are supported (maybe I’ll
extend to nurbs too at some point)
NOTE2: Internally the search mechanism needs verts.
If the components are faces, edges or uvs, I am converting to verts,
do the work and then convert back to your initial components or selection,
based on the type of the first component. I may extend this functionality at some point if need be.

Advertisements

One response to “n_mirrorComponents

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: