nodebpy 0.1.1__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nodebpy/nodes/color.py ADDED
@@ -0,0 +1,72 @@
1
+
2
+ import bpy
3
+
4
+ from ..builder import NodeBuilder, SocketLinker
5
+ from ..types import (
6
+ TYPE_INPUT_COLOR,
7
+ TYPE_INPUT_VALUE,
8
+ )
9
+
10
+
11
+ class Gamma(NodeBuilder):
12
+ """Apply a gamma correction"""
13
+
14
+ _bl_idname = "ShaderNodeGamma"
15
+ node: bpy.types.ShaderNodeGamma
16
+
17
+ def __init__(
18
+ self,
19
+ color: TYPE_INPUT_COLOR = None,
20
+ gamma: TYPE_INPUT_VALUE = 1.0,
21
+ ):
22
+ super().__init__()
23
+ key_args = {"Color": color, "Gamma": gamma}
24
+
25
+ self._establish_links(**key_args)
26
+
27
+ @property
28
+ def i_color(self) -> SocketLinker:
29
+ """Input socket: Color"""
30
+ return self._input("Color")
31
+
32
+ @property
33
+ def i_gamma(self) -> SocketLinker:
34
+ """Input socket: Gamma"""
35
+ return self._input("Gamma")
36
+
37
+ @property
38
+ def o_color(self) -> SocketLinker:
39
+ """Output socket: Color"""
40
+ return self._output("Color")
41
+
42
+
43
+ class RgbCurves(NodeBuilder):
44
+ """Apply color corrections for each color channel"""
45
+
46
+ _bl_idname = "ShaderNodeRGBCurve"
47
+ node: bpy.types.ShaderNodeRGBCurve
48
+
49
+ def __init__(
50
+ self,
51
+ fac: TYPE_INPUT_VALUE = 1.0,
52
+ color: TYPE_INPUT_COLOR = None,
53
+ ):
54
+ super().__init__()
55
+ key_args = {"Fac": fac, "Color": color}
56
+
57
+ self._establish_links(**key_args)
58
+
59
+ @property
60
+ def i_fac(self) -> SocketLinker:
61
+ """Input socket: Factor"""
62
+ return self._input("Fac")
63
+
64
+ @property
65
+ def i_color(self) -> SocketLinker:
66
+ """Input socket: Color"""
67
+ return self._input("Color")
68
+
69
+ @property
70
+ def o_color(self) -> SocketLinker:
71
+ """Output socket: Color"""
72
+ return self._output("Color")