Skip to content
Snippets Groups Projects

Resolve "Create Composites v2 - bitmap composites"

Merged Niki requested to merge 28-change-created-comps-to-bitmap into main
1 file
+ 4
5
Compare changes
  • Side-by-side
  • Inline
@@ -12,7 +12,7 @@ def set_composite_to_pass_through(session, comp):
if not attribute:
raise ValueError(f"No attribute {composite_attribute_keyword}")
attribute.set_value(1, "Pass Through")
attribute.set_value(1, "As Bitmap")
def handle_top_level_node_linking(session, selected_node, comp, next_node):
@@ -45,10 +45,10 @@ def handle_group_node_linking(session, scene, selected_node, comp, next_node):
parent_group = selected_node.parent_group()
mout = parent_group.multi_port_out
# Step 1: Link the selected node’s output to the multi-port out
# Link the selected node’s output to the multi-port out
selected_node.ports_out[0].link(mout)
# Step 2: Create the multi-port out’s connection to the new composite
# Create the multi-port out’s connection to the new composite
idx = len(parent_group.ports_out) - 1 # Get the index of the new port on the group
parent_group.ports_out[idx].link(comp.ports_in[0])
@@ -66,7 +66,7 @@ def position_composite_near_group_or_port(session, composite_node, selected_node
"""
Position the new composite node close to the selected node's parent group or multi-port out. This function adjusts x-position dynamically to avoid overlap while keeping the nodes close to the group.
"""
# global _last_x_position_offset
parent_group = selected_node.parent_group()
# If the node is at the top level, position near the selected node
@@ -75,7 +75,6 @@ def position_composite_near_group_or_port(session, composite_node, selected_node
composite_node.position.y = selected_node.position.y + offset_y
else:
# Position near the parent group, ensuring no overlap
# _last_x_position_offset += offset_x
composite_node.position.x = parent_group.position.x
composite_node.position.y = parent_group.position.y + offset_y
Loading