UI: Clicking the camera icon while rendering should open render window #105765

Merged
Jeroen Bakker merged 6 commits from rems64/blender:T102210-click-camera-icon into main 2023-03-21 07:53:41 +01:00
Contributor

During rendering, clicking on the Camera icon of the jobs panel should focus or open a Render Window.

Adds a op_name variable to store the operation.
Fix #102210

During rendering, clicking on the Camera icon of the jobs panel should focus or open a Render Window. Adds a `op_name` variable to store the operation. Fix #102210
Rémy Fayet added 1 commit 2023-03-14 15:49:17 +01:00
747f24472d
UI: Clicking the camera icon while rendering should open render window
During rendering, clicking on the Camera icon of the jobs panel should focus or open a Render Window.

Adds a `op_name` variable to store the operation.
Fix #102210
Iliya Katushenock added this to the User Interface project 2023-03-14 15:50:27 +01:00
Member

This is a nice idea. Thanks for working on it. I can't think of any good reason why we couldn't have this. But I have a few suggestions:

If op_name is anything at all then it is going to show a tooltip that it is "Show/ focus render window." Your change will be more generic and usable for other job types if you deal with the description in the exact same way as you do with op_name, perhaps "op_desc"?

In our C++ files (those ending in ".cc") our coding style is to use nullptr rather than NULL.

The tooltip description should be a plain and regular English sentence as that is clearer and easier to translate, so I would find an alternative without the slash. Perhaps just "Show the render window"?

Your change adds an "if" and "else" that largely duplicates the uiDefIconTextBut call. You could get rid of the "else" and its contents. Then the icon argument for the current uiDefIconTextBut could be a ternary like (op_name) ? 0 : icon. Would make it simpler.

This is a nice idea. Thanks for working on it. I can't think of any good reason why we couldn't have this. But I have a few suggestions: If op_name is anything at all then it is going to show a tooltip that it is "Show/ focus render window." Your change will be more generic and usable *for other job types* if you deal with the description in the exact same way as you do with op_name, perhaps "op_desc"? In our C++ files (those ending in ".cc") our coding style is to use `nullptr` rather than `NULL`. The tooltip description should be a plain and regular English sentence as that is clearer and easier to translate, so I would find an alternative without the slash. Perhaps just "Show the render window"? Your change adds an "if" and "else" that largely duplicates the `uiDefIconTextBut` call. You could get rid of the "else" and its contents. Then the icon argument for the current `uiDefIconTextBut` could be a ternary like `(op_name) ? 0 : icon`. Would make it simpler.
Rémy Fayet added 1 commit 2023-03-15 12:53:42 +01:00
Author
Contributor

Thank you for your feedback. I think I have corrected all the points you mentioned.

Thank you for your feedback. I think I have corrected all the points you mentioned.
Member

@rems64 - Thank you for your feedback. I think I have corrected all the points you mentioned.

No worries. That looks really nice, and seems to be just what Jeroen was looking for.

> @rems64 - Thank you for your feedback. I think I have corrected all the points you mentioned. No worries. That looks really nice, and seems to be just what Jeroen was looking for.
Harley Acheson requested review from Jeroen Bakker 2023-03-18 02:29:55 +01:00
Jeroen Bakker reviewed 2023-03-18 10:02:20 +01:00
@ -6125,2 +6125,4 @@
void *owner = nullptr;
int handle_event, icon = 0;
const char *op_name = nullptr;
const char *op_desc = nullptr;
Member

Best to use none abbreviated names op_description.
Code is mostly written once, but read many times, code and naming should reflect this.

Best to use none abbreviated names `op_description`. Code is mostly written once, but read many times, code and naming should reflect this.
Member

Note: I didn't test drive it as it is still marked as WIP. If you want a proper review remove the WIP, so I known the state of the PR.

Note: I didn't test drive it as it is still marked as WIP. If you want a proper review remove the WIP, so I known the state of the PR.
Rémy Fayet added 1 commit 2023-03-18 14:24:04 +01:00
Rémy Fayet added 1 commit 2023-03-18 14:25:03 +01:00
Rémy Fayet changed title from WIP: UI: Clicking the camera icon while rendering should open render window to UI: Clicking the camera icon while rendering should open render window 2023-03-18 14:25:17 +01:00
Jeroen Bakker requested changes 2023-03-20 09:48:32 +01:00
Jeroen Bakker left a comment
Member

Patch doesn't work in all cases of Temporary Windows Perhaps we should only add the operation when the Temporary Editors setting makes sense. Eg Keep User Interface doesn't work, but I would also not expect it to be able to work in a sense that the user wants it to work. Other options should be supported.

Patch doesn't work in all cases of `Temporary Windows` Perhaps we should only add the operation when the `Temporary Editors` setting makes sense. Eg `Keep User Interface` doesn't work, but I would also not expect it to be able to work in a sense that the user wants it to work. Other options should be supported.
Author
Contributor

Oops, I forgot to remove the automatic WIP, I still have to get used to it.
Is it better to exclude the Keep User Interface case, or to explicitly specify which temporary windows should display the button? I chose the first option, but does it really fit with Blender's coding style? A small function like display_type_show_but or an explicit switch statement with each temporary window setting seems to be more widely used in such cases.

Oops, I forgot to remove the automatic WIP, I still have to get used to it. Is it better to exclude the `Keep User Interface` case, or to explicitly specify which temporary windows should display the button? I chose the first option, but does it really fit with Blender's coding style? A small function like `display_type_show_but` or an explicit switch statement with each temporary window setting seems to be more widely used in such cases.
Rémy Fayet added 2 commits 2023-03-20 21:53:42 +01:00
Jeroen Bakker approved these changes 2023-03-21 07:47:06 +01:00
Member

although a switch statement would be preferred, it has to make sense. In this case a switch-statement doesn't and an exclusive if statement is fine (like you did). USER_RENDER_DISPLAY_NONE is used in other places as an early exit.

although a switch statement would be preferred, it has to make sense. In this case a switch-statement doesn't and an exclusive if statement is fine (like you did). USER_RENDER_DISPLAY_NONE is used in other places as an early exit.
Jeroen Bakker added this to the 3.6 LTS milestone 2023-03-21 07:52:03 +01:00
Jeroen Bakker merged commit 439beb20c3 into main 2023-03-21 07:53:41 +01:00
Sign in to join this conversation.
No reviewers
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
3 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#105765
No description provided.