本文整理汇总了Python中pymel.core.createNode函数的典型用法代码示例。如果您正苦于以下问题:Python createNode函数的具体用法?Python createNode怎么用?Python createNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createNode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _visualizer_setup
def _visualizer_setup(self):
"""Add a shader to visualize the outValue and the coneAngle."""
visualize_sdr = pm.shadingNode('surfaceShader', asShader=True,
n='visualize')
sets = pm.sets(renderable=True, noSurfaceShader=True, empty=True,
n='visualize')
visualize_sdr.outColor >> sets.surfaceShader
vis_ramp = pm.createNode('ramp', n='visualize')
vis_ramp.setAttr('type', 1)
vis_ramp.setAttr('colorEntryList[0].color', 0, 0, 0)
vis_ramp.setAttr('colorEntryList[1].position', 1)
vis_ramp.setAttr('colorEntryList[1].color', 0, 0, 0)
vis_ramp.setAttr('colorEntryList[2].position', 0)
cmds.setAttr('%s.colorEntryList[2].color' % vis_ramp, 0, 0, 0,
type='double3')
vis_ramp.setAttr('colorEntryList[3].color', 0, 0, 0)
self.ramp.outColorR >> vis_ramp.colorEntryList[1].color.colorG
rmv = pm.createNode('remapValue', n='visualize')
rmv.setAttr('inputMin', -1)
rmv.setAttr('inputMax', 0)
rmv.setAttr('outputMin', 1)
rmv.setAttr('outputMax', 0)
self.ramp.outColorR >> rmv.inputValue
rmv.outValue >> vis_ramp.colorEntryList[2].color.colorR
(self.ramp.colorEntryList[0].position >>
vis_ramp.colorEntryList[0].position)
(self.ramp.colorEntryList[3].position >>
vis_ramp.colorEntryList[3].position)
vis_ramp.outColor >> visualize_sdr.outColor
pm.defaultNavigation(source=visualize_sdr,
destination=self.sphere.getShape().instObjGroups[0],
connectToExisting=True)
开发者ID:PaulSchweizer,项目名称:UVBasedPoseReader,代码行数:34,代码来源:UVBasedPoseReader.py
示例2: createEtWorldPosRE
def createEtWorldPosRE(self):
#create etWorldPosRE
etWorldPosRE = self.createRenderElement('ExtraTexElement')
pm.rename(etWorldPosRE, 'rbEtWorldPos')
#SetAttrs on etWorldPosRE
pm.setAttr(etWorldPosRE.vray_name_extratex, 'rbEtWorldPos')
pm.setAttr(etWorldPosRE.vray_explicit_name_extratex, 'rbEtWorldPos')
pm.setAttr(etWorldPosRE.vray_affectmattes_extratex, 0)
pm.setAttr(etWorldPosRE.vray_filtering_extratex, 0)
#Create vrayfresnel tex and setAttrs
pm.select(cl = True)
vrayFresnelTex = pm.createNode('VRayFresnel')
pm.rename(vrayFresnelTex, 'rbVRayFresnelWorldPos')
pm.setAttr(vrayFresnelTex.IOR, 1)
pm.select(cl = True)
#Create sampler Info Node
samplerInfoWorldPos = pm.createNode('samplerInfo')
pm.rename(samplerInfoWorldPos, 'rbSamplerInfoWorldPos')
#connections
samplerInfoWorldPos.pointWorld >> vrayFresnelTex.frontColor
samplerInfoWorldPos.pointWorld >> vrayFresnelTex.sideColor
vrayFresnelTex.outColor >> etWorldPosRE.vray_texture_extratex
pm.select(cl = True)
#verbose
if(self.verbose): print('Extra Tex World Pos RE created')
开发者ID:gitter-badger,项目名称:rugbybugs,代码行数:35,代码来源:rbCreateDataPasses.py
示例3: create_copier
def create_copier(in_meshes, name='out_geo#', in_array=None, rotate=True):
# Create output mesh
out_shape = pm.createNode('mesh')
out_xform = out_shape.getParent()
out_xform.rename(name)
# Create copier node
copier = pm.createNode('copier')
copier.orient.set(1)
copier.toggleUV.set(1)
copier.outputMesh.connect(out_shape.inMesh)
# Connect input meshes
for i, mesh in enumerate(in_meshes):
shape = mesh.getShape(noIntermediate=True)
shape.worldMesh[0].connect(copier.inputMesh[i])
if not in_array:
# Connect input transforms
array = pm.createNode('transformsToArrays')
else:
array = in_array
array.outPositionPP.connect(copier.posArray)
if rotate:
array.outRotationPP.connect(copier.rotArray)
return out_xform, copier, array
开发者ID:danbradham,项目名称:splitflap,代码行数:29,代码来源:utils.py
示例4: closestEndOrStartVertToSurface
def closestEndOrStartVertToSurface(targetSurface, transforms):
'''
Usage:
closestEndOrStartVertToSurface(pm.PyNode('r_hand_GEO'), pm.ls(sl=True))
'''
cpom = pm.createNode('closestPointOnMesh')
distBet = pm.createNode('distanceBetween')
targetSurface.outMesh.connect(cpom.inMesh)
for transform in transforms:
closestPointAndVert = {}
loc = pm.spaceLocator(n=transform.name().replace('GEO','LOC'))
loc.translate.set( transform.getShape().vtx[-1].getPosition() )
cpom.inPosition.set(loc.translate.get())
closestVert = cpom.closestVertexIndex.get()
closestPosEnd = targetSurface.vtx[cpom.closestVertexIndex.get()].getPosition()
distBet.point1.set( closestPosEnd )
distBet.point2.set( loc.translate.get() )
distToEnd = distBet.distance.get()
closestPointAndVert[distToEnd] = [closestVert, closestPosEnd]
loc.translate.set( transform.getShape().vtx[0].getPosition() )
cpom.inPosition.set(loc.translate.get())
closestVert = cpom.closestVertexIndex.get()
closestPosStart = targetSurface.vtx[cpom.closestVertexIndex.get()].getPosition()
distBet.point1.set( closestPosStart )
distBet.point2.set( loc.translate.get() )
distToStart = distBet.distance.get()
closestPointAndVert[distToStart] = [closestVert, closestPosEnd]
loc.translate.set( closestPointAndVert[ min(distToStart, distToEnd) ][1] )
开发者ID:AndresMWeber,项目名称:aw,代码行数:31,代码来源:aw_pythonJunk.py
示例5: connectJacketLoc
def connectJacketLoc(twistCrv, untwistCrv, param, name='', addCrvs=[]):
'''
'''
mp = pm.createNode('motionPath', n=twistCrv+name+'_mp')
untwistCrv.worldSpace >> mp.geometryPath
mp.u.set(param)
npc = pm.createNode('nearestPointOnCurve', n=twistCrv+name+'_npc')
mp.allCoordinates >> npc.inPosition
twistCrv.worldSpace >> npc.inputCurve
allLocs = []
loc = pm.spaceLocator(n=twistCrv+name+'_loc')
npc.position >> loc.translate
allLocs.append(loc)
for crv in addCrvs:
pci = pm.createNode('pointOnCurveInfo', n=crv+name+'_pci')
npc.parameter >> pci.parameter
crv.worldSpace >> pci.inputCurve
loc = pm.spaceLocator(n=crv+name+'_loc')
pci.position >> loc.translate
allLocs.append(loc)
pm.select(allLocs)
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:25,代码来源:jacket.py
示例6: test_export_network
def test_export_network(self, epsilon=0.00001):
pynode_a = pymel.createNode('transform')
pynode_b = pymel.createNode('transform')
old_instance = A()
old_instance.ex_int = 42
old_instance.ex_float = 3.14159
old_instance.ex_str = 'Hello World'
old_instance.ex_None = None
old_instance.ex_list_pynode = [None, pynode_a, None, pynode_b]
#
# Ensure consistency when exporting to network
#
n = libSerialization.export_network(old_instance)
network_ex_int = n.ex_int.get()
network_ex_float = n.ex_float.get()
network_ex_str = n.ex_str.get()
self.assertTrue(network_ex_int == old_instance.ex_int)
self.assertTrue(abs(network_ex_float- old_instance.ex_float) < epsilon)
self.assertTrue(network_ex_str == old_instance.ex_str)
# Note: libSerialization will NEVER export a None value since the type cannot be resolved.
self.assertTrue(not n.hasAttr('ex_None'))
#
# Ensure consistency when importing from network
#
new_instance = libSerialization.import_network(n)
self.assertTrue(network_ex_int == new_instance.ex_int)
self.assertTrue(abs(network_ex_float- new_instance.ex_float) < epsilon)
self.assertTrue(network_ex_str == new_instance.ex_str)
开发者ID:SqueezeStudioAnimation,项目名称:libSerialization,代码行数:32,代码来源:test_maya.py
示例7: _attachRenderProxy
def _attachRenderProxy( self, objects ):
path = self.fileInput.text()
proxy = []
if os.path.isdir(path):
for file in glob.glob(path+"/*.mib"):
bipx = pm.createNode('mip_binaryproxy',n=file.split('/').pop().split('.')[0]+'_BINARYPROXY')
bipx.object_filename.set(file)
proxy.append(bipx)
else:
bipx = pm.createNode('mip_binaryproxy',n=path.split('/').pop().split('.')[0]+'_BINARYPROXY')
bipx.object_filename.set(path)
proxy.append( bipx )
if not objects:
for prx in proxy:
objects.append(pm.polyCube())
for arg in objects:
if len(proxy)==0: pm.error('No proxies found in folder. Womp Womp.')
elif len(proxy)>1:
print 'more than one proxy'
#turn the lo geometry shader on
arg.miExportGeoShader.set(1)
#connect the proxy to the lo's geo shader
proxy[random.randint(0,len(proxy)-1)].outValue.connect(arg.miGeoShader, f=True)
else:
print 'one proxy'
#turn the lo geometry shader on
arg.miExportGeoShader.set(1)
#connect the proxy to the lo's geo shader
proxy.pop().outValue.connect(arg.miGeoShader, f=True)
开发者ID:creuter23,项目名称:tools,代码行数:32,代码来源:aw_binaryProxy.py
示例8: _gather_exported_alembic_info_
def _gather_exported_alembic_info_():
cmds.loadPlugin("AbcImport.mll", quiet=True)
template_obj, fields, tk = _get_shotgun_fields_from_file_name_()
if not pm.objExists("animatedAlembicGroup"):
pm.createNode("transform", name="animatedAlembicGroup")
temp, fields, tk = _get_shotgun_fields_from_file_name_()
masterAlembicTemplate = tk.templates["master_alembic_cache"]
alembicFolder = libFile.get_parent_folder(masterAlembicTemplate.apply_fields(fields))
# Get all the abc files
exported_alemblic_info = {}
if libFile.exists(alembicFolder):
for alembicFile in libFile.listfiles(alembicFolder, "abc"):
alembicFilePath = libFile.join(alembicFolder, alembicFile)
# Edited by Chet
# Project Kitten Witch 25 May 2016
# ========================================================
# Old code that was causing the list of alembics to build
# niceName = alembicFile.split(".")[0].split("_")[]
niceName = alembicFile.split(".")[0]
niceName = niceName.split("_")
niceName = " ".join(niceName[1:])
exported_alemblic_info[niceName] = alembicFilePath
return exported_alemblic_info
开发者ID:mds-dev,项目名称:mds_repository,代码行数:31,代码来源:MDSShotgun.py
示例9: createSubdivApproxNode
def createSubdivApproxNode():
'''
copy of createApproxNode from mentalrayApproxEditor.mel
node will be named "mathildaSubdivApprox"
'''
# delete existing node if exists
nodeName = 'mathildaSubdivApprox'
# make sure mental ray is loaded first
if not pm.pluginInfo('Mayatomr', q=True, loaded=True):
pm.loadPlugin('Mayatomr', qt=True)
# create approx node
approxNode = pm.createNode('mentalraySubdivApprox', n=nodeName)
# get listNode
try:
mrItemsListNode = pm.ls(type='mentalrayItemsList')[0]
except IndexError:
mrItemsListNode = pm.createNode('mentalrayItemsList', n='mentalrayItemsList')
# connect approx to list
pm.connectAttr(approxNode.message, mrItemsListNode.subdivApproxs, na=True)
return approxNode
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:25,代码来源:tools.py
示例10: _create_custom
def _create_custom(self):
self.pos_x_remap.outputMin.set(1)
self.pos_x_remap.outputMax.set(0)
self.neg_x_remap.outputMin.set(0)
self.neg_x_remap.outputMax.set(1)
NL_mult = pm.createNode("multDoubleLinear", name="%s_NL_mult" % self.prefix)
NR_mult = pm.createNode("multDoubleLinear", name="%s_NR_mult" % self.prefix)
SL_mult = pm.createNode("multDoubleLinear", name="%s_SL_mult" % self.prefix)
SR_mult = pm.createNode("multDoubleLinear", name="%s_SR_mult" % self.prefix)
self.pos_x_remap.outValue >> NR_mult.input1
self.pos_y_remap.outValue >> NR_mult.input2
NR_mult.output >> self.control_group.nShapeR
self.neg_x_remap.outValue >> NL_mult.input1
self.pos_y_remap.outValue >> NL_mult.input2
NL_mult.output >> self.control_group.nShapeL
self.pos_x_remap.outValue >> SR_mult.input1
self.neg_y_remap.outValue >> SR_mult.input2
SR_mult.output >> self.control_group.sShapeR
self.neg_x_remap.outValue >> SL_mult.input1
self.neg_y_remap.outValue >> SL_mult.input2
SL_mult.output >> self.control_group.sShapeL
开发者ID:adamfok,项目名称:afok_toolset,代码行数:27,代码来源:facial_control_creator.py
示例11: createFresnel
def createFresnel(out = None):
#创建菲涅尔节点组合
#
#参数out: 属性输出给哪个节点, 连接属性
#
#创建节点
samplerInfo = pm.createNode('samplerInfo', name = 'Fre_samplerInfo_arnold')
ramp = pm.createNode('ramp', name = 'Fre_ramp_arnold')
aiUtility, SG = pm.createSurfaceShader('aiUtility', name = 'Fresnel_arnold')
#修改属性
ramp.interpolation.set("Exponential Down")
ramp.colorEntryList[2].remove(b=1)
ramp.colorEntryList[1].position.set(1)
ramp.colorEntryList[0].color.set(1,1,1)
ramp.colorEntryList[1].color.set(0,0,0)
aiUtility.shadeMode.set(2)
#链接属性
samplerInfo.facingRatio >> ramp.uvCoord.uCoord
samplerInfo.facingRatio >> ramp.uvCoord.vCoord
ramp.outColor >> aiUtility.color
if out :
aiUtility.outColor >> out
else :
pass
return aiUtility, SG
开发者ID:TianD,项目名称:TianD_arnold_tool,代码行数:31,代码来源:CreateNodeGroup.py
示例12: createZ
def createZ(out = None):
#创建Z通道节点组合
#
#参数out: 属性输出给哪个节点, 连接属性
#
#创建节点
samplerInfo = pm.createNode('samplerInfo', name = 'z_samplerInfo_arnold')
multiplyDivide = pm.createNode('multiplyDivide', name = 'z_multiplyDivide_arnold')
setRange = pm.createNode('setRange', name = 'z_setRange_arnold')
aiUtility, SG = pm.createSurfaceShader('aiUtility', name = 'zdp_arnold')
#修改属性
multiplyDivide.input2X.set(-1)
setRange.minX.set(1)
setRange.oldMinX.set(0.1)
setRange.oldMaxX.set(500)
aiUtility.shadeMode.set(2)
#属性链接
samplerInfo.pointCameraZ >> multiplyDivide.input1X
multiplyDivide.outputX >> setRange.valueX
setRange.message >> aiUtility.colorR
setRange.message >> aiUtility.colorG
setRange.message >> aiUtility.colorB
if out :
aiUtility.outColor >> out
else :
pass
return aiUtility, SG
开发者ID:TianD,项目名称:TianD_arnold_tool,代码行数:33,代码来源:CreateNodeGroup.py
示例13: wiggleJointChain
def wiggleJointChain(strPnt, endPnt, side='FL', chainPos='Upper'):
'''
create joint chain between two points (strPnt & endPnt). require name string of strPnt & endPnt
'''
strPos = pm.xform( strPnt, q=True, ws=True, translation=True )
endPos = pm.xform( endPnt, q=True, ws=True, translation=True )
if side.endswith('L'):
sideLabel = 1
elif side.endswith('R'):
sideLabel = 2
ikSpCrv = pm.curve( degree=2, editPoint=( strPos, endPos) )
ikSpCrv.rename( 'wiggle_%s_%s_CRV'%(side, chainPos) )
ikSpCrvShp = ikSpCrv.listRelatives(shapes=True)[0]
pm.select(clear=True)
jnt2pos = pm.pointOnCurve( ikSpCrv, pr=0.3333, turnOnPercentage=True)
jnt3pos = pm.pointOnCurve( ikSpCrv, pr=0.6667, turnOnPercentage=True )
jntPos = ( strPos, jnt2pos, jnt3pos, endPos )
jntList = []
for pnt in jntPos:
jName = 'Wiggle_%s_%s_%02d'%(side, chainPos, jntPos.index(pnt)+1)
newJoint = pm.joint(name=jName, p=pnt)
newJoint.side.set(sideLabel)
newJoint.__getattr__('type').set(18)
newJoint.otherType.set(jName)
jntList.append(newJoint)
pm.joint( jntList[0], edit=True, orientJoint='xyz', secondaryAxisOrient='xup', children=True, zeroScaleOrient=True )
ikHandle = pm.ikHandle( name='Wiggle_%s_%s_ikHandle'%(side, chainPos),
solver='ikSplineSolver',
createCurve=False,
curve=ikSpCrvShp,
startJoint=jntList[0].name(),
endEffector=jntList[-1].name(),
rootOnCurve=False,
createRootAxis=True,
parentCurve=False )
jntGrp = jntList[0].listRelatives(parent=True)[0]
jntGrp.rename('Wiggle_%s_%s'%(side, chainPos))
crvInfo = pm.createNode('curveInfo', name='crvInf_wiggle_%s_%s'%(side, chainPos))
multDiv1 = pm.createNode('multiplyDivide', name='md_wiggle_%s_%s_01'%(side, chainPos))
multDiv2 = pm.createNode('multiplyDivide', name='md_wiggle_%s_%s_02'%(side, chainPos))
ikSpCrvShp.worldSpace >> crvInfo.inputCurve
arcLgt = crvInfo.arcLength.get()
multDiv1.input2X.set(arcLgt)
multDiv1.operation.set(2)
spacing = jntList[1].tx.get()
multDiv2.input2X.set(spacing)
multDiv1.outputX >> multDiv2.input1X
crvInfo.arcLength >> multDiv1.input1X
for jnt in jntList[1:]:
multDiv2.outputX >> jnt.tx
return ikSpCrvShp, ikSpCrv, ikHandle[0], jntGrp
开发者ID:anang-prabowo,项目名称:work,代码行数:60,代码来源:addFeatures.py
示例14: build
def build(self, no_subdiv=False, num_ctrl=None, degree=3, create_ctrl=True, constraint=False, rot_fol=True, *args,
**kwargs):
super(Ribbon, self).build(create_grp_anm=create_ctrl, *args, **kwargs)
if num_ctrl is not None:
self.num_ctrl = num_ctrl
nomenclature_rig = self.get_nomenclature_rig()
# Create the plane and align it with the selected bones
plane_tran = next(
(input for input in self.input if libPymel.isinstance_of_shape(input, pymel.nodetypes.NurbsSurface)), None)
if plane_tran is None:
plane_name = nomenclature_rig.resolve("ribbonPlane")
if no_subdiv: # We don't want any subdivision in the plane, so use only 2 bones to create it
no_subdiv_degree = 2
if degree < 2:
no_subdiv_degree = degree
plane_tran = libRigging.create_nurbs_plane_from_joints([self.chain_jnt[0], self.chain_jnt[-1]],
degree=no_subdiv_degree, width=self.width)
else:
plane_tran = libRigging.create_nurbs_plane_from_joints(self.chain_jnt, degree=degree, width=self.width)
plane_tran.rename(plane_name)
plane_tran.setParent(self.grp_rig)
self._ribbon_shape = plane_tran.getShape()
# Create the follicule needed for the system on the skinned bones
self.attach_to_plane(rot_fol)
# TODO : Support aim constraint for bones instead of follicle rotation?
follicles_grp = pymel.createNode("transform")
follicle_grp_name = nomenclature_rig.resolve("follicleGrp")
follicles_grp.rename(follicle_grp_name)
follicles_grp.setParent(self.grp_rig)
for n in self._follicles:
n.setParent(follicles_grp)
# Create the joints that will drive the ribbon.
# TODO: Support other shapes than straight lines...
self._ribbon_jnts = libRigging.create_chain_between_objects(
self.chain_jnt.start, self.chain_jnt.end, self.num_ctrl, parented=False)
# Group all the joints
ribbon_chain_grp_name = nomenclature_rig.resolve('ribbonChainGrp')
self.ribbon_chain_grp = pymel.createNode('transform', name=ribbon_chain_grp_name, parent=self.grp_rig)
align_chain = True if len(self.chain_jnt) == len(self._ribbon_jnts) else False
for i, jnt in enumerate(self._ribbon_jnts):
# Align the ribbon joints with the real joint to have a better rotation ctrl
ribbon_jnt_name = nomenclature_rig.resolve('ribbonJnt{0:02d}'.format(i))
jnt.rename(ribbon_jnt_name)
jnt.setParent(self.ribbon_chain_grp)
if align_chain:
matrix = self.chain_jnt[i].getMatrix(worldSpace=True)
jnt.setMatrix(matrix, worldSpace=True)
# TODO - Improve skinning smoothing by setting manually the skin...
pymel.skinCluster(list(self._ribbon_jnts), plane_tran, dr=1.0, mi=2.0, omi=True)
try:
libSkinning.assign_weights_from_segments(self._ribbon_shape, self._ribbon_jnts, dropoff=1.0)
except ZeroDivisionError, e:
pass
开发者ID:SqueezeStudioAnimation,项目名称:omtk,代码行数:60,代码来源:rigRibbon.py
示例15: connectLocRotate
def connectLocRotate():
'''
'''
locGrpNames = ['_back',
'_left',
'_front',
'_right',
'_leftBack',
'_rightBack',
'_rightFront',
'_leftFront']
# create one nurb circle for all groups
circ = pm.createNode('makeNurbCircle', n='CT_jacketLocsAlign_circle')
circ.normal.set(0,1,0)
# use the same root ctrl for all groups
rootCtl = pm.PyNode('Mathilda_root_ctrl')
# create one motionpath for each group
for grpName in locGrpNames:
mp = pm.createNode('motionPath', n='CT_jacketLocsAlign'+grpName+'_mp')
circ.outputCurve >> mp.gp
# use paramater from lowest npc
pm.PyNode('torsoReader_3'+grpName+'_npc').parameter >> mp.uValue
rootCtl.worldMatrix >> mp.worldUpMatrix
mp.worldUpType.set(2)
mp.worldUpVector.set(0,1,0)
mp.frontAxis.set(0)
mp.upAxis.set(1)
# connect to all locs in grp
for locId in range(1,10):
mp.rotate >> pm.PyNode('torsoReader_%d%s_loc.r' %
(locId, grpName))
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:33,代码来源:jacket.py
示例16: addAOV
def addAOV(self, aovName, aovType=None):
'''
add an AOV to the active list for this AOV node
returns the created AOV node
'''
if aovType is None:
aovType = getAOVTypeMap().get(aovName, 'rgba')
if not isinstance(aovType, int):
aovType = dict(TYPES)[aovType]
aovNode = pm.createNode('aiAOV', name='aiAOV_' + aovName, skipSelect=True)
out = aovNode.attr('outputs')[0]
pm.connectAttr('defaultArnoldDriver.message', out.driver)
filter = defaultFiltersByName.get(aovName, None)
if filter:
node = pm.createNode('aiAOVFilter', skipSelect=True)
node.aiTranslator.set(filter)
filterAttr = node.attr('message')
import mtoa.hooks as hooks
hooks.setupFilter(filter, aovName)
else:
filterAttr = 'defaultArnoldFilter.message'
pm.connectAttr(filterAttr, out.filter)
aovNode.attr('name').set(aovName)
aovNode.attr('type').set(aovType)
nextPlug = self.nextAvailableAttr()
aovNode.message.connect(nextPlug)
aov = SceneAOV(aovNode, nextPlug)
addAliases([aov])
return aov
开发者ID:Quazo,项目名称:breakingpoint,代码行数:32,代码来源:aovs.py
示例17: symmetryLayer
def symmetryLayer():
allCtrls = pm.PyNode('CT_face_ctrl').getChildren(ad=True, type='nurbsCurve')
allCtrls = set([crv.getParent() for crv in allCtrls])
# new group to hold mirrored locs
symLocGrp = pm.group(em=True, n='RT_symmetryLoc_grp')
allRightCtrls = [crv for crv in allCtrls if 'RT_' in crv.name()]
symMatrix = pm.createNode('fourByFourMatrix', n='CT_symmetryMatrix_mat')
symMatrix.in00.set(-1)
for rightCtl in allRightCtrls:
leftCtl = pm.PyNode(rightCtl.replace('RT_', 'LT_'))
loc = pm.spaceLocator(n=rightCtl+'_symLoc')
symLocGrp | loc
# connect to left side
mm = pm.createNode('multMatrix', n=rightCtl+'_sym_mm')
symMatrix.output >> mm.matrixIn[0]
leftCtl.worldMatrix >> mm.matrixIn[1]
symMatrix.output >> mm.matrixIn[2]
dcm = pm.createNode('decomposeMatrix', n=rightCtl+'_sym_dcm')
mm.matrixSum >> dcm.inputMatrix
dcm.ot >> loc.t
dcm.outputRotate >> loc.r
# constrain on anim layer
pm.parentConstraint(loc, rightCtl, l='Symmetry', weight=1)
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:27,代码来源:hacks.py
示例18: _setup_node
def _setup_node(self, *args, **kwargs):
"""Setup and return the node
@param args <list> Storing args from config file as list
@param kwargs <dict> Storing keyword args from config file as dict
@DONE use logging instead of printing
"""
node = None
if args:
if args[0] == help:
msg = "\nValid parameters for the %s node:" % self._nodename
logging.debug(msg)
for n in self._nodes[self._nodename].items():
if not n[0] == '__ABBREVIATION__':
logging.debug('-- %s : <%s>' % (n[0], n[1]))
# end if exclude abbreviation
# end for print parameters and types
return
# end if help or set name
if not self.suffix:
self.suffix = self._nodes[self._nodename]['__ABBREVIATION__']
# end if not suffix given use abbreviation list
name = '%s_%s_%s' % (self.side, args[0], self.suffix)
node = pm.createNode(self._nodename, n=name)
else:
node = pm.createNode(self._nodename)
# end if args exists
self._setup_attribute(node, **kwargs)
self.suffix = None
return node
开发者ID:jonntd,项目名称:Public,代码行数:30,代码来源:utils.py
示例19: connectEyelidLocsToBlinkAttr
def connectEyelidLocsToBlinkAttr():
'''
'''
blinkAttr = pm.PyNode('LT_eye_ctl.blink')
locA, locB = pm.ls(sl=True)[:2]
# get center pt between two locs (from their pocis)
pociA = locA.t.inputs(type='pointOnCurveInfo', p=True)[0]
pociB = locB.t.inputs(type='pointOnCurveInfo', p=True)[0]
pma = pm.createNode('plusMinusAverage', n=locA+'_avgPos_pma')
pma.operation.set(3)
pociA >> pma.input3D[0]
pociB >> pma.input3D[1]
# blend positions
blendA = pm.createNode('blendColors', n=locA+'_blendPos_bld')
pma.output3D >> blendA.color1
pociA >> blendA.color2
blinkAttr >> blendA.blender
blendA.output >> locA.t
blendB = pm.createNode('blendColors', n=locB+'_blendPos_bld')
pma.output3D >> blendB.color1
pociB >> blendB.color2
blinkAttr >> blendB.blender
blendB.output >> locB.t
开发者ID:sayehaye3d,项目名称:ls-rigging-tools,代码行数:25,代码来源:mods.py
示例20: makeNodeSet
def makeNodeSet(pointValueList, transNodeType):
for x in pointValueList:
if transNodeType == 'locator':
pm.spaceLocator().t.set(x)
else:
pm.createNode(transNodeType).t.set(x)
开发者ID:jiwonchoe,项目名称:mayaPy,代码行数:7,代码来源:posUtil.py
注:本文中的pymel.core.createNode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论