Cameras within references #2008
-
We are running into an issue where we have 100s of cameras listed in the Viewport's Panels -> Perspective menu when loading a full set. It can take a long time to open the list of cameras and it can be challenging to find the camera you are looking for. Our sets are constructed by referencing in models and a model can contain several projection cameras. We were wondering if there has been any discussion on what cameras should/should not be listed? Or, if we may want a setting to control what cameras are listed in the drop down? Also, if it would be preferred to handle this on a per-studio basis, is there a way we can hook into this menu and customize the UsdCameras that are listed? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Looking at the mel to generate this menu (buildPerspLookthruMenu.mel in runTime\scripts\others) there is currently no way to customize or filter the list. The listCameras command returns all the perspective cameras in the scene (native Maya and Ufe) and builds a menu item for each one. @seando-adsk I'm not familiar enough with the UI to know if/how we can make it configurable. Do you have any ideas? |
Beta Was this translation helpful? Give feedback.
-
Chatting internally we came up with an idea. If you replace the UsdCameraHandler with your own camera handler (by inserting your handler before ours maya-usd/lib/mayaUsd/ufe/Global.cpp Line 154 in 91ced34 That will prevent Maya from finding the camera in buildPrespLookthruMenu.mel. |
Beta Was this translation helpful? Give feedback.
-
Hi Grace, hopefully when you try it out it'll suit your purpose. It's a bit of a blunt instrument, in that the CameraHandler isn't passed any context to decide whether or not to create the Ufe::Camera interface, but the idea is that relying on the argument Ufe::SceneItem is enough. It might look like this:
Hope this helps. Cheers. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your help! We were able to make an internal patch to filter out the cameras. It is still a bit slow to open the menu on heavy sets (since it has to go through the scene items looking for cameras). However, once it is open, it is easier to find the camera we are looking for - thank you! |
Beta Was this translation helpful? Give feedback.
Hi Grace, hopefully when you try it out it'll suit your purpose. It's a bit of a blunt instrument, in that the CameraHandler isn't passed any context to decide whether or not to create the Ufe::Camera interface, but the idea is that relying on the argument Ufe::SceneItem is enough. It might look like this:
Hope this helps. Cheers.