-
Notifications
You must be signed in to change notification settings - Fork 9
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
Comments
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? |
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) |
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. |
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 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. |
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.
The text was updated successfully, but these errors were encountered: