GPencil: Material filter is not working in modifiers #76594

Closed
opened 2020-05-09 20:55:40 +02:00 by Vyacheslav Kobozev · 13 comments

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.59

Blender Version
Broken: version: 2.83 (sub 15), branch: master, commit date: 2020-05-06 16:18, hash: 9605c26166
Worked: (newest version of Blender that worked as expected)

Short description of error
Modifier work with material only when filter inverted. If it is intended, it is higly counter-intuitive. But I am sure it is a bug.
untitled1.blend
37084154.jpg
2020-05-09_21-50-17.mp4

**System Information** Operating system: Windows-7-6.1.7601-SP1 64 Bits Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.59 **Blender Version** Broken: version: 2.83 (sub 15), branch: master, commit date: 2020-05-06 16:18, hash: `9605c26166` Worked: (newest version of Blender that worked as expected) **Short description of error** Modifier work with material only when filter inverted. If it is intended, it is higly counter-intuitive. But I am sure it is a bug. [untitled1.blend](https://archive.blender.org/developer/F8523599/untitled1.blend) ![37084154.jpg](https://archive.blender.org/developer/F8523606/37084154.jpg) [2020-05-09_21-50-17.mp4](https://archive.blender.org/developer/F8523595/2020-05-09_21-50-17.mp4)

Added subscriber: @Vyach

Added subscriber: @Vyach
Antonio Vazquez self-assigned this 2020-05-10 10:08:02 +02:00

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

It looks the material filter is not working. I can reproduce it.

It looks the material filter is not working. I can reproduce it.

Added subscribers: @JulianEisel, @ideasman42

Added subscribers: @JulianEisel, @ideasman42

@ideasman42 @JulianEisel I have found a very weird bug in the prop_search function.

Here it' s an extract of the code I have in python:

row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE')
row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")

And this is the Panel... looks carefully to Material... there is a extra blank in front.

{F8525463}

And here is what I have in the variable (set by RNA).

prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "materialname");
RNA_def_property_ui_text(prop, "Material", "Material name");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");```


![image.png](https://archive.blender.org/developer/F8525466/image.png)

You can see the name of the material is " Green", not "Green" as expected....

And this is the Data:

![image.png](https://archive.blender.org/developer/F8525469/image.png)

As you can see, something is happening in `prop_search`
@ideasman42 @JulianEisel I have found a very weird bug in the `prop_search` function. Here it' s an extract of the code I have in python: ```row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL') row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE') row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") ``` And this is the Panel... looks carefully to Material... there is a extra blank in front. {F8525463} And here is what I have in the variable (set by RNA). ``` ``` prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "materialname"); RNA_def_property_ui_text(prop, "Material", "Material name"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");``` ``` ![image.png](https://archive.blender.org/developer/F8525466/image.png) You can see the name of the material is " Green", not "Green" as expected.... And this is the Data: ![image.png](https://archive.blender.org/developer/F8525469/image.png) As you can see, something is happening in `prop_search`

The strange is that this problem is only with Materials, but not with Layers or Vertex groups that use the same code logic.

The strange is that this problem is only with Materials, but not with Layers or Vertex groups that use the same code logic.
Antonio Vazquez changed title from Grease pencil modifiers: material filter works inverted to GPencil: Material filter is not working in modifiers 2020-05-10 10:32:44 +02:00
Member

Data-blocks (materials are data-blocks, GPencil layers and vertex groups are not) get a 3 character prefix to indicate their linking state and user-count, see https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/lib_id.c$2092-2109.
This is done for all search menu templates and shouldn't be an issue. The issue probably lies somewhere else.

Data-blocks (materials are data-blocks, GPencil layers and vertex groups are not) get a 3 character prefix to indicate their linking state and user-count, see https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/lib_id.c$2092-2109. This is done for all search menu templates and shouldn't be an issue. The issue probably lies somewhere else.

Proposed fix: D7681

Proposed fix: [D7681](https://archive.blender.org/developer/D7681)

@JulianEisel What is your plan here?

We have 3 options:

  1. I can do a quick hack and solve it for 2.83. In 2.90 I can apply the D7681 fix.
  2. You can apply your quick fix to prop_search.
  3. We can apply D7681 now to 2.83.

I don't like too much the option 3), so IMHO it's better apply solution 1) or 2) to 2.83 and apply the correct fix with pointer (D7681) in 2.90.

@JulianEisel What is your plan here? We have 3 options: 1) I can do a quick hack and solve it for 2.83. In 2.90 I can apply the [D7681](https://archive.blender.org/developer/D7681) fix. 2) You can apply your quick fix to `prop_search`. 3) We can apply [D7681](https://archive.blender.org/developer/D7681) now to 2.83. I don't like too much the option 3), so IMHO it's better apply solution 1) or 2) to 2.83 and apply the correct fix with pointer ([D7681](https://archive.blender.org/developer/D7681)) in 2.90.
Member

I'm just doing some final checking, but will commit my quick 2.83 fix in a moment. D7681 can go into 2.90 then.

I'm just doing some final checking, but will commit my quick 2.83 fix in a moment. [D7681](https://archive.blender.org/developer/D7681) can go into 2.90 then.
Member

Changed status from 'Confirmed' to: 'Resolved'

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

Committed 249ccab111 for the 2.83 release. @antoniov also committed d63956d0e5, which fixes this specific issue too, but is too unsafe for 2.83. It does however fix the case of duplicated data-block names due to linking/library-overrides.

Committed 249ccab111 for the 2.83 release. @antoniov also committed d63956d0e5, which fixes this specific issue too, but is too unsafe for 2.83. It does however fix the case of duplicated data-block names due to linking/library-overrides.

Thanks @JulianEisel I have tested and the problem is solved in 2.83 and also solved in the right way in 2.90.

Thanks @JulianEisel I have tested and the problem is solved in 2.83 and also solved in the right way in 2.90.
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#76594
No description provided.