@@ -124,9 +124,6 @@ def add_driver_for_multiply(node, collection_index, shot_index, data_path):
124124 value_node .outputs [0 ].default_value = 1.0
125125 value_node .name = "ValueEmissionNode"
126126
127- if collection :
128- add_driver (value_node , 0 , bpy .context .scene , 'SCENE' , f"Omni_Collections[{ collection_index } ].emission_value" , True )
129-
130127 multiply_emission_node = nodes .new ("ShaderNodeMath" )
131128 multiply_emission_node .location = (400.0 , bsdf_vertical_position - 500 )
132129 multiply_emission_node .operation = 'MULTIPLY'
@@ -137,10 +134,14 @@ def add_driver_for_multiply(node, collection_index, shot_index, data_path):
137134 mix_rgb_emission_node .hide = True
138135 mix_rgb_emission_node .name = "MixRGBEmissionNode"
139136
137+ if collection :
138+ add_driver (value_node , 0 , bpy .context .scene , 'SCENE' , f"Omni_Collections[{ collection_index } ].emission_value" , True )
139+ add_driver (mix_rgb_emission_node , 0 , bpy .context .scene , 'SCENE' , f"Omni_Collections[{ collection_index } ].mix_rgb_emission_input" )
140+
140141 create_link (material .node_tree , color_ramp_emission_node , 0 , multiply_emission_node , 0 )
141142 create_link (material .node_tree , value_node , 0 , multiply_emission_node , 1 )
142- create_link (material .node_tree , multiply_emission_node , 0 , mix_rgb_emission_node , 1 )
143- create_link (material .node_tree , value_node , 0 , mix_rgb_emission_node , 2 )
143+ create_link (material .node_tree , multiply_emission_node , 0 , mix_rgb_emission_node , 2 )
144+ create_link (material .node_tree , value_node , 0 , mix_rgb_emission_node , 1 )
144145 else :
145146 # Update positions if nodes already exist
146147 color_ramp_emission_node = find_node (nodes , 'VALTORGB' , 'ColorRampEmissionNode' )
0 commit comments