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
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-08-26Cleanup: Use `ID_IS_LINKED` instead of direct `id.lib` pointer check.Bastien Montagne
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-23Memfile Undo: aslo tag embedded IDs for update.Bastien Montagne
This is again in the fuzzy area of how embedded IDs are handled respectively by partial undo code and depsgraph... Should not be necessary currently, but better be safe and explicit, and also tag those embeded IDs from re-used owner ID.
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-03-01Work around T86015: Crash undoing in certain scenario (disabling Global Undo).Bastien Montagne
Simply disable advanced 're-use current blend data` process when loading a memfile step and Global Undo is disabled, since there is no way to ensure we have a proper 'differential' state in the stack then. NOTE: this is a quick work-around to fix the crash, not a satisfying solution by far (pretty sure there can still be crashes if you then re-enable Global Undo afterwards e.g.).
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-09Cleanup: comments, replace 'undoes' with 'undo-steps'Campbell Barton
2021-02-09Cleanup: spellingCampbell Barton
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.
2021-01-06UndoType: Refactor: replace `use_context` boolean by a bitflag.Bastien Montagne
We will soon need more options here, sinmpler and cleaner to use a bitflag then.
2021-01-06UndoType: Fix some incinsistencies re context usage flag.Bastien Montagne
`use_context_for_encode` was not properly set regarding actual `encode` code for a few types.
2021-01-06Cleanup/refactor: UndoType: Clarify `use_context` variable.Bastien Montagne
Rename it to mark it is only for `encode` callbacks, fix `encode` callback of text undo to early fail in case it gets a NULL context, add an assert to `BKE_undosys_step_push_with_type` that context is not NULL when undotype requires a valid one. Note that in practice this should not change anything, currently it seems that we always get a valid context in `BKE_undosys_step_push_with_type`?
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-12-15Cleanup: reduce indirect DNA header inclusionCampbell Barton
Remove DNA headers, using forward declarations where possible. Also removed duplicate header, header including it's self and unnecessary inclusion of libc system headers from BKE header.
2020-11-16Cleanup: spellingCampbell Barton
2020-11-12Fix T82388: Sculpt mode: Unexpected undo behavior.Bastien Montagne
Issue exposed by rB4c7b1766a7f1. Main idea is that non-memfile first undo step should check into previous memfile and tag the ID it is editing as `future_changed`. That way, when we go back and undo to the memfile, said IDs are properly detected as changed and re-read from the memfile. Otherwise, undo system sees them as unchanged, and just re-use the current data instead. Note that currently only Sculpt mode seems affected (probably because it is storing the mode switch itself as a Sculpt undo step instead of a memfile one), but similar action might be needed in some other cases too. Maniphest Tasks: T82388 Differential Revision: https://developer.blender.org/D9510
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-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
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-25Libquery: Refactor: add bmain to data passed to callback.Bastien Montagne
No reason to enforce defining own callback user data for something that controlling has already available...
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-17Enable new undo code by default.Bastien Montagne
Note that given how experimental is working currently, I had to rename and inverse the effect of the experimental undo flag, which will now instead activate legacy code when set.
2020-04-14Fix T75542: toggling modifier visibility not working correct with undo speedupBrecht Van Lommel
The problem was that in direct_link_id_restore_recalc, recalc_undo_accumulated should contain the changes from the target state to the current state. However it had already been cleared at that point, to start accumulating changes up to the next undo push. Delaying the clear of this flag seems like the obvious solution, but it's hard to find the right place for that (if there is one). Instead this splits up the flag into two separate variables. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D7402
2020-04-08Cleanup: spellingCampbell Barton
2020-04-07Undo: change depsgraph recalc flags handling to improve performanceBrecht Van Lommel
These changes only have an effect when the experimental Undo Speedup preference is enabled. * For DEG_id_tag_update, accumulate recalc flags immediately before the undo push happens instead of afterwards. Otherwise the undo state does not contain enough flags, and the current state may contain too many flags. This also means we call DEG_id_tag_update after undo with the accumulated flags to ensure they are flushed to other datablocks. * For undo, accumulate recalc flags in id->recalc and clear accumulated flags immediately. Not clearing would cause circular behavior where accumulated flags may never end up being cleared. This matches what happens after an undo push where these are also cleared, indicating that the undo state and current in-memory state match exactly. * Don't change id->recalc of identical datablocks, it should not be needed. There is one exception for armatures where pointers across datablocks exist which otherwise would cause problems. There may be a better solution to this but it seems to work in agent 327 production files. * This contains a change in undofile.c to avoid detecting all datablocks as changed for the first of the two undo steps, where we restore to the state of the last undo push before going to the one before. Without this the whole system is much less efficient. However this is unsafe in the sense that if an app handler or operators edits a datablock after an undo push, that change will not be undone. It can be argued that this is acceptable behavior, since a following undo push will include that change and this may already have unexpected side effects. Ref T60695 Differential Revision: https://developer.blender.org/D7339
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