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-03-24Cleanup: remove stdio.h header from MEM_guardedalloc.hCampbell Barton
This was included for `FILE *` which isn't used in the header. Ref D10799
2021-02-25Refactor: IDTypeInfo: Add `owner_get` to get owner of embedded IDs.Bastien Montagne
This concerns currently only collections (`master_collection` of scenes) and root node trees. It removes the matching type-specific helpers (`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`). No functional change expected here. NOTE: Current implementation of `owner_get` is far from optimal, we could probably do it better, see {T69169}. NOTE: While it could also have it, shapekeys IDTypeInfo was left out of this change for now. Mainly because it sould not be used currently, and we ultimately want to demote shape keys from ID status anyway.
2021-01-22LibOverride: Add an 'post apply' callback to IDTypeInfo.Bastien Montagne
Currently this is needed to properly tag PointCache's for info update (fixes an issue reported in T82503). Suspect we may need this in more cases in the future though, RNA assign/update processes are not always 100% enough to deal with complicated corner cases.
2020-11-03Add a callback to `IDTypeInfo` to allow preservation of some data accross ↵Bastien Montagne
memfile undos This is essentially adding that new callback, and using it only for already existing Scene's 3DCursor. Note that the place where this is called has been moved again, after all have been lib-linked, such that those callbacks may also work on ID pointers. Maniphest Tasks: T71759 Differential Revision: https://developer.blender.org/D9237
2020-10-30Refactor: move WorkSpace .blend I/O to IDTypeInfo callbacksJacques Lucke
2020-10-27Cleanup: use over-line for doxy commentsCampbell Barton
Follow our code style for doxygen sections.
2020-10-08Cleanup/refactor: `BKE_libblock_alloc` -> `BKE_id_new` in ID creation code.Bastien Montagne
Better use higher-level code from common ID management when possible. Helps to de-duplicate logic, and reduces outside usages of more 'dangerous' functions. Note that we could get rid of many of those `BKE_<id_type>_add` functions now, but on the other hand several of those take extra parameters and perform additional actions, so think we can keep them all for now as 'non-standard ID specific creation functions'.
2020-10-07IDTypeInfo: add flag to indicate that ID has no animation dataJacques Lucke
This is part of T75724. Reviewers: mont29 Differential Revision: https://developer.blender.org/D9134
2020-10-02Fix (unreported) design flow in how workspace's relation data are read from ↵Bastien Montagne
.blend file. Relying on pointer addresses across different data-blocks is extremely not recommended (and should be strictly forbidden ideally), in particular in direct_link step of blend file reading. - It assumes a specific order in reading of data, which is not ensured in future, and is in any case a very bad, non explicit, hidden dependency on behaviors of other parts of the codebase. - It is intrinsically unsafe (as in, it makes writing bad code and making mistakes easy, see e.g. fix in rB84b3f6e049b35f9). - It makes advanced handling of data-blocks harder (thinking about partial undo code e.g., even though in this specific case it was not an issue as we do not re-read neither windowmanagers nor worspaces during undo). New code uses windows' `winid` instead as 'anchor' to find again proper workspace hook in windows at read time. As a bonus, it will also cleanup the list of relations from any invalid ones (afaict it was never done previously). Differential Revision: https://developer.blender.org/D9073
2020-09-29Fix unreported Eisenbug leading to a crash when reading a blend file.Bastien Montagne
This took more than a day to fully investigate and understand, one of the reasons being that the probability of the issue to show up was extremely low, and subjected to very specific random factors. Root of the issue is that, in some very rare cases, a newly read ID might get the exact same memory address as the one it had when the blend file was saved. In that case, `BKE_workspace_active_set` would return immediately, since the pointer to the active workspace would remain unchanged. But that lead to having an unset NULL active layout pointer, which would crash when attempting to get e.g. the active screen. For the record, I ran into this when running a specific build (master with one flag added to the `LIB_ID_CREATE` ones, with value `1 << 3`), using a specific set of options (`--background --factory-startup -noaudio`), and passing the .blend file from T80090 as argument.
2020-08-28IDTypeInfo: add .blend file io callbacksJacques Lucke
This is part of T76372. It adds the `blend_write`, `blend_read_data`, `blend_read_lib` and `blend_read_expand` which correspond to the various steps when reading and writing .blend files. Having these callbacks allows us to decentralize the blenloader code a lot more. This has the affect that code related to any specific ID type is less scattered. Reviewers: mont29 Differential Revision: https://developer.blender.org/D8670
2020-08-07Cleanup: Blenkernel, 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/blenkernel` module. No functional changes.
2020-05-26Cleanup/refactor: Workspace API, boilerplate code, early exitJulian Eisel
* Simplify workspace API a bit * Comment on behavior of workspace-layout relations where exposed in API * Remove annoying getters/setters * Avoid lookups if we can early exit * A NULL check is removed in `direct_link_workspace()` that I don't see a need for. Am not 100% sure though, fingers crossed. In general these changes should improve readability and make things easier to reason about.
2020-05-18Refactor: Move workspace foreach_id to new IDTypeInfo structure.Bastien Montagne
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-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-09Cleanup: WorkSpace: Move to IDTypeInfo and remove unused BKE API.Bastien Montagne
2020-02-18Fix (unreported) wrong handling of usercount in `BKE_workspace_add()`.Bastien Montagne
This does not seem to be an actual issue in current master code (as creating a new ID will assign 1 user to it by default), but is breaking generic usercount handling in future changes.
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2020-01-15Fix T70965: Undo crash with specific fileJulian Eisel
Not sure how the WorkSpaceLayout.screen pointer could end up being NULL, but apparently that happens, or at least happened with older files. Rather than just adding NULL-checks, prefer not keeping around those invalid layouts at all.
2019-11-29Tests: prevent failing assertion when running blendfile-loading testSybren A. Stüvel
Loading a blendfile allocates one or more windows that need to be freed. Freeing those windows also calls `BKE_workspace_instance_hook_free()` to free workspaces. However, in the `BlendfileLoadingBaseTest` test there are no workspaces allocated. This caused an assertion failure, which was worked around by not asserting when Blender is running in background mode. Reviewed by @Severin via pair programming
2019-06-15Cleanup: spellingCampbell Barton
2019-05-16Refactor: Simplify ID Property freeingJacques Lucke
This also makes `IDP_CopyProperty` the "opposite" of `IDP_FreeProperty`, which is what I'd expect. Two refactoring steps: * rename IDP_FreeProperty to IDP_FreePropertyContent * new IDP_FreeProperty function that actually frees the property Reviewers: brecht Differential Revision: https://developer.blender.org/D4872
2019-05-15Tool System: avoid redundant refreshCampbell Barton
Workspaces refreshes tools multiple times when used by multiple windows. Also improve comments.
2019-05-15Cleanup: use doxy sections for workspaceCampbell Barton
Also move function in wrong category.
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-02Cleanup: remove DNA_PRIVATE_WORKSPACE hacks.Brecht Van Lommel
This is just not practical to do for the code as a whole, and having it as an exception for one specific data structure is not that helpful. This has only been in the way for me when refactoring code.
2019-04-02Cleanup: empty expression statement warningCampbell Barton
2019-03-08Cleanup: use plural names for Main listsCampbell Barton
Convention was not to but after discussion on 918941483f7e we agree its best to change the convention. Names now mostly follow RNA. Some exceptions: - Use 'nodetrees' instead of 'nodegroups' since the struct is called NodeTree. - Use 'gpencils' instead of 'grease_pencil' since 'gpencil' is a common abbreviation in the C code. Other exceptions: - Leave 'wm' as it's a list of one. - Leave 'ipo' as is for versioning.
2019-02-27Cleanup: Main struct member namesCampbell Barton
Rename latt to lattice and don't use plural names.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-26Cleanup: remove redundant BKE/BLI/BIF headersCampbell Barton
2019-01-15Cleanup: replace usages of deprecated BKE_libblock_free by BKE_id_free.Bastien Montagne
2018-09-27Tool System: set a default tool for each modeCampbell Barton
Also clear tools for the default startup file so changes to defaults apply to new files.
2018-09-13Workspaces: reference count screens, otherwise they are never freed.Brecht Van Lommel
They are not directly accessible in the UI anymore, it's the workspaces that we always keep until they are manually deleted now.
2018-07-10Fix workspace not freeing tool propertiesCampbell Barton
2018-07-04Workspaces: store view layer per main window, instead of per workspace.Brecht Van Lommel
It was a bit odd that the scene was stored per window but not the view layer. The reasoning was that you would use different view layers for different tasks. This is still possible, but it's more predictable to switch them both explicitly, and with child window support manually syncing the view layers between multiple windows is no longer needed as often.
2018-06-29Merge branch 'master' into blender2.8Campbell Barton
2018-06-26UI: move modal operator text from headers to status bar.Brecht Van Lommel
Python API is context.workspace.status_text_set()
2018-06-25Silence warning for release buildsDalai Felinto
2018-06-15Cleanup: G.main removal from 2.8-only code.Bastien Montagne
2018-05-31Depsgraph: Consider depsgraphs used by workspace as activeSergey Sharybin
Will cause some bad behavior when object is shared across multiple visible view layers with different overrides. Accept it for now, and possibly force single view layer later.
2018-05-26Cleanup: whitespace, long lines, duplicate includeCampbell Barton
2018-05-25Fix T55062: crash with workspace scene relations.Brecht Van Lommel
List of relations was saved with wrong struct type.
2018-05-25Fix T55183, fix T55174: crashes with workspace / view layer relation.Brecht Van Lommel
Don't store pointers to ViewLayer in the workspace, only names. Add specific relation type since the generic mechanism makes the code hard to follow. Integrate with pointer restore for undo and library remapping code to avoid data going out of sync. Also add relation automatically if there doesn't exists one yet in BKE_workspace_view_layer_get, because in general it's really hard to ensure it will exist when making arbitrary scene changes. Differential Revision: https://developer.blender.org/D3432
2018-05-22Tool System: store operator properties in the toolCampbell Barton
This replaces last-used property use which wasn't reliable since properties were not considered 'set' - causing them to be ignored.
2018-05-17Tool System: per space/mode tool supportCampbell Barton
This patch adds support for: - Per space-type tools (3D view and edit). - Per mode tools (object, edit, weight-paint .. etc). The top-bar shows the last activated tools options, this is a design issue with using a global topbar to show per-space settings. See D3395