예제 #1
0
    def test_TexNode_getAttrValue(self):
        setupScene()

        nodesAttrsValues = [
            ('fileNodeWithProjPath', 'ftn', getFxptLocation() +
             '/fxpt/fx_texture_manager/tests/testMayaProject/sourceimages/testTex_exit.png'
             ),
            ('fileNodeWithAbsPath', 'ftn', getFxptLocation() +
             '/fxpt/fx_texture_manager/icons/filter_active.png'),
            ('fileNodeWithEnvVar', 'ftn',
             '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'),
            ('fileNodeWithInvalidEnvVar', 'ftn',
             '%INVALID_ENV_VAR%/fxpt/fx_texture_manager/icons/copy.png'),
            ('fileNodeWithNetworkPath', 'ftn',
             '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png'
             ), ('fileNodeWithInvalidPath', 'ftn', 'some/path/tex.png'),
            ('someNodeWithTextures1', 'texture',
             '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'),
            ('someNodeWithTextures1', 'texture1',
             'sourceimages/testTex_exit.png'),
            ('someNodeWithTextures1', 'texture2',
             '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png'
             ),
            ('someNodeWithTextures2', 'texture',
             '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'),
            ('someNodeWithTextures2', 'texture1',
             'sourceimages/testTex_exit.png'),
            ('someNodeWithTextures2', 'texture2', '')
        ]

        for node, attr, value in nodesAttrsValues:
            tn = tex_node.TexNode(node, attr)
            self.assertEqual(tn.getAttrValue(), value)
예제 #2
0
def setupScene():
    meval(
        'setProject "{}/fxpt/fx_texture_manager/tests/testMayaProject"'.format(
            getFxptLocation()))
    loadMayaScene(
        getFxptLocation() +
        '/fxpt/fx_texture_manager/tests/testMayaProject/scenes/testScene_01.mb'
    )
    setFileNodeWithAbsPath()
    os.environ['FXPT_LOCATION'] = getFxptLocation()
예제 #3
0
    def test_TexNode_getAttrValue(self):
        setupScene()

        nodesAttrsValues = [
            ('fileNodeWithProjPath', 'ftn', getFxptLocation() + '/fxpt/fx_texture_manager/tests/testMayaProject/sourceimages/testTex_exit.png'),
            ('fileNodeWithAbsPath', 'ftn', getFxptLocation() + '/fxpt/fx_texture_manager/icons/filter_active.png'),
            ('fileNodeWithEnvVar', 'ftn', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'),
            ('fileNodeWithInvalidEnvVar', 'ftn', '%INVALID_ENV_VAR%/fxpt/fx_texture_manager/icons/copy.png'),
            ('fileNodeWithNetworkPath', 'ftn', '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png'),
            ('fileNodeWithInvalidPath', 'ftn', 'some/path/tex.png'),
            ('someNodeWithTextures1', 'texture', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'),
            ('someNodeWithTextures1', 'texture1', 'sourceimages/testTex_exit.png'),
            ('someNodeWithTextures1', 'texture2', '//BLACK/C$/GitHub/fxpt/fxpt/fx_texture_manager/icons/retarget.png'),
            ('someNodeWithTextures2', 'texture', '%FXPT_LOCATION%/fxpt/fx_texture_manager/icons/copy.png'),
            ('someNodeWithTextures2', 'texture1', 'sourceimages/testTex_exit.png'),
            ('someNodeWithTextures2', 'texture2', '')
        ]

        for node, attr, value in nodesAttrsValues:
            tn = tex_node.TexNode(node, attr)
            self.assertEqual(tn.getAttrValue(), value)
예제 #4
0
def setFileNodeWithAbsPath():
    m.setAttr('fileNodeWithAbsPath.ftn',
              getFxptLocation() +
              '/fxpt/fx_texture_manager/icons/filter_active.png',
              typ='string')
예제 #5
0
def setupScene():
    meval('setProject "{}/fxpt/fx_texture_manager/tests/testMayaProject"'.format(getFxptLocation()))
    loadMayaScene(getFxptLocation() + '/fxpt/fx_texture_manager/tests/testMayaProject/scenes/testScene_01.mb')
    setFileNodeWithAbsPath()
    os.environ['FXPT_LOCATION'] = getFxptLocation()
예제 #6
0
def setFileNodeWithAbsPath():
    m.setAttr('fileNodeWithAbsPath.ftn', getFxptLocation() + '/fxpt/fx_texture_manager/icons/filter_active.png', typ='string')
예제 #7
0
def getTestEnvVar():
    return 'FXPT_LOCATION', getFxptLocation()
예제 #8
0
def getTestEnvVar():
    return 'FXPT_LOCATION', getFxptLocation()