@@ -89,6 +89,20 @@ class ExporterPreferences(bpy.types.AddonPreferences):
8989 description = "The size of the Empty to display a Scale DOF as"
9090 )
9191
92+ switch_empty_type : EnumProperty (
93+ name = "Switch" ,
94+ description = "The Empty to display a Switch as" ,
95+ items = empty_enum_items ,
96+ default = "SPHERE" ,
97+ )
98+
99+ switch_empty_size : FloatProperty (
100+ default = 1.0 ,
101+ min = 0.01 ,
102+ name = "Size" ,
103+ description = "The size of the Empty to display a Switch as"
104+ )
105+
92106
93107 def draw (self , context ):
94108 layout = self .layout
@@ -98,7 +112,7 @@ def draw(self, context):
98112 box .prop (self , "copy_to_clipboard_command" , expand = True )
99113
100114 layout .separator ()
101- layout .label (text = "DOF Display " )
115+ layout .label (text = "DOF/Switch " )
102116 box = layout .box ()
103117 # Ajout de l'opérateur RefreshDofList ici
104118 box .operator ("bml.refresh_dof_switch_list" , icon = "FILE_REFRESH" , text = "Refresh DOF/Switch Lists" )
@@ -115,6 +129,10 @@ def draw(self, context):
115129 row .prop (self , "dof_scale_empty_type" )
116130 row .prop (self , "dof_scale_empty_size" )
117131
132+ row = box .row ()
133+ row .prop (self , "switch_empty_type" )
134+ row .prop (self , "switch_empty_size" )
135+
118136 box .operator (ApplyEmptyDisplaysToDofs .bl_idname , icon = "CHECKMARK" )
119137
120138 layout .separator ()
@@ -142,26 +160,23 @@ def execute(self, context):
142160 scale_empty = context .preferences .addons ["bms_blender_plugin" ].preferences .dof_scale_empty_type
143161 scale_empty_size = context .preferences .addons ["bms_blender_plugin" ].preferences .dof_scale_empty_size
144162
145- translate_empty = context .preferences .addons ["bms_blender_plugin" ].preferences .dof_translate_empty_type
146- scale_empty = context .preferences .addons ["bms_blender_plugin" ].preferences .dof_scale_empty_type
163+ switch_empty = context .preferences .addons ["bms_blender_plugin" ].preferences .switch_empty_type
164+ switch_empty_size = context .preferences .addons ["bms_blender_plugin" ].preferences .switch_empty_size
147165
148166 for obj in bpy .data .objects :
149167 if get_bml_type (obj ) == BlenderNodeType .DOF :
150168 if obj .dof_type == DofType .ROTATE .name :
151169 obj .empty_display_type = rotate_empty
152170 obj .empty_display_size = rotate_empty_size
153-
154171 elif obj .dof_type == DofType .TRANSLATE .name :
155172 obj .empty_display_type = translate_empty
156173 obj .empty_display_size = translate_empty_size
157-
158174 elif obj .dof_type == DofType .SCALE .name :
159175 obj .empty_display_type = scale_empty
160176 obj .empty_display_size = scale_empty_size
161- elif obj .dof_type == DofType .TRANSLATE .name :
162- obj .empty_display_type = translate_empty
163- elif obj .dof_type == DofType .SCALE .name :
164- obj .empty_display_type = scale_empty
177+ elif get_bml_type (obj ) == BlenderNodeType .SWITCH :
178+ obj .empty_display_type = switch_empty
179+ obj .empty_display_size = switch_empty_size
165180
166181 return {"FINISHED" }
167182
0 commit comments