Exemple #1
0
 def applyChannelConfig(self):
     with pm.UndoChunk():
         configDict = self._buildConfigDict()
         #TODO add checker to avoid error if the datas is not found in the scene
         for rule in configDict["map"]:
             # proxy
             if rule[3]:
                 source = pm.PyNode("{}.{}".format(rule[1], rule[0]))
                 target = pm.PyNode(rule[2])
                 att.addProxyAttribute(source, target,
                                       configDict["proxyPolicy"])
             #move
             else:
                 source = pm.PyNode(rule[1])
                 target = pm.PyNode(rule[2])
                 att.moveChannel(rule[0], source, target,
                                 configDict["movePolicy"])
Exemple #2
0
def _applyChannelConfig(configDic):
    tableMap = configDic["map"]
    movePolicy = configDic["movePolicy"]
    proxyPolicy = configDic["proxyPolicy"]
    for rule in tableMap:
        attr = rule[0]
        sourceNode = rule[1]
        targetNode = rule[2]
        option = rule[3]
        # proxy
        if option:
            node = pm.PyNode(sourceNode)
            sourceAttrs = node.attr(attr)
            target = pm.PyNode(targetNode)
            att.addProxyAttribute(sourceAttrs, target, proxyPolicy)
        # move
        else:
            att.moveChannel(attr, sourceNode, targetNode, movePolicy)
Exemple #3
0
def test_moveChannel_fullName():
    """move_channel_fullName"""
    for source in ("source1", "source2"):
        assert_is_none(
            att.moveChannel("chanName", source, "source1", "fullName"))
Exemple #4
0
def test_moveChannel_index():
    """move_channel_index"""
    for source in ("source1", "source2"):
        assert_is_none(att.moveChannel("chanName", source, "source1", "index"))
Exemple #5
0
def test_move_channel():
    """chanName.moveChannel works"""

    for source in ("source1", "source2"):
        assert_false(att.moveChannel("chanName", source, "target"))
Exemple #6
0
 def test_moveChannel_merge(self):
     """move_channel_merge
     """
     for s in [self.pcs[0], self.pcs2[0]]:
         self.assertIsNone(att.moveChannel(self.chanName,  s,  self.pct[0], "merge"))
Exemple #7
0
 def test_moveChannel_index(self):
     """move_channel_index
     """
     for s in [self.pcs[0], self.pcs2[0]]:
         self.assertIsNone(att.moveChannel(self.chanName,  s,  self.pct[0], "index"))
Exemple #8
0
 def test_moveChannel(self):
     """move_channel
     """
     for s in [self.pcs[0], self.pcs2[0]]:
         self.assertFalse(att.moveChannel(self.chanName,  s,  self.pct[0]))