Skip to content
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 cache previews #724

Merged
merged 16 commits into from
Jan 28, 2014
Merged

Scene cache previews #724

merged 16 commits into from
Jan 28, 2014

Conversation

johnhaddon
Copy link
Member

This adds the ability to preview scene caches in both the browser and view apps. The preview allows a camera to be added to the cache, tracking an element within it, to aid in previewing animation.

I've decided against adding a WitnessCamera node accessible to users for now. I'm not totally against the idea, but I think one thing it should provide would be the specification of where the parent for the camera is - and that's not really possible until we allow PathFilters to have inputs. PathFilter inputs are next up on the todo list though so once they're done I'll be happy to listen to arguments for making a variant of the _Camera node into something public.

I'm not particularly enamoured with the new node toolbars - one of my aims is to keep things free of on-screen clutter as much as possible, and they do feel quite cluttered. I'd like to have options for hiding and showing them dynamically in the future, and think about having smaller items in them with popup UIs for editing the details, rather than the current list-of-crap approach. I do think it's worthwhile introducing them even in this form though so we can start to use them and get them refined as we go. The only thing using them at this point is the scene cache preview.

aaf4c2d is worth discussing - when I committed it I believed I had totally irradicated the "invalid drawable" errors, but later discovered that still show up when toggling between fullscreen and non-fullscreen view. Currently I'm out of ideas for fixing that, having spent a good deal of time on it - it may be that we really just need Qt/OS X to get the root cause sorted. Given that, I'm not sure whether it's worth having this partial fix in or not - I'm totally open to removing it if people don't want the extra clutter in the code.

@andrewkaufman
Copy link
Contributor

I don't mind keeping aaf4c2d if it reduces at least some of the invalid drawable issues. Maybe you could reword the commit so it doesn't fix #396 though, and while you're at it, roll 292541f into the same commit. Also, this needs a rebase to auto-merge.

@andrewkaufman
Copy link
Contributor

It would be nice for previewing animation if the view/browser apps to set the frame range of their timeline based on the sample times in the file. I guess you don't really know a frame range from that though...

When running "gaffer test ModuleName", the other modules are no longer loaded. This can be useful when running a subset of the tests in an environment where GafferUI won't import due to the lack of an X connection (over ssh for instance).
This returns the current view, which allows its settings to be modified - they are exposed simply as plugs on the View class itself.
This would manifest itself as "invalid framebuffer" errors leaking into the IECoreGL and PyOpenGL code and being reported there, causing various forms of havoc.

Fixes GafferHQ#404.
I had hoped that this fix would make the previous commit unnecessary, but testing shows that they address different problems and both are needed. Additionally, although this fixes the initial "invalid drawable" messages on startup, they still appear later on when switching between fullscreen and not-fullscreen. This goes some way to addressing GafferHQ#396, but I suspect it'll be very hard to fix it completely without patching Qt in some way.
This makes it capable of showing more information than just the basic viewer it used before - IndexedIO and header previews for instance.
These are refactored out from the private Viewer toolbar class. Currently they are still only used to present plugs for the Views, but this is a step towards having toolbars for any of the standard nodes.
This is using the same method as is used in StandardNodeUI and CompoundPlugValueWidget. The method itself has flaws (although they're much more likely to be an issue for CompoundPlugValueWidget than for the toolbars), so I've added some more notes as to how we might be able to address them.

Also added workaround for labels having an unwanted width, and a todo for getting it fixed.
The later tabs are more specialised and therefore a better guess as to the most interesting for a given path.
@johnhaddon
Copy link
Member Author

Thanks for the comments - I've removed the "fixes #396", rolled those two commits together, added the frame range setting you suggested, and rebased it all on top of the current master.

@andrewkaufman
Copy link
Contributor

Hmm. I seem to be getting exceptions now.

gaffer browser /tmp

Traceback (most recent call last):
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/bin/gaffer.py", line 108, in <module>
    result = app.run()
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/Gaffer/Application.py", line 87, in run
    return self.__run( args )
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/Gaffer/Application.py", line 117, in __run
    return self._run( args )
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/apps/browser/browser-1.py", line 76, in _run
    browser = GafferUI.BrowserEditor( self.root()["scripts"]["script1"] )
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/GafferUI/BrowserEditor.py", line 69, in __init__
    self.__pathChooser = GafferUI.PathChooserWidget( Gaffer.DictPath( {}, "/" ), previewTypes=GafferUI.PathPreviewWidget.types() )
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/GafferUI/PathChooserWidget.py", line 89, in __init__
    self.__previewWidget = GafferUI.CompoundPathPreview( tmpPath, childTypes=previewTypes )
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/GafferUI/CompoundPathPreview.py", line 58, in __init__
    widget = GafferUI.PathPreviewWidget.create( type, path )
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/GafferUI/PathPreviewWidget.py", line 104, in create
    return cls.__namesToCreators[name]( path )
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/GafferSceneUI/SceneReaderPathPreview.py", line 63, in __init__
    self._updateFromPath()
  File "/home/andrewk/apps/gaffer/0.88.1dev/cent6.x86_64/cortex/8/gaffer/python/GafferSceneUI/SceneReaderPathPreview.py", line 80, in _updateFromPath
    scene = IECore.SharedSceneInterfaces.get( fileName )
RuntimeError: I/O Exception : 

This allows scene caches to be previewed in the browser and view apps. A node toolbar provides options for adding a camera to the scene and having it track a particular object.

Fixes GafferHQ#416 and fixes GafferHQ#636 by way of demonstrating how it can be done.
@johnhaddon
Copy link
Member Author

Gah. Thanks for spotting that - should be fixed now.

andrewkaufman added a commit that referenced this pull request Jan 28, 2014
@andrewkaufman andrewkaufman merged commit c47fcb8 into GafferHQ:master Jan 28, 2014
@johnhaddon johnhaddon deleted the pathPreviews branch January 31, 2014 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants