Arnold, problem running under maya.standalone

I have tested this with both maya 2014(mtoa, 1.0.01) and maya 2015(mtoa, 1.2.xx)

after you have a regular install of maya and mtoa.
open mayapy for example in C:\Program Files\Autodesk\Maya2015\bin\mayapy.exe

import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
cmds.loadPlugin(all=1)#this loads all your plug-ins

and then every other plugins loads fine, except for arnold, which will give an error similar to:

API error detected in plugins\mtoa\extension\PxMayaNode.cpp at line 222
: (kFailure): Unexpected Internal Failure
00:00:00   140MB WARNING | [mtoa] [mtoa_shaders] [node volume_collector] Assigni
ng temporary node id 1138176 to associated Maya type name aiVolumeCollector.
00:00:00   140MB ERROR   | [mtoa] [xgenTranslator] Could not find xgen_procedura
l in search path $ARNOLD_PLUGIN_PATH
API error detected in plugins\mtoa\extension\ExtensionsManager.cpp at line 571
: (kFailure): Unexpected Internal Failure
00:00:00   142MB WARNING | [mtoa] Extension xgenTranslator(C:/solidangle/mtoadep
loy/2015/extensions/xgenTranslator.dll) requires Maya plugin xgenToolkit, regist
ering will be deferred until plugin is loaded.

API error detected in plugins\mtoa\Main.cpp at line 770
: (kFailure): Unexpected Internal Failure
00:00:00   142MB ERROR   | Failed to import python module 'arnold'

well, every version will look slightly different, but it’ll always involve PxMayaNode.cpp and xgen loading problem.

I’ve tried with quite a few versions, in 5 or more computers with very different configurations, and always fails, if anyone can succeed, I would loved to know your config, and software version and exactly how you did it. Thanks in advanced!

does xgen load properly?

I’ve tried in 2015, and nope, it doesn’t, xgen also doesn’t load properly, but in 2014, there’s no xgen that came with it, so I can’t try it, but of course, in GUI mode everything loads fine, so I’m thinking maybe it had something to do with some preload script in Gui mode that’s missing from standalone?

Actually, xgen loads fine, although it did gave some error about Unable to execute igInitialize.mel.Unable to execute xgen.mel.Error: file: C:/Program Files/Autodesk/Maya2015/plug-ins/xgen/scripts/igInitialize.mel line 63: not found,

but I was able to fix that by adding that to path.

now xgen loads perfectly, and yet, arnold still doesn’t load, here’s the error for arnold even after xgen is loaded:

>>> cmds.loadPlugin('xgenToolkit')
[u'xgenToolkit']
>>> cmds.loadPlugin('mtoa')

API error detected in plugins\mtoa\extension\PxMayaNode.cpp at line 222
: (kFailure): Unexpected Internal Failure

API error detected in plugins\mtoa\extension\PxMayaNode.cpp at line 222
: (kFailure): Unexpected Internal Failure

API error detected in plugins\mtoa\extension\PxMayaNode.cpp at line 222
: (kFailure): Unexpected Internal Failure

API error detected in plugins\mtoa\extension\PxMayaNode.cpp at line 222
: (kFailure): Unexpected Internal Failure
00:00:00   181MB WARNING | [mtoa] [mtoa_shaders] [node volume_collector] Assigni
ng temporary node id 1138176 to associated Maya type name aiVolumeCollector.
00:00:00   182MB ERROR   | [mtoa] [xgenTranslator] Could not find xgen_procedura
l in search path $ARNOLD_PLUGIN_PATH

API error detected in plugins\mtoa\extension\ExtensionsManager.cpp at line 571
: (kFailure): Unexpected Internal Failure

API error detected in plugins\mtoa\extension\ExtensionsManager.cpp at line 571
: (kFailure): Unexpected Internal Failure

API error detected in plugins\mtoa\extension\ExtensionsManager.cpp at line 571
: (kFailure): Unexpected Internal Failure

API error detected in plugins\mtoa\Main.cpp at line 770
: (kFailure): Unexpected Internal Failure
00:00:00   184MB ERROR   | Failed to import python module 'arnold'
Error: No module named mtoa.lightFilters
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named mtoa.lightFilters
Error: No module named mtoa.lightFilters
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named mtoa.lightFilters
Error: No module named mtoa.lightFilters
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named mtoa.lightFilters
Error: No module named mtoa.lightFilters
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named mtoa.lightFilters
Error: No module named mtoa.api.extensions
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named mtoa.api.extensions
Error: No module named mtoa.api.extensions
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named mtoa.api.extensions
Error: No module named mtoa.api.extensions
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named mtoa.api.extensions
Error: No module named arnold
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
# ImportError: No module named arnold
Error: Failed to import python module 'arnold'
Error: initializePlugin function failed (mtoa)

I have figured it out~
just by adding

sys.path.append(‘C:/solidangle/mtoadeploy/2015/scripts’)

will let arnold load up, while the error about xgen is still there, it was able to load a maya scene with arnold nodes.

and after I installed the latest maya 2015 extension 5, it crashed right after loaded… like such:

>>> cmds.loadPlugin('mtoa')
00:00:00   142MB ERROR   | [mtoa] [mtoa_shaders] Could not find mtoa_shaders in
search path $ARNOLD_PLUGIN_PATH

API error detected in plugins\mtoa\Main.cpp at line 465
: (kNotFound): Unexpected Internal Failure
00:00:00   142MB WARNING | [mtoa] Error opening $MTOA_EXTENSIONS_PATH.
00:00:00   142MB WARNING | [mtoa] Error opening $ARNOLD_PLUGIN_PATH.
Successfully imported python module 'arnold'
Successfully imported python module 'mtoa'
pymel.core : INFO : Updating pymel with pre-loaded plugins: mtoa
Warning: file: C:/Program Files/Autodesk/Maya2015/scripts/startup/initialStartup
.mel line 195: Y-axis is already the Up-axis
00:00:04   408MB ERROR   | signal caught: error C0000005 -- access violation

****
* Arnold 4.2.4.1 windows icc-14.0.2 oiio-1.4.14 rlm-11.2.2 2015/03/11 13:59:27
* CRASHED in RtlDeNormalizeProcessParams at 00:00:00
* signal caught: error C0000005 -- access violation
*
* backtrace:
*  0 0x000000000a789450 [ai            ] AiArray

*  1 0x000000000a78be30 [ai            ] AiArray

*  2 0x000000007747b940 [kernel32      ] UnhandledExceptionFilter

*  3 0x0000000077693398 [ntdll         ] MD5Final

*  4 0x00000000776185c8 [ntdll         ] _C_specific_handler

*  5 0x0000000077629d2d [ntdll         ] RtlDecodePointer

*  6 0x00000000776191cf [ntdll         ] RtlUnwindEx

*  7 0x0000000077651248 [ntdll         ] KiUserExceptionDispatcher

>> 8 0x000000007764e4e4 [ntdll         ] RtlDeNormalizeProcessParams

*  9 0x000000007764e40b [ntdll         ] RtlDeNormalizeProcessParams

* 10 0x0000000070cdeead [MSVCR90       ] lock_file

* 11 0x0000000070cddccc [MSVCR90       ] getc

* 12 0x000000001e0fa58d [python27      ] PyParser_ParseFile

* 13 0x000000001e0fa888 [python27      ] PyParser_ParseFile

* 14 0x000000001e0fb226 [python27      ] PyParser_ParseFile

* 15 0x000000001e0fb909 [python27      ] PyToken_ThreeChars

* 16 0x000000001e0fc30e [python27      ] PyToken_ThreeChars

* 17 0x000000001e0f9a71 [python27      ] PyNode_Free

* 18 0x000000001e0f9ebd [python27      ] PyParser_ParseFileFlagsEx

* 19 0x000000001e1421b8 [python27      ] PyParser_ASTFromFile

* 20 0x000000001e142913 [python27      ] PyRun_FileExFlags

* 21 0x000007fedde95a27 [OpenMaya      ] Tplugin::loadScript

* 22 0x000007feddf03ddf [OpenMaya      ] TpluginPref::~TpluginPref

* 23 0x000007feddf0300a [OpenMaya      ] TpluginPref::~TpluginPref

* 24 0x000007feddf0273b [OpenMaya      ] TpluginPref::~TpluginPref

* 25 0x000007fee921590c [CommandEngine ] Tjournal::operator=

* 26 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 27 0x000007fee9261113 [CommandEngine ] melScanDouble

* 28 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 29 0x000007fee923d3e4 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 30 0x000007fee925db90 [CommandEngine ] SophiaExecutable::evaluate

* 31 0x000007fee922046f [CommandEngine ] TcommandEngine::sourceFile

* 32 0x000007feddd977e2 [OpenMaya      ] MGlobal::sourceFile

* 33 0x000007fed7ab53fb [mayaHIK       ] initializePlugin

* 34 0x000007fedde9643c [OpenMaya      ] Tplugin::primaryLoad

* 35 0x000007fedde9555d [OpenMaya      ] Tplugin::load

* 36 0x000007feddf03e78 [OpenMaya      ] TpluginPref::~TpluginPref

* 37 0x000007feddf0300a [OpenMaya      ] TpluginPref::~TpluginPref

* 38 0x000007feddf0273b [OpenMaya      ] TpluginPref::~TpluginPref

* 39 0x000007fee921590c [CommandEngine ] Tjournal::operator=

* 40 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 41 0x000007fee925f4e1 [CommandEngine ] melScanDouble

* 42 0x000007fee923bea6 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 43 0x000007fee926106a [CommandEngine ] melScanDouble

* 44 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 45 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 46 0x000007fee925fbb4 [CommandEngine ] melScanDouble

* 47 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 48 0x000007fee923d3e4 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 49 0x000007fee925db90 [CommandEngine ] SophiaExecutable::evaluate

* 50 0x000007fee921eace [CommandEngine ] TcommandEngine::executeCommand

* 51 0x000007fee7d68ea8 [ExtensionLayer] TscriptAction::execute

* 52 0x000007fee7c29406 [ExtensionLayer] QmayaMenuItem::version

* 53 0x000007fee921590c [CommandEngine ] Tjournal::operator=

* 54 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 55 0x000007fee923d123 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 56 0x000007fee923d3e4 [CommandEngine ] TmelVariableList::`default constructor
closure'
* 57 0x000007fee925db90 [CommandEngine ] SophiaExecutable::evaluate

* 58 0x000007fee921eace [CommandEngine ] TcommandEngine::executeCommand

* 59 0x000007fee927774d [CommandEngine ] TpythonFlagException::typeof

* 60 0x000000001e0c0966 [python27      ] PyCFunction_Call

* 61 0x000000001e110484 [python27      ] PyEval_GetGlobals

* 62 0x000000001e113c34 [python27      ] PyEval_EvalFrameEx

* 63 0x000000001e115439 [python27      ] PyEval_EvalCodeEx

* 64 0x000000001e10eba9 [python27      ] PyEval_GetFuncDesc

* 65 0x000000001e110514 [python27      ] PyEval_GetGlobals

* 66 0x000000001e113c34 [python27      ] PyEval_EvalFrameEx

* 67 0x000000001e115439 [python27      ] PyEval_EvalCodeEx

* 68 0x000000001e10eba9 [python27      ] PyEval_GetFuncDesc

* 69 0x000000001e110514 [python27      ] PyEval_GetGlobals

* 70 0x000000001e113c34 [python27      ] PyEval_EvalFrameEx

* 71 0x000000001e115439 [python27      ] PyEval_EvalCodeEx

* 72 0x000000001e1154d9 [python27      ] PyEval_EvalCode

* 73 0x000000001e127fa0 [python27      ] PyImport_ExecCodeModuleEx

* 74 0x000000001e1287b4 [python27      ] PyImport_ExecCodeModuleEx

* 75 0x000000001e12aa33 [python27      ] PyImport_FindModule

* 76 0x000000001e12ade9 [python27      ] PyImport_FindModule

* 77 0x000000001e12b3b7 [python27      ] PyImport_ReloadModule

* 78 0x000000001e12b7a2 [python27      ] PyImport_ReloadModule

* 79 0x000000001e12b910 [python27      ] PyImport_ImportModuleLevel

* 80 0x000000001e108f53 [python27      ] PyAST_FromNode

* 81 0x000000001e0c0966 [python27      ] PyCFunction_Call

* 82 0x000000001e08adf5 [python27      ] PyObject_Call

* 83 0x000000001e10e938 [python27      ] PyEval_CallObjectWithKeywords

* 84 0x000000001e11360a [python27      ] PyEval_EvalFrameEx

* 85 0x000000001e115439 [python27      ] PyEval_EvalCodeEx

* 86 0x000000001e1154d9 [python27      ] PyEval_EvalCode

* 87 0x000000001e127fa0 [python27      ] PyImport_ExecCodeModuleEx

* 88 0x000000001e1287b4 [python27      ] PyImport_ExecCodeModuleEx

* 89 0x000000001e12ade9 [python27      ] PyImport_FindModule

* 90 0x000000001e12b3b7 [python27      ] PyImport_ReloadModule

* 91 0x000000001e12b7a2 [python27      ] PyImport_ReloadModule

* 92 0x000000001e12b910 [python27      ] PyImport_ImportModuleLevel

* 93 0x000000001e108f53 [python27      ] PyAST_FromNode

* 94 0x000000001e0c0966 [python27      ] PyCFunction_Call

* 95 0x000000001e08adf5 [python27      ] PyObject_Call

* 96 0x000000001e10e938 [python27      ] PyEval_CallObjectWithKeywords

* 97 0x000000001e11360a [python27      ] PyEval_EvalFrameEx

* 98 0x000000001e115439 [python27      ] PyEval_EvalCodeEx

* 99 0x000000001e1154d9 [python27      ] PyEval_EvalCode

*
* loaded modules:
*    0x000000000a250000  ai
*    0x00000000773e0000  kernel32
*    0x0000000077600000  ntdll
*    0x0000000070cd0000  MSVCR90
*    0x000000001e000000  python27
*    0x000007feddd30000  OpenMaya
*    0x000007fee9200000  CommandEngine
*    0x000007fed7a80000  mayaHIK
*    0x000007fee7c00000  ExtensionLayer
****

So it doesn’t take path in Window’s variables or Maya.env into consideration?

I’m guessing it does, I just don’t know the correct one to add in.

That error looks like a mismatch between the compiled plugin and the new maya. C++ wins again

but in Gui mode it works fine.