-
Notifications
You must be signed in to change notification settings - Fork 12
/
keys.py
172 lines (156 loc) · 5.25 KB
/
keys.py
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
from typing import Any
import bpy
from . import operators
streamingTypeItems = set()
def add_streaming_type_ndi(items):
items.add(("NDI", "NDI", "Use NDI for streaming", "NONE", 1))
def add_streaming_type_spout(items):
items.add(("SPOUT", "Spout / Syphon", "Use Spout (for Windows) or Syphon (for OSX) for streaming", "NONE", 0))
class TEXS_PG_image_texshare_streaming_type(bpy.types.PropertyGroup):
# Define a StringProperty for the filepath
streaming_type : bpy.props.EnumProperty(
name = "stream type",
items = streamingTypeItems
)
class TEXS_PG_image_texshare_settings(bpy.types.PropertyGroup):
#key_path = bpy.props.StringProperty(name="Key", default="Unknown")
enable : bpy.props.BoolProperty(
name="Enable",
description = "Enables texture sharing",
default=False,
update=operators.texshare_receive
)
has_started : bpy.props.BoolProperty(
name = "hasstarted",
default = 0,
description = "Inidicates if sharing has been activated"
)
is_running : bpy.props.BoolProperty(
name = "isrunning",
default = 0,
description = "Inidicates if sharing is active"
)
is_flipped : bpy.props.BoolProperty(
name = "isflipped",
default = 0,
description = "Inidicates if the texture is flipped when sharing is active"
)
name : bpy.props.StringProperty(
name="Name",
default="TextureReceiver"
)
texs_server : bpy.props.StringProperty(
name = "Server",
default="Unkown"
)
texs_image : bpy.props.PointerProperty(
name="Image",
type=bpy.types.Image
)
ui_expanded : bpy.props.BoolProperty(
name="Expanded",
default=True
)
dbID : bpy.props.StringProperty(
name ="database ID",
default= "off",
description = "referenceID for database"
)
streaming_type : bpy.props.StringProperty(
name = "streaming_type",
default = "SPOUT",
description = "streaming type"
)
refresh_rate : bpy.props.IntProperty(
name = "frame_refresh_rate",
default = 100,
description = "Refresh rate for the incomming frames in milliseconds"
)
class TEXS_PG_camera_texshare_settings(bpy.types.PropertyGroup):
streaming_type : bpy.props.EnumProperty(
name = "streaming_type",
items = streamingTypeItems
)
enable : bpy.props.BoolProperty(
name = "enable",
default = 0,
description = "Enables texture sharing",
update=operators.texshare_send
)
hasstarted : bpy.props.BoolProperty(
name = "hasstarted",
default = 0,
description = "Inidicates if sharing has been activated"
)
isrunning : bpy.props.BoolProperty(
name = "isrunning",
default = 0,
description = "Inidicates if sharing is active"
)
isflipped : bpy.props.BoolProperty(
name = "isflipped",
default = 0,
description = "Flips the outgoing texture when sharing is active"
)
backgroundTransparent : bpy.props.BoolProperty(
name = "backgroundTransparent",
default = 1,
description = "Renders the background transparent"
)
applyColorManagmentSettings : bpy.props.BoolProperty(
name = "applyColorManagmentSettings",
default = 1,
description = "Applies the current scene color management settings"
)
capture_width : bpy.props.IntProperty(
name = "Capture width",
default = 1280,
description = "Capture resolution width in pixels"
)
capture_height : bpy.props.IntProperty(
name = "Capture hight",
default = 720,
description = "Capture resolution height in pixels"
)
dbID : bpy.props.StringProperty(
name ="database ID",
default= "off",
description = "referenceID for database"
)
workspace : bpy.props.StringProperty(
name ="workspace",
default= "Layout",
description = "Workspace from which to use the Overlay and Shading properties"
)
scene : bpy.props.StringProperty(
name ="scene",
default= "Scene",
description = "Scene to render"
)
layer : bpy.props.StringProperty(
name ="layer",
default= "ViewLayer",
description = "Layer in Scene to render"
)
preview : bpy.props.BoolProperty(
name ="Preview",
default= 0,
description = "Show preview of shared texture inside viewport"
)
key_classes = (
TEXS_PG_image_texshare_settings,
TEXS_PG_camera_texshare_settings,
TEXS_PG_image_texshare_streaming_type
)
def register():
for cls in key_classes:
bpy.utils.register_class(cls)
bpy.types.Scene.TEXS_streaming_type = bpy.props.PointerProperty(type=TEXS_PG_image_texshare_streaming_type)
bpy.types.Scene.TEXS_imgs = bpy.props.CollectionProperty(type=TEXS_PG_image_texshare_settings)
bpy.types.Camera.TEXS_share = bpy.props.PointerProperty(type=TEXS_PG_camera_texshare_settings)
def unregister():
for cls in reversed(key_classes):
bpy.utils.unregister_class(cls)
del bpy.types.Scene.TEXS_imgs
del bpy.types.Scene.TEXS_streaming_type
del bpy.types.Camera.TEXS_share