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 😉

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import openMASH 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? if cmds.getAttr(initialStateConns[i]+'.visibility'): md.outVisibility[i]=1 else: md.outVisibility[i]=0 #tell MASH to write the network data md.setData() |