bpy.ops.paint.image_paint with a texture requires initialization with manual paint stroke otherwise color not quite right #54554
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#54554
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Win 10 5820K GTX 970
Blender Version
2.79b and latest daily build
Short description of error
bpy.ops.paint.image_paint with slightly wrong colors when painting on object with texture on brush before a manual paint stroke applied
Exact steps for others to reproduce the error
This seems to happen each time I change the texture on the brush to a new one (with obviously different colors on it)
Image is attached showing this.
Possibly something not being initialized properly?
Thanks you in advance for any work on this.
modal_paint.blend
Added subscriber: @RevDr
I have done a little further investigation.
It seems what is happening is this: bpy.ops.paint.image_paint does not use color space of the brush texture until after a stroke has been 'manually' done. Therefore the texture is being used as if it is in the raw texture space until a manual stroke overides this.
Having looked at the code it appears that the color space initialization for the texture is done in
paint_stroke.c
function: paint_brush_update (particualy lines 239->261)
However this is never called from the python code image_paint function.
As a workaround I tried adding the following (adapted from paint_brush update function) lines of code to
function: paint_stroke_new
Added subscriber: @lichtwerk
Hi @RevDr and thx for the report,
as a first note: I can confirm the issue and also that your code fixes it (I tested without stroke->brush_init -- but needs more research...)
After 6 years, still there.
Nowadays it even seems to crash:
Tweaking the solution from @RevDr a bit (I think we should only do this in
paint_stroke_new
and not inpaint_brush_update
[which would do this per step]), but yes, since this also crashes nowadays, will put a PR up shortly (or next week, depending on how much testing is needed).So will put on my desk