Edit last commit

Better check if the property is set in case others want to use this
property w/o SKIP_SAVE set.
This commit is contained in:
2018-05-31 12:54:44 +02:00
parent 46508430f8
commit d41bf6b8e8

View File

@@ -62,7 +62,6 @@ rna_space_type_prop = EnumProperty(
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
),
default='EMPTY',
options={'SKIP_SAVE'},
)
@@ -2360,8 +2359,10 @@ class WM_OT_tool_set_by_name(Operator):
activate_by_name,
activate_by_name_or_cycle,
)
space_type = self.space_type
if space_type == 'EMPTY':
if self.properties.is_property_set("space_type"):
space_type = self.space_type
else:
space_type = context.space_data.type
fn = activate_by_name_or_cycle if self.cycle else activate_by_name