@@ -303,7 +303,7 @@ def color_ramp_settings(node, file: TextIO, inner: str, node_var: str):
303303 file .write ((f"{ inner } { element_var } .alpha = "
304304 f"{ element .alpha } \n " ))
305305 color_str = vec4_to_py_str (element .color )
306- file .write ((f"{ element_var } .color = { color_str } \n \n " ))
306+ file .write ((f"{ inner } { element_var } .color = { color_str } \n \n " ))
307307
308308def curve_node_settings (node , file : TextIO , inner : str , node_var : str ):
309309 """
@@ -318,37 +318,35 @@ def curve_node_settings(node, file: TextIO, inner: str, node_var: str):
318318
319319 #mapping settings
320320 file .write (f"{ inner } #mapping settings\n " )
321- mapping = f"{ inner } { node_var } .mapping"
321+ mapping_var = f"{ inner } { node_var } .mapping"
322322
323323 #extend
324324 extend = enum_to_py_str (node .mapping .extend )
325- file .write (f"{ mapping } .extend = { extend } \n " )
325+ file .write (f"{ mapping_var } .extend = { extend } \n " )
326326 #tone
327327 tone = enum_to_py_str (node .mapping .tone )
328- file .write (f"{ mapping } .tone = { tone } \n " )
328+ file .write (f"{ mapping_var } .tone = { tone } \n " )
329329
330330 #black level
331- b_lvl = node .mapping .black_level
332- b_lvl_str = f"({ b_lvl [0 ]} , { b_lvl [1 ]} , { b_lvl [2 ]} )"
333- file .write ((f"{ mapping } .black_level = { b_lvl_str } \n " ))
331+ b_lvl_str = vec3_to_py_str (node .mapping .black_level )
332+ file .write ((f"{ mapping_var } .black_level = { b_lvl_str } \n " ))
334333 #white level
335- w_lvl = node .mapping .white_level
336- w_lvl_str = f"({ w_lvl [0 ]} , { w_lvl [1 ]} , { w_lvl [2 ]} )"
337- file .write ((f"{ mapping } .white_level = { w_lvl_str } \n " ))
334+ w_lvl_str = vec3_to_py_str (node .mapping .white_level )
335+ file .write ((f"{ mapping_var } .white_level = { w_lvl_str } \n " ))
338336
339337 #minima and maxima
340338 min_x = node .mapping .clip_min_x
341- file .write (f"{ mapping } .clip_min_x = { min_x } \n " )
339+ file .write (f"{ mapping_var } .clip_min_x = { min_x } \n " )
342340 min_y = node .mapping .clip_min_y
343- file .write (f"{ mapping } .clip_min_y = { min_y } \n " )
341+ file .write (f"{ mapping_var } .clip_min_y = { min_y } \n " )
344342 max_x = node .mapping .clip_max_x
345- file .write (f"{ mapping } .clip_max_x = { max_x } \n " )
343+ file .write (f"{ mapping_var } .clip_max_x = { max_x } \n " )
346344 max_y = node .mapping .clip_max_y
347- file .write (f"{ mapping } .clip_max_y = { max_y } \n " )
345+ file .write (f"{ mapping_var } .clip_max_y = { max_y } \n " )
348346
349347 #use_clip
350348 use_clip = node .mapping .use_clip
351- file .write (f"{ mapping } .use_clip = { use_clip } \n " )
349+ file .write (f"{ mapping_var } .use_clip = { use_clip } \n " )
352350
353351 #create curves
354352 for i , curve in enumerate (node .mapping .curves ):
@@ -371,7 +369,7 @@ def curve_node_settings(node, file: TextIO, inner: str, node_var: str):
371369
372370 #update curve
373371 file .write (f"{ inner } #update curve after changes\n " )
374- file .write (f"{ mapping } .update()\n " )
372+ file .write (f"{ mapping_var } .update()\n " )
375373
376374def set_input_defaults (node , file : TextIO , inner : str , node_var : str ,
377375 addon_dir : str ):
0 commit comments