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-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-09Cleanup: use own username in code-comment tagsCampbell Barton
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
2021-12-17UI: move "undo history" from a custom popup to a menu typeCampbell Barton
This lets the undo history expand as a regular sub-menu instead of being a popup. Also disable the active undo step menu item as this is a no-op.
2021-12-16Fix T94115: Selecting current action in undo history undoes allCampbell Barton
When selecting the current undo step there is no need to do anything. Fix and minor refactor to de-duplicate refreshing after running undo/redo & undo history.
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-10-19Cleanup: use 'e' prefix for enum typesCampbell Barton
2021-09-13Various UI messages fixes and updates.Bastien Montagne
2021-09-02Docs: improve the error when undo poll failsCampbell Barton
Calling undo in from Python background-mode would raise an exception without any information about how to initialize undo.
2021-07-16Cleanup: remove redundant parenthesesCampbell Barton
2021-07-15Assets: Initial Asset List as part of the Asset System designJulian Eisel
Implements a basic, WIP version of the asset list. This is needed to give the asset view UI template asset reading and displaying functionality. See: * Asset System: Data Storage, Reading & UI Access - https://developer.blender.org/T88184 Especially the asset list internals should change. It uses the File/Asset Browser's `FileList` API, which isn't really meant for access from outside the File Browser. But as explained in T88184, it does a lot of the stuff we currently need, so we (Sybren Stüvel and I) decided to go this route for now. Work on a file-list rewrite which integrates well with the asset system started in the `asset-system-filelist` branch. Further includes: * Operator to reload the asset list. * New `bpy.types.AssetHandle.get_full_library_path()` function, which gets the full path of the asset via the asset-list. * Changes to preview loading to prevent the preview loading job to run eternally for asset views. File Browsers have this issue too, but should be fixed separately.
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-04-09Cleanup: use our own code style for doxy-gen comment blocksCampbell Barton
2021-03-17Fix T86609: GPencil: Sculpt brush cursor disappears on undo.Bastien Montagne
Regression from rB2a8122fb65c5, somehow that piece of code was lost during the refactor.
2021-03-16Fix T86561: Edit-mode crash with multiple objects sharing a meshCampbell Barton
Use a for loop that always begins with the active object, instead of moving the active object in the array, which failed when it's data already being handled. While the existing logic could have been fixed, it's simpler to change the loop order.
2021-02-26Cleanup: move comment into function doc-stringCampbell Barton
2021-02-25Fix T85975: Edit-mode undo/redo removes overlaysCampbell Barton
Setting the active object when decoding undo steps missed a call to ED_object_base_active_refresh.
2021-02-05Cleanup/refactor: Undosys: Get rid of the magic values for undo direction.Bastien Montagne
Move `eUndoStepDir` to `BKE_undo_system.h` and use its values everywhere. Note that this also introduce the `STEP_INVALID` value in that enum. Finally, kept the matching struct members in some lower-level readfile code as an `int` to avoid having to include `BKE_undo_system.h` in a lot of unrelated files.
2021-02-03BKE UndoSys refactor: deduplicate and simplify code, sanitize naming.Bastien Montagne
Now we only use 'undo' or 'redo' in function names when the direction is clear (and we assert about it). Otherwise, use 'load' instead. When passing an undo step to BKE functions, consider calling code has done its work and is actually passing the target step (i.e. the final step intended to be loaded), instead of assuming we have to load the step before/after it. Also deduplicate and simplify a lot of core undo code in BKE, now `BKE_undosys_step_load_data_ex` is the only place where all the complex logic of undo/redo loop (to handle several steps in a row) is placed. We also only use a single loop there, instead of the two existing ones in previous code. Note that here we consider that when we are loading the current active step, we are undoing. This makes sense in that doing so //may// undo some changes (ideally it should never do so), but should never, ever redo anything. `BKE_undosys_step_load_from_index` also gets heavily simplified, it's not basically a shallow wrapper around `BKE_undosys_step_load_from_index`. And some general update of variable names, commenting, etc. Part of T83806. Differential Revision: https://developer.blender.org/D10227
2021-01-28Fix T85124: Undo assert changing property in redo panel.Bastien Montagne
Logical mistake in recent refactor (rB2a8122fb65c5).
2021-01-26ed_undo refactor: split/remove `ed_undo_step_impl`.Bastien Montagne
This function was doing too many things, with behaviors fairly different depending on its input parameters. This was making the code fragile and hard to follow. Split it in three: * `ed_undo_step_pre` does the common actions before we actually undo data. * `ed_undo_step_post` does the common actions after we have undone/redone data. Then, `ed_undo_step_direction`, `ed_undo_step_by_name` and `ed_undo_step_by_index` do their actual specific actions, with their own logic. Note: Since the actual behavior of those three funtions is fairly different (the first only undo/redo one effective step, the second is only supposed to **undo** //before// given named step, and the third actually undo/redo until given indexed step become active), we could also find better names for those. right now, it sounds like they are doing the same thing, with just different ways to specify the target step. Note: This is part of on-going refactor work on undo system, see T83806. Differential Revision: https://developer.blender.org/D10112
2021-01-26Fix T85054: undo/redo app handlers brokenFalk David
Regression in recent commit c13383da416c9c99d03058caaf66c736af0272cb which swapped undo/redo when calling the handlers. Ref D10200
2021-01-14Cleanup: ed_undo: naming of parameters, const, etc.Bastien Montagne
No behavrioral change expected here.
2021-01-14Cleanup/refactor: Remove logically broken code from GPencil undo.Bastien Montagne
`ED_undo_gpencil_step` only support valid undo step direction, passing step name here is useless and only add confusion to what works or not. Undo by step name or step index is fully not supported by GPencil undo mode currently. Note that since GPencil undo mode does not seem to ever be used anyway, this is not an urgent issue in practice, but this needs to be cleaned up at some point. See also T84703.
2021-01-14Cleanup: use enum for undo step directionCampbell Barton
The step direction was confusingly 1 for undo, -1 for redo. This convention is from 2004 (562d6958cbf646aba31ed92fe4f0e07d1dc495b6). Use enum for ed_undo.c for better readability.
2020-12-28UI: List library overrides in the OutlinerJulian Eisel
Having a centeral place to find a list of all library overrides should be useful for managing production scenes where library overrides are used a lot. This change adds the individually overridden properties of a data-block under the data-block itself. Just how we show modifiers, constraints or pose channels there. This way we can also expose library override operations/options better in future. There's also a filter option for the library overrides now, so they can be hidden. It is only available in the View Layer display mode though, like the other filter options. One internal change this has to do is adding more informative return values to undo pushes and the library override functions called by it. That way we can send a notifier when library overrides change for the Outliner to know when to rebuild the tree. Differential Revision: https://developer.blender.org/D7631 Reviewed by: Andy Goralczyk, Bastien Montagne, William Reynish
2020-10-30Undo System: support for grouping steps with begin/end callsCampbell Barton
This adds support for treating multiple undo steps as a single step from the user perspective. This is needed for outliner mode switching and `object.switch_object` operator which change active object and mode in a single action.
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-09-30Cleanup: convert gforge task ID's to phabricator formatValentin
Cleanup old tracker task format to the new. e.g: [#34039] to T34039 Ref D8718
2020-09-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
2020-07-19Fix T78624: Crash running operators from Python in background modeCampbell Barton
2020-07-03Cleanup: Editors, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors` module. No functional changes.
2020-05-14Fix undo-push assert for some modes with zero undo stepsCampbell Barton
Also fixes files not being tagged as modified with zero undo steps.
2020-05-14Fix sculpt/paint missing undo-step limitingCampbell Barton
2020-04-03Code Quality: Replace for loops with LISTBASE_FOREACHDalai Felinto
Note this only changes cases where the variable was declared inside the for loop. To handle it outside as well is a different challenge. Differential Revision: https://developer.blender.org/D7320
2020-04-03Cleanup: Rename ScrArea variables from sa to areaJulian Eisel
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432. Now the area and region naming conventions should be less confusing. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-04-03Cleanup: Continue renaming ARegion variables from ar to regionJulian Eisel
Continuation of b2ee1770d4c3, now non-single word variables are also renamed. Part of T74432. Also ran clang-format on affected files.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-09GPencil: Refactor of Draw Engine, Vertex Paint and all internal functionsAntonio Vazquez
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes. Also, a huge code cleanup has been done at all levels. Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development. Differential Revision: https://developer.blender.org/D6293
2020-03-06Cleanup: Reduce context usage in UI functionsJulian Eisel
Part of https://developer.blender.org/T74429. There's a chance that this causes some issues becaue in some cases we change from getting the window from context to getting it from somewhere else.
2020-02-04Merge branch 'blender-v2.82-release'Campbell Barton
2020-02-04Fix T73234: Undo/redo with local collection crashesCampbell Barton
Resolves crashes when edit-mode undo data wasn't included because it wasn't visible, also resolves T73416.
2020-01-28UI: Edit Menu - Undo History List and Operator PollingHarley Acheson
Enable and Disable Edit Menu items based on whether those actions are currently applicable. https://developer.blender.org/D4846 Reviewed by Brecht Van Lommel
2019-11-07Fix T69822: Switching sculpt objects breaks undoCampbell Barton
This introduces object mode tagging for data which hasn't yet been written back to the ID data. Now when selecting other sculpt objects, the original objects data is flushed back to the ID before writing a memfile undo step.
2019-09-11Python handlers: Pass depsgraph to events where it makes senseSergey Sharybin
The goal is to make it possible to access evaluated datablocks at a corresponding context. For example, be able to check evaluated state if an object used for rendering. Allows to write scripts in a safe manner for T63548 and T60094. Reviewers: brecht Differential Revision: https://developer.blender.org/D5726
2019-09-09Move callbacks API from BLI to BKESergey Sharybin
Preparing for the bigger changes which will be related on passing dependency graph to various callbacks which need it. Differential Revision: https://developer.blender.org/D5725