RTVal in Maya / pointing client.DG to the right maya canvas

TrevorTrevor Posts: 1

I wrote the following to get the DFG from a canvas node living in Maya:

    name = 'MyCanvas' # assume this is a maya canvas node with some content

    contextID = cmds.fabricSplice('getClientContextID')
    if contextID == '':
        contextID = cmds.fabricSplice('getClientContextID')
    gActiveClient = FabricEngine.Core.createClient({"contextID": contextID})
    gActiveHost = gActiveClient.DFG.host

    bindingID = cmds.FabricCanvasGetBindingID(n=name)
    binding = gActiveHost.getBindingForID(bindingID)
    graph = binding.getExec()

and then I can safely do something like
for i in xrange(graph.getNodeCount()):
nodeName = graph.getNodeName(i)
nodeData= json.loads(graph.getNodeDesc(nodeName))

and read all about the node, but I want to set data and call functions,
so I figured I could then also do (inside that for loop):

but I immediately get something like:
# Exception: Fabric: no NamedObject named 'XfoFromSRT_1' #

So the real question is: how to iterate over the nodes in a canvas living in Maya and iterate over the attributes posisbly getting or setting them?



Sign In or Register to comment.