forked from hlorus/CAD_Sketcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_diameter.py
32 lines (23 loc) · 845 Bytes
/
add_diameter.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
import logging
from bpy.types import Operator
from bpy.props import FloatProperty, BoolProperty
from ..declarations import Operators
from ..stateful_operator.utilities.register import register_stateops_factory
from .base_constraint import GenericConstraintOp
logger = logging.getLogger(__name__)
class VIEW3D_OT_slvs_add_diameter(Operator, GenericConstraintOp):
"""Add a diameter constraint"""
bl_idname = Operators.AddDiameter
bl_label = "Diameter"
bl_options = {"UNDO", "REGISTER"}
# Either Radius or Diameter
value: FloatProperty(
name="Size",
subtype="DISTANCE",
unit="LENGTH",
precision=5,
options={"SKIP_SAVE"},
)
setting: BoolProperty(name="Use Radius")
type = "DIAMETER"
register, unregister = register_stateops_factory((VIEW3D_OT_slvs_add_diameter,))