Cleanup: avoid using instance to get enum

This commit is contained in:
Campbell Barton
2018-11-05 13:54:43 +11:00
parent 25a9816c30
commit 8fcc04edce

View File

@@ -95,11 +95,11 @@ def generate_from_brushes_tool_slots_ex(
def generate_from_enum_ex(
context, *,
icon_prefix,
data,
type,
attr,
):
tool_defs = []
for enum in data.rna_type.properties[attr].enum_items_static:
for enum in type.bl_rna.properties[attr].enum_items_static:
name = enum.name
identifier = enum.identifier
tool_defs.append(
@@ -1006,7 +1006,7 @@ class _defs_particle:
return generate_from_enum_ex(
context,
icon_prefix="brush.particle.",
data=context.tool_settings.particle_edit,
type=bpy.types.ParticleEdit,
attr="tool",
)