Setting up relative file paths

Okay guys, let's see who knows the answer to this one.  It's a little technical maybe.

I'm trying to set up Relative Paths -  well, more specifically, I'm trying to set up a render output folder as a relative path in my startup file, so that Blender will automatically create a new dedicated "render" output folder for each project in that project's own folder.

This is how I like to set up a project folder: 

This would be the main project folder.  The blend subfolder would hold all of the .blend files of course; ref would contain any reference images used for the project, render is the project's output folder, and tex contains any textures the project uses (decals, PBR textures, HDRI, etc).  I like to keep the .blend files in a subfolder rather than the main project folder because I make iterative saves which means even simple projects can have looooots of .blend files and I like to keep clutter down.

Up until now I've always just manually created all these folders and whenever it was time to output, for every single project I'd go into the output settings and use the file browser to dig and find the right render subfolder and point to it.  But I'm setting up a new startup file, and I figure if the option is there to have Blender just already be pointing to the correct render output folder from the start, I want to use that and save a little bit of time.

But here's the thing - how do I do that, while using my preferred folder setup?  In the output settings, you set a relative output path by starting the path with // ....so, putting "//render/ " there would automagically create a "render" subfolder in whatever folder the currently open .blend file is in, and would save the output in that.  But I don't want that - that would create a render subfolder inside the blend subfolder.  I want Blender to always go UP one directory level and create (or just use) the render output folder there.  How do I make that happen, or is that simply not possible?

  • Jake Korosi(jakeblended) replied

    Okay, thanks to this video I've.....partially? discovered the answer.  Python recognizes two decimals ( .. ) as an instruction to go up one directory in a relative filepath.  So, using the // to turn on the relative pathing, the way you'd type this in the output settings is 

    //../render/render_

    This should make Blender go UP one directory (out of the blend subfolder and into the main project folder), then look for or create a new folder called "render", and then output the file there (specifically named "render_", plus whatever number Blender chooses to append to the file name).  

    This works PERFECTLY whenever I render an animation, so yay!  It does not work at all if I'm rendering a still image, though.  Whether it's a viewport render or an actual render, it doesn't save anything until in the Image Editor you manually go to Image>Save or >Save As.  And when the file browser pops up, it does not respect the path setting in the Output Settings panel at all, it starts me off in the blend subfolder where the project file is.  

    I guess there's just no way around this?

  • Chris Lee(infin8eye) replied

    You can just render a single image as a 1 frame animation which will get the job done.
    Or you can set up a the compositor to output your render files to the correct place automatically. Once set up you can save that in your default starting file with relative paths, so that it always starts you off with the suitable basic file structure comp.