Created
January 2, 2023 22:47
-
-
Save Roumenov/4741ea376016dbb1818f86895db1ea75 to your computer and use it in GitHub Desktop.
messing with MASH, stumbling through some major confusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MASH.editor; MASH.editor.updateMASHEditor() | |
import MASH.api as mapi | |
import pymel.core as pm | |
# there's no reason to use pm, force of habit | |
# best to use cmds for implementation | |
name = pm.ls(sl=1)[0].name() | |
MASH.deleteMashNode.deleteMashNode('MASH1') | |
network_mash = mapi.Network() | |
# i guess this is like the mash network factory class | |
network_mash.createNetwork(name = 'MASH_waiter') | |
# not clear what the "waiter" actually is | |
# this is the actual central network object, shows up in DAG | |
network_audio = network_mash.addNode('MASH_Audio') | |
print(network_audio.name) | |
type(network_audio) | |
# i guess factory class doesn't output classes? | |
# can't instantiate PyNode() from these network objects either | |
target = pm.createNode('group', name = 'test') | |
target.addAttr('volume', at = 'float', keyable = True) | |
audio_out = str(network_audio.name) + '.outVolume' | |
audio_in = target.name() + '.volume' | |
# turn into strings for old school maya cmds | |
pm.connectAttr(audio_out, audio_in) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment