Repository navigation
Expand file tree
/
Copy pathBESettings.py
More file actions
102 lines (72 loc) · 2.56 KB
/
Copy pathBESettings.py
File metadata and controls
102 lines (72 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
from enum import Enum
import os
UV_NAMES = {"uv_map", "uv_map2", "uv_map3", "uv_map4", "uv_map5",
"uv_map6", "uv_map7", "uv_map8", "uv_map9", "uv_map10"}
BENGINE_INSTANCE = "be_instance"
BENGINE_MATERIAL = "be_material"
BENGINE_COLOR = "be_color"
BENGINE_NORMAL = "be_normal"
TYPE_GN = "GeometryNodeTree"
TYPE_SV = "SverchCustomTreeType"
TYPE_SV_SCRIPT = "SvScriptNodeLite"
OUTPUT_JSON_NAME = "BlenderOutputs.json"
# Out Variables
KEYPARAM_BE_INSTANCE = "BE_Instance"
CUSTOM_ATTRIBUTES = "CustomAttributes"
CUSTOM_FLOAT_ATTRIBS = "CustomFloatAttributes"
CUSTOM_VECTOR_ATTRIBS = "CustomVectorAttributes"
CUSTOM_COLOR_ATTRIBS = "CustomColorAttributes"
class EngineType(Enum):
Unity = 0
Unreal = 1
class RunBlenderType(Enum):
RunBlender = 0
RunNetwork = 1
class RunNodesType(Enum):
UpdateNodes = 0
RunNodes = 1
# Sverchok Constants
class SVConstants:
SV_INPUT_BOOL = "BEBoolean.py"
SV_INPUT_COLL = "BECollection.py"
SV_INPUT_COLOR = "BEColor.py"
SV_INPUT_FLOAT = "BEFloat.py"
SV_INPUT_INT = "BEInteger.py"
SV_INPUT_OBJ = "BEObject.py"
SV_INPUT_STR = "BEString.py"
SV_INPUT_VEC = "BEVector.py"
SV_Inputs = (SV_INPUT_BOOL, SV_INPUT_COLL, SV_INPUT_COLOR,
SV_INPUT_FLOAT, SV_INPUT_INT, SV_INPUT_OBJ,
SV_INPUT_STR, SV_INPUT_VEC)
SV_OUTPUT_OBJ = "BEObjectsOutput.py"
class BaseStuff:
section = "/NodeTree/"
blendfile = ""
blendfolder = ""
node_sys_name = ""
blendfile_basename = ""
blendfile_name = ""
filepath = ""
directory = ""
filename = ""
engine_type: EngineType
def __init__(self, be_paths: dict):
self.blendfile = be_paths["BlendFile"]
self.blendfolder = be_paths["BlendFolder"]
if not self.blendfolder.endswith('/'):
self.blendfolder = self.blendfolder + "/"
self.node_sys_name = be_paths["NodeSysName"]
# blend file name
self.blendfile_basename = os.path.basename(self.blendfile)
self.blendfile_name = os.path.splitext(self.blendfile_basename)[0]
# Load GN Paths
self.filepath = self.blendfile + self.section + self.node_sys_name
self.directory = self.blendfile + self.section
self.filename = self.node_sys_name
self.engine_type = EngineType[be_paths["BEngineType"]]
# Run Nodes Type
self.run_type = be_paths["RunNodesType"]
if RunNodesType.RunNodes._name_ == self.run_type:
self.run_type = RunNodesType.RunNodes
else:
self.run_type = RunNodesType.UpdateNodes