The extensive production software provides a range of advanced features that make modeling, shading, and texturing fun and exciting. The latest version of Autodesk Maya download for Windows consists of dynamic functions that make it easy to create awe-inspiring effects without much hassle. Users can also preview animations the moment they’re created for easy editing. source('Overload_%s' %, language='mel') .source('Overload_%s' % Maya is a beginner-friendly software that can help moviemakers and artists create characters, scenes, and 3D objects using powerful modeling tools. If not scriptRootPath in ("MAYA_SCRIPT_PATH"): ScriptRootPath = '%s/maya/scripts' % toolRoot # First make sure script path is added (first time plug in is loaded it will not be) # I got this behavior logged as a bug in the middle of 2017 The Overload script sits in the module folder's scripts directory (LCG/maya/scripts) # We need to trigger our pre-save callback before that happens. # Autodesk/Maya removes the file from file system when saving an iteration and then puts it back # For incremental save we have to overload the global proc incrementalSaveScene because # Add after new scene callback (for scene configuration) # Add after open scene callback (for scene configuration) # Import modules to set up pre-save callback and scene configuration # Now our framework is available to Maya. # The very first time the plug in is loaded Python path will not be initialized - do it here Output = '\r\nMAYA_SHELF_PATH = %s/maya/shelves' % toolRoot # Any shelf file in this directory will be automatically loaded on Maya startup If not plugInFolderPath in ("MAYA_PLUG_IN_PATH"): # First time that the module is written, the path will not yet be initialized - do it here Output = '\r\nMAYA_PLUG_IN_PATH = %s' % plugInFolderPath PlugInFolderPath = directory.replace('\\', '/') # Dynamically add all subdirectories containing py files of the root maya plugin Python folderįor directory, subDirectories, filenames in os.walk(plugInRootFolderPath): Output = '\r\nPYTHONPATH = %s/lcg/lib' % pythonRoot Output = '\r\nPYTHONPATH = %s' % pythonRoot With open(mayaModuleFile, 'w') as moduleFile: # Given where the plug in is loaded from this the root dir of our framework (LCG) MayaModuleFile = '%s/LCG.mod' % mayaModuleDirectoryPath If not os.path.exists(mayaModuleDirectoryPath): MayaModuleDirectoryPath = '%s/modules' % ('MAYA_APP_DIR') # Check if the modules directory exists in the user preference directory (if it doesn't, create it) PythonRoot = '/'.join(plugPath.split('/')) lcg/maya/plugin/LCG.py which is the "plugPath" variable # Our framework's internal folder structure dictates that the python root folder path PlugInRootFolderPath = os.path.abspath(os.path.join(plugPath, os.pardir)).replace('\\', '/') PlugPath = inspect.getfile(inspect.currentframe()) # This is where the plug in is currently being loaded from # Declare globals so that we can modify the variables Override incrementalSaveScene (due to AD bug) Create a mod file in user local that adds plug in path to this plug in to retain auto load Add plug in paths to the Maya environment On initialization, this function gets called to: Raise RuntimeError, 'Failed to unregister command: %s\nDetails:\n%s' % (e, traceback.format_exc()) registerCommand(LCGInitialize.kPluginCmdName) Raise RuntimeError, 'Failed to register command: %s\nDetails:\n%s' % (e, traceback.format_exc()) Plugin.registerCommand(LCGInitialize.kPluginCmdName, LCGInitialize.cmdCreator) Plugin = OpenMaya.MFnPlugin(obj, 'LCG United', '1.0', 'Any') Raise Exception('Plugin not supposed to be invoked - only loaded or unloaded.') The presence of this function tells Maya that the plugin produces, andĮxpects to be passed, objects created using the Maya Python API 2.0.Ĭlass LCGInitialize(OpenMaya.MPxCommand): Print '-Start Maya Plug in Paths-'įor path in ("MAYA_PLUG_IN_PATH").split(' '): Print '-Start Maya Python Paths-'įor path in ("PYTHONPATH").split(' '): Print '-Start Maya Shelf Paths-'įor path in ("MAYA_SHELF_PATH").split(' '): Print '-Start Maya Icon Paths-'įor path in ("XBMLANGPATH").split(' '): Print '-Start Maya Script Paths-'įor path in ("MAYA_SCRIPT_PATH").split(' '):
0 Comments
Leave a Reply. |