def test_move_channel(): """chanName.moveChannel works""" for source in ("source1", "source2"): assert_false( att.moveChannel("chanName", source, "target") )
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) attribute.addProxyAttribute(sourceAttrs, target, proxyPolicy) # move else: attribute.moveChannel(attr, sourceNode, targetNode, movePolicy)
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]) attribute.addProxyAttribute(source, target, configDict["proxyPolicy"]) # move else: source = pm.PyNode(rule[1]) target = pm.PyNode(rule[2]) attribute.moveChannel(rule[0], source, target, configDict["movePolicy"])
def test_moveChannel_fullName(): """move_channel_fullName""" for source in ("source1", "source2"): assert_is_none( att.moveChannel("chanName", source, "source1", "fullName") )
def test_moveChannel_index(): """move_channel_index""" for source in ("source1", "source2"): assert_is_none( att.moveChannel("chanName", source, "source1", "index") )