Name Error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I dont know much about mel or python.
I bought a auto rig to make life easier, and the following is what I get.
Also I should mention doesn't matter if I load this via Windows/Plugins/ load/autoload.
Or via script editor file load source Docs Maya Scripts IKMAX.ply
Any and all help would be welcome, but please remember I have no clue how to use the script editor and will need an in depth answer.
Thanks.
file -f -new;
// Warning: file: C:/Program Files/Autodesk/Maya2018/scripts/startup/rememberViewportSettings.mel line 29: Active stereo does not work with Aero enabled. Active stereo has been disabled. //
// untitled //
commandPort -securityWarning -name commandportDefault;
onSetCurrentLayout "Maya Classic";
// pymel.core : Updating pymel with pre-loaded plugins: GPUBuiltInDeformer, deformerEvaluator, IKMAX, renderSetup, modelingToolkit
START
Found! 33
FOUND
SubItem Found
menuItem415
// Warning: file: C:/Program Files/Autodesk/Maya2018/scripts/others/supportRenderers.mel line 67: The renderer "arnold" used by this scene, is not currently available. The "mayaSoftware" renderer will be used instead. To prevent this message from being displayed in the future, set the option variable: MAYA_NO_WARNING_FOR_MISSING_DEFAULT_RENDERER=1 //
# Error: NameError: file <maya console> line 1: name 'mel' is not defined #
file -f -new;
// Warning: file: C:/Program Files/Autodesk/Maya2018/scripts/startup/rememberViewportSettings.mel line 29: Active stereo does not work with Aero enabled. Active stereo has been disabled. //
// untitled //
commandPort -securityWarning -name commandportDefault;
onSetCurrentLayout "Maya Classic";
// pymel.core : Updating pymel with pre-loaded plugins: GPUBuiltInDeformer, deformerEvaluator, IKMAX, renderSetup, modelingToolkit
START
Found! 33
FOUND
SubItem Found
menuItem415
// Warning: file: C:/Program Files/Autodesk/Maya2018/scripts/others/supportRenderers.mel line 67: The renderer "arnold" used by this scene, is not currently available. The "mayaSoftware" renderer will be used instead. To prevent this message from being displayed in the future, set the option variable: MAYA_NO_WARNING_FOR_MISSING_DEFAULT_RENDERER=1 //
# Error: NameError: file <maya console> line 1: name 'mel' is not defined #
import sys
import maya.OpenMaya as OpenMaya
import maya.OpenMayaMPx as OpenMayaMPx
commandName = 'ikmax'
class IKMAXClass( OpenMayaMPx.MPxCommand 😞
def __init__(self):
''' Constructor. '''
OpenMayaMPx.MPxCommand.__init__(self)
def doIt(self, args):
''' Command execution. '''
import sys
import os
from os import path
import maya.mel as mel
import maya.cmds as cmds
scriptPath = os.path.expanduser("~/maya/plug-ins/IKMAX_Files/ikm.py")
scriptPathPyc = os.path.expanduser("~/maya/plug-ins/IKMAX_Files/ikm.pyc")
if os.path.exists(scriptPathPyc): scriptPath = scriptPathPyc
if os.path.exists(scriptPath): scriptPath = scriptPath
def psource(module):
file = os.path.basename( module )
dir = os.path.dirname( module )
toks = file.split( '.' )
modname = toks[0]
if( os.path.exists( dir ) 😞
paths = sys.path
pathfound = 0
for path in paths:
if(dir == path):
pathfound = 1
if not pathfound:
sys.path.append( dir )
exec ('import ' + modname) in globals()
exec( 'reload( ' + modname + ' )' ) in globals()
return modname
def IKMAXstart():
# When you import a file you must give it the full path
print "ikmax: " + scriptPath
psource( scriptPath )
print "executed"
IKMAXstart()
#-------------------------------------------------------------------------------------
def cmdCreator():
''' Create an instance of our command. '''
return OpenMayaMPx.asMPxPtr( IKMAXClass() )
def initializePlugin( mobject 😞
import maya.mel as mel
import maya.cmds as cmds
import sys
import os
from os import path
from sys import path as sysPath
#--------------------- ADD ITEMS IN MENU --------------------------
scriptPath = os.path.expanduser("~/maya/plug-ins/IKMAX_Files")
sysPath.append(scriptPath)
import ikmax_menu
ikmax_menu.start()
#--------------------- ADD ITEMS IN MENU // END --------------------------
''' Initialize the plug-in when Maya loads it. '''
mplugin = OpenMayaMPx.MFnPlugin( mobject, "3DtoAll", "1.5" )
try:
mplugin.registerCommand( commandName, cmdCreator )
except:
sys.stderr.write( 'Failed to register command: ' + commandName )
def uninitializePlugin( mobject 😞
''' Uninitialize the plug-in when Maya un-loads it. '''
print "Unloaded!"
import ikmax_menu
ikmax_menu.remove()
mplugin = OpenMayaMPx.MFnPlugin( mobject )
try:
mplugin.deregisterCommand( commandName )
except:
sys.stderr.write( 'Failed to unregister command: ' + commandName )