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)
|
# Scene.matlib = PointerProperty(type = matlibProperties)
|
||||||
|
|
||||||
### MENUS
|
### MENUS
|
||||||
class matlibLibsMenu(Menu):
|
class MATLIB_MT_LibsMenu(Menu):
|
||||||
bl_idname = "matlib.libs_menu"
|
|
||||||
bl_label = "Libraries Menu"
|
bl_label = "Libraries Menu"
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@ -749,8 +748,7 @@ class matlibLibsMenu(Menu):
|
|||||||
for i, lib in enumerate(libs):
|
for i, lib in enumerate(libs):
|
||||||
layout.operator("matlib.operator", text=lib.shortname).cmd="lib"+str(i)
|
layout.operator("matlib.operator", text=lib.shortname).cmd="lib"+str(i)
|
||||||
|
|
||||||
class matlibCatsMenu(Menu):
|
class MATLIB_MT_CatsMenu(Menu):
|
||||||
bl_idname = "matlib.cats_menu"
|
|
||||||
bl_label = "Categories Menu"
|
bl_label = "Categories Menu"
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@ -776,7 +774,7 @@ class matlibCatsMenu(Menu):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MatlibAdd(Operator):
|
class MATLIB_OT_add(Operator):
|
||||||
"""Add active material to library"""
|
"""Add active material to library"""
|
||||||
bl_idname = "matlib.add"
|
bl_idname = "matlib.add"
|
||||||
bl_label = "Add active material"
|
bl_label = "Add active material"
|
||||||
@ -794,7 +792,7 @@ class MatlibAdd(Operator):
|
|||||||
self.report({success[0]}, success[1])
|
self.report({success[0]}, success[1])
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
class MatlibRemove(Operator):
|
class MATLIB_OT_remove(Operator):
|
||||||
"""Remove material from library"""
|
"""Remove material from library"""
|
||||||
bl_idname = "matlib.remove"
|
bl_idname = "matlib.remove"
|
||||||
bl_label = "Remove material from library"
|
bl_label = "Remove material from library"
|
||||||
@ -812,7 +810,7 @@ class MatlibRemove(Operator):
|
|||||||
self.report({success[0]}, success[1])
|
self.report({success[0]}, success[1])
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
class MatlibReload(Operator):
|
class MATLIB_OT_remove(Operator):
|
||||||
"""Reload library"""
|
"""Reload library"""
|
||||||
bl_idname = "matlib.reload"
|
bl_idname = "matlib.reload"
|
||||||
bl_label = "Reload library"
|
bl_label = "Reload library"
|
||||||
@ -833,7 +831,7 @@ class MatlibReload(Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class MatlibApply(Operator):
|
class MATLIB_OT_apply(Operator):
|
||||||
"""Apply selected material"""
|
"""Apply selected material"""
|
||||||
bl_idname = "matlib.apply"
|
bl_idname = "matlib.apply"
|
||||||
bl_label = "Apply material"
|
bl_label = "Apply material"
|
||||||
@ -855,7 +853,7 @@ class MatlibApply(Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class MatlibPreview(Operator):
|
class MATLIB_OT_preview(Operator):
|
||||||
"""Preview selected material"""
|
"""Preview selected material"""
|
||||||
bl_idname = "matlib.preview"
|
bl_idname = "matlib.preview"
|
||||||
bl_label = "Preview selected material"
|
bl_label = "Preview selected material"
|
||||||
@ -877,7 +875,7 @@ class MatlibPreview(Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class MatlibFlush(Operator):
|
class MATLIB_OT_flush(Operator):
|
||||||
"""Flush unused materials"""
|
"""Flush unused materials"""
|
||||||
bl_idname = "matlib.flush"
|
bl_idname = "matlib.flush"
|
||||||
bl_label = "Flush unused materials"
|
bl_label = "Flush unused materials"
|
||||||
@ -914,7 +912,7 @@ class MatlibFlush(Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class matlibOperator(Operator):
|
class MATLIB_OT_operator(Operator):
|
||||||
"""Add, Remove, Reload, Apply, Preview, Clean Material"""
|
"""Add, Remove, Reload, Apply, Preview, Clean Material"""
|
||||||
bl_label = "New"
|
bl_label = "New"
|
||||||
bl_idname = "matlib.operator"
|
bl_idname = "matlib.operator"
|
||||||
@ -1115,7 +1113,7 @@ for mat in mats:
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class matlibvxPanel(Panel):
|
class MATLIB_PT_vxPanel(Panel):
|
||||||
bl_label = "Material Library VX"
|
bl_label = "Material Library VX"
|
||||||
bl_space_type = "PROPERTIES"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "WINDOW"
|
bl_region_type = "WINDOW"
|
||||||
@ -1141,7 +1139,7 @@ class matlibvxPanel(Panel):
|
|||||||
else:
|
else:
|
||||||
text = "Select a Library"
|
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"
|
row.operator("matlib.operator", icon="ZOOMIN", text="").cmd = "LIBRARY_ADD"
|
||||||
if matlib.active_material:
|
if matlib.active_material:
|
||||||
row.label(matlib.active_material.category)
|
row.label(matlib.active_material.category)
|
||||||
@ -1172,7 +1170,7 @@ class matlibvxPanel(Panel):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
text = "All"
|
text = "All"
|
||||||
if matlib.current_category: text = matlib.current_category
|
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.prop(matlib, "filter", icon="FILTER", text="")
|
||||||
row.operator("matlib.operator", icon="FILE_PARENT", text="").cmd="FILTER_SET"
|
row.operator("matlib.operator", icon="FILE_PARENT", text="").cmd="FILTER_SET"
|
||||||
row.operator("matlib.operator", icon="ZOOMIN", text="").cmd="FILTER_ADD"
|
row.operator("matlib.operator", icon="ZOOMIN", text="").cmd="FILTER_ADD"
|
||||||
@ -1195,7 +1193,7 @@ class matlibvxPanel(Panel):
|
|||||||
# else:
|
# else:
|
||||||
# row.label("Library not found!.")
|
# 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)
|
#print(bpy.context.scene)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user