Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
772 stars 201 forks source link

Getting custom layer data crashes Maya #3877

Open vinRosso opened 3 months ago

vinRosso commented 3 months ago

Description of Issue

Getting the custom layer data from a layer created in Autodesk Bifrost raises an error.


Steps to Reproduce

  1. Create a simple layer like in the following image image

  2. Try to query the custom layer data from USD, it causes Maya to crash:

    
    from pxr import Sdf

identifier = "anon:0x7f6b8c051af0:bifrost.usd" # put here whatever the identifier is layer = Sdf.Layer.FindOrOpen(identifier) layer.customLayerData


---

### Stack Trace
```js
  /usr/autodesk/mayausd/maya2024/0.29.0_202406120659-f8eb6c1/mayausd/USD/lib/python/pxr/Vt/_vt.so(+0x9cc871) [0x7f2c24dcc871]
  boost::python::converter::detail::arg_to_python_base::arg_to_python_base(void const volatile*, boost::python::converter::registration const&)
  boost::python::api::object pxrInternal_v0_22__pxrReserved__::TfPyObject<pxrInternal_v0_22__pxrReserved__::VtValue>(pxrInternal_v0_22__pxrReserved__::VtValue const&, bool)
  /usr/autodesk/mayausd/maya2024/0.29.0_202406120659-f8eb6c1/mayausd/USD/lib/python/pxr/Vt/_vt.so(+0x9c62d2) [0x7f2c24dc62d2]
  boost::python::objects::caller_py_function_impl<boost::python::detail::caller<pxrInternal_v0_22__pxrReserved__::VtDictionary (pxrInternal_v0_22__pxrReserved__::SdfLayer::*)() const, boost::python::default_call_policies, boost::mpl::vector2<pxrInternal_v0_22__pxrReserved__::VtDictionary, pxrInternal_v0_22__pxrReserved__::SdfLayer&> > >::operator()(_object*, _object*)
  boost::python::objects::function::call(_object*, _object*) const
  /usr/autodesk/mayausd/maya2024/0.29.0_202406120659-f8eb6c1/mayausd/USD/lib/python/pxr/Tf/../../../libboost_python310.so.1.76.0(+0x1fcf6) [0x7f2c326accf6]
  boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const
  boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<pxrInternal_v0_22__pxrReserved__::TfBaseException, void (*)(pxrInternal_v0_22__pxrReserved__::TfBaseException const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(pxrInternal_v0_22__pxrReserved__::TfBaseException const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&)
  boost::python::handle_exception_impl(boost::function0<void>)
  /usr/autodesk/mayausd/maya2024/0.29.0_202406120659-f8eb6c1/mayausd/USD/lib/python/pxr/Tf/../../../libboost_python310.so.1.76.0(+0x1d722) [0x7f2c326aa722]
  _PyObject_Call
  boost::python::objects::full_py_function_impl<pxrInternal_v0_22__pxrReserved__::Tf_ModuleProcessor::_InvokeWithErrorHandling, boost::mpl::vector1<_object*> >::operator()(_object*, _object*)
  boost::python::objects::function::call(_object*, _object*) const
  /usr/autodesk/mayausd/maya2024/0.29.0_202406120659-f8eb6c1/mayausd/USD/lib/python/pxr/Tf/../../../libboost_python310.so.1.76.0(+0x1fcf6) [0x7f2c326accf6]
  boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const
  boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<pxrInternal_v0_22__pxrReserved__::TfBaseException, void (*)(pxrInternal_v0_22__pxrReserved__::TfBaseException const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(pxrInternal_v0_22__pxrReserved__::TfBaseException const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&)
  boost::python::handle_exception_impl(boost::function0<void>)
  /usr/autodesk/mayausd/maya2024/0.29.0_202406120659-f8eb6c1/mayausd/USD/lib/python/pxr/Tf/../../../libboost_python310.so.1.76.0(+0x1d722) [0x7f2c326aa722]
  _PyObject_MakeTpCall
  /usr/autodesk/maya2024/lib/libpython3.10.so.1.0(+0xcd540) [0x7f2c786cd540]
  _PyObject_GenericGetAttrWithDict
  PyObject_GetAttr
  _PyEval_EvalFrameDefault
  /usr/autodesk/maya2024/lib/libpython3.10.so.1.0(+0x1bda24) [0x7f2c787bda24]
  PyEval_EvalCode
  TpythonInterpreter::executeCommand(Tstring const&, bool, bool, TinterpreterResult*)
  /usr/autodesk/maya2024/lib/libExtensionLayer.so(+0x36985a) [0x7f2c8556985a]
  TidleAction::preDoIdleAction(Tevent const&)
  /usr/autodesk/maya2024/lib/libExtensionLayer.so(+0x2fbcf7) [0x7f2c854fbcf7]
  TeventHandler::doIdles()
  /usr/autodesk/maya2024/lib/libExtensionLayer.so(+0x317155) [0x7f2c85517155]
  QObject::event(QEvent*)
  QApplicationPrivate::notify_helper(QObject*, QEvent*)
  /usr/autodesk/maya2024/lib/libExtensionLayer.so(+0x3040bd) [0x7f2c855040bd]
  QCoreApplication::notifyInternal2(QObject*, QEvent*)
  QTimerInfoList::activateTimers()
  /usr/autodesk/maya2024/lib/libQt5Core.so.5(+0x300564) [0x7f2c81d00564]
  g_main_context_dispatch
  /lib64/libglib-2.0.so.0(+0xa9508) [0x7f2c7796f508]

System Information

Maya version: 2024.2 Bifrost version: 2.10.0.0 Maya USD version: 0.29.0


Related to https://github.com/PixarAnimationStudios/OpenUSD/issues/3202

wallworm commented 3 months ago

Thank you for sharing this. We will look into this.