When using Initial State transforms in MASH, it’s possible to also inherit the visibility of those transforms and get them into the MASH network using this simple Python script.
Just a note, this only works with the Transform mode of Initial State (see screenshot).
Script below, I appreciate it could be shorter, but I’m trying to make it obvious what’s happening 😉
import MASH.api as mapi
import maya.cmds as cmds
#initialise the MASH network data
md = openMASH.MASHData(thisNode)
#get the MASH Network API object
waiter = mapi.getWaiterFromNode(thisNode)
network = mapi.Network(waiter)
#and this gets the number of objects in the network
count = md.count()
#get the initial state connections
initialStateConns = cmds.listConnections(network.distribute+'.initialStateMatrix')
#for every point
for i in range(count):
#is there an initial state for it?
if i < len(initialStateConns):
#is this initial state node visible?
#tell MASH to write the network data