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

Closed
opened 5 years ago by tiles · 8 comments
tiles commented 5 years ago

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)
tiles commented 5 years ago
Poster

Added subscriber: @tiles

Added subscriber: @tiles
tiles commented 5 years ago
Poster

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 ...
Collaborator

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
lichtwerk self-assigned this 5 years ago
Collaborator

thanx @tiles , will doublechk and commit (soonish)

thanx @tiles , will doublechk and commit (soonish)
tiles 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 5 years ago
Collaborator

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

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

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
lichtwerk closed this issue 5 years ago
Collaborator

@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?
tiles commented 5 years ago
Poster

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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#54803
Loading…
There is no content yet.