Save layer references relative to the graph - #126
enriquevelmai wants to merge 1 commit into
Conversation
Absolute reference paths are rewritten relative to the directory the layer is saved to, so a graph folder can be moved or shared without breaking its references. References that are already relative or start with an environment variable are left untouched, as are paths that cannot be made relative (another Windows drive). comp_overrides keys are remapped with the reference. Only the save data changes, never the live layer state.
|
I feel like this is a step up from default behavior. It still doesn't feel quite right to me. If im working in a "stock" NXT install I would hope layer references are made relative but only if they are relative like We also make good use of the NXT_ROOT_PATHS in nxt/plugins/file_fallbacks.py in our pipeline to allow user working directories that can have sparse checkouts and a branch based development merge back to production after a feature or fix is complete. I know this is technically plugin functionality, but if somehow there was a way for the relative pathing to make use of that feature, it would be much more useful for us. Maybe plugins should be able to provide absolute -> relative path resolve somehow? Simplest/shortest final relative path wins? |
|
@enriquevelmai and @michaelharmonart we will take a look. Thank you for the PR. Should get back to you soon. |
|
We currently have a working version with reference editor. We plan to push out updates that should solve this and other PR issues. We will check this PR against our latest version and respond here soon |
When a layer is saved, absolute reference paths are rewritten relative to the directory the layer is saved to (
./sub/graph.nxt,../shared/graph.nxt). References are already resolved relative to the parent layer on load, so this only makes the saved form portable: a graph folder can be moved, checked in or shared without every reference breaking.$GRAPHS/...) are left untouched.comp_overrideskeys are remapped together with the reference so mute/solo overrides stay attached.SpecLayerstate keeps whatever path it was given.Tests added in
test_layer.py.