Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-23Cleanup: Clang tidyHans Goudey
Mainly duplicate includes and else after return.
2022-06-16Fix (studio-reported) broken 'system override' filtering in liboverride view ↵Bastien Montagne
of the Outliner. Regression from recent rB717ab5aeaecc.
2022-06-15Fix T98909: Outliner - "Show Hierarchy" only shows one levelJulian Eisel
Error in a4a7af47326. To allow deleting tree elements while iterating, the new iterators would get needed data out of the tree element before calling the iterator callback. This included the info if the element is open or collapsed. So if the callback would open or collapse elements, the iterator wouldn't respect that change. Luckily the way the open/collapsed state is stored, we can still query it after the callback is executed, without having to access the (possibly freed) tree element.
2022-06-14Outliner: Sanitize material unlinking callback, report errorsJulian Eisel
The callback would just assume that it's only called on materials, which may in fact not be the case. It could also be called for other ID types and layer collections (see `outliner_do_libdata_operation()`). Properly check this now. Also avoid faling silently when the object or object-data to unlink from couldn't be determined. Report this to the user. Operators that just do nothing are confusing.
2022-06-14Fix T98753: Outliner Unlink material in Blender File mode crashesJulian Eisel
This issue was only exposed by ba49345705a3. The ID pointer of the material's parent tree-element wasn't actually pointing to an ID, but to the list-base containing the IDs. It was just unlikely to cause issues in practice, although an assert was thrown. Just don't do anything if the object or object-data to unlink the material from could not be found. The following commit will introduce a error message about this.
2022-06-13Outliner performance: Only expand sub-trees if neededJulian Eisel
Before this, we would build the sub-trees of some elements, just to remove them afterwards. In big files, this would sometimes build ten thousands of elements unnecessarily. Now support not building those sub-trees in the first place. Performance tests in a Sprite Fright production file (release build): - View Layer display mode, reduced Outliner tree rebuilding from ~45ms to 12-17ms - Library Overrides display mode, Hierarchies view, reduced tree rebuilding from 5-6s(!) to 220ms
2022-06-10LibOverride: Consider animated/driven properties as part of the 'system ↵Bastien Montagne
override' ones in the Outliner. Conceptually animated/driven properties are not controlled by the liboverride system anymore, even though they may generate override operations. So consider them as part of the 'system overrides' category, and hide them by default in the Outliner.
2022-06-10Liboverride: Add rna array index return value to ↵Bastien Montagne
`BKE_lib_override_rna_property_find`. Very useful e.g. for dealing with FCurves search.
2022-06-05Cleanup: assign operator type flags in their initializationCampbell Barton
Some operators OR'ed the existing flags in a way that made it seem the value might already have some values set. Replace this with assignment as no flags are set and the convention with almost all operators is to write the value directly.
2022-05-31RNA: add macros for EnumPropertyItem layout elementsCampbell Barton
Add the following macros for enums as support for these features wasn't all that obvious and there were some inconsistencies in their use. - RNA_ENUM_ITEM_HEADING(name, description) - RNA_ENUM_ITEM_SEPR - RNA_ENUM_ITEM_SEPR_COLUMN
2022-05-30Fix T98461: Crash running screenshot from the command-lineJulian Eisel
When launching Blender with a script creating a screenshot, the Outliner tree wasn't initialized and built properly. That is because at this stage, all visible regions were only tagged for a non-rebuild redraw, not a full redraw. So ensure all regions are tagged for a full redraw immediately after file reading. Usually the full redraw would be caused by a file-read notifier, but the Python expression/script is executed before notifiers are handled. Note that even before this was crashing, the Outliner would be empty in the created screenshot. Additionally adds an assert to the Outliner to note assumptions explicitly, rather than crashing later.
2022-05-27Cleanup: Use new macro for deprecated ID typesJulian Eisel
Uses the macro introduced in b45f410b315 where it makes sense.
2022-05-27Merge branch 'blender-v3.2-release'Julian Eisel
2022-05-27Fix T97790: Crash in Outliner "Blender File" mode with old filesJulian Eisel
IPO data-block types are deprecated since 2.5. Don't show them in the Outliner at all. Differential Revision: https://developer.blender.org/D15049
2022-05-26Outliner: Make use of new C++ based functional iteratorsJulian Eisel
(Not meant to cause user visible changes.) Makes use of the new iterators introduced in the previous commit. Some benefits: - Shorter, simpler, easier to read & understand - Deduplicates logic - Centralizes iteration logic, making it easier to replace tree storage (as planned), see previous commit. - Avoids having to pass (sub-)tree to iterate around (often redundant since it's just `SpaceOutliner.tree`, even though `SpaceOutliner` is already passed). - Function arguments that are only passed to the recursive call are recognized as unused (found and removed a few). Also does some general cleanups while refactoring the code for the iterators. Use `const`, use references (signals null is not expected), early-exit (see 16fd5fa656af), remove redundant arguments, etc.
2022-05-26Outliner: New C++ based functional tree iteratorsJulian Eisel
(Not meant to cause user visible changes.) Adds some first new iterators to traverse over tree elements with a functional syntax. Functional because it meant to be used with C++ lambdas. For example, this common pattern: ```lang=cpp void some_recursive_function(SpaceOutliner *space_outliner, ListBase *tree, ...) { LISTBASE_FOREACH (TreeElement *, te, tree) { /* ... do something with the element ... */ /* Recurse into open children. */ if (TSELEM_OPEN(TREESTORE(te), space_outliner) { some_recursive_function(&te->subtree, ...); } } } ``` Gets simplified to this: ```lang=cpp void some_function(SpaceOutliner &space_outliner, ...) { tree_iterator::all_open(space_outliner, [&](TreeElement *te) { /* ... do something with the element ... */ }); } ``` We can add more iterators, e.g. some that support early exiting or skipping children, returning a custom type, only act on selected elements, etc. The following commit will convert a bunch of code to use these. Some further benefits will become visible there. Not all cases are straight forward to convert, but hopefully more and more code can be refactored to work with this. This deduplicates and centralizes the iteration logic, which will later make it much easier to refactor how the tree storage is done (e.g. move it to `SpaceOutliner_Runtime` and use a better container than `ListBase`).
2022-05-25Outliner: Fix warning icon not bubbling up correctly to collapsed parentJulian Eisel
Design is to have warnings in the sub-tree of a collapsed element show up next to the collapsed element. But if inside the collapsed element, there was a uncollapsed one containing yet another element with a warning, that warning wouldn't "bubble up" to the collapsed parent. Issue was that the warning lookup would only recurse into collapsed elements, rather than all elements inside of a collapsed element. While the actual fix for this could've been simpler, I decided to rework this code entirely. Recursively querying the warning message is now done separately from drawing the message once found, which makes the code easier to follow and implements the single responsibility principle better.
2022-05-25Outliner: Use general warning mechanics for library overridesJulian Eisel
Library overrides were basically using their own system to display warnings for tree elements, even though for other display elements we have a more general solution. With the previous commit this has been generalized further and made trivial to extend.
2022-05-25Outliner: Refactor element warning and mode column queryingJulian Eisel
Uses a inheritance based approach for querying warning of tree elements and the mode column support of display modes. For the warnings, tree elements can override the `AbstractTreeElement::getWarning()` method and return a warning string. The UI will draw the warning column with warning icons. This makes the warning column more generalized and easier to extend to more use-cases. E.g. library override elements will use this after a followup commit. To support mode toggles a display mode can now just return true in the `AbstractTreeDisplay::supportsModeColumn()` method. This makes it trivial to add mode columns to other display modes, and less error prone because there's no need to hunt down a bunch of display mode checks in different places.
2022-05-20LibOverride: Add option to Hierarchy Creation to get all data user-editable ↵Bastien Montagne
by default. Avoids having to manually enable data-blocks for user-edition when you do not care about what should be edited by whom. Similar to default behavior before introduction of system overrides (aka non-user-editable overrides).
2022-05-17Revert "Outliner: Remove the 'Remap data-block usages' operation."Bastien Montagne
This reverts commit 30534deced8dad16c566dd82db3edd462283de13. After discussion and feedback from users, it's better to keep this tool available until there is time to properly re-think the whole Outliner's contextual menu.
2022-05-17Cleanup: Use `switch` and `BLI_assert_unreachable()` more.Bastien Montagne
Replace some `if/else if` chains by proper `switch` statement. Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-15Cleanup: Clang tidyHans Goudey
2022-05-11Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-11Fix (unreported) crash in Outliner Overrides Properties view in invalid cases.Bastien Montagne
We cannot try to get RNA info when the rna path of an override property is invalid.
2022-05-11Outliner: Remove the 'Remap data-block usages' operation.Bastien Montagne
This feature is very advanced, and the way it was exposed in the Outliner was very confusing at best. It remains available through the Python API (`ID.user_remap`) e.g.
2022-05-11Outliner: Remove 'rename library' feature.Bastien Montagne
This was historically the only way to change/fix paths of library files in Blender. However, only changing the path then required a manual reload of the library, which could be skipped by user, or a save/reload of the working .blend file, which could lead to corruption of advanced library usages like overrides. Prefferred, modern way to change path of a library is to use the Relocate operation instead. Direct path modification remains possible through RNA (python console or the Data API view in the Outliner.
2022-05-05Outliner: add icons for nodegroupsPhilipp Oeser
These were missing in "Blender File" view. before {F13053175} after {F13053176} Differential Revision: https://developer.blender.org/D14859
2022-05-05Cleanup: sort cmake file listsCampbell Barton
2022-04-29Cleanup: Fix harmless runtime error about null pointer in Outliner tree code.Bastien Montagne
While the reference would never be used in case of NULL pointer, this bit of code was not really clear and nice, so make it less ambiguous now. Also add early return in case a NULL idv pointeris actually passed.
2022-04-26Outliner: Add icon column to toggle if library overrides are editableJulian Eisel
Adds a column to the right in the Library Overrides Hierarchies view mode to toggle editability of library overrides. Note that making a library override non-editable currently involves clearing all overridden properties. This is an arguable design choice, we should probably at least warn the user before doing this. Part of T95802. Reviewed by: Bastien Montagne Differential Revision: https://developer.blender.org/D14653
2022-04-18Minor tweaks to labels/tooltips of override operation in the Outliner.Bastien Montagne
2022-04-12Fix T95679: Outliner 'Unlink' directly on action misses DEG updatePhilipp Oeser
Animation would still play in the viewport. There are two ways to unlink an action from the Outliner: [1] `Unlink Action` on the Animation Data context menu. This does `outliner_do_data_operation` / `unlinkact_animdata_fn` and has the correct DEG update. [2] `Unlink` on the Action context menu This does `outliner_do_libdata_operation` / `unlink_action_fn` and was missing the DEG update. Now add the missing DEG update to the second case. Maniphest Tasks: T95679 Differential Revision: https://developer.blender.org/D14089
2022-04-05Curves: fix edit mode detectionKévin Dietrich
This adds missing cases to detect edit mode for Curves objects. Unlike other object types, Curves do not have specific edit data, rather we edit the original data directly, and rely on `Object.mode`. For this, `BKE_object_data_is_in_editmode` had to be modified to take a pointer to the object. This affects two places: the outliner and the dependency graph. For the former place, the object pointer is readily available, and we can use it. For the latter, the object pointer is not available, however since it is used to update edit mode pointers, and since Curves do not have such data, we can safely pass null to the function here. This also fixes the assertion failure that happens when closing a file in edit mode. Differential Revision: https://developer.blender.org/D14330
2022-04-04Cleanup: Left-over debug print in own recent commit.Bastien Montagne
Kudos to Aaron Carlisle (@Blendify) for noticing it!
2022-04-04Cleanup: clang-tidyCampbell Barton
2022-04-04Cleanup: ensure space after file named in headersCampbell Barton
Add blank lines after file references to avoid them being interpreted as doc-strings the following declarations.
2022-04-04Cleanup: clang-formatCampbell Barton
Add ccl_gpu_kernel_postfix as a statement macro to prevent the following declarations from being indented.
2022-03-31Outliner: New "Hierarchies" view mode for Library OverridesJulian Eisel
Adds a dropdown for the Library Overrides display mode that lets users choose between a "Properties" and a "Hierachies" view mode. The former is what was previously there (a mode that displays all overridden properties with buttons to edit the values), the latter is new. It displays the hierarchical relationships between library overridden data-blocks. E.g. to override the mesh of an object inside a linked collection, the entire collection > object > mesh hierarchy needs to be overridden (whereby the former two will be automatically overridden using system overrides). The Hierarchies mode will also show the override hierarchies of data-blocks that were linked and are overridden in the source file. This information is useful to have, especially for debugging scenes. Part of T95802. Differential Revision: https://developer.blender.org/D14440 Reviewed by: Bastien Montagne
2022-03-29LibOverride: Massive edits to 'editable' IDs checks in editors code.Bastien Montagne
Add new `BKE_id_is_editable` helper in `BKE_lib_id.h`, that supercedes previous check (simple `ID_IS_LINKED()` macro) for many editing cases. This allows to also take into account 'system override' (aka non-editable override) case. Ref: {T95707}.
2022-03-29LibOverride: Rename 'delete hierarchy' to 'clear hierarchy', add 'clear ↵Bastien Montagne
single' operations. 'Delete' was a confusing name, even though it would delete the overrides it would replace them by linked data. Adding the 'single' version of that operation made it even more confusing, since often it has to keep the override ID for sakes of hierarchy, and just reset it and turn it back into a non-editable system override. Ref: {T95707}.
2022-03-29LibOverride: Implement default 'user override' behavior.Bastien Montagne
Implement default behavior to decide which overrides remain 'system' ones, and which become 'user editable' ones, when creating hierarchy override from 3DView or the Outliner. 3DView: If from an Empty-instanced collection, only Armature objects in that collection are user overrides. If from a set of selected objects, all overrides created from selected objects are user overrides. Outliner: All override IDs created from selected elements in the Outliner are user overrides. There is one special case: When a collection is selected, and is 'closed' in the outliner, all its inner armature objects are also user overrides. Ref: {T95707}.
2022-03-29Fix T96844: Crash when switching workspaces and outliner modesJulian Eisel
Error exposed by ba49345705a3. Code just assumed that the tree-element pointed to a real ID, but this is often not the case, and the ID pointer contains completely different data. E.g. before ba49345705a3, it would be a pointer to one of the `Main` listbases, so this code would have undefined behavior. Now the pointer is null for elements in the "Current File" element, causing a null-pointer dereference rather than undefined behavior (that just happened to virtually always result in the intended code path).
2022-03-28Outliner: Don't show indirectly linked Library Overrides propertiesJulian Eisel
The Library Overrides display mode is meant to show overridden properties from the current file only, not library overrides in data-blocks that just were linked in. The upcoming Hierarchies view mode for Library Overrides will also display linked in data-blocks that have overrides in the source file (but not the individual overridden properties), see T95802.
2022-03-25Fix Outliner highlighting multiple base elements in different librariesJulian Eisel
In the Blender File display mode of the Outliner, mouse hovering a "base" element (e.g. "Objects", "Materials", ...) would also highlight that same base element in other libraries linked into the scene. In fact operations like (un)collapsing would be applied to both too. Issue was that we'd always use the listbase containing the data-blocks from the current main as a way to identify the tree element. So for the same data-block types we'd use the same listbase pointers. Instead use the the library pointer + a per library index.
2022-03-24Outliner: Don't show empty base elements in the library overrides modeJulian Eisel
In the library overrides mode, in some situations there would be empty base elements like "Collections" or "Objects". Don't show them, it's confusing wihout use. Code just failed to consider that case.
2022-03-24Outliner: Don't draw library overrides indicator for override buttonsJulian Eisel
All the buttons in the Library Overrides display mode would be shown in cyan, indicating that they are library overrides. Given that this is solely what this display mode is about, the indicator is just redundant, confusing (why are the buttons purple?) and looks weird. Part of T95802. Reviewed by: Bastien Montagne Differential Revision: https://developer.blender.org/D14416
2022-03-24Outliner: Remove list of library overrides from general display modesJulian Eisel
There is a dedicated Library Override display mode now, and showing these elsewhere just adds noise and makes the code problematic to maintain (since the same element hierarchy will be used in two entirely different contexts). The corresponding filter settings are removed too. Part of T95802. Reviewed by: Bastien Montagne Differential Revision: https://developer.blender.org/D14411
2022-03-24Outliner: Don't display library overrides from linked filesJulian Eisel
Instead of having the "Current File" and then the individual libraries containing indirect library overrides in the Library Overrides display mode, only show what's in the current file. Agreement was that this isn't very useful in this view, we may want to add it to the Hierarchy view though (see T95802). Part of T95802. Also expands the top level ID type items ("Objects", "Materials", ...) by default. See D14410 for details. Reviewed by: Bastien Montagne Differential Revision: https://developer.blender.org/D14410
2022-03-24Outliner: tweak handling of liboverrides in delete code.Bastien Montagne
Essentially, we only allow deletion of hierarchy roots of liboverrides, when hierarchy deletion option is enabled. Also add some checking code in the generic, non-object/collection ID delete code, to prevent any deletion of liboverrides that would be part of a hierarchy.