Guest User

Untitled

a guest
Mar 30th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import bpy
  2. import colorsys
  3.  
  4. rgb = bpy.data.materials["Material"].node_tree.nodes["Principled BSDF"].inputs[0].default_value
  5. hsv = colorsys.rgb_to_hsv(rgb[0], rgb[1], rgb[2])
  6. hue = hsv[0]
  7.  
  8. mid_point = 0.5
  9.  
  10. if hue < mid_point:
  11.     hue = hue + mid_point
  12. else:
  13.     hue = hue - mid_point
  14.  
  15. print(hue)
Advertisement
Add Comment
Please, Sign In to add comment