mayapy segfaults when trying to scene files with references locked (not
attributes but the ref node itself is locked)

Maya Version: Autodesk Maya 2017 Update 4


Repro:

   1. Create a file reference(any maya file, contents do not matter) in an
   empty maya scene.
   2. Right-click on the referenced node in the outliner.
   3. In the context menu select Reference > Lock.
   4. Save the file.
   5. Run the following script in the mayapy interpreter ($ mayapy lock.py)

# lock.pyimport maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
cmds.file(
    'path/to/file/in/repro/step/4/above',
    open=True,
    force=True)

maya.standalone.uninitialize()


mayapy will segfault with the following stack trace:

* Stack trace: TfileUtil::lockReference(TsceneFile*)
TloadReference::lockReference(TsceneFile*)
TloadReference::lockAllReferences(TsceneFile*)
TglobalTranslator::doReadFile(TsceneFile&, bool, bool)
TfileUtil::readFile(TsceneFile*, bool, bool, bool)
TsceneOperator::openFile(TsceneFile*, bool, bool)
TfileCmd::handleFileOpenFlag(TargDatabase&, TsceneFile*)
TfileCmd::handleFlags(TargDatabase&, TsceneFile*, TnamespaceSwapper*,
TgraphDiff*) TfileCmd::handleFlags(TargDatabase&, Tstring const&)
TfileCmd::doCommand(TargList&)
TpythonInterpreter::dispatchMayaCommand(TmetaCommand&, _object*, _object*)
PyEval_EvalFrameEx PyEval_EvalCodeEx PyEval_EvalCode PyRun_FileExFlags
PyRun_SimpleFileExFlags Py_Main __libc_start_main /<maya intall
dir>/bin/python-bin() [0x400649] *
All the calls starting with Py** at the bottom of the stack trace are
standard Python C API functions.

Did anyone experience this? If yes it there a way around this (using mayapy).
I could not find this in the know bugs.

For what it's worth -
This works flawlessly calling python from  mel  non-gui mode of maya binary
for interactive non-gui mode.

maya -prompt -command "python(\"import maya.cmds as
cmds;cmds.file(\\\"path/to/file/in/repro/step/4/above\\\", open=True,
force=True)\");quit -f;"




Thanks,

- Alok

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMRCNCKOjb%2Bg%3DrzseAkX4yQAR-cwE1qOgku390bZQVvprw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to