-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathuniverse.py
56 lines (46 loc) · 1.78 KB
/
universe.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
# Copyright Hugo Aboud, vanous
#
# This file is part of BlenderDMX.
#
# BlenderDMX is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# BlenderDMX is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
from bpy.props import EnumProperty, IntProperty, StringProperty
from bpy.types import PropertyGroup
network_options_list = (
("BLENDERDMX", "BlenderDMX", "Set DMX buffer from the Programmer"),
("ARTNET", "ArtNet", "Read DMX buffer from ArtNet"),
("sACN", "sACN", "Read DMX buffer from sACN"),
)
class DMX_Universe(PropertyGroup):
id: IntProperty(name="ID", description="Number of the universe", default=0)
name: StringProperty(
name="Name", description="Name of the universe", default="Universe 0"
)
input: EnumProperty(
name="Input",
description="Input source of the universe",
default="BLENDERDMX",
items=network_options_list,
)
input_settings: StringProperty(default="Input Settings")
@staticmethod
def add(dmx, id, name):
dmx.universes.add()
universe = dmx.universes[-1]
universe.id = id
universe.name = name
return universe
@staticmethod
def remove(dmx, i):
if i >= 0 and i < len(dmx.universes):
dmx.universes.remove(i)