Skip to content

Using a compositing setup from a .blend file #781

Answered by cornerfarmer
stevenpclark asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, blender does not allow importing a whole node graph from a blend file. However, it allows importing node groups.
So in your blend file, you first have to group all the nodes you want to export via ctrl + g (see https://docs.blender.org/manual/en/latest/interface/controls/nodes/groups.html#make-group).

Then in blenderproc, you can import node groups from a blend file via:

bproc.loader.load_blend("my_file.blend", data_blocks=["node_groups"])

Then you can create a new instance of that node group via:

import bpy
bpy.context.scene.use_nodes = True
nodes = bpy.context.scene.node_tree.nodes
links = bpy.context.scene.node_tree.links
node = nodes.new("CompositorNodeGroup")
node.node…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stevenpclark
Comment options

Answer selected by stevenpclark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants