maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

Returning nullptr from Ufe::CameraHandler::camera crashes Maya

Open dj-mcg opened this issue 1 year ago • 2 comments

Describe the bug According to the UFE 4.2 documentation for Ufe::CameraHandler::camera

Returns Camera interface of given SceneItem. Returns a null pointer if no Camera interface can be created for the item.

However it appears that returning nullptr from a CameraHandler will crash Maya, starting with 2024/UFE4.

We were able to work around this issue by instead putting a conditional in the find functions for cameras we did not want to appear in the Panels > Perspective menu. This seemed to do the trick and avoid the crash. So, we are not blocked on this issue, but I wanted to file it and suggest that either returning nullptr from camera should be handled gracefully in UFE, or that the documentation (and the current code) should be updated

dj-mcg avatar Feb 21 '25 20:02 dj-mcg

I've brought discussion up with devs. We'll get an official answer soon.

wallworm avatar Feb 24 '25 14:02 wallworm

Team is looking into this but it does appear to be a defect on our side.

wallworm avatar Feb 27 '25 16:02 wallworm