Grease pencil sculpt stroke size not displayed in the viewport. #47783

Closed
opened 2016-03-13 20:20:19 +01:00 by Alexey Khoral · 23 comments

System Information
Xubuntu 14.04 x64 3.19.0-51-generic

Blender Version
Broken: 2.77 RC1, RC2

Short description of error
Grease pencil sculpt stroke size not displayed in the viewport, but i can see white circle on bottom panel. See include screen.
gpenscil.png

**System Information** Xubuntu 14.04 x64 3.19.0-51-generic **Blender Version** Broken: 2.77 RC1, RC2 **Short description of error** Grease pencil sculpt stroke size not displayed in the viewport, but i can see white circle on bottom panel. See include screen. ![gpenscil.png](https://archive.blender.org/developer/F289913/gpenscil.png)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @allkhor

Added subscriber: @allkhor

#47878 was marked as duplicate of this issue

#47878 was marked as duplicate of this issue
Member

Added subscriber: @JoshuaLeung

Added subscriber: @JoshuaLeung
Member

Does this happen for any other types of brush (eg go eraser, sculpt brush, particle edit brush)?

From the screenshot it looks like you've got Only Render enabled for that viewport?

Please include details about your graphics card as this could be an opengl related issue.

Does this happen for any other types of brush (eg go eraser, sculpt brush, particle edit brush)? From the screenshot it looks like you've got Only Render enabled for that viewport? Please include details about your graphics card as this could be an opengl related issue.
Joshua Leung self-assigned this 2016-03-13 22:00:21 +01:00
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Agree that information here could be better, anyhow, I can easily recreate with any brush using GPencil sculpt modal.

Agree that information here could be better, anyhow, I can easily recreate with any brush using GPencil sculpt modal.
Member

@JulianEisel: I can't reproduce this issue here (Windows 8.1 + Nvidia GeForce 740M)

@JulianEisel: I can't reproduce this issue here (Windows 8.1 + Nvidia GeForce 740M)
Joshua Leung was unassigned by Julian Eisel 2016-03-14 02:51:43 +01:00
Julian Eisel self-assigned this 2016-03-14 02:51:43 +01:00
Member

Yuk! Can investigate tomorrow on my machine in the institute then (Linux, Nvidia GTX260 or something like that :S)

Yuk! Can investigate tomorrow on my machine in the institute then (Linux, Nvidia GTX260 or something like that :S)
Author

My hardware: Video card: Nvidia GTX 750ti 2gb, driver 352.79, cpu core i5 750, 8 GB ram...
Eraser, sculpt brush and other brushs display correct. It's not only render mode, you cant's see mouse cursor, because xubuntu don't grub it when i make screenshot.

Tested on blender-softwaregl issue reproduced here.

My hardware: Video card: Nvidia GTX 750ti 2gb, driver 352.79, cpu core i5 750, 8 GB ram... Eraser, sculpt brush and other brushs display correct. It's not only render mode, you cant's see mouse cursor, because xubuntu don't grub it when i make screenshot. Tested on blender-softwaregl issue reproduced here.
Author

Tested on windows 8.1 x32, video integrated intel, some here.
gpencil_windows.PNG

Tested on windows 8.1 x32, video integrated intel, some here. ![gpencil_windows.PNG](https://archive.blender.org/developer/F290234/gpencil_windows.PNG)

Added subscriber: @sindra1961

Added subscriber: @sindra1961

windows 10 pro 64bits
NVidia GTX960 + GT730
version: 2.77 (sub 0), hash: 34fe03c
Grease Pencil2.png
Grease Pencil.png

windows 10 pro 64bits NVidia GTX960 + GT730 version: 2.77 (sub 0), hash: 34fe03c ![Grease Pencil2.png](https://archive.blender.org/developer/F290456/Grease_Pencil2.png) ![Grease Pencil.png](https://archive.blender.org/developer/F290458/Grease_Pencil.png)
Member

@sindra1961 Thanks for the screenshots. I can now reproduce the bug, and I think I might know why it happens :)

@sindra1961 Thanks for the screenshots. I can now reproduce the bug, and I think I might know why it happens :)
Member

Cheeesis, this is tricky. Spent some hours investigating, here's what's going on (if I'm not mistaken):

  • Selecting the item from the menu makes the ui-handler return WM_UI_HANDLER_BREAK which again makes the wm-handler return WM_HANDLER_BREAK.
  • Because of this, wm_event_do_handlers doesn't call the functions needed to set the right context for drawing the cursors (ED_screen_set_subwinactive & wm_paintcursor_test).
  • To trigger an update of the cursor, it's usually enough to send a mouse move event, which is done in fact.
  • Issue is though, that now the modal operator for stroke sculpting runs, and - unlike other modal operators - it doesn't return OPERATOR_PASS_THROUGH for the mouse move event added (nor for any other mouse move event).
  • This means, as long as the operator runs, the wm_event_do_handlers never calls the functions for updating the cursor context.
  • The wrong context causes a glScissor call for the wrong region.

Possible ways to fix this:

  • Let stroke sculpt operator pass the first event - P334
  • Always return OPERATOR_PASS_THROUGH on mouse move during stroke sculpting and use paintcursor poll to check for correct region (to lazy to write patch, should work though ;) )
  • Always let WM call the cursor context update functions after cursor was changed (a bit ugly and just another event system hack, but technically it would be a correct fix) - P333
  • Always let WM call the cursor context update on mouse move - P335 (also a correct fix - here we had to add a paintcursor poll check for correct region too though)

While investigating I also noticed that the return values in gpsculpt_brush_modal are managed in a pretty odd way. For example it's assuming that view rotation is set to middle mouse button. The operator should return OPERATOR_PASS_THROUGH by default and only block events it really uses (doing that would basically include #2.)

BTW: Invoking the stroke sculpt operator from the search menu outside of the main 3D view region causes a crash :| Instead of using CTX_wm_region to get the region we should search for a region that supports gpencil drawing (we'd also need that for #2.).

Cheeesis, this is tricky. Spent some hours investigating, here's what's going on (if I'm not mistaken): * Selecting the item from the menu makes the ui-handler return `WM_UI_HANDLER_BREAK` which again makes the wm-handler return `WM_HANDLER_BREAK`. * Because of this, `wm_event_do_handlers` doesn't call the functions needed to set the right context for drawing the cursors (`ED_screen_set_subwinactive` & `wm_paintcursor_test`). * To trigger an update of the cursor, it's usually enough to send a mouse move event, which is done in fact. * Issue is though, that now the modal operator for stroke sculpting runs, and - unlike other modal operators - it doesn't return `OPERATOR_PASS_THROUGH` for the mouse move event added (nor for any other mouse move event). * This means, as long as the operator runs, the `wm_event_do_handlers` never calls the functions for updating the cursor context. * The wrong context causes a `glScissor` call for the wrong region. Possible ways to fix this: - Let stroke sculpt operator pass the first event - [P334](https://archive.blender.org/developer/P334.txt) - Always return `OPERATOR_PASS_THROUGH` on mouse move during stroke sculpting and use paintcursor poll to check for correct region (to lazy to write patch, should work though ;) ) - Always let WM call the cursor context update functions after cursor was changed (a bit ugly and just another event system hack, but technically it would be a correct fix) - [P333](https://archive.blender.org/developer/P333.txt) - Always let WM call the cursor context update on mouse move - [P335](https://archive.blender.org/developer/P335.txt) (also a correct fix - here we had to add a paintcursor poll check for correct region too though) While investigating I also noticed that the return values in `gpsculpt_brush_modal` are managed in a pretty odd way. For example it's assuming that view rotation is set to middle mouse button. The operator should return `OPERATOR_PASS_THROUGH` by default and only block events it really uses (doing that would basically include #2.) BTW: Invoking the stroke sculpt operator from the search menu outside of the main 3D view region causes a crash :| Instead of using `CTX_wm_region` to get the region we should search for a region that supports gpencil drawing (we'd also need that for #2.).
Member

This is also reproducible from other editors btw, e.g. call stroke sculpting from search menu in node editor toolbar.

We could fix the crash by ensuring the operator is only called in the main region in case of a 3D View, but that would make it inconsistent with other areas (wouldn't be a big annoyance though).

I'd propose we continue as follows:

  • Add bool ED_region_supports_gpencil(ARegion *ar)
  • Use it for implementing #4
  • Use it for fixing crash
  • Cleanup gpsculpt_brush_modal for a more streamlined event handling
This is also reproducible from other editors btw, e.g. call stroke sculpting from search menu in node editor toolbar. We could fix the crash by ensuring the operator is only called in the main region in case of a 3D View, but that would make it inconsistent with other areas (wouldn't be a big annoyance though). I'd propose we continue as follows: * Add `bool ED_region_supports_gpencil(ARegion *ar)` * Use it for implementing #4 * Use it for fixing crash * Cleanup `gpsculpt_brush_modal` for a more streamlined event handling
Member

Added subscriber: @mendio

Added subscriber: @mendio
Member

@JoshuaLeung, any feedback? Would just go with my proposed changes otherwise.

@JoshuaLeung, any feedback? Would just go with my proposed changes otherwise.

Added subscriber: @DenzylBasterfield

Added subscriber: @DenzylBasterfield

This issue is still happening for me
Windows 10
GTX 770
Blender V2.78c

This issue is still happening for me **Windows 10 GTX 770 Blender V2.78c**

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Grease pencil sculpting in 2.8 is completely different, assuming this is no longer relevant.

Grease pencil sculpting in 2.8 is completely different, assuming this is no longer relevant.
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
7 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#47783
No description provided.