dreamworksanimation / usdmanager

USD Manager
http://www.usdmanager.org
Apache License 2.0
321 stars 60 forks source link

SUG: Point usdview at usdmanager #7

Closed rhaleblian closed 5 years ago

rhaleblian commented 5 years ago

@superfunc over here also thought it would be nice. That is, have a widget in usdview that opens the scene in usdmanager.

Now, getting fancy, send updates to usdview via an update message and maybe a temp file to simulate in-buffer preview without saving a file.

Of course, this is really a sug against usd to start.

mds-dwa commented 5 years ago

Pixar's talked about adding an option to launch usdmanager from usdview. I don't know if it's actually on the road map or just an idea, nor do I know if it would be a right-click option to open the current layer or something else like a top-level menu item.

In the meantime, it shouldn't be too hard to do a custom usdview plug-in to open the current stage in USD Manager. Everyone's deployment of USD packages is a bit different (you may or may not be using rez, for example), and your usdview plugins likely wouldn't be bundled with usdmanager itself. You'd probably have to build a command similar to this (this doesn't have the usdview PluginContainer logic, but you'd call something like this when that plugin menu item is triggered):

def launch_usdmanager(usdviewApi):
    from subprocess import Popen
    path = usdviewApi.stage.GetRootLayer().realPath
    cmd = "rez-env usdmanager -c \"usdmanager '{}'\"".format(path)
    Popen(cmd, shell=True)

I'd definitely recommend mentioning this on the usd project or usd-interest mailing list to get some traction on it.

mds-dwa commented 5 years ago

https://github.com/ColinKennedy/USD-Cookbook/tree/master/tricks/usdview_auto_reloader also shows an example usdview plugin that you selectively toggle on when you want to listen for changes to any layer in your current USD stage. I have something similar that essentially just calls this at a timed interval, if/when the timer is enabled:

Sdf.Layer.ReloadLayers([x for x in usdviewApi.stage.GetUsedLayers() if not x.anonymous])

The advantage of this usdview approach is that it doesn't require any changes to usdmanager and in fact works if changes to the USD layers come from any other application.

I'm going to close this out since I think these suggestions cover your requests, but really need to be implemented in Pixar's USD/usdview repository.