Warning: 'matlib.libs_menu' doesn't contain '_MT_' with prefix & suffix #54803

Closed
opened 2018-04-25 09:19:03 +02:00 by Reiner Prokein · 8 comments

System Information
Operating system and graphics card

Windows 7 64 Bit, 1060 gtx

Blender Version
Broken: (example: 2.69.7 4b206af, see splash screen)
Worked: (optional)

Latest buildbot version 2.79.4

Short description of error

Three name convention warnings when you switch the library in the materials library vx addon.

Materials Library VX addon comes with Blender and is activated by default.

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

Open Blender, switch to Materials tab, go to the Materials Library VX addon. Switch to another library. Watch the console.

There is one panel and two menus which doesn't follow the name convention so far. And the two menus had a unnecessary bl_idname, which gots used to display them in the panel. While you can display the menus with the classes names already.

I tried to fix it by myself, and so far the addon is working fine, and doesn't throw an error anymore. So my solution seems to follow the name convention now.

matlibwarnings.jpg

Diff:

 ### MENUS
-class matlibLibsMenu(Menu):
-  bl_idname = "matlib.libs_menu"
+class MATLIB_MT_LibsMenu(Menu):
+  #bl_idname = "matlib.libs_menu"
   bl_label = "Libraries Menu"
 
   def draw(self, context):
@@ -749,8 +749,8 @@ 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_idname = "matlib.cats_menu"
   bl_label = "Categories Menu"
 
   def draw(self, context):
@@ -1115,7 +1115,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 +1141,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)
@@ -1179,7 +1179,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"
@@ -1202,7 +1202,7 @@ class matlibvxPanel(Panel):
 - else:
 - row.label("Library not found!.")
 
-#classes = [matlibvxPanel, matlibOperator, matlibLibsMenu, matlibCatsMenu]
+#classes = [MATLIB_PT_vxPanel, matlibOperator, matlibLibsMenu, matlibCatsMenu]
 #print(bpy.context.scene)

Or if you want the whole init.py:

init.zip

**System Information** Operating system and graphics card Windows 7 64 Bit, 1060 gtx **Blender Version** Broken: (example: 2.69.7 4b206af, see splash screen) Worked: (optional) Latest buildbot version 2.79.4 **Short description of error** Three name convention warnings when you switch the library in the materials library vx addon. Materials Library VX addon comes with Blender and is activated by default. **Exact steps for others to reproduce the error** Based on a (as simple as possible) attached .blend file with minimum amount of steps Open Blender, switch to Materials tab, go to the Materials Library VX addon. Switch to another library. Watch the console. There is one panel and two menus which doesn't follow the name convention so far. And the two menus had a unnecessary bl_idname, which gots used to display them in the panel. While you can display the menus with the classes names already. I tried to fix it by myself, and so far the addon is working fine, and doesn't throw an error anymore. So my solution seems to follow the name convention now. ![matlibwarnings.jpg](https://archive.blender.org/developer/F2996202/matlibwarnings.jpg) Diff: ``` ### MENUS -class matlibLibsMenu(Menu): - bl_idname = "matlib.libs_menu" +class MATLIB_MT_LibsMenu(Menu): + #bl_idname = "matlib.libs_menu" bl_label = "Libraries Menu" def draw(self, context): @@ -749,8 +749,8 @@ 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_idname = "matlib.cats_menu" bl_label = "Categories Menu" def draw(self, context): @@ -1115,7 +1115,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 +1141,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) @@ -1179,7 +1179,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" @@ -1202,7 +1202,7 @@ class matlibvxPanel(Panel): - else: - row.label("Library not found!.") -#classes = [matlibvxPanel, matlibOperator, matlibLibsMenu, matlibCatsMenu] +#classes = [MATLIB_PT_vxPanel, matlibOperator, matlibLibsMenu, matlibCatsMenu] #print(bpy.context.scene) ``` Or if you want the whole __init__.py: [__init__.zip](https://archive.blender.org/developer/F2996188/__init__.zip)
Author

Added subscriber: @tiles

Added subscriber: @tiles
Author

Whoops, better check the init.py, i made some usability changes at it, and forgot to revert them for this report. I included the Preview element into the addon, and made the preview and assign buttons bigger and easier to access. Both has nothing to do with the error message reported here. But maybe you find it useful ...

Whoops, better check the init.py, i made some usability changes at it, and forgot to revert them for this report. I included the Preview element into the addon, and made the preview and assign buttons bigger and easier to access. Both has nothing to do with the error message reported here. But maybe you find it useful ...
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Philipp Oeser self-assigned this 2018-04-25 09:30:08 +02:00
Member

thanx @tiles , will doublechk and commit (soonish)

thanx @tiles , will doublechk and commit (soonish)
Reiner Prokein changed title from Warning: 'MAT_PT_matlib.libs_menu' doesn't contain '_MT_' with prefix & suffix to Warning: 'matlib.libs_menu' doesn't contain '_MT_' with prefix & suffix 2018-04-25 09:38:33 +02:00

This issue was referenced by blender/blender-addons@9e97716c99

This issue was referenced by blender/blender-addons@9e97716c99af066ba578c8ac5685a7e92a363b59
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

@tiles : fixed strict namings now, havent looked at other changes though, if desired, could you submit a diff and we go through this separately?

@tiles : fixed strict namings now, havent looked at other changes though, if desired, could you submit a [diff ](https://developer.blender.org/differential/diff/create/) and we go through this separately?
Author

Not necessary. It was accidentally committed anyways. Thanks for the fix :)

Not necessary. It was accidentally committed anyways. Thanks for the fix :)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#54803
No description provided.