So close yet so far (I think)
A function within an addon am creating is suppose to rename the file ouput using tokens. This is based on the Oscurart tools.
The projects consists of markers on every frame with different binded cameras. The rendered image name needs to consist of a Marker and Camera.
def replaceMarker (dummy):
global renderpath
#Set Tokens variables
cameraCURRENT = bpy.context.scene.camera.name
markerTIMELINE = []
for marker in bpy.context.scene.timeline_markers:
name = marker.name
markerTIMELINE.extend([name])
markerCURRENT = markerTIMELINE[bpy.context.scene.frame_current-1]
tokens = {
"$Marker":markerCURRENT,
"$Camera":cameraCURRENT
}
#Replace filename output
renderpath = bpy.context.scene.render.filepath
bpy.context.scene.render.filepath = renderpath.replace("$Marker",tokens["$Marker"]).replace("$Camera",tokens["$Camera"])
print(bpy.context.scene.render.filepath)
#Clear list to repeat sequence
markerTIMELINE.clear()
The function does not replace the marker and only uses one camera name.
Am I suppose to more this to the init.py? How can I call the function between every frame?
Thanks
EDIT Question to circumvent the issue, it is possible to access the Metadata in fileoutput and use it to rename the file?