示例#1
0
    def test_inputConnections(self):
        node = utilnodes.createUtilityNode('multiplyDivide')

        cons = utilnodes.getInputConnections(1, node.input1)
        self.assertEqual(len(cons), 1)
        self.assertEqual(cons[0][0], 1)
        self.assertEqual(cons[0][1].longName(), 'input1X')

        cons = utilnodes.getInputConnections([1, 2], node.input1)
        self.assertEqual(len(cons), 2)
        self.assertEqual(cons[0][0], 1)
        self.assertEqual(cons[0][1].longName(), 'input1X')
        self.assertEqual(cons[1][0], 2)
        self.assertEqual(cons[1][1].longName(), 'input1Y')

        cons = utilnodes.getInputConnections([1, 2, 3], node.input1)
        self.assertEqual(len(cons), 1)
        self.assertEqual(cons[0][0], [1, 2, 3])
        self.assertEqual(cons[0][1].longName(), 'input1')

        node = utilnodes.createUtilityNode('condition')
        cons = utilnodes.getInputConnections(1, node.colorIfTrueR)
        self.assertEqual(len(cons), 1)
        self.assertEqual(cons[0][0], 1)
        self.assertEqual(cons[0][1].longName(), 'colorIfTrueR')
示例#2
0
    def test_utilityOutputAttr(self):
        node = utilnodes.createUtilityNode('multiplyDivide')
        outputAttr = utilnodes.getOutputAttr(node)
        self.assertEqual(outputAttr.longName(), 'output')
        outputAttr = utilnodes.getOutputAttr(node.input1X)
        self.assertEqual(outputAttr.longName(), 'outputX')
        outputAttr = utilnodes.getOutputAttr(node.input1Y)
        self.assertEqual(outputAttr.longName(), 'outputY')

        node = utilnodes.createUtilityNode('condition')
        outputAttr = utilnodes.getOutputAttr(node.colorIfTrueR)
        self.assertEqual(outputAttr.longName(), 'outColorR')
示例#3
0
 def test_plusMinusAverageOutputAttr(self):
     node = utilnodes.createUtilityNode('plusMinusAverage')
     output1D = utilnodes.getPlusMinusAverageOutputAttr(node)
     self.assertEqual(output1D.longName(), 'output1D')
     output1D = utilnodes.getOutputAttr(node)
     self.assertEqual(output1D.longName(), 'output1D')
     output2D = utilnodes.getPlusMinusAverageOutputAttr(node.input2D)
     self.assertEqual(output2D.longName(), 'output2D')
     output2D = utilnodes.getOutputAttr(node.input2D)
     self.assertEqual(output2D.longName(), 'output2D')
     output3DX = utilnodes.getPlusMinusAverageOutputAttr(
         node.input3D[0].input3Dx)
     self.assertEqual(output3DX.longName(), 'output3Dx')
     output3Dy = utilnodes.getPlusMinusAverageOutputAttr(
         node.input3D[0].input3Dy)
     self.assertEqual(output3Dy.longName(), 'output3Dy')
示例#4
0
 def test_attrDimensions(self):
     node = utilnodes.createUtilityNode('multiplyDivide')
     largest = utilnodes.getLargestDimensionAttr(
         [node.outputX, node.output])
     self.assertEqual(largest.longName(), 'output')
示例#5
0
 def test_createUtilityNode(self):
     node = utilnodes.createUtilityNode('multiplyDivide')
     self.assertEqual(node.nodeType(), 'multiplyDivide')