Knife tool draws huge vertices (it draws verts with glPointSize is not initialized) #82164

Closed
opened 2020-10-27 18:59:12 +01:00 by Jose Conseco · 13 comments

System Information
Operating system: Linux-5.8.16-2-MANJARO-x86_64-with-arch-Manjaro-Linux 64 Bits
Graphics card: GeForce GTX 1660 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100

Blender Version
Broken: version: 2.91.0 Beta, branch: master, commit date: 2020-10-26 17:29, hash: edf4378c44
Worked: 2.90

Short description of error
When I draw something with bgl and use:

bgl.glPointSize(41) #to default 1

The build-in knife tool UI is affected (knife draws huge vertices):
image.png

Exact steps for others to reproduce the error
Run script from attached blend file
Then run knife tool - it vertices higlight will be huge

import bpy
import gpu
import bgl
from gpu_extras.batch import batch_for_shader

coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)]
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'LINES', {"pos": coords})


def draw():
    shader.bind()
    shader.uniform_float("color", (1, 1, 0, 1))
    batch.draw(shader)
    bgl.glPointSize(41) #default 1 


bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

KnifeVErtSizeBug.blend

**System Information** Operating system: Linux-5.8.16-2-MANJARO-x86_64-with-arch-Manjaro-Linux 64 Bits Graphics card: GeForce GTX 1660 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100 **Blender Version** Broken: version: 2.91.0 Beta, branch: master, commit date: 2020-10-26 17:29, hash: `edf4378c44` Worked: 2.90 **Short description of error** When I draw something with bgl and use: ``` bgl.glPointSize(41) #to default 1 ``` The build-in knife tool UI is affected (knife draws huge vertices): ![image.png](https://archive.blender.org/developer/F9112513/image.png) **Exact steps for others to reproduce the error** Run script from attached blend file Then run knife tool - it vertices higlight will be huge ``` import bpy import gpu import bgl from gpu_extras.batch import batch_for_shader coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)] shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR') batch = batch_for_shader(shader, 'LINES', {"pos": coords}) def draw(): shader.bind() shader.uniform_float("color", (1, 1, 0, 1)) batch.draw(shader) bgl.glPointSize(41) #default 1 bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW') ``` [KnifeVErtSizeBug.blend](https://archive.blender.org/developer/F9112523/KnifeVErtSizeBug.blend)
Author

Added subscriber: @JoseConseco

Added subscriber: @JoseConseco
Author

BTW. maybe it is related to: https://developer.blender.org/D8728

BTW. maybe it is related to: https://developer.blender.org/D8728
Member

Added subscribers: @mano-wii, @lichtwerk

Added subscribers: @mano-wii, @lichtwerk
Member

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

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

@mano-wii: assume D8728: Knife: Use specialized shader for drawing points would resolve this, too, so do you have plans to finish that up?

@mano-wii: assume [D8728: Knife: Use specialized shader for drawing points](https://archive.blender.org/developer/D8728) would resolve this, too, so do you have plans to finish that up?

It would solve, but the problem is more internal.
The knife tool shows only a side effect of the real problem.

The real problem is known and should be resolved before the final release.

It would solve, but the problem is more internal. The knife tool shows only a side effect of the real problem. The real problem is known and should be resolved before the final release.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

I'll set the priority to high, because you said this should be solved before the release.

I'll set the priority to high, because you said this should be solved before the release.

Added subscribers: @fclem, @dfelinto

Added subscribers: @fclem, @dfelinto
Germano Cavalcante was assigned by Dalai Felinto 2020-11-05 17:45:29 +01:00

@mano-wii but what is the "real problem"? And who is planning to tackle it? (assigning it to you, assuming it is in your agenda).

That said I would hardly consider this a bug, specially not a high priority one. The script should change the point size back to the default after using it. @fclem thoughts?

@mano-wii but what is the "real problem"? And who is planning to tackle it? (assigning it to you, assuming it is in your agenda). That said I would hardly consider this a bug, specially not a high priority one. The script should change the point size back to the default after using it. @fclem thoughts?
Author

The probem is if I reset point size to 1, then knife tool vert size will be to small (should be around 3-5 px by default?) It like the knife tool does not initialize point size correctly for itself.

The probem is if I reset point size to 1, then knife tool vert size will be to small (should be around 3-5 px by default?) It like the knife tool does not initialize point size correctly for itself.

This issue was referenced by 1b9d9cb1ed

This issue was referenced by 1b9d9cb1ed7019e05b11cc480aef75a10e952957

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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
6 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#82164
No description provided.