-
Notifications
You must be signed in to change notification settings - Fork 124
Scene shape component names #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scene shape component names #276
Conversation
Is there any reason |
It would indeed be nice if selectionName() and componentNames() didn't require a call to glScene() to actually work. I need them to work for a unit test though. At the moment, my options are:
I'm a bit worried this might have unintended consequences when not called on the main thread - is this true? Does a deferred IECoreGL::Renderer make opengl calls?
I figured my lighting tool work might require a bit of a SceneShape revamp in the future to support fancy gl viewport features, and I'd probably be able to fix this more comprehensively as part of that work, so I went for the safe/minimal option, which was number 3. |
https://github.com/ImageEngine/cortex/blob/master/python/IECoreMaya/FnProceduralHolder.py#L88 Deferred IECoreGL::Renderers shouldn't make any GL calls at all (they execute procedurals in parallel, and those threads don't have a GL context). Unless testing shows a real problem then I think 2) is the better option... |
oh. Well that's nice then, innit... Any preferences about weather to put that in FnSceneShape.py or just put a const_cast( this )->glScene(); directly into ScneShapeInterface.cpp? |
If it doesn't cause problems, then I'd go for the .cpp because it fixes the issue as close to the root cause as possible... |
there we go then. I'm a lot less worried about it if we were already doing it in the proc. |
Can you rebase squash those 2 commits? |
SceneShapeInterface::componentNames() and SceneShapeInterface::selectionName() now automatically refresh the gl scene when they're called, in case they get called before a maya viewport refresh has happened
there ya go |
Scene shape component names
Added an ensureComponentNames() method to FnSceneShape, for forcing the computation of the component names if the shape hasn't been drawn in the gl viewport. Also added component names unit test.