Changing render output name in File Output Nodes ???

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

_patrice_
Posts: 6
Joined: Tue Feb 28, 2012 6:13 pm

Changing render output name in File Output Nodes ???

Postby _patrice_ » Sun Jul 29, 2012 3:21 pm

Hi,

I wrote a plugin for blender 2.57 and try now to fix the problems I have when running the plugin in blender 2.63.

In my old script I create some different file output nodes (image,depth,...) and render multiple views of a scene in a loop (not using the timeline) storing the different outputs with a increasing filename counter:

in 2.57 this works:

Code: Select all

 
nodes = bpy.data.scenes[0].node_tree.nodes
imgOutNode = nodes["File Output"]
depthOutNode = nodes["Depth_File_Output"]

for n in range(something):
fileindex = "%3.3i_" % (n)
imgOutNode.filepath = path.join(filepath,'images/',fileindex)
depthOutNode.filepath = path.join(filepath,'depth/',fileindex)


(This has rendered sequences: 000_Image0001.png, 001_Image0001.png,...)


But the .filepath property doesn't exist anymore in the node objects.

I found out that they now have the base_path proberty:

Code: Select all

fileindex = "%5.5i_" % (n)
imgOutNode.base_path = path.join(filepath,'images/')
depthOutNode.base_path = path.join(filepath,'depth/')



But I have no idea how to access now the output filename. How can I change for each output node the name similar to this:

Code: Select all

imgOutNode.secretFileName = fileindex
depthOutNode.secretFileName = fileindex


Hope my description is not that confusing and anyone can help me with this...!? :roll:

floww
Posts: 1
Joined: Fri Oct 12, 2012 11:31 am

Postby floww » Fri Oct 12, 2012 11:42 am

Hi,

you can set the name of the image via

[code]
imgOutNode.file_slots[0].path = "name_of_output_img"
[/code]

Hope that helps.

Regards, Flo


Return to “Python”

Who is online

Users browsing this forum: No registered users and 0 guests