Ejemplo n.º 1
0
def importSplice(*args) :
  # check if there is an existing splice node
  if cmds.objExists('fabricVegetation') :
    print 'FVegetation: Fabric:Splice node already exists!'
    return

  # create the node and load in the splice file
  node=cmds.createNode('spliceMayaNode')
  cmds.rename(node, 'fabricVegetation')
  path=cmds.internalVar(userScriptDir=True)+'FabricVegetation.splice'
  cmds.fabricSplice('loadSplice', 'fabricVegetation', '{"fileName" : "'+path+'"}')
Ejemplo n.º 2
0
def importSplice(*args):
    # check if there is an existing splice node
    if cmds.objExists('fabricVegetation'):
        print 'FVegetation: Fabric:Splice node already exists!'
        return

    # create the node and load in the splice file
    node = cmds.createNode('spliceMayaNode')
    cmds.rename(node, 'fabricVegetation')
    path = cmds.internalVar(userScriptDir=True) + 'FabricVegetation.splice'
    cmds.fabricSplice('loadSplice', 'fabricVegetation',
                      '{"fileName" : "' + path + '"}')
cmds.file(new=True, f=True)
cmds.file(toolboxPath +
          "/Tests/GeometryStack/Resources/SkinnedTube_hierarchy.ma",
          r=True)

##############################################
## Set up the loader node.

influenceInitNode = cmds.createNode("spliceMayaNode",
                                    name="tubeCharacter_Init")

cmds.fabricSplice(
    'addInputPort', influenceInitNode,
    json.dumps({
        'portName': 'filePath',
        'dataType': 'String',
        'addMayaAttr': True
    }))
cmds.fabricSplice(
    'addOutputPort', influenceInitNode,
    json.dumps({
        'portName': 'stack',
        'dataType': 'GeometryStack',
        'extension': 'RiggingToolbox',
        'addSpliceMayaAttr': True,
        'autoInitObjects': True
    }))

cmds.setAttr(
    influenceInitNode + '.filePath',
Ejemplo n.º 4
0
##############################################
## Set up the BezierXfo test node.

knot1Locator = cmds.createNode("locator", name = "knot1")
cmds.move(-2,0,2)
knot2Locator = cmds.createNode("locator", name = "knot2")
cmds.move(3,0,-4)

knot3Locator = cmds.createNode("locator", name = "knot2")
cmds.move(6,0,0)


node = cmds.createNode("spliceMayaNode", name = "BezierXfo")

cmds.fabricSplice('addOutputPort', node, json.dumps({'portName':'bezierXfo', 'dataType':'BezierXfo', 'extension':'RiggingToolbox', 'addSpliceMayaAttr':True }))
cmds.fabricSplice('addOutputPort', node, json.dumps({'portName':'handle', 'dataType':'DrawingHandle', 'extension':'InlineDrawing', 'addSpliceMayaAttr':True }))

cmds.fabricSplice('addInputPort', node, json.dumps({'portName':'mode', 'dataType':'Integer', 'addMayaAttr': True}))
cmds.fabricSplice('addInputPort', node, json.dumps({'portName':'count', 'dataType':'Integer', 'addMayaAttr': True}))
cmds.fabricSplice('addInputPort', node, json.dumps({'portName':'samples', 'dataType':'Integer', 'addMayaAttr': True}))
cmds.fabricSplice('addInputPort', node, json.dumps({'portName':'start', 'dataType':'Scalar', 'addMayaAttr': True}))
cmds.fabricSplice('addInputPort', node, json.dumps({'portName':'end', 'dataType':'Scalar', 'addMayaAttr': True}))
cmds.fabricSplice('addInputPort', node, json.dumps({'portName':'tangentLength', 'dataType':'Scalar', 'addMayaAttr': True}))

cmds.fabricSplice('addInputPort', node, json.dumps({'portName':'knots', 'dataType':'Mat44[]', 'addMayaAttr': True, 'arrayType':"Array (Multi)"}))

cmds.connectAttr(knot1Locator+'.worldMatrix', node + '.knots[0]')
cmds.connectAttr(knot2Locator+'.worldMatrix', node + '.knots[1]')
cmds.connectAttr(knot3Locator+'.worldMatrix', node + '.knots[2]')
Ejemplo n.º 5
0
    raise Exception("Please set the rigging ")
toolboxPath = os.environ['FABRIC_RIGGINGTOOLBOX_PATH']

# cmds.file(new=True,f=True)
# cmds.file("D:/Resources/captainatom_project/scenes/captainatom_v1_geomStripped.mb", r=True);

##############################################
## Set up the loader node.

influenceGeoms_InitNode = cmds.createNode(
    "spliceMayaNode", name="captainAtom_InfluenceGeoms_Init")

cmds.fabricSplice(
    'addInputPort', influenceGeoms_InitNode,
    json.dumps({
        'portName': 'filePath',
        'dataType': 'String',
        'addMayaAttr': True
    }))
cmds.fabricSplice(
    'addOutputPort', influenceGeoms_InitNode,
    json.dumps({
        'portName': 'stack',
        'dataType': 'GeometryStack',
        'extension': 'RiggingToolbox',
        'addSpliceMayaAttr': True,
        'autoInitObjects': True
    }))

cmds.setAttr(influenceGeoms_InitNode + '.filePath',
             toolboxPath +
def splice(operator, command, *args, **kwargs):
    json.dumps(kwargs)
    return cmds.fabricSplice(command, operator, json.dumps(kwargs), *args)
Ejemplo n.º 7
0
# -*- coding: utf-8 -*-
import maya.cmds as cmds
import random

cmds.polySphere(r=10, sx=40, sy=40)

cmds.select(r=True)
list = cmds.ls(sl=True)

node = cmds.createNode('spliceMayaNode', n="FE_MultiChannelWeightMap")
cmds.select(node, r=True)
FENodeName = cmds.ls(sl=True)

cmds.fabricSplice('addOutputPort', node, '{"portName":"multiChannelWeightMap", "dataType":"MultiChWeightmap", "extension":"TKCM"}')
cmds.fabricSplice('setPortPersistence', node, '{"portName": "multiChannelWeightMap", "persistence": true}')
cmds.fabricSplice('addIOPort', node, '{"portName":"mesh", "dataType":"PolygonMesh", "addMayaAttr":true}')
cmds.fabricSplice('addInputPort', node, '{"portName":"matrix44", "dataType":"Mat44", "addMayaAttr":true}')
cmds.fabricSplice('addInputPort', node, '{"portName":"activeChnnel", "dataType":"Integer"}')
cmds.fabricSplice('addInputPort', node, '{"portName":"chnnelCount", "dataType":"Integer", "addMayaAttr":true}')
cmds.fabricSplice('addInputPort', node, '{"portName":"saveEnable", "dataType":"Boolean", "addMayaAttr":true}')
cmds.fabricSplice('addInputPort', node, '{"portName":"saveExternalFile", "dataType":"Boolean", "addMayaAttr":true}')
cmds.fabricSplice('addInputPort', node, '{"portName":"saveFolderPath", "dataType":"String", "addMayaAttr":true}')
cmds.fabricSplice('addInputPort', node, '{"portName":"saveFileName", "dataType":"String", "addMayaAttr":true}')
cmds.fabricSplice('addOutputPort', node, '{"portName":"run", "dataType":"Vec3", "addMayaAttr":true}')

cmds.addAttr(node, ln='activeChnnel', at="long", min=0)
cmds.connectAttr(list[0]+'.worldMesh[0]', FENodeName[0]+'.mesh')
cmds.connectAttr(list[0]+'.worldMatrix[0]', FENodeName[0]+'.matrix44')
cmds.setAttr( FENodeName[0]+'.chnnelCount', 10 )
loc = cmds.spaceLocator( p=(0, 0, 0), n="run")
cmds.select(loc, r=True)
def splice(operator, command, *args, **kwargs):
    json.dumps(kwargs)
    return cmds.fabricSplice(command, operator, json.dumps(kwargs), *args)
if 'FABRIC_RIGGINGTOOLBOX_PATH' not in os.environ:
    raise Exception("Please set the rigging ")
toolboxPath = os.environ['FABRIC_RIGGINGTOOLBOX_PATH']

cmds.file(new=True, f=True)

##############################################
## Set up the BlendShapesParams node.

initnode = cmds.createNode("spliceMayaNode",
                           name="BlendShapesSphereCharacter_Init")

cmds.fabricSplice(
    'addInputPort', initnode,
    json.dumps({
        'portName': 'filePath',
        'dataType': 'String',
        'addMayaAttr': True
    }))
cmds.fabricSplice(
    'addOutputPort', initnode,
    json.dumps({
        'portName': 'stack',
        'dataType': 'GeometryStack',
        'extension': 'RiggingToolbox',
        'addSpliceMayaAttr': True,
        'autoInitObjects': True
    }))

cmds.setAttr(initnode + '.filePath',
             toolboxPath +