Blender Git Loki

Git Commits -> Revision 2120a65

Revision 2120a65 by Nathan Craddock (soc-2019-outliner)
August 1, 2019, 04:44 (GMT)
Outliner: Open Scene list elements by default

Ensures that Scenes in the outliner scene display mode start opened.

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Outliner: Add active element theme color

Adds a themable color for the outliner's active elements in both light and default themes

Outliner: Active element

Initial implementation for active elements. Currently works for select and extend selection

Merge branch 'master' into soc-2019-outliner

Outliner: Utils function to find active element

Searches tree and returns active TreeElement

Outliner: Add range select to keymap

Changes keymap for outliner.item_activate
ctrl: extend
shift: range
alt: recursive
ctrl+alt: recursive extend

Merge branch 'master' into soc-2019-outliner

Outliner: Utils function is element visible

Outliner: Add range select

Adds range select to outliner_activate.
Range select is based on the active element and the clicked element.
If no active element is visible, report an error

Outliner: Click and drag to box select

Allows tweak event for box selection from the left gutter of the outliner.
If the gutter is clicked, everything is deselected

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Revert "Outliner: Open Scene list elements by default"

This reverts commit a3448a9eef601db5bfef682bf3e95532a7c3f367.

I accidentally included the submodules in the commit. Won't happen again!

Outliner: Fix scene elements closed by default

I committed this earlier but accidentally committed the submodules alongside it.

Outliner: Remove range select restrictions

Removes restrictions for range select requiring a visible active element.
Now if no active element is visible the shift+clicked element is set as active and selected.
This way no warnings need to be reported.

Also silenced some warnings

Outliner: Allow box select from any empty space

This allows click and drag box select from anywhere except for name
and icons of elements. Currently the restriction toggles are a valid
locaion to select from. Could remove if it becomes an issue

Outliner: Add walk select operator

Adds a walk select operator to the outliner. Currently only up
and down walk are supported, opening and closing and walking left
and right will be added later.

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Outliner: Fix memroy error in walk select

Didn't close an EnumPropertyItem with NULL

Merge branch 'master' into soc-2019-outliner

Outliner: Finish walk select

Adds walk in and out for walk select (left and right arrows)
If an element is closed, walk in will open the element. If
the element is open, left will close it. Otherwise left moves the
active element to the parent.

Merge branch 'master' into soc-2019-outliner

Outliner: Fix opening scenes by default

Keeping `sce == scene` for files with many scenes and having too many
open becomes unmaneageable.

Outliner: Cleanup active element

After discussion with Campbell, I realized that some ways I was using
active elements did not fit with Blender's way of things. Like box select
making the root of the tree active if no active element existed. These
issues are fixed, in addition to using the already-present `active`
Theme struct member.

Outliner: Cleanup range and box select

Cleanup properties, keymap, code styling, and descriptions

Outliner: Fix crash on modifier key click in empty space

I changed this line earlier, I think while implementing box selection.
Changing it back to what it was before I modified it solved the issue.

Outliner: Fix walk select error on open leaf elements

In the outliner, leaf elements like light or material data do not
show a disclosure triangle. However, they can still be toggled
with a click or the openclose operator. This led to the walk select
attempting to walk down another level in the tree.

This could be fixed in the toggle open/close functions as well, but
it seems to address it in walk select seemed simpler as this is
the only area affected.

Fix: Use correct icon for armature deform constraint

Use constraint icon rather than modifier icon for consistency

Outliner: Draw constraint icons

Draws constraint icons in the outliner for bones and objects. The
only icon that has an issue is the Action constraint icon, because
it doesn't have a specific constraint icon, so it is drawn white
instead of blue.

At first I tried to replicate the code for modifier icons, then
I found a solution using `te->directdata` that worked for both
objects and bones. It works well enough, not sure if that simpler
solution should be used for modifiers too.

Outliner: Redraw on constraint reordering

Rather than restricting which constraint actions redraw the outliner,
all will (similar to modifiers). This will redraw on constraint

Merge branch 'master' into soc-2019-outliner

Outliner: Add sync selection property

Adds a toggle to each outliner for synced selection

Outliner: Remove negative from sync selection

Removing because it was behaving strangely. I might not entirely
understand what `negative_sdna` does

Outliner: Add dirty flag

This dirty flag is to indicate whether an outliner needs to sync
its selection state with the active view layer before redrawing

Outliner: Add synced selection

This implementation is to see how syncing will be done, to be redone
later in a more general way. Right now each operator must explicitly
sync the selection.

Outliner: Refine synced selection

Any selection event that uses ED_object_base_select will now
mark the outliners as being dirty. When an outliner draws and is
dirty with synced selection enabled, it will sync its selection
state with the view layer.

More work still needs to be done. This may not be the best way
to implement it (selections from scripts won't be tracked). Also,
selection from the outliner isn't perfect.

Merge branch 'master' into soc-2019-outliner

Outliner Visibility: Add Invisible filter

This adds an object invisible filter to the outliner to only show hidden
or disabled objects in the outliner. In large scenes, it is often
difficult to locate hidden objects in the outliner to show them again.
This invisible filter makes it easier.

Outliner: Show enable/disable button for constraints

This adds the restriction icon for constraints in the outliner so
they can be enabled/disabled similar to modifiers.

It also moves the icon definition to RNA from the UI template for
the constraints in the properties editor.

Outliner: Add modifier keys to box select

Adds shift for add and ctrl for subtract, matching the 3D view
default keymap.

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Outliner: Versioning for active element theme change

It doesn't have a version bump condition currently to always apply
the theme during the summer of code

Outliner: Fix TreeStore loading in textbutton edit mode

Fixes incorrectly added the TSE_ACTIVE flag field after TSE_SELECTED
because it logically made more sense there. Old files were loading
with each tree element in textbutton edit mode. This addresses that
and other issues with mismatches on TreeStoreElem flags.

Outliner: Don't adjust horizontal scroll on show active

The show active operator tried to scroll the outliner
horizontally to show the active object. On wide outliners this
caused a jittery redraw on mousemove. When the outliner
was more narrow, repeating the operation also caused
unexpected jittery redraws.

Merge branch 'master' into soc-2019-outliner

Outliner: Sync selection state on sync selection toggle

When turning on synced selection, sync the selection. Previously
this required clicking in the outliner or doing a 3D view selection

Merge branch 'soc-2019-outliner' of into soc-2019-outliner

Outliner: Silence warning on visibility

Missing a break within a switch.

Eyedropper: Support datablock picking in outliner

This adds support for picking datablocks from the outliner with the
eyedropper tool.

This requires changing the region the UI tooltip is drawn in by
tracking when the mouse moves to a different area on the screen.
By doing this the draw callback can be reset for each new area the
eyedropper enters.

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Revert most of "Outliner: Refine synced selection"

This reverts the majority of commit

Rather than modifying ED_object_base_select to need the
view layer, use a global instead (for now)

Outliner: Add sync selection flag to main

The is_sync_select_dirty flag will be set after outliner and
3D viewport selection events to indicate a sync needs to occur.

Outliner: Enable synced selection by default

Mark outliners as dirty and enable synced selection for new
outliners. Also apply in versioning.

Outliner: Redraw 3D view after syncing selection

After deselect all in the outliner, the 3D view needs to be redrawn.
Also fix some syncing edge cases

Outliner: Redo synced selection dirty outliner implementation

The previous implementation assumed each selection type was identical
and synced each outliner with the 3D view. This had flaws because
hidden objects can be selected in the outliner, and it would be impossible
to know whether or not to keep them selected when syncing. To work around
that and other cases, this implementation does two things:

1. After any 3D view selection, sync selection flags with an outliner.
After syncing, a clean outliner is stored. Then the other outliners
are marked as dirty, to be synced from the clean outliner.

2. After an outliner select, that outliner is set as clean and the
other outliners are marked as dirty to be synced from.

More work is needed to support all outliner selection operations,
as well as properly supporting extending selections from the 3D
view. However, the underlying code for selection syncing should now
support the edge cases that the other implementation failed to

Merge branch 'master' into soc-2019-outliner

Synced Selection: Fix syncing not working

Removing some changes that were supposed to address extending
the selection, but they were preventing the replace selection
from behaving properly.

Synced Selection: Sync outliner selections to view layer

Outliner select operators now flush their selections to the
active view layer when synced selection is enabled.

Merge branch 'master' into soc-2019-outliner

Outliner: Only draw active highlight when syncing selection

When synced selection is off, it makes no sense to draw
active highlights, especially because they may be out of
sync from view layer active highlights

Merge branch 'master' into soc-2019-outliner

Synced Selection: Sync active objects between outliner and view layer

This adds the syncing of active elements. When synced selection is off
and elements are selected, no activation or selection will occur.
When synced selection is enabled, active bases will be synced
in both directions between outliner and view layer.

Currently some issues still exist, like selecting a collection
will mark it active.

Outliner: Select active on walk select with no elements selected

Rather than actually walking the selection down from the active
element on walk select, the operator now only selects the active
element in the outliner.

Outliner: Fix walk selection wrapping and other issues

This prevents walk selection from wrapping around from the last
to the first tree element. Additionally, if the active tree
element is within a closed subtree, walk select will move the
active element to the first visible parent.

The operator code is also simplified and slightly optimized.

Outliner: Fix tree building not setting parents properly

When the scenes view tree was built, the parent for view layers
and objects were not set properly (either NULL or incorrect
parent), causing walk select to fail. Now the proper parents are

Not sure if there was a reason why the wrong parent was set for
view layers before.

Outliner: Add extend selection to walk select

Walk select now extends the selection when shift is pressed.
This implementation works well, though if there are existing
selections in the tree the behavior may not work as expected.
This could be improved on in the future if that is a problem.

Merge branch 'master' into soc-2019-outliner

Outliner: Remove ctrl+click to rename

This conflicts with ctrl+click to extend selection, and is not
conventional. F2 and double click still function to rename
elements in the outliner.

Outliner: Fix range selection on active element

Range select on active element was selecting down the entire tree
because there was no element to stop at. This is resolved by
not doing a range select when the cursor element and the active
element are the same.

Outliner: Move sync_select_dirty_flag to new file

Adds `outliner_sync.c` for the global rather than storing in Main.

Outliner: Move selection syncing functions to outliner_sync.c

This is just for organization. Also fixes a small error when
outliner select/deselect all still synced when selection syncing
was disabled.

Outliner: Fix range select when active element is not selected

When the active element was not selected and range select
was used, it would become selected and the range select would
execute. A more intuitive behavior is to simply select the clicked

Also optimized the outliner_is_element_visible utility function

Merge branch 'master' into soc-2019-outliner

Outliner: Fix range select sometimes leaving hidden elements selected

The range select opearator sometimes would leave other elements
selected when changing the active element. This is fixed by
clearing the selection each time the operator runs.

Merge branch 'master' into soc-2019-outliner

Outliner: Draw more sequencer icons

Not all of the sequencer icons had been added to the outliner.
Some are still drawing with editor/modifier colors so they will
need their own icons. Or some other code workaround.

Outliner: Sync selection from sequencer

Sequencer selection operators now sync to outliners. Still needs
to sync the other direction

Outliner: Draw correct scene icon

Was drawing incorrect icon for scene

Outliner: Sync selection from outliner to sequencer

Outliner selection events now sync to the sequencer. Still need
to support active strips

Outliner: Sync active sequences between outliner and sequencer

Active sequences are now synced on selection

Outliner: Fix crash on range select when no active element exists

The old code incorrectly assumed that an active element always
existed. The fix is to set the cursor element to active when
no active element is found.

Synced Selection: Merge functions

Merged the sequence and base syncing functions together to
simplify and to make adding pose and edit bone syncing easier.
Also reduces the number of times the tree is looped over.

Outliner: Sync edit and pose bone selection state

Syncs selection to and from outliner for bones in both modes.

The code for pose bones is acceptable, but edit bones is quite
the mess. Something more intelligent needs to be thought of here.

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Outliner: Activate elements on walk select

Rather than just setting flags, activate outliner elements
to support toggling modes. This still needs some work while in
synced selection mode. Outside of synced selection it works

Merge branch 'master' into soc-2019-outliner

Outliner: Move active element code

Moves code for setting active element to activate function
rather than select function as this makes more sense

Outliner: Support selecting other objects when in edit/pose modes

When selecting in the outliner, rather than activating other
elements when in edit or pose mode, just select. This is useful
for selecting other objects while in edit/pose modes for adding
parents, hooks, etc.

Outliner: Fix setting active when in edit mode

Fixes some small issues with setting active elements

Merge branch 'master' into soc-2019-outliner

Merge branch 'master' into soc-2019-outliner

Outliner: Utils made outliner_find_active more general

Rather than only searching for active, now search for element with
matching flag.

Outliner: Rewrite walk select

Rather than basing walk select on active flags, use a new TSE_WALK
flag to navigate. Also cleaned up and simplified code.

Outliner: Fix setting of active element from the outliner

The active element was being synced, which incorrectly failed
when clicking on object data and other non-base elements in the
outliner. Now it leaves activation to operators in the outliner
rather than syncing to avoid code duplication.

Merge branch 'master' into soc-2019-outliner

Outliner: prevent bone selection when sync select disabled

More refinements to the synced selection code

Outliner: Cleanup sync code

Removed some commented code

Outliner: Improve walk select

Now that walk select doesn't start from active, some selection
operators and syncing needed to set the walk element. So after
some select operators, set the walk element alongside the active

Outliner: Remove warnings

Left a few unused variables from removing old code

Keymap: Simplify outliner select keymap

Changed extend default and simplified the keymap

Outliner: Disable synced selection in certain modes

Certain display modes don't make sense, or don't work well for
selection syncing. This disables syncing in Blender Libraries,
Data API, and Orphans view.

Revert "Keymap: Simplify outliner select keymap"

This reverts most of commit 210600e7f6df7575ad00ebbe4e4ef40be17677d0.

Outliner: Support multiple objects for parenting

Now parents multiple objects in the outliner on drag and drop.
This only works for setting an object as the parent, not for
armatures, lattices, etc. Will be improved on.

Outliner: Always do object parenting

Outliner: Support multiple selected objects for parent clear

Clear parents for all selected objects on drag and drop

Merge branch 'master' into soc-2019-outliner

Collections: Update active collection after visibility restriction

When changing viewport visiblity or restriction change the active
collection. This replicates the behavior of excluding the active
collection, which sets the first non-excluded parent as active.

This required a function to recursively check parents for the
visiblility restrictions.

Merge branch 'master' into soc-2019-outliner

Outliner: Set active camera on camera data activate

Allow setting the active scene camera on camera data activate.

Not sure if all the depsgraph and event notifier calls are needed.
Tested removing some and it still worked.

Outliner: Fix crash on duplicating scene

The function to determine if a collection was hidden was missing
a check to see if the layer collection was not null.

Outliner: Redraw on scene camera change

This appears to be a redraw on any change in the scene..
wonder if there is a better way.

Merge branch 'master' into soc-2019-outliner

Outliner: Prevent scroll page from leaving view bounds

The page up/down operator to scroll the tree could go past the
bounds of the tree leading to jumpy redraws. This prevents the
operator to go outside the bounds of the area.

Merge branch 'master' into soc-2019-outliner

Outliner: Show active improvements

Prevent the show active operator from scrolling beneath the
allowed scrolling range. This removes jumpy redraws after the
operator executes.

The horizontal centering is difficult, because the elements
outside the view of the outliner do not have the xend properly set
and the max width of the outliner is not properly calculated.
This means it is not possible to center the x position while
keeping the view in range of scrolling.

This could be resolved by drawing the outliner after setting the y
position, but that is not an ideal solution.

Outliner: Allow clicking on row icons

The feature to click on row icons was removed (presumably because
the icons now draw stacked with a number, rather than individually).
This brings back support for clicking because the benefits of
clicking on the icon without opening the element outweighs the con
of not being able to select grouped elements. A solution for that
is being worked on.

Outliner: Search recursively for icons in row

Rather than searching just the child list, search recursively
down the tree to allow clicking on all icons.

Outliner: Fix find item at x

Now that the icons are displayed for the entire subtree, the
condition to not look past the cursor X position caused errors.
Removed and the function behaves as expected.

Outliner: Draw highlights for icons in row

This draws icon highlights when the row icons are hovered.

Merge branch 'master' into soc-2019-outliner

Outliner: Rename tree element flag

Renamed from MULTI to MERGED now that I see the real name in the

Outliner: Show menu when clicking on aggregated iconrow icons

This is still a work in progress. The code needs to be better
and the behavior could use some improvement. It works okay for
now though.

Merge branch 'master' into soc-2019-outliner

Outliner: Use existing function to get unique index for element type

Just code cleanup for merged element search menu

Outliner: Draw icons in merged icon select menu

Get icon for each tree element when listing the menu

Outliner: Clear search on creation of merged element search menu

Rather than showing the last searched or selected element name
in the search button, clear each time the menu is created so
all the items are shown by default.

Outliner Cleanup: Move merge search to outliner_tools.c

Moving to a different file because the search is a menu and that
fits in better with the code there compared to the select code.

Outliner Cleanup: Finish renaming multi object to merged

Cleaned up the select code to use the word merged rather than
multi object for consistency

Outliner: Merged icon select popup UI tweaks

Adjusted some spacing and did some cleanup to the code

Outliner comment cleanup

Merge branch 'master' into soc-2019-outliner

Outliner: Fix merge search menu not showing all children

The menu was not searching over the entire subtree of the
collapsed element, but it also needed information of the
parent element and type, so a struct and memory allocation were
required to pass all of the data into the popup menu.

Outliner: Fix merge element search from finding incorrect items

When selecting aggregated collections (for example) the search
menu would show many other types of data (vertex groups, materials,
modifiers, etc.) This fixes that issue.

Merge branch 'master' into soc-2019-outliner

Outliner: Adjust data icon drawing

The icons drawn on the iconrow were brighter than the expanded
icons. This changes the color to be identical.

Merge branch 'master' into soc-2019-outliner

Outliner: Move sync selection toggle to filter popover

Moved the toggle to the popover. When in sequences view the
filter popover does not show, so the toggle is drawn on the header
in that case.

Outliner: Merged Element Search Menu Cleanup

Simplified the struct passed to the popup menu

Outliner: Fix coordinates setting incorrectly on iconrow

Iconrow coordinates were set incorrectly sometimes. It was a bad
condition check.

Outliner: Draw vertex group icons

Outliner cleanup: Disclosure triangle coordinate check

This shouldn't need to check if the element is am iconrow element
because no iconrow elements are found until the call to

Outliner: Cleanup merge search menu

Moved the struct out of the intern file to simplify and group
related code better. It was easily possible to move all the
menu code to `outliner_tools.c` so this makes more sense.
Also leads to a cleaner outliner element activate function.

Outliner: Support click+drag for toggling disclosure triangles

This reworks the openclose operator for toggling disclosure
triangles. Rather than mapping to `Enter` by default, it supports
left click and left tweak events. This allows click+drag over
elements in the tree to open or close levels. Once the click+drag
is started, only elements on that level in the outliner will open
or close.

This removes the toggling from `outliner_select.c` which adds more
clarity to the activate function.

Outliner: Cleanup outliner_select.c

Remove the unnecessary toggle function which involved duplicated
code, and move the check for restrict columns to the utils file
as it is used in multiple files.

Merge branch 'master' into soc-2019-outliner

Keymap: Remove recursive select from outliner

Removes alt and alt+ctrl from outliner for recursive select
as there is a context menu option for this, and alt+click can be
taken globally by the emulate 3 button mouse option.

Outliner fix openclose recursive not working as expected

The openclose all operator would not close the upper element, nor
would it work on the outermost collections of a scene. Now the
recursive open all option will work as expected, opening all of
an element's children, and the element itself, or closing
the element and all of its children.

Outliner: Add open/close all children to walk navigation

When pressing Shift and left or right arrow, expand or collapse
all child elements in walk navigation.

Outliner: Fix item openclose

Rather than just switching between open and close when toggling
all children, first check if any children are closed when the
item is open. If so, extend all the children first. This behavior
makes more sense.

Merge branch 'master' into soc-2019-outliner

Outliner: Improve click and drag for openclose

This adds the ability to click and drag over a disclosure triangle
and immediately drag back over it to close it. Previously it
required opening the next element before closing the first opened
element because of the way the operator stored the previously
toggled disclosure. This makes the operator more easy to use and

Outliner: Fix small issues in walk navigation

After adding open/close features to walk navigation, a few small
issues appeared. This adds a few more checks to ensure a walk
or expand really occurs when the desired keys are pressed, rather
than expanding when a walk is desired.

Also moved the walking code to separate functions to make the
switch statement more clear to read.

Outliner: Cleanup item activate code

Removed the recursive operator property as it is no longer needed.

Outliner: Refactor show active to show all instances of object

Previously the show active operator opened the tree to show the
first instance of the active object. With collection linking,
the active object could be in multiple collections. This expands
the show active operator to expand all hierarchies that contain
the active object. The view will be centered on the first
active object in the outliner.

Outliner: small cleanup to show active

Merge branch 'master' into soc-2019-outliner

Outliner: Add set parent menu for multiple objects

Allow setting the parent for multiple objects to curves, lattices
and armatures from the outliner. This has a few issues still.

Keymap: Remove recursive property from outliner item activate

Merge branch 'master' into soc-2019-outliner

Keymap: Support F2 for rename in the outliner

Rather than use the F2 rename active object popup when in the
outliner, rename the active element. This allows renaming object
data, collection, and other non-object elements within the

Outliner: Improvements to outliner parenting

Cleaned up the code for parenting to armatures, lattices, and
curves. The only downside of this method is the operator reports
will not function from the menu.

Outliner: small cleanup for show active

Outliner: Fix icons drawing over rename box

The iconrow icons were drawing as buttons, placing them above the
textbutton for item renaming. This reverts an older change which
broke the expected behavior.

Outliner: Basic outliner walk scrolling implementation

A staring point for outliner walk navigation scrolling. This
will scroll the outliner to keep the walk element in focus.

Outliner cleanup: openclose and scroll page

Simplify code and operator properties

Keymap: Simplify openclose keymap

Merge branch 'master' into soc-2019-outliner

Outliner: Add scroll view util function

Adds a scroll view utility function to be used for walk select
scrolling, pageup/pagedown scrolling, show active, and other
operators that scroll the outliner. The scroll view function
ensures the scroll amount does not go past the bounds of the
outliner, reducing redundant code in the operators.

Outliner: Use scroll view util function for walk scroll

Simplify the walk scrolling function by using the scrol view util

Outliner: Use scroll view util function for walk scroll

Simplify the walk scrolling function by using the scrol view util

Outliner: Cleanup scroll page and show active

Use scroll view util function to reduce complicated and
redundant code.

Merge branch 'soc-2019-outliner' of into soc-2019-outliner

Outliner cleanup: Version control text

Not sure what VSCode did here. Cleaning up extra text.

Merge branch 'master' into soc-2019-outliner

Differential Revision:

Commit Details:

Full Hash: 2120a6539155cdf366021a4b650cac22b8244f60
Parent Commits: 760dbd1, ca80866

Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021