UI: Add eyedropper button to camera focus distance #121486
No reviewers
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#121486
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "filedescriptor/blender:eyedropper-focus-distance"
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?
Blender already had the ability to sample the depth with an eyedropper and fill the focus distance
(see
"ui.eyedropper_depth"
). But this feature is fairly hidden. You have to hover over thefocal_distance
property in the camera data panel and then pressE
.This patch adds a
prop_data_path
property to theui.eyedropper_depth
operator toallow specifying the property that should be filled with the depth value.
The idea for this is taken from
wm.radial_control
, which also uses this approach to write to a property.This allows us to add the eyedropper as a button:
TODO:
poll
function ofui.eyedropper_depth
. This poll function was very specific and I noticed that without it, e.g. pressingE
in the console editor no longer works.DepthDropper
struct a5fd16e5fdWIP: UI: Add eyedropper button to camera focus distanceto UI: Add eyedropper button to camera focus distance@blender-bot build
You could leave the poll in by adding a coarse test for this situation. You can't get very specific so you'd still need your new (awesome) tests in depthdropper_init, but there might be some utility is having the poll for enabling/disabling buttons.
@Harley But the poll function will always be false for a button next to the focus distance since 1) we're not hovering over a float value (which we are not if we're pressing the eyedropper button), and 2) because the properties editor doesn't have a 3D viewport.
I swear that I tested the poll function above and it worked correctly with focus distance. If it has a window and an icon of ICON_EYEDROPPER it will return true. That is a little broad but then it still has to go through your improved tests in depthdropper_init.
@Harley Oh! I missed the icon case. This whole poll function just seems incredible hackish 😅 But if others are fine with it, I guess it's ok.
Yes, it definitely seems hacky and my change certainly wouldn't help it. I only offered that in case you wanted it.
My own gut feeling is we should do it as you propose here and remove that poll.
@ -73,1 +77,4 @@
const char *prop_path,
PointerRNA *r_ptr,
PropertyRNA **r_prop)
{
This function could return bool?
@ -74,0 +84,4 @@
if (r_prop) {
*r_prop = nullptr;
}
return 1;
I'm unsure why this state is returning true. It looks like it would cause problems later if this happened.
It does catch it later, but you're right, we can just return false here.
depthdropper_get_path
b06c123693This is awesome. Our ancestors will be singing your praises for generations...
@blender-bot build
Also added this to the release notes in https://developer.blender.org/docs/release_notes/4.2/user_interface/