Home Youtube GitHub

Relative file paths in pre and post build scripts


#1

It would be nice to have the option to use relative file paths in the build scripts window. I often keep rig specific scripts in an adjacent folder to my guides folder and it would be nice to be able to rename that root folder for the rig without breaking the build script paths.

Maybe this is already possible and I’m not using build scripts correctly?

Cheers,
Lucas


#2

Hey Lucas, do you know about the MGEAR_SHIFTER_CUSTOMSTEP_PATH environment variable? Put that in your Maya.env and the custom steps are relative to that.

MGEAR_SHIFTER_CUSTOMSTEP_PATH = your/path/here


#3

Unless you meant relative to each separate rig. I don’t know that. I keep all my build scripts in a separate build/ directory.


#4

Ah did not know about the environment variable, it solves one of the problems I’ve ran into at work. Thanks for that tidbit!
On my own personal rig projects though it wouldn’t help as sometimes I send the guide file to someone else to work with and that, of course, breaks literal file paths.


#5

Another hack you could do is write a script that re-writes all your paths relative to the scene name.

preCustomStep and postCustomStep are just ‘|’ and ‘,’ separated string attributes on the guide. I had to write a script to write them as / paths to be cross-compatible on macOS.

name | path,name | path,name | path

Otherwise, it might just pay off to formalize your directory structure with your collaborators.

(Also sorry to hijack your feature request with temp hacks! hehe)