getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
218 stars 48 forks source link

Workfiles API for Hosts #387

Closed BigRoy closed 5 years ago

BigRoy commented 5 years ago

It seems my branch is ahead or differs from main getavalon/core here and there so this PR might be a bit messy. To see the clean changes that need to be made for this to actually work, see this PR: https://github.com/Colorbleed/core/pull/42

I will investigate the rest of the differences here and comment on this PR


Implement Workfiles API

This implements a Workfiles API for the hosts.

Example implementations

References

BigRoy commented 5 years ago

See files changed overview for a more readable overview of my comments on the "other" commits that are in this branch. Sorry for the mess. :)

BigRoy commented 5 years ago

About the conflicting files

avalon/houdini/pipeline.py
avalon/maya/pipeline.py

So the conflict in this PR seems to be on a change from self.name to self.data["subset"] in the creation of instances for the node names - which has been discussed that self.name was actually the preferred pick here

To resolve the conflict thus the best pick would be go for self.name - which is interesting to see that it wasn't actually resolved in avalon/core (yet). Let's also make sure the Nuke and Fusion integration to that too while we're at it.

davidlatwe commented 5 years ago

To resolve the conflict thus the best pick would be go for self.name - which is interesting to see that it wasn't actually resolved in avalon/core (yet).

Oh, nooo.. I forgot this one :( Looks like if the conflict get resolved here and we are safe ? :thinking:

BigRoy commented 5 years ago

Fixed the conflicts as described above.

Looks like if the conflict get resolved here and we are safe ?

Yup! :)

BigRoy commented 5 years ago

@tokejepsen have you been able to play with this yet? :)

tokejepsen commented 5 years ago

Not yet :( Hope to get onto pipeline next week/month.

tokejepsen commented 5 years ago

Seems to work fine here. Only tested Maya though as I don't have Houdini or know Fusion.

Happy to merge this :)

BigRoy commented 5 years ago

@davidlatwe is this something you can test too? Just want to make sure things behave as everyone wants at this stage. :)

davidlatwe commented 5 years ago

Yes, for sure :) I was planning to do the test this weekend. I can test on Maya and Houdini tomorrow.

davidlatwe commented 5 years ago

Tested, working good on both Maya and Houdini :D

One thing though, I did not set any default_dirs for Houdini, so at first it gives me an error saying that path/to/houdini-workspace/scenes dir not exists, I think this worth be mentioned in workfile's README ? Or auto makedirs if not exists ?

BigRoy commented 5 years ago

One thing though, I did not set any default_dirs for Houdini, so at first it gives me an error saying that path/to/houdini-workspace/scenes dir not exists, I think this worth be mentioned in workfile's README ? Or auto makedirs if not exists ?

Ah - wait. That's definitely a good point. I'm wondering if there's a more customizable approach to this for a studio, without altering avalon core... any ideas? Maya has the workspace you can customize. But what would Houdini have? Or even Fusion, or Nuke? Should we have an environment variable for applications that don't have a default fallback for "workspace customization"?

tokejepsen commented 5 years ago

Maybe it should use the first entry in the default_dirs if it exists?

Could also have a workfiles_dir entry in the toml files?

BigRoy commented 5 years ago

Maybe it should use the first entry in the default_dirs if it exists? Could also have a workfiles_dir entry in the toml files?

I believe inside the Host the .toml file itself isn't readily accessible - or at least it's non-trivial. So maybe it's best to have like a AVALON_SCENEDIR kind of environment variable so that hosts that do not have their own workspace management that this scene dir name gets appended to the AVALON_WORKDIR path for work files to be saved into.

set AVALON_WORKDIR=houdini
set AVALON_SCENEDIR=scenes

Makes houdini/scenes. When AVALON_SCENEDIR is not set then Workfiles will operate directly in the root of the avalon workdir?

tokejepsen commented 5 years ago

Makes houdini/scenes. When AVALON_SCENEDIR is not set then Workfiles will operate directly in the root of the avalon workdir?

Sounds good to me.

davidlatwe commented 5 years ago

Sounds good to me, too :D

tokejepsen commented 5 years ago

Nobody wants to hit the merge button ? :)

@Bigroy are you happy to merge this?

BigRoy commented 5 years ago

Sorry, I'm a bit swamped with other things.

The only remainder is still: https://github.com/getavalon/core/pull/387#issuecomment-500879708 specifically the AVALON_SCENEDIR

BigRoy commented 5 years ago

Implemented AVALON_SCENEDIR to define the scenes directory for hosts that do not have their own mechanism. So Fusion and Houdini now fall back to using that variable. Maya still uses its own workspace mechanism to define where to save scene files.

It's important to note that when the scenes directory does not exist the Work Files tool will still fail to launch. When using a custom folder name in your own pipeline, please make sure the folder is created prior it, e.g. through the use of default_dirs in Application .toml files.

Also note that this is still the case:

Nuke is still missing its Workfiles API here.

@tokejepsen @davidlatwe - 👍 ?

davidlatwe commented 5 years ago

Looks nice ! Will have a test later today !

tokejepsen commented 5 years ago

How about we use AVALON_WORKDIR for all apps?

We could essentially get rid of the AVALON_SCENEDIR and just rely on a single environment variables for all apps.

BigRoy commented 5 years ago

How about we use AVALON_WORKDIR for all apps?

We could essentially get rid of the AVALON_SCENEDIR and just rely on a single environment variables for all apps.

That way one could never set the "root" folder in AVALON_WORKDIR where you might also save images/references/other content for a specific shot (in their own respective subfolders if you'd want). It really is the root of the asset's work directory... not necessarily where the scenes get saved.

So, what you are saying is to always save the scene files in the root of AVALON_WORKDIR - which I think wouldn't be the best way... And if we'd never have the "asset work root" then we'd miss out on that.

In a way, it's similar to Maya's workspaces like:

cmds.workspace(query=True, rootDirectory=True) == AVALON_WORKDIR
cmds.workspace(fileRuleEntry="scene") == AVALON_SCENEDIR
tokejepsen commented 5 years ago

Fair enough :) Haven't really got a good overview of this PR, so just throwing ideas on the table.

How about just unifying using AVALON_WORKDIR in all apps?

BigRoy commented 5 years ago

How about just unifying using AVALON_WORKDIR in all apps?

We could, but..

  1. I'm just afraid of backwards incompatibility for studios operating on Maya for which workfiles currently works as they'd expect since it relies on Maya's workspace system.
  2. Personal preference. ;) Just makes most sense to me to rely as much as possible on what's provided by the host.
tokejepsen commented 5 years ago

I'm just afraid of backwards incompatibility for studios operating on Maya for which workfiles currently works as they'd expect since it relies on Maya's workspace system.

Good point! Continue as is :)

BigRoy commented 5 years ago

@davidlatwe once you have tested it feel free to merge.

davidlatwe commented 5 years ago

I have tested in Houdini and Maya, and they both worked smoothly :D Merging this !