Name Error

Name Error

Anonymous
Not applicable
1,866 Views
2 Replies
Message 1 of 3

Name Error

Anonymous
Not applicable

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 )

0 Likes
1,867 Views
2 Replies
Replies (2)
Message 2 of 3

tkaap2
Autodesk
Autodesk

I would recommend that you contact the author of the IKMAX auto rig for assistance in how best to load and use their product.  I think it should be fairly straightforward, but without more details any replies here would just be guessing and could cause more confusion than help.

 

The "name error" appears to be coming from the software attempting to use a renamed module before it has specified to the system which name it wants to use for that module.  That's a perfectly normal process, but for one of several reasons their script isn't doing its setup work first.  It's best to contact them to get help in sorting out why that's happening.

0 Likes
Message 3 of 3

Anonymous
Not applicable
I tried.
No response yet, and its been like 2 weeks.
Posted on tge youtube comments, facebook page, webpage I bought the plugin
from no reply.
0 Likes