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

Static default root #6

Open
mottosso opened this issue Oct 6, 2016 · 4 comments
Open

Static default root #6

mottosso opened this issue Oct 6, 2016 · 4 comments

Comments

@mottosso
Copy link
Member

mottosso commented Oct 6, 2016

Description

The root directory governs (1) where assets are published and (2) where assets are loaded from.

By default, the root directory is set to the current project directory, but doesn't update when the user changes the project.

This causes assets to be published into and loaded from the wrong location.

@BigRoy
Copy link
Member

BigRoy commented Oct 6, 2016

This could be resolved by using a load and save callback that automatically identifies whether the new location is still within the old project. If it is not it can update the "set project" to the new one.

Or are you looking for different solutions?

@mottosso
Copy link
Member Author

mottosso commented Oct 6, 2016

It could, and I was doing exactly that, until I realised that it doesn't work since the root directory isn't necessarily the Maya project directory. That's just a default, and a pretty inflexible one at that. It's meant to be set to wherever you host assets.

For completeness, here's how I was doing that.

from maya import cmds
from pyblish_starter import api

def on_setproject():
    api.register_root(...)

cmds.scriptJob(event=["workspaceChanged", on_setproject])
cmds.workspace("C:/my/project", openWorkspace=True)

@BigRoy
Copy link
Member

BigRoy commented Oct 6, 2016

Ah, but that is on workspace changed. That would still require the artist to actually update manually by "setting project"? Why not do it on scene save/load (whenever the current path changes) and you identify automatically what is actually the project root?

Either way, you'd need to have a means of identifying what is the project.
You could maybe tag it using cquery?

@mottosso
Copy link
Member Author

mottosso commented Oct 6, 2016

Wait, I think you're misunderstanding.

Starter has the notion of a "root". The root directory could be anywhere, and isn't related to Maya. The command register_root enables the user to specify this directory, and it just so happens that by calling pyblish_starter.install() passing pyblish_starter.maya it sets this for you as the currently active project directory.

This isn't really the place to discuss it, this is more me documenting limitations for others to read about and to inspire how and why one would build it differently. Starter was never meant to be the most optimal implementation of a pipeline, but the simplest, and the things you suggest are good and practical solutions, but also takes away from how easily the implementation is explained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants