Maniphest T98589

Paint Mode: Color Sampling
Needs Triage, NormalDESIGN

Assigned To
None
Authored By
Julien Kaspar (JulienKaspar)
Jun 4 2022, 2:46 PM
Tags
  • Sculpt, Paint & Texture
Subscribers
Jeroen Bakker (jbakker)
Joseph Eagar (joeedh)
Julien Kaspar (JulienKaspar)
Ramil Roosileht (Limarest)

Description

NOTE: This task is currently to document the requirements for an updated color sampler for painting workflows. This should be the basis for discussions on the implementation.

Goal

Sampling colors is implemented in various different ways throughout Blender, each implementation with their own advantages and features.
The goal here is to combine all needed features into an easily accessible operator, with additional options to get other sampling effects.
This operator will then be used for color sampling in sculpt/paint mode and paint mode in the image editor.

The basic implementation in sculpt mode is already usable for now.

Requirements

Existing Features

  • Sample Merged (Only available in the keymap options or with the color picker button)
  • Add to Palette (Already available via left click)
  • Sample Size (Only in the image editor sample tool)
  • Live sample values for XY, RGBA, CMGB, HSVL, color (Only in the image editor sample tool)
  • Sample Interpolated vs Closest (Automatic for textures. Always picks closest in Weight painting. Not implemented for color attributes. Needs more investigation on what would be most useful.)

Accessibility

The easiest way to access the color sampling should always be with a shortcut.
For now the established default is S. We should follow this wherever possible to stay consistent.

Potentially the best usable way to implement this in the UI is as a button in the color picker instead of an active tool.
The disadvantages of making this an active tool are

  • that it doesn't directly relate to any particular color or brush/tool
  • it's more intuitive to use as a temporary one-click operation (No needs to keep it active)

Sample other Objects

It's already possible to pick any color of the screen when sampling merged colors.
When sampling the current paint slot of the Canvas this is not the case.
Multi-object workflows are very common so there needs to be an implementation to instantly sample local colors from another object.

Use active Canvas picker mode
One straight forward implementation would be to use the Canvas picker mode of the active object to define which colors will be picked. This mode can be set to:

  • Color Attribute
  • Image Texture
  • Material

Each of the other visible objects will have an active color attribute, image texture and node in the material.
So the desired approach is to look for that data and use it for color sampling other objects whenever the option "Sample Merged" is not used.

Color Sample Overlay

When painting for materials there will be cases where it is not obvious what color will be picked.
For example when picking from a greyscale image texture that is used for roughness, while you see the final material in Eevee with additional colors and procedural roughness textures mixed in.

This color sampling preview would ideally be shown directly on the brush cursor, comparing it side-by-side with the currently set color.

Event Timeline

Julien Kaspar (JulienKaspar) created this task.Jun 4 2022, 2:46 PM
Julien Kaspar (JulienKaspar) moved this task from Backlog to To Do on the Sculpt, Paint & Texture board.
Julien Kaspar (JulienKaspar) updated the task description.Jun 4 2022, 3:40 PM
Ramil Roosileht (Limarest) added a subscriber: Ramil Roosileht (Limarest).EditedJun 4 2022, 4:34 PM

I agree that sampling color from other objects is a crucial improvement for the current eyedropper

Julien Kaspar (JulienKaspar) mentioned this in T96225: PBVH image texture painting implementation.Jun 5 2022, 12:49 PM
Julien Kaspar (JulienKaspar) added a comment.Jul 6 2022, 11:00 AM

From the recent module meeting, @Joseph Eagar (joeedh) mentioned a color sampler UI improvement in sculpt-dev.
This should be taken into account for the design.

Julien Kaspar (JulienKaspar) moved this task from To Do to Paint Mode Design on the Sculpt, Paint & Texture board.Jul 15 2022, 2:25 PM
Julien Kaspar (JulienKaspar) updated the task description.Sep 1 2022, 9:44 AM