Light linking: Allow re-ordering in the light linking collections #112849

Merged
Sergey Sharybin merged 2 commits from Sergey/blender:light_linking_reorder into main 2023-09-25 18:00:37 +02:00

The order of collections in the light linking collection is important
as it is used for tie-breaking when the same object is reachable from
multiple linked collections with different light linking state.

This commit utilizes the generic tree view reordering operations to
allow insertion of elements to a specific location and to re-order
existing objects and collections in the light linking collection.

It is possible to re-order both collections and objects, even tough
re-ordering objects does not really make a difference for the light
linking behavior. It is not possible to place an object before
collections.


More user testing and tweaks is needed. Overall can't say the way
how the re-ordering feedback is done is really friendly. It becomes
too noisy to change tooltip. Much more friendly approach would be
to draw an insertion line which will give clear indication where an
item will be placed.

It is also possible to do more restrictive rules, like disable
objects re-ordering, or do some early outs when an object is
attempted to be inserted prior to collections. Not sure this is
something we want to have at all, or want to have from the get-go in
the initial patch.

The order of collections in the light linking collection is important as it is used for tie-breaking when the same object is reachable from multiple linked collections with different light linking state. This commit utilizes the generic tree view reordering operations to allow insertion of elements to a specific location and to re-order existing objects and collections in the light linking collection. It is possible to re-order both collections and objects, even tough re-ordering objects does not really make a difference for the light linking behavior. It is not possible to place an object before collections. --- More user testing and tweaks is needed. Overall can't say the way how the re-ordering feedback is done is really friendly. It becomes too noisy to change tooltip. Much more friendly approach would be to draw an insertion line which will give clear indication where an item will be placed. It is also possible to do more restrictive rules, like disable objects re-ordering, or do some early outs when an object is attempted to be inserted prior to collections. Not sure this is something we want to have at all, or want to have from the get-go in the initial patch.
Sergey Sharybin added the
Module
Render & Cycles
label 2023-09-25 14:20:34 +02:00
Sergey Sharybin added 1 commit 2023-09-25 14:20:46 +02:00
cbebde5eb0 Light linking: Allow re-ordering in the light linking collections
The order of collections in the light linking collection is important
as it is used for tie-breaking when the same object is reachable from
multiple linked collections with different light linking state.

This commit utilizes the generic tree view reordering operations to
allow insertion of elements to a specific location and to re-order
existing objects and collections in the light linking collection.

It is possible to re-order both collections and objects, even tough
re-ordering objects does not really make a difference for the light
linking behavior. It is not possible to place an object before
collections.

---

More user testing and tweaks is needed. Overall can't say the way
how the re-ordering feedback is done is really friendly. It becomes
too noisy to change tooltip. Much more friendly approach would be
to draw an insertion line which will give clear indication where an
item will be placed.

It is also possible to do more restrictive rules, like disable
objects re-ordering, or do some early outs when an object is
attempted to be inserted prior to collections. Not sure this is
something we want to have at all, or want to have from the get-go in
the initial patch.
Sergey Sharybin requested review from Brecht Van Lommel 2023-09-25 14:21:49 +02:00
Brecht Van Lommel requested changes 2023-09-25 17:44:33 +02:00
Brecht Van Lommel left a comment
Owner

The UI is not great, but I think solving it will require changes that to the tree view in general, and wouldn't make sense to do as part of this PR.

Otherwise it looks fine to me, just some comments about the tooltips.

The UI is not great, but I think solving it will require changes that to the tree view in general, and wouldn't make sense to do as part of this PR. Otherwise it looks fine to me, just some comments about the tooltips.
@ -65,3 +83,4 @@
std::string drop_tooltip(const DragInfo & /*drag*/) const override
{
return TIP_("Add to light linking collection");

Maybe "Add to light linking collection" > "Add to linking collection" to avoid confusion with the shadow linking case?

Maybe "Add to light linking collection" > "Add to linking collection" to avoid confusion with the shadow linking case?
@ -91,0 +126,4 @@
case DropLocation::Before:
return fmt::format(TIP_("Add to light linking collection before {}"), drop_name);
case DropLocation::After:
return fmt::format(TIP_("Add to light linking collection after {}"), drop_name);

It would be nice if reordering would show just "Move before" and "Move after" rather than "Add".

It would be nice if reordering would show just "Move before" and "Move after" rather than "Add".
Author
Owner

I was thinking about that. Thing is: it is only correct to use "Move" when the drag source originates from the linking collection. But it is possible to drag ID from outliner and insert it before/after existing item in the collection, and that's where the "Move" sounds a bit odd.

Currently there is no way to attach extra flag to the drag data used for the ID dragging. We could add special eWM_DragDataType so that we can distinguish origin from the drop_tooltip to generate proper tooltip, but it does not seem to worth the trouble.

Maybe there is an easy way to distinguish move and add within existing framework, but I did not find it yet.

I was thinking about that. Thing is: it is only correct to use "Move" when the drag source originates from the linking collection. But it is possible to drag ID from outliner and insert it before/after existing item in the collection, and that's where the "Move" sounds a bit odd. Currently there is no way to attach extra flag to the drag data used for the ID dragging. We could add special `eWM_DragDataType` so that we can distinguish origin from the `drop_tooltip` to generate proper tooltip, but it does not seem to worth the trouble. Maybe there is an easy way to distinguish move and add within existing framework, but I did not find it yet.
Sergey Sharybin added 1 commit 2023-09-25 17:49:06 +02:00
b5e7f4770f Use less confusing tooltip
The light and shadow linking are using the same mechanism for
drag-n-drop, and referring to the light linking collection
when doing shadow linking collection manipulation could be
confusing.
Brecht Van Lommel approved these changes 2023-09-25 17:59:17 +02:00
Sergey Sharybin merged commit 19db9a213e into main 2023-09-25 18:00:37 +02:00
Sergey Sharybin deleted branch light_linking_reorder 2023-09-25 18:00:38 +02: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
2 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#112849
No description provided.