Page MenuHome

Outliner synced selection refinements
Needs ReviewPublic

Authored by Nathan Craddock (Zachman) on Aug 23 2019, 11:15 PM.

Details

Summary

Various Synced Selection Fixes

These changes are mostly less obvious cases where a selection sync is needed. I did not take the time to fix or test all of these cases earlier because I first wanted the selection syncing algorithm to be reviewed and accepted before proceeding.

Sync Implementation Fixes (Committed)
  • Fix syncing expecting an active object. When no active object existed, a sync would not occur in either direction.
  • Fix syncing to the outliner not clearing the active flag from non-active elements. (Needed for adding a new View Layer)
  • Optimize syncing to outliners by only syncing when necessary. Previously if an outliner was marked dirty it would sync, but the sequence dirty flag is not cleared unless a sync for that type occured. So if an outliner had not synced edit bones, it would attempt to sync each time it was drawn, even in object mode. The simple fix is to determine which types to sync and if a type will be synced, then proceed with syncing.
  • Allow selection syncing of objects from the outliner regardless of the current interaction mode.
Fixes for various actions
  • Ensure that syncs occur on changing, creating, and deleting view layers.
  • Tag for syncing after changing scenes. With unique scenes, syncing already functioned as expected. When a linked copy of a scene is created, the outliner tree element selection state is maintained between the two scenes, so it is required to sync on scene changes because a scene may be a linked copy.
  • Tag for syncing after creating a full copy of a scene.
  • Sync selection on creating a new workspace
  • Sync selection on loading a file/homefile with load UI disabled
  • Sync selection on duplicating objects
  • Sync selection on separate operators
  • Sync selection on paste in 3D view, sequencer, and outliner.
  • Sync selection on various outliner operations (object ops, drag and drop)

Diff Detail

Repository
rB Blender
Branch
arcpatch-D5572 (branched from master)
Build Status
Buildable 4701
Build 4701: arc lint + arc unit

Event Timeline

Nathan Craddock (Zachman) retitled this revision from These changes are mostly less obvious cases where a selection sync is needed. I did not take the time to fix or test all of these cases earlier because I first wanted the selection syncing algorithm to be reviewed and accepted before proceeding. to Outliner synced selection refinements.Aug 23 2019, 11:15 PM
Nathan Craddock (Zachman) edited the summary of this revision. (Show Details)
Nathan Craddock (Zachman) edited the summary of this revision. (Show Details)

Updated with more syncing fixes for separation, duplication, and outliner operations

Outliner: fix select sync on sequence paste

Before adding calls anywhere objects are added/removed. I'd like to look into handling this in a generic way.
There are so many places where object selection changes that remembering to call update functions all over the code is error prone.
For objects we already have two update calls that handle this:

DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);

The ID_RECALC_SELECT flag could be made to set the dirty flag.

Or we could have a single function call when selection changes which calls DEG_id_tag_update, WM_event_add_notifier & ED_outliner_select_sync_from_object_tag.

This is more a design task at the moment, I'd like to put this path on hold until we agree on how sync selection should be handled.

source/blender/editors/screen/workspace_edit.c
360 ↗(On Diff #17555)

This should be called from WM_window_set_active_workspace.

source/blender/makesrna/intern/rna_wm.c
846 ↗(On Diff #17555)

This is called from other places, suggest WM_window_set_active_view_layer tags for sync selection instead of just doing it from RNA.

For now I'd like to avoid adding sync selection calls for individual operators which are already tagging the depsgraph for selection updates.

Global selection syncing tags on file load will be needed irrespective, so these are fine to go in.

source/blender/windowmanager/intern/wm_files.c
1975–1977 ↗(On Diff #17555)

This can go into master.

2234–2236 ↗(On Diff #17555)

This can go into master.

Nathan Craddock (Zachman) marked 4 inline comments as done.Thu, Aug 29, 5:34 AM
Nathan Craddock (Zachman) updated this revision to Diff 17651.
  • Move scene, viewlayer, and workspace update tagging out of RNA

I moved the tagging on setting view layer, scene, and workspace from the RNA. I think it would be safe now to commit this, the improvements to syncing, and tagging for outliner operations.

  • Merge branch 'master' into arcpatch-D5572
  • Merge branch 'master' into arcpatch-D5572