-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmisc_ot.py
51 lines (39 loc) · 1.61 KB
/
misc_ot.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
import bpy
from . properties import NTZEDGCRV_ignitproperties
from . import misc_functions
from bpy.props import (StringProperty, BoolProperty, IntProperty, FloatProperty, FloatVectorProperty, EnumProperty, PointerProperty)
from bpy.types import (Panel, Operator, AddonPreferences, PropertyGroup)
# -----------------------------------------------------------------------------
# Reset Settings
# -----------------------------------------------------------------------------
class NTZEDGCRV_OT_resetsettings(bpy.types.Operator):
"""Tooltip"""
bl_idname = "ntzedgcrv.resetsettings"
bl_label = "Neltulz - Edge Curve : Reset Setting(s)"
bl_description = "Resets setting(s)"
settingToReset : StringProperty(
name="Setting to Reset",
description='Name of the setting to be reset',
default = "NONE"
)
@classmethod
def poll(cls, context):
return True
def execute(self, context):
scn = context.scene
defaultSettingsDict = {
"numSegmentsSlider" : 1,
"useEdgeFlowCheckbox" : True,
"tensionSlider" : 180,
"numIterationsSlider" : 4,
"minAngleSlider" : 0,
}
if self.settingToReset == "ALL":
for key in defaultSettingsDict:
setattr(scn.ntzedgcrv, key, defaultSettingsDict[key])
elif self.settingToReset != "NONE":
key = self.settingToReset
setattr(scn.ntzedgcrv, key, defaultSettingsDict[key])
return {'FINISHED'}
# END execute()
# END Operator()