-
Notifications
You must be signed in to change notification settings - Fork 1
/
properties.py
41 lines (34 loc) · 1.38 KB
/
properties.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
import bpy
type_property= bpy.props.EnumProperty(
name="Type",
# Warnings meant for end user, not to alter within UI
description="PlotRock Component Type (DO NOT CHANGE)",
default = "NONE",
items=(
("plot", "Plot", "DO NOT CHANGE", 1),
("ROOT", "Root", "DO NOT CHANGE", 2),
("NONE", "None", "DO NOT CHANGE", 3)
)
)
class RootSettings(bpy.types.PropertyGroup):
use_min_x: bpy.props.BoolProperty()
use_min_y: bpy.props.BoolProperty()
min_x: bpy.props.FloatProperty()
min_y: bpy.props.FloatProperty()
max_x: bpy.props.FloatProperty()
max_y: bpy.props.FloatProperty()
x_axis_label: bpy.props.PointerProperty(type=bpy.types.Object)
y_axis_label: bpy.props.PointerProperty(type=bpy.types.Object)
csv_file = bpy.props.PointerProperty(type=bpy.types.Text)
def register():
bpy.utils.register_class(RootSettings)
bpy.types.Curve.plotrock_type = type_property
bpy.types.Object.plotrock_type = type_property
bpy.types.Curve.plotrock_csv = csv_file
bpy.types.Object.plotrock_settings = bpy.props.PointerProperty(type=RootSettings)
def unregister():
del bpy.types.Curve.plotrock_type
del bpy.types.Object.plotrock_type
del bpy.types.Curve.plotrock_csv
del bpy.types.Object.plotrock_settings
bpy.utils.unregister_class(RootSettings)