i'm trying to make a little script to change all file outputs node in my compositing scene, relatively to my file output render directory.
For example, if i render something in /Render/Combined/Combined_#### i want the file outputs nodes to create some folders in /Render/
So far, i've got this :
import bpy
import os
# Get absolute path:
filepath = bpy.context.scene.render.filepath
absolutepath = bpy.path.abspath(filepath)
# set the path for all file output nodes:
for scene in bpy.data.scenes:
for node in scene.node_tree.nodes:
if node.type == 'OUTPUT_FILE':
node.base_path = absolutepath
And it works, but i can't find a way to get to the "superior" directory... Is someone out here have some answers ? thank you very much !