当前位置: 首页>>代码示例>>Python>>正文


Python standalone.initialize函数代码示例

本文整理汇总了Python中maya.standalone.initialize函数的典型用法代码示例。如果您正苦于以下问题:Python initialize函数的具体用法?Python initialize怎么用?Python initialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了initialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')

        # Stage with simple (non-nested) instancing.
        mayaFile = os.path.abspath('InstancedShading.ma')
        cmds.file(mayaFile, open=True, force=True)

        usdFilePath = os.path.abspath('InstancedShading.usda')
        cmds.loadPlugin('pxrUsd')
        cmds.usdExport(mergeTransformAndShape=True, file=usdFilePath,
                shadingMode='displayColor', exportInstances=True,
                materialsScopeName='Materials',
                exportCollectionBasedBindings=True,
                exportMaterialCollections=True,
                materialCollectionsPath="/World")

        cls._simpleStage = Usd.Stage.Open(usdFilePath)

        # Stage with nested instancing.
        mayaFile = os.path.abspath('NestedInstancedShading.ma')
        cmds.file(mayaFile, open=True, force=True)

        usdFilePath = os.path.abspath('NestedInstancedShading.usda')
        cmds.loadPlugin('pxrUsd')
        cmds.usdExport(mergeTransformAndShape=True, file=usdFilePath,
                shadingMode='displayColor', exportInstances=True,
                materialsScopeName='Materials',
                exportCollectionBasedBindings=True,
                exportMaterialCollections=True,
                materialCollectionsPath="/World")

        cls._nestedStage = Usd.Stage.Open(usdFilePath)
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:32,代码来源:testUsdExportShadingInstanced.py

示例2: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')

        cmds.loadPlugin('pxrUsd')

        cls._deformingCubeUsdFilePath = os.path.abspath('DeformingCube.usda')
        cls._deformingCubePrimPath = '/DeformingCube/Geom/Cube'
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:7,代码来源:testPointBasedDeformerNode.py

示例3: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')

        cmds.file(os.path.abspath('UsdExportPrefTest.ma'), open=True,
            force=True)

        cmds.loadPlugin('pxrUsd', quiet=True)
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:7,代码来源:testUsdExportPref.py

示例4: requires_maya

def requires_maya(func=None, gui=False):

    # Function as a decorator constructor.
    if not func:
        return functools.partial(requires_maya, gui=gui)

    # Start it up.
    if _has_maya and not hasattr(maya_cmds, 'about'):
        from maya import standalone
        standalone.initialize()

    _is_batch = _has_maya and threads.call_in_main_thread(maya_cmds.about, batch=True)

    if not _has_maya or (gui and _is_batch):
        @functools.wraps(func)
        def _skipper(*args, **kwargs):
            from nose.exc import SkipTest
            raise SkipTest
        return _skipper

    # Not in batch mode, so we need to run in the main thread.
    if not _is_batch:
        trampoliner = trampoline.decorate(threads.call_in_main_thread)
        return trampoliner(func)

    # Pass it through.
    return func
开发者ID:felixzxf,项目名称:mayatools,代码行数:27,代码来源:test.py

示例5: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        cmds.loadPlugin('pxrUsd')

        usdFile = os.path.abspath('UsdImportColorSetsTest.usda')
        cmds.usdImport(file=usdFile, shadingMode='none',
                excludePrimvar='ExcludeMe')
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:7,代码来源:testUsdImportColorSets.py

示例6: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        cmds.loadPlugin('pxrUsd')

        if not UsdMaya.WriteUtil.WriteUVAsFloat2():
            cmds.file(os.path.abspath('UsdExportUVSetsTest.ma'), open=True,
                       force=True)
        else:
            cmds.file(os.path.abspath('UsdExportUVSetsTest_Float.ma'), open=True,
                       force=True)

        # Make some live edits to the box with weird UVs for the
        # testExportUvVersusUvIndexFromIterator test.
        cmds.select("box.map[0:299]", r=True)
        cmds.polyEditUV(u=1.0, v=1.0)

        usdFilePath = os.path.abspath('UsdExportUVSetsTest.usda')
        cmds.usdExport(mergeTransformAndShape=True,
            file=usdFilePath,
            shadingMode='none',
            exportColorSets=False,
            exportDisplayColor=False,
            exportUVs=True)

        cls._stage = Usd.Stage.Open(usdFilePath)
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:25,代码来源:testUsdExportUVSets.py

示例7: setUpModule

def setUpModule():
    from maya import standalone
    standalone.initialize(name='python')
    from maya import cmds
    from mtoatools import plugins

    module_namespace['standalone'] = standalone
    module_namespace['cmds'] = cmds
    module_namespace['plugins'] = plugins
开发者ID:danbradham,项目名称:mtoatools,代码行数:9,代码来源:test_plugins.py

示例8: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        cmds.loadPlugin('pxrUsd')

        usdFile = ""
        if UsdMaya.ReadUtil.ReadFloat2AsUV(): 
            usdFile = os.path.abspath('UsdImportUVSetsTest_Float.usda')
        else:
            usdFile = os.path.abspath('UsdImportUVSetsTest.usda')
        cmds.usdImport(file=usdFile, shadingMode='none')
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:10,代码来源:testUsdImportUVSets.py

示例9: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        cmds.file(new=True, force=True)

        # Import the USD file.
        usdFilePath = os.path.abspath('UsdImportCameraTest.usda')
        cmds.loadPlugin('pxrUsd')
        cmds.usdImport(file=usdFilePath, readAnimData=True)

        cls._stage = Usd.Stage.Open(usdFilePath)
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:10,代码来源:testUsdImportCamera.py

示例10: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        cmds.file(new=True, force=True)

        # Import from USD.
        usdFilePath = os.path.abspath('MarbleCube.usda')
        cmds.loadPlugin('pxrUsd')
        cmds.usdImport(file=usdFilePath, shadingMode='pxrRis')

        cls._stage = Usd.Stage.Open(usdFilePath)
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:10,代码来源:testUsdImportShadingModePxrRis.py

示例11: setUp

	def setUp(self):
		# Start Maya
		standalone.initialize(name='python')
	
		# Initial preset values
		self.input = {}
		self.input['control_options'] =	 {'name':'cnt1', 'shape':'circle', 'color':'red', 'control_grp':'controls_grp', 'scale':1}
		self.input['cluster_options'] = {'relative':True, 'resolution':'Full','angle_interp':'Closest'}
		self.input['parentConstraint_options'] = {'interp_type':'Average', 'buffer_node':'cnt1_buffer', 'follow':'back_jnt_2'}
		self.input['geo_options'] = { 'name':'pSphere01', 'vertices':'pSphere01Shape.vtx[0:100]', 'radius':5 }	
开发者ID:Mauricio3000,项目名称:MSH_Maya,代码行数:10,代码来源:TestClusterControl.py

示例12: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')

        cmds.loadPlugin('pxrUsd')

        mayaFile = os.path.abspath('SingleLocator.ma')
        cmds.file(mayaFile, open=True, force=True)

        cls._singleLocatorUsdFilePathMerged = os.path.abspath(
            'SingleLocator_MERGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathMerged,
            mergeTransformAndShape=True, shadingMode="none")

        cls._singleLocatorUsdFilePathUnmerged = os.path.abspath(
            'SingleLocator_UNMERGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathUnmerged,
            mergeTransformAndShape=False, shadingMode="none")

        cls._singleLocatorUsdFilePathMergedRanged = os.path.abspath(
            'SingleLocator_MERGED_RANGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathMergedRanged,
            mergeTransformAndShape=True, shadingMode="none",
            frameRange=(1, 1))

        cls._singleLocatorUsdFilePathUnmergedRanged = os.path.abspath(
            'SingleLocator_UNMERGED_RANGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathUnmergedRanged,
            mergeTransformAndShape=False, shadingMode="none",
            frameRange=(1, 1))

        mayaFile = os.path.abspath('CubeUnderLocator.ma')
        cmds.file(mayaFile, open=True, force=True)

        cls._locatorParentUsdFilePathMerged = os.path.abspath(
            'CubeUnderLocator_MERGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathMerged,
            mergeTransformAndShape=True, shadingMode="none")

        cls._locatorParentUsdFilePathUnmerged = os.path.abspath(
            'CubeUnderLocator_UNMERGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathUnmerged,
            mergeTransformAndShape=False, shadingMode="none")

        cls._locatorParentUsdFilePathMergedRanged = os.path.abspath(
            'CubeUnderLocator_MERGED_RANGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathMergedRanged,
            mergeTransformAndShape=True, shadingMode="none",
            frameRange=(1, 1))

        cls._locatorParentUsdFilePathUnmergedRanged = os.path.abspath(
            'CubeUnderLocator_UNMERGED_RANGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathUnmergedRanged,
            mergeTransformAndShape=False, shadingMode="none",
            frameRange=(1, 1))
开发者ID:PixarAnimationStudios,项目名称:USD,代码行数:54,代码来源:testUsdExportLocator.py

示例13: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        filepath = os.path.abspath('AssemblyTest.ma')
        cmds.file(filepath, open=True, force=True)

        usdFilePath = os.path.abspath('AssemblyTest.usda')
        cmds.loadPlugin('pxrUsd')
        cmds.usdExport(mergeTransformAndShape=True,
                       file=usdFilePath,
                       shadingMode='none')

        cls._stage = Usd.Stage.Open(usdFilePath)
开发者ID:JT-a,项目名称:USD,代码行数:12,代码来源:testUsdExportAssembly.py

示例14: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        cmds.file(new=True, force=True)

        cmds.loadPlugin('RenderMan_for_Maya', quiet=True)

        # Import from USD.
        usdFilePath = os.path.abspath('RfMLightsTest.usda')
        cmds.loadPlugin('pxrUsd')
        cmds.usdImport(file=usdFilePath, shadingMode='pxrRis')

        cls._stage = Usd.Stage.Open(usdFilePath)
开发者ID:lvxejay,项目名称:USD,代码行数:12,代码来源:testUsdImportRfMLight.py

示例15: setUpClass

    def setUpClass(cls):
        standalone.initialize('usd')
        cmds.file(os.path.abspath('UserExportedAttributesTest.ma'), open=True, force=True)

        usdFilePathFormat = 'UserExportedAttributesTest_EXPORTED_%s.usda'
        
        mergedUsdFilePath = os.path.abspath(usdFilePathFormat % 'MERGED')
        unmergedUsdFilePath = os.path.abspath(usdFilePathFormat % 'UNMERGED')

        cmds.loadPlugin('pxrUsd', quiet=True)

        cmds.usdExport(file=mergedUsdFilePath, mergeTransformAndShape=True)
        cmds.usdExport(file=unmergedUsdFilePath, mergeTransformAndShape=False)
开发者ID:mplanck,项目名称:USD,代码行数:13,代码来源:testUsdMayaUserExportedAttributes.py


注:本文中的maya.standalone.initialize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。