nodebpy 0.2.0__py3-none-any.whl → 0.3.0__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 CHANGED
@@ -1,75 +1,71 @@
1
+
1
2
  import bpy
2
3
 
3
4
  from ..builder import NodeBuilder, SocketLinker
4
- from .types import TYPE_INPUT_COLOR, TYPE_INPUT_VALUE
5
-
5
+ from ..types import (
6
+ TYPE_INPUT_COLOR,
7
+ TYPE_INPUT_VALUE,
8
+ )
6
9
 
7
- class RGBCurves(NodeBuilder):
8
- """Apply color corrections for each color channel"""
9
10
 
10
- # TODO: add support for custom curves along with FloatCurve
11
+ class Gamma(NodeBuilder):
12
+ """Apply a gamma correction"""
11
13
 
12
- name = "ShaderNodeRGBCurve"
13
- node: bpy.types.ShaderNodeRGBCurve
14
+ _bl_idname = "ShaderNodeGamma"
15
+ node: bpy.types.ShaderNodeGamma
14
16
 
15
17
  def __init__(
16
18
  self,
17
- factor: TYPE_INPUT_VALUE = 1.0,
18
- color: TYPE_INPUT_COLOR = (1.0, 1.0, 1.0, 1.0),
19
- **kwargs,
19
+ color: TYPE_INPUT_COLOR = None,
20
+ gamma: TYPE_INPUT_VALUE = 1.0,
20
21
  ):
21
22
  super().__init__()
22
- key_args = {"Factor": factor, "Color": color}
23
- key_args.update(kwargs)
23
+ key_args = {"Color": color, "Gamma": gamma}
24
24
 
25
25
  self._establish_links(**key_args)
26
26
 
27
- @property
28
- def i_factor(self) -> SocketLinker:
29
- """Input socket: Factor"""
30
- return self._input("Fac")
31
-
32
27
  @property
33
28
  def i_color(self) -> SocketLinker:
34
29
  """Input socket: Color"""
35
30
  return self._input("Color")
36
31
 
32
+ @property
33
+ def i_gamma(self) -> SocketLinker:
34
+ """Input socket: Gamma"""
35
+ return self._input("Gamma")
36
+
37
37
  @property
38
38
  def o_color(self) -> SocketLinker:
39
39
  """Output socket: Color"""
40
40
  return self._output("Color")
41
41
 
42
42
 
43
- class Gamma(NodeBuilder):
44
- """Apply a gamma correction"""
43
+ class RgbCurves(NodeBuilder):
44
+ """Apply color corrections for each color channel"""
45
45
 
46
- name = "ShaderNodeGamma"
47
- node: bpy.types.ShaderNodeGamma
46
+ _bl_idname = "ShaderNodeRGBCurve"
47
+ node: bpy.types.ShaderNodeRGBCurve
48
48
 
49
49
  def __init__(
50
50
  self,
51
- color: TYPE_INPUT_COLOR = (
52
- 1.0,
53
- 1.0,
54
- 1.0,
55
- 1.0,
56
- ),
57
- gamma: TYPE_INPUT_VALUE = 1.0,
51
+ fac: TYPE_INPUT_VALUE = 1.0,
52
+ color: TYPE_INPUT_COLOR = None,
58
53
  ):
59
54
  super().__init__()
60
- key_args = {"Color": color, "Gamma": gamma}
55
+ key_args = {"Fac": fac, "Color": color}
56
+
61
57
  self._establish_links(**key_args)
62
58
 
59
+ @property
60
+ def i_fac(self) -> SocketLinker:
61
+ """Input socket: Factor"""
62
+ return self._input("Fac")
63
+
63
64
  @property
64
65
  def i_color(self) -> SocketLinker:
65
66
  """Input socket: Color"""
66
67
  return self._input("Color")
67
68
 
68
- @property
69
- def i_gamma(self) -> SocketLinker:
70
- """Input socket: Gamma"""
71
- return self._input("Gamma")
72
-
73
69
  @property
74
70
  def o_color(self) -> SocketLinker:
75
71
  """Output socket: Color"""