本文整理汇总了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)
示例2: setUpClass
def setUpClass(cls):
standalone.initialize('usd')
cmds.loadPlugin('pxrUsd')
cls._deformingCubeUsdFilePath = os.path.abspath('DeformingCube.usda')
cls._deformingCubePrimPath = '/DeformingCube/Geom/Cube'
示例3: setUpClass
def setUpClass(cls):
standalone.initialize('usd')
cmds.file(os.path.abspath('UsdExportPrefTest.ma'), open=True,
force=True)
cmds.loadPlugin('pxrUsd', quiet=True)
示例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
示例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')
示例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)
示例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
示例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')
示例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)
示例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)
示例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 }
示例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))
示例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)
示例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)
示例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)