mirror of
https://github.com/blender/blender-addons.git
synced 2025-08-16 15:35:05 +00:00
Fix T54803: Materials Library VX: follow strict class naming
This commit is contained in:
@ -738,8 +738,7 @@ bpy.ops.wm.save_mainfile(filepath="%s", check_existing=False, compress=True)'''
|
||||
# Scene.matlib = PointerProperty(type = matlibProperties)
|
||||
|
||||
### MENUS
|
||||
class matlibLibsMenu(Menu):
|
||||
bl_idname = "matlib.libs_menu"
|
||||
class MATLIB_MT_LibsMenu(Menu):
|
||||
bl_label = "Libraries Menu"
|
||||
|
||||
def draw(self, context):
|
||||
@ -749,8 +748,7 @@ class matlibLibsMenu(Menu):
|
||||
for i, lib in enumerate(libs):
|
||||
layout.operator("matlib.operator", text=lib.shortname).cmd="lib"+str(i)
|
||||
|
||||
class matlibCatsMenu(Menu):
|
||||
bl_idname = "matlib.cats_menu"
|
||||
class MATLIB_MT_CatsMenu(Menu):
|
||||
bl_label = "Categories Menu"
|
||||
|
||||
def draw(self, context):
|
||||
@ -776,7 +774,7 @@ class matlibCatsMenu(Menu):
|
||||
|
||||
|
||||
|
||||
class MatlibAdd(Operator):
|
||||
class MATLIB_OT_add(Operator):
|
||||
"""Add active material to library"""
|
||||
bl_idname = "matlib.add"
|
||||
bl_label = "Add active material"
|
||||
@ -794,7 +792,7 @@ class MatlibAdd(Operator):
|
||||
self.report({success[0]}, success[1])
|
||||
return {'FINISHED'}
|
||||
|
||||
class MatlibRemove(Operator):
|
||||
class MATLIB_OT_remove(Operator):
|
||||
"""Remove material from library"""
|
||||
bl_idname = "matlib.remove"
|
||||
bl_label = "Remove material from library"
|
||||
@ -812,7 +810,7 @@ class MatlibRemove(Operator):
|
||||
self.report({success[0]}, success[1])
|
||||
return {'FINISHED'}
|
||||
|
||||
class MatlibReload(Operator):
|
||||
class MATLIB_OT_remove(Operator):
|
||||
"""Reload library"""
|
||||
bl_idname = "matlib.reload"
|
||||
bl_label = "Reload library"
|
||||
@ -833,7 +831,7 @@ class MatlibReload(Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class MatlibApply(Operator):
|
||||
class MATLIB_OT_apply(Operator):
|
||||
"""Apply selected material"""
|
||||
bl_idname = "matlib.apply"
|
||||
bl_label = "Apply material"
|
||||
@ -855,7 +853,7 @@ class MatlibApply(Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class MatlibPreview(Operator):
|
||||
class MATLIB_OT_preview(Operator):
|
||||
"""Preview selected material"""
|
||||
bl_idname = "matlib.preview"
|
||||
bl_label = "Preview selected material"
|
||||
@ -877,7 +875,7 @@ class MatlibPreview(Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class MatlibFlush(Operator):
|
||||
class MATLIB_OT_flush(Operator):
|
||||
"""Flush unused materials"""
|
||||
bl_idname = "matlib.flush"
|
||||
bl_label = "Flush unused materials"
|
||||
@ -914,7 +912,7 @@ class MatlibFlush(Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class matlibOperator(Operator):
|
||||
class MATLIB_OT_operator(Operator):
|
||||
"""Add, Remove, Reload, Apply, Preview, Clean Material"""
|
||||
bl_label = "New"
|
||||
bl_idname = "matlib.operator"
|
||||
@ -1115,7 +1113,7 @@ for mat in mats:
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class matlibvxPanel(Panel):
|
||||
class MATLIB_PT_vxPanel(Panel):
|
||||
bl_label = "Material Library VX"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
@ -1141,7 +1139,7 @@ class matlibvxPanel(Panel):
|
||||
else:
|
||||
text = "Select a Library"
|
||||
|
||||
row.menu("matlib.libs_menu",text=text)
|
||||
row.menu("MATLIB_MT_LibsMenu",text=text)
|
||||
row.operator("matlib.operator", icon="ZOOMIN", text="").cmd = "LIBRARY_ADD"
|
||||
if matlib.active_material:
|
||||
row.label(matlib.active_material.category)
|
||||
@ -1172,7 +1170,7 @@ class matlibvxPanel(Panel):
|
||||
row = layout.row(align=True)
|
||||
text = "All"
|
||||
if matlib.current_category: text = matlib.current_category
|
||||
row.menu("matlib.cats_menu",text=text)
|
||||
row.menu("MATLIB_MT_CatsMenu",text=text)
|
||||
row.prop(matlib, "filter", icon="FILTER", text="")
|
||||
row.operator("matlib.operator", icon="FILE_PARENT", text="").cmd="FILTER_SET"
|
||||
row.operator("matlib.operator", icon="ZOOMIN", text="").cmd="FILTER_ADD"
|
||||
@ -1195,7 +1193,7 @@ class matlibvxPanel(Panel):
|
||||
# else:
|
||||
# row.label("Library not found!.")
|
||||
|
||||
#classes = [matlibvxPanel, matlibOperator, matlibLibsMenu, matlibCatsMenu]
|
||||
#classes = [MATLIB_PT_vxPanel, MATLIB_OT_operator, MATLIB_MT_LibsMenu, MATLIB_MT_CatsMenu]
|
||||
#print(bpy.context.scene)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user