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.
@@ -0,0 +1,85 @@
1
+ from typing import Literal
2
+
3
+ import bpy
4
+
5
+ from ..builder import NodeBuilder
6
+
7
+
8
+ class Viewer(NodeBuilder):
9
+ """Display the input data in the Spreadsheet Editor"""
10
+
11
+ _bl_idname = "GeometryNodeViewer"
12
+ node: bpy.types.GeometryNodeViewer
13
+
14
+ def __init__(
15
+ self,
16
+ ui_shortcut: int = 0,
17
+ domain: Literal[
18
+ "AUTO", "POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"
19
+ ] = "AUTO",
20
+ ):
21
+ super().__init__()
22
+ key_args = {}
23
+ self.ui_shortcut = ui_shortcut
24
+ self.domain = domain
25
+ self._establish_links(**key_args)
26
+
27
+ @classmethod
28
+ def auto(cls) -> "Viewer":
29
+ """Create Viewer with operation 'Auto'."""
30
+ return cls(domain="AUTO")
31
+
32
+ @classmethod
33
+ def point(cls) -> "Viewer":
34
+ """Create Viewer with operation 'Point'."""
35
+ return cls(domain="POINT")
36
+
37
+ @classmethod
38
+ def edge(cls) -> "Viewer":
39
+ """Create Viewer with operation 'Edge'."""
40
+ return cls(domain="EDGE")
41
+
42
+ @classmethod
43
+ def face(cls) -> "Viewer":
44
+ """Create Viewer with operation 'Face'."""
45
+ return cls(domain="FACE")
46
+
47
+ @classmethod
48
+ def spline(cls) -> "Viewer":
49
+ """Create Viewer with operation 'Spline'."""
50
+ return cls(domain="CURVE")
51
+
52
+ @classmethod
53
+ def instance(cls) -> "Viewer":
54
+ """Create Viewer with operation 'Instance'."""
55
+ return cls(domain="INSTANCE")
56
+
57
+ @classmethod
58
+ def layer(cls) -> "Viewer":
59
+ """Create Viewer with operation 'Layer'."""
60
+ return cls(domain="LAYER")
61
+
62
+ @property
63
+ def ui_shortcut(self) -> int:
64
+ return self.node.ui_shortcut
65
+
66
+ @ui_shortcut.setter
67
+ def ui_shortcut(self, value: int):
68
+ self.node.ui_shortcut = value
69
+
70
+ @property
71
+ def domain(
72
+ self,
73
+ ) -> Literal[
74
+ "AUTO", "POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"
75
+ ]:
76
+ return self.node.domain
77
+
78
+ @domain.setter
79
+ def domain(
80
+ self,
81
+ value: Literal[
82
+ "AUTO", "POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"
83
+ ],
84
+ ):
85
+ self.node.domain = value