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-09-14ViewLayer: Lazy sync of scene data.Monique Dewanchand
When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885
2022-09-14Adding `const Scene*` parameter in many areas.Monique Dewanchand
Related to {D15885} that requires scene parameter to be added in many places. To speed up the review process the adding of the scene parameter was added in a separate patch. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15930
2022-09-08Cleanup: make meaning of base visibility flags more clearBrecht Van Lommel
Rename, add comments, and use flag in the depsgraph to ensure the logic matches. Differential Revision: https://developer.blender.org/D15883
2022-09-01Cleanup: Remove/replace View Layer macros.Monique Dewanchand
This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799
2022-08-24Cleanup: Move outliner types to namespace, avoid C-style type definitionJulian Eisel
With C++ we should transition towards namespaces to avoid naming collisions. Having the namespace in place is the first step for that transition. Plus, the `typedef` isn't necessary for struct/class/enum definitions in C++, so avoid the verbosity it adds.
2022-08-19Outliner: Refactor how lazy-building of children is doneJulian Eisel
Makes the lazy-building (where children are only built when the parent isn't collapsed) more generic, so more display modes can use it. So far this was hardcoded for the "Data API" display mode. This will be used to work around a big performance issue with the Library Overrides Hierachies view in a complex production file, see following commit.
2022-07-29Cleanup: Replace reinterpret_cast<> with static_cast<> in UI codeJulian Eisel
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-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-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-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-15Outliner: 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-03-14Auto-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-03-11Cleanup: use doxy sections for the outlinerCampbell Barton
2022-03-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-02-18Cleanup: 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-02-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-02-07Curves: 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-01-27Outliner: avoid creating unnecessary undo stepsGermano Cavalcante
The `OUTLINER_OT_item_activate` operator, although it detects when something changes, always returns `OPERATOR_FINISHED` and thus induces the creation of undo steps. So return `OPERATOR_CANCELLED` when nothing changes. Ref T94080 Reviewed By: Severin Maniphest Tasks: T94080 Differential Revision: https://developer.blender.org/D13638
2022-01-26Cleanup: Reduce `void *` reliance of new sequencer C++ Outliner elementsJulian Eisel
Plan is to remove things like `TreeElement.directdata` and to instead expose specific queries in the new type specific tree-element classes. e.g. like here: `TreeElementSequence.getSequence()` For now uses `tree_element_cast<>()` to get the new type specific tree-element, later these should replace `TreeElement` all together.
2022-01-14Cleanup: spelling in comments, C++ style comments for disabled codeCampbell Barton
Also ensure space at end of comment.
2022-01-14Cleanup: Clang tidyHans Goudey
- modernize-deprecated-headers - modernize-use-using - modernize-use-nullptr - modernize-use-bool-literals
2022-01-13Cleanup: Use `nullptr` in new Outliner C++ filesJulian Eisel
2022-01-13Outliner: Compile all Outliner files in C++Julian Eisel
We want to refactor quite some of the Outliner code using C++, this is a logical step to help the transition to a new architecture. Includes plenty of fixes to make this compile without warnings, trying not to change logic. The usual stuff (casts from `void *`, designated initializers, compound literals, etc.).