Closed gywn closed 1 year ago
@gywn please avoid auto type, I pushed it (thank you for allowing pushing from the maintainer)
By the way I'm a little unclear, do you mean ocolors is not GCed until PyGraphHandle is GCed and your patch fixes that?
@cielavenir What failed in my build is extract<boost::multi_array<float,2> >(ocolors)
. It seems pybind11::object::cast
does not support boost::multi_array
. I look through the code base and it seems this is the only place where such a conversion is considered. Runtime error message from pybind11:
Exception RuntimeError: u'Unable to cast Python instance to C++ type (compile in debug mode for details)' in <finalize object at 0x7ff9cce81d00; dead> ignored
And sorry about the auto
, I was unaware/ignorant about this coding style in Mujin/OpenRAVE.
thanks~
The affected code section allows drawtrimesh to accept an array of color attributes that match the triangle array. This is more efficient than creating many draw handles because OpenGL can consume this array of color attributes directly. This functionality was impacted when using pybind11 to compile the Python interface.