Guest User

Untitled

a guest
May 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. def append_vec_math_node(nodes, operation='NORMALIZE', name=None, a_name='A', b_name='B', output_a_name='Vector', output_b_name='Fac', a_default=(0.57735, 0.57735, 0.57735), b_default=(0.57735, 0.57735, 0.57735), parent=None, custom_color=None):
  2. vec_math = nodes.new('ShaderNodeVectorMath')
  3. vec_math.operation = operation
  4. vec_math.parent = parent
  5.  
  6. if name:
  7. vec_math.label = vec_math.name = name
  8. else:
  9. vec_math.label = vec_math.name = operation.replace('_', ' ').capitalize()
  10.  
  11. if custom_color:
  12. vec_math.use_custom_color = True
  13. vec_math.color = custom_color
  14.  
  15. vec_math.inputs[0].name = a_name
  16. vec_math.inputs[0].default_value = a_default
  17.  
  18. vec_math.inputs[1].name = b_name
  19. vec_math.inputs[1].default_value = b_default
  20.  
  21. vec_math.outputs[0].name = output_a_name
  22. vec_math.outputs[1].name = output_b_name
  23.  
  24. return vec_math
Add Comment
Please, Sign In to add comment