def list(scene, path_to_save_psa, script_name, actors): for actor in actors: scene.open(scene) if actor == "cam": util.debug("Exporting camera") if camera.export(path_to_save_psa, script_name): util.debug("Camera exported successfully.") else: return False else: util.debug('Exporting actor "%s"' % actor) if actor.export(path_to_save_psa, script_name, actor): util.debug('Actor "%s" exported successfully.' % actor) else: return False return True
def __action_open_scene_home(self): """Open the Home scene. __action_open_scene_home() -> None """ try: self.zui.scene = Scene.open( os.path.join("data", "home.pzs")) except Exception, e: self.__show_error("Unable to open the Home scene", str(e))
def __action_open_scene(self): """Open a scene from the location chosen by the user in a file selection dialog. __action_open_scene() -> None """ filename = str(QtGui.QFileDialog.getOpenFileName( self, "Open scene", self.__prev_dir, "PyZUI Scenes (*.pzs)")) if filename: self.__prev_dir = os.path.dirname(filename) try: self.zui.scene = Scene.open(filename) except Exception, e: self.__show_error("Unable to open scene", str(e))
import os import sys import maya.standalone print("=" * 30) print("TEST SCRIPT MAYA") print("=" * 30) print("Initializing maya standalone ...") maya.standalone.initialize(name="python") import scene print("Current file path: {}".format(scene.get_file_path())) maya_engine_scene = os.path.join(os.path.join(os.environ["USERPROFILE"]), "Desktop", "test.ma") print("Save at: {}".format(maya_engine_scene)) scene.save(maya_engine_scene) print("Open {}".format(maya_engine_scene)) scene.open(maya_engine_scene) print("Uninitialized maya standalone ...") maya.standalone.uninitialize() sys.exit(0)