This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
import maya.mel as mel | |
def mesh_density_calc(mesh, operation = 'density'): | |
#TODO: add line ot save existing selection and reselect at the end | |
pm.select(mesh) | |
if operation == 'volume': | |
return mel.eval('computePolysetVolume ') | |
elif operation == 'polycount': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
import maya.cmds as cmds | |
#Version: 1.1.2 | |
#declaring initial variables | |
#global playStartTime | |
#global playEndTime | |
def ab_getFile(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
import vo_sceneTools as st | |
reload(st) | |
#this will select sylvia's root control regardless of the namespace | |
#when replacing for another character, make sure to keep the *: characters if there's a namespace | |
pm.select('*:sylv_root_CTL') | |
st.export_character('auto') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
metaRig test setup | |
also messing with what kind of objects I can pass to red9 for instancing r9MetaClass | |
skinned_mesh | |
""" | |
import Red9.core.Red9_Meta as r9Meta | |
import maya.cmds as cmds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vo_maya | |
reload(vo_maya) | |
for item in os.listdir(vo_maya.VO_SHELF_PATH): | |
#shelf names looke like 'shelf_vo_polyTools.mel' | |
shelf_name = 'vo_' + item.split('_')[2].replace('.mel','') | |
print(shelf_name) | |
ps.delete_shelf(shelf_name) | |
shelf_path = os.path.normpath(os.path.join(vo_maya.VO_SHELF_PATH,item)).replace('\\', '/') | |
ps.load_shelf(shelf_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
#select the mesh, the source influence, and the target influence you want to move weights to | |
target_mesh, source_influence, target_influence = pm.ls(sl=1)[0:3]# unpack selection | |
target_skinCluster = target_mesh.listHistory(type='skinCluster')[0] # pm.mel.findRelatedSkinCluster(target_mesh) should also work | |
#verts = target_mesh.select("pSphere1.vtx[*]") | |
target_skinCluster.addInfluence(target_influence, weight = 0.0) | |
pm.select(target_mesh.vtx[:]) | |
pm.skinPercent(target_skinCluster, tmw=[source_influence, target_influence]) # the data from the first will be written to the second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bunch of messy procs for moving skinweights to bind joints and then contraining them to the prior | |
import pymel.core as pm | |
target_mesh = pm.ls(sl=1)[0]# unpack selection | |
target_skinCluster = target_mesh.listHistory(type='skinCluster')[0] # pm.mel.findRelatedSkinCluster(target_mesh) should also work | |
source_influence, target_influence = pm.ls(sl=1)[0:2]# unpack selection | |
target_skinCluster.addInfluence(target_influence, weight = 0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
target_mesh = pm.ls(sl=1)[0] | |
print target_mesh | |
pm.select("mesh:simple_plane.vtx[*]") | |
pm.select("mesh:Xidriel_head_mesh.vtx[*]") | |
target_mesh.vtx[0].select() | |
target_mesh.vtx[:].select() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def get_blendShape(target): | |
"""Get blendshape of target.""" | |
if (pm.nodeType(target.getShape()) in ["mesh", "nurbsSurface", "nurbsCurve"]): | |
blendShape = pm.listHistory(target, type="blendShape")[0] | |
return blendShape | |
def add_blendShape(new_shape, blend_mesh): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def primitiveWindow(name = 'primitiveWindow'): | |
if pm.window(name, query=True, exists=True): | |
pm.deleteUI(name) | |
pm.window(name) | |
pm.showWindow(name) |
OlderNewer