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-04-11Curves: 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-11Cleanup: Left-over debug print in own recent commit.Bastien Montagne
Kudos to Aaron Carlisle (@Blendify) for noticing it!
2022-04-11Cleanup: 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-11Cleanup: clang-formatCampbell Barton
Add ccl_gpu_kernel_postfix as a statement macro to prevent the following declarations from being indented.
2022-04-11Outliner: 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-04-11LibOverride: 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-04-11LibOverride: 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-04-11LibOverride: 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-04-11Fix 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-04-11Outliner: 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-04-11Fix 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-04-11Outliner: 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-04-11Outliner: 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-04-11Outliner: 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-04-11Outliner: 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-04-11Outliner: 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.
2022-04-11Cleanup: Clang tidyHans Goudey
- Deprecated headers - Else after return - Inconsistent parameter names (I used the most recently modified) - Raw string literals
2022-04-11Tiny visual fixes/tweaks for new library override buttons in OutlinerJulian Eisel
Tweaks: - Increase horizontal padding for the buttons from 1 point to 2, looked like an unintentional placement error before. Fixes: - Missing horizontal padding for array buttons - Small gap between separator line and right column when using a high interface scale - Properly center buttons vertically.
2022-04-11Cleanup: Deprecated field access in outliner_duplicateSergey Sharybin
Solved by introducing introducing a variant of MEM_cnew which behaves as a copy-constructor for a trivial types. Alternative approach would be to surround DNA structs with clang/gcc diagnostics push/modify/pop so that implicitly defined constructors and copy operators are allowed to access deprecated fields. The downside of the DNA approach is that it will require some way to easily apply diagnostics modifications to many structs, which is not possible currently. The newly added MEM_cnew has other good usecases, so is easiest to use this route, at least for now. Differential Revision: https://developer.blender.org/D14356
2022-04-11Outliner: Display buttons to edit library override propertiesJulian Eisel
As proposed in T95802, this adds buttons to a new column on the right to modify the override in the Library Override display mode. Some further usability improvements are planned. E.g. this does not yet expand collections (modifiers, constraints, etc) nicely or group modified properties of a modifier together. Vector properties with more than 3 items or matrices aren't displayed nicely yet, they are just squeezed into the column. If this actually becomes a problem there are some ideas to address this. Differential Revision: https://developer.blender.org/D14268
2022-04-11Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
2022-04-11RNA: Generate property declerations header, solving msg-bus C++ incompatibilityJulian Eisel
Lets `makesrna` generate a `RNA_prototypes.h` header with declarations for all RNA properties. This can be included in regular source files when needing to reference RNA properties statically. This solves an issue on MSVC with adding such declarations in functions, like we used to do. See 800fc1736748. Removes any such declarations and the related FIXME comments. Reviewed By: campbellbarton, LazyDodo, brecht Differential Revision: https://developer.blender.org/D13837
2022-04-11Fix out of order event handling when calling operators from gizmosCampbell Barton
Activating a gizmo used the windows eventstate which may have values newer than the event used to activate the gizmo. This meant transforms check for the key that activated transform could be incorrect. Support passing an event when calling operators to avoid this problem.
2022-04-11Cleanup: use doxy sections for the outlinerCampbell Barton
2022-04-11Fix dragging items in the outlinerCampbell Barton
Regression in b8960267dd51f9108b3b49e9b762e6b4d35ae1dc, it's important for box-select to use the drag start to check if the cursor is over an icon.
2022-04-11Outliner: Ensure compiler error when passing wrong tree-element to macroJulian Eisel
Passing a `TreeElement *` instead of its `TreeStoreElement *` to `TSELEM_OPEN()` would seem to work but cause a bug. Add a type check that will cause a compiler error if it fails.
2022-04-11Outliner: Correct check for element cullingJulian Eisel
I don't see a reason to use 2x the element height for the "in-view" checks. That seems incorrect (although shouldn't cause issues). So remove that, I don't expect behavior changes.
2022-04-11Cleanup: Deduplicate Outliner item culling logicJulian Eisel
For whatever reason the "in-view" check was using 2x the element height. From what I can see this isn't needed, so I'll remove it in a follow-up commit.
2022-04-11LibOverride/Outliner: Restrict further operations over liboverrides.Bastien Montagne
Restrict a lot deletion/moving around of liboverride objects and collections in the Outliner. While some of those operations may be valid in some specific cases, in the vast majority of cases they would just end up breaking override hierarchies/relationships. Part of T95708/T95707.
2022-04-11Event System: drag events no longer default to the drag start locationCampbell Barton
This avoids transform jumping which is a problem when tweaking values a small amount. A fix for T40549 was made box-select used the location when the key was pressed. While it's important for box-select or any operator where it's expected the drag-start location is used, this is only needed in some cases. Since the event stores the click location and the current location, no longer overwrite the events real location. Operators that depend on using the drag-start can use this location if they need. In some cases the region relative cursor location (Event.mval) now needs to be calculated based on the click location. - Added `WM_event_drag_start_mval` for convenient access to the region relative drag-start location (for drag events). - Added `WM_event_drag_start_xy` for window relative coordinates. - Added Python property Event.mouse_prev_click_x/y Resolves T93599. Reviewed By: Severin Ref D14213
2022-04-11Cleanup: Clang tidyHans Goudey
2022-04-11Cleanup: spelling in commentsCampbell Barton
2022-04-11Cleanup: spelling in comments, use C++ comments for disabled codeCampbell Barton
2022-04-11Cleanup: use doxy-sections in outliner_draw.ccCampbell Barton
Also remove outdated comment.
2022-04-11Outliner: Display respective data-block icon in library overrides modeJulian Eisel
Just showing the library override icon for every item doesn't add much information, it's just redundant. Displaying the data-block type icon on the other hand can be useful. Differential Revision: https://developer.blender.org/D14208
2022-04-11UI: Enable the outliner to use the correct icon for each curve subtypeEthan Hall
This patch enables enables the outliner to use the correct icon for each of the curve subtypes (Curve/Surface/Font). Differential Revision: https://developer.blender.org/D14093 Reviewed by: Julian Eisel
2022-04-11Fix modal item open/close in the outliner since removing tweak eventsCampbell Barton
Correct check for left-mouse event which assumed the alternative was a tweak event. Also remove print added by accident.
2022-04-11Cleanup: use back-slash for doxygen commands, color after parametersCampbell Barton
2022-04-11Cleanup: Remove duplicated commentJulian Eisel
Something went wrong here in 61776befc3f8.
2022-04-11LibOverrides: fix handling of hierarchy root in complex cases.Bastien Montagne
This affects essentially the Outliner 'create hierarchy' tool currenlty. Previously code did not handle properly hierarchy root in case overrides where created from a non-root ID (e.g. an object inside of a linked collection), and in case additional partial overrides were added to an existing partially overrided hierarchy. Also did some renaming on the go to avoid using 'reference' in override context for anything else but the reference linked IDs.
2022-04-11Cleanup: use flags for wmEvent modifier keysCampbell Barton
Using flags makes checking multiple modifiers at once more convenient and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag which have been removed. It also simplifies checking if modifier keys have changed.
2022-04-11Fix incorrect Outliner tree-display type returnedJulian Eisel
Reverts 6d97fdc37eef. A function like this should not return a different tree-display object than of the requested type. This may hide errors, and leaves the Outliner in an undefined state (where the stored display mode doesn't match the tree-display object). I rather don't hide the fact that all display-modes should be handled here, and emit a clear error if one isn't.
2022-04-11Cleanup: Rename original curve object type enumHans Goudey
This commit renames enums related the "Curve" object type and ID type to add `_LEGACY` to the end. The idea is to make our aspirations clearer in the code and to avoid ambiguities between `CURVE` and `CURVES`. Ref T95355 To summarize for the record, the plans are: - In the short/medium term, replace the `Curve` object data type with `Curves` - In the longer term (no immediate plans), use a proper data block for 3D text and surfaces. Differential Revision: https://developer.blender.org/D14114
2022-04-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-04-11Curves: Rename "Hair" types, variables, and functions to "Curves"Hans Goudey
Based on discussions from T95355 and T94193, the plan is to use the name "Curves" to describe the data-block container for multiple curves. Eventually this will replace the existing "Curve" data-block. However, it will be a while before the curve data-block can be replaced so in order to distinguish the two curve types in the UI, "Hair Curves" will be used, but eventually changed back to "Curves". This patch renames "hair-related" files, functions, types, and variable names to this convention. A deep rename is preferred to keep code consistent and to avoid any "hair" terminology from leaking, since the new data-block is meant for all curve types, not just hair use cases. The downside of this naming is that the difference between "Curve" and "Curves" has become important. That was considered during design discussons and deemed acceptable, especially given the non-permanent nature of the somewhat common conflict. Some points of interest: - All DNA compatibility is lost, just like rBf59767ff9729. - I renamed `ID_HA` to `ID_CV` so there is no complete mismatch. - `hair_curves` is used where necessary to distinguish from the existing "curves" plural. - I didn't rename any of the cycles/rendering code function names, since that is also used by the old hair particle system. Differential Revision: https://developer.blender.org/D14007
2022-04-11Remove internal proxy code, and deprecate related DNA data.Bastien Montagne
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
2022-04-11Cleanup: Clang tidy, use bracesHans Goudey
Braces missed in b73d3b80fdcb72446
2022-04-11Remove operators to manually convert proxies to liboverrides.Bastien Montagne
Now that proxy conversions if enforced, those operations are not useful anymore. Part of T91671.
2022-04-11LibOverride: Add 'owner library' info to some liboverride code.Bastien Montagne
This will help when dealing with liboverrides from other library files, e.g for resync or proxies conversion. This commit only affects proxy conversion. Part of T91671.
2022-04-11Cleanup: Better name for new Outliner tree element typeJulian Eisel
The name `type` was confusing, since we usually use that in other ways. Also updated the relating comments.