#another mash network to show number of turns setAttr(pfx + "de", pyStr, type = "string") connectAttr (pfx + "de", pfx + "tower_Python.pyScript")Ĭmds. addAttr(longName = "code", dataType = "string")Ĭmds. S = "import openMASH \n\n md = openMASH.MASHData(thisNode) \n\n " #getting the visibility commandĬmds. #parts of the string for the MASH Python node #call the game function to create MASH network headsUpMessage( 'This block was already removed' ) #definition for each player turn def playerTurn(num):Ĭmds.
MAYA PYTHON SETATTR WITH WILDCARD CODE
#return the string so it can be implemented as code return strCommand StrCommand = visString + " \n\n md.outVisibility" else: StrCommand = "md.outVisibility" for item in range ( len(myList)): #function to return a string with the visibility command #for the MASH Python node def visCommand(i): setAttr( pfx + "tower_oundPlanePositionY", - 0.25)Ĭmds. setAttr(pfx + "tower_Replicator.rotatePointsY", 1530)Ĭmds. setAttr(pfx + "tower_Replicator.offsetPositionZ", 0)Ĭmds. setAttr(pfx + "tower_Replicator.offsetPositionX", 0)Ĭmds. setAttr(pfx + "tower_Replicator.offsetPositionY", 0.5)Ĭmds. setAttr(pfx + "tower_Replicator.replicants", 17)Ĭmds. #adjust the Replicator settings to make a towerĬmds. addNode( "MASH_Replicator")ĭyn = mashNetwork. createNetwork(name = pfx + "tower", distributionStyle = 6, geometry = "Repro")Ĭmds. # create a new MASH network with grid distribution setAttr ( "blinn1.ambientColor", 1, 1, 1, type = "double3") shadingNode( 'blinn', asShader = True)Ĭmds. setAttr( "pointLightShape1.intensity", 0.2)Ĭmds. playbackOptions( maxTime = '20sec' )Ĭmds. #a function to build the MASH network def game():Ĭmds. #return block number so it can be called return remBlock intSliderGrp ( "blockRemoval", q = 1, v = 1) #query to get the value of the slider/number of block Repattern = seta.*nurbsSphereShape.*Īpi = 0.319000005722 sec, 4323 shapes modifiedĬmds = 14.5989999771 sec, 4323 shapes modifiedĪpi = 0.182000160217 sec, 0 shapes modifiedĬmds = 11.#Kushal Das #MASH Kenga Game import MASH.api as mapi import maya.cmds as cmds import os import sys #function for getting the number of the block to be removed def getBlock( *args): Shapes, all the shapes, and no shapes, performance beats the builtinĪpi = 0.460000038147 sec, 8016 shapes modifiedĬmds = 26.9750001431 sec, 8016 shapes modified Doing this, the time comesĭown to 0.5 of a second. Module, and run my setAttr if it matches. I get all the shapes, get each shapes dagPath, test it with the re Was curious how slow/fast it'd be if I did the wildcard match myself. Getting maya to do the wildcard matching still takes about 27 seconds When this happens, processing jumps to 3 hours per frame. Thus, if a lighter wildcards to the sub-object level, eg "set:*|leaves*", the only safe way to do that is to process every object, then every sub-object, unsetting atts those objects which AREN'T leaves, and setting attrs on those objects which ARE leaves. It can contain many sub-objects, which our maya plugin doesn't allow us to list or search for sub-objects names easily. Things get messy with our alembic style heirachical geo format. Normally our system will process these scenes within a minute or two per frame, if lighters use wildcards, eg 'set:tree*', that can jump to maybe 6 mins per frame. We're getting into the situation where we have _very_ heavy scenes, with thousands of objects. This sometimes means adding attributes first (or connecting our custom attribute node), then setting them. One of its core functions is grabbing whatever geometry is defined by a lighter, and setting attributes. We have a python based, text based render pass submission tool for lighters at work. Would using the python OpenMaya module give big speed gains for selecting thousands of objects and modifying their attributes?