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-03-30Iterator to loop over objects based on a flagDalai Felinto
2022-03-25LibOverride: Prevent some more potential modification of overridden collections.Bastien Montagne
2022-03-17Cleanup: spelling in commentsCampbell Barton
Use <pre>..</pre> for pseudo-code.
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-03Fix (unreported) broken do_version of hidden layers from pre-2.8 files.Bastien Montagne
`BKE_collection_object_add` ensures given object is added to an editable collection, and not e.g. a linked or override one. However, some processes like do_version manipulate collections also from libraries, i.e. linked collections, in those cases we need a version of the code that unconditionnally adds the given object to the given colleciton.
2021-12-22Fix (unreported) potential bug in collections parenting update code.Bastien Montagne
Own mistake in rB2ef192a55b2c. Did not seem to have any visible effect though...
2021-12-22Cleanup: Use `LISTBASE_FOREACH_` macros.Bastien Montagne
2021-12-22Fix T93799: Outliner: Remaping objects could result in duplicates in a ↵Bastien Montagne
collection. Fix is similar to how CollectionObject with NULL object pointers are handled. Using one of the 'free' pad bytes in Object_Runtime struct instead of a gset (or other external way to detect object duplicates), as this is several times faster. NOTE: This makes remapping slightly slower again (adds 10 extra seconds to file case in T94059). General improvements of remapping time complexity, especially when remapping a lot of IDs at once, is a separate topic currently investigated in D13615.
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-11-29Refactor BKE_bpath module.Bastien Montagne
The main goal of this refactor is to make BPath module use `IDTypeInfo`, and move each ID-specific part of the `foreach_path` looper into their own IDTypeInfo struct, using a new `foreach_path` callback. Additionally, following improvements/cleanups are included: * Attempt to get better, more consistent namings. ** In particular, move from `path_visitor` to more standard `foreach_path`. * Update and extend documentation. ** API doc was moved to header, according to recent discussions on this topic. * Remove `BKE_bpath_relocate_visitor` from API, this is specific callback that belongs in `lib_id.c` user code. NOTE: This commit is expected to be 100% non-behavioral-change. This implies that several potential further changes were only noted as comments (like using a more generic solution for `lib_id_library_local_paths`, addressing inconsistencies like path of packed libraries always being skipped, regardless of the `BKE_BPATH_FOREACH_PATH_SKIP_PACKED` `eBPathForeachFlag` flag value, etc.). NOTE: basic unittests were added to master already in rBdcc500e5a265093bc9cc. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13381
2021-11-24Cleanup: `IDTypeInfo` new `asset_type_info` member.Bastien Montagne
Two issues addressed here: I) `asset_type_info` is sub-data, not a callback. Therefore, move it before the callbacks in the `IDTypeInfo` struct. II) More important, initialize this new attribute in *ALL* `IDTypeInfo` instances. No member of this struct should ever be left implicitely uninitilazed, ever. Aftermath of rBa84f1c02d251.
2021-11-01Fix T92629: Crash on mesh separate after rB43bc494892c3.Bastien Montagne
rB43bc494892c3 switched `BKE_libblock_relink_to_newid` to use new ID remapping and libquery code. However, that new code does protect by default against remapping an objects's data pointer when that object is in Edit mode, since this is not a behavior that generic BKE code can handle (due to required editing data for most obdata types when in edit mode). So specific code that does create new IDs and need remapping in Edit mode has to pass specific exception flags to remaping code. This commit adds those remapping flags to `BKE_libblock_relink_to_newid` and add said exception flag to the remapping call from `ED_object_add_duplicate` when the object is in edit mode.
2021-10-29IDManagement: Remove deprecated `BKE_libblock_relink_to_newid` usages.Bastien Montagne
Move all usages to new `BKE_libblock_relink_to_newid_new`, and rename that one to `BKE_libblock_relink_to_newid`. Fix T91413.
2021-10-26Cleanup: clang-formatBrecht Van Lommel
2021-10-26Cleanup: LibQuery: Rename `BKE_LIB_FOREACHID_PROCESS` to ↵Bastien Montagne
`BKE_LIB_FOREACHID_PROCESS_IDSUPER`. More in-line name with the rest of that macro-based API, especially since this will be extended in the future.
2021-09-30Fix T90246: Full Copy'ing a scene confuses physics in the original scene.Bastien Montagne
Handling of RigidBody data in duplicate of scenes/collections was very wrong. This commit: - Add handling of duplication of RB collections when fully duplicating a scene. - Fix Object duplication trying to add duplicated RB objects to matching RBW collections. While the later behavior is desired when only duplicated objects, when duplicating their collections and/or scenes it is actually very bad, as it would add back new object duplicates to old (RBW) collections.
2021-08-24Fix T90840: Can't duplicate or copy (Ctrl-C) object from linked file.Bastien Montagne
We need to separate the flag telling duplicate code to not handle remapping to new IDs etc., from the one telling the code that we are currently duplicating a 'root' ID (i.e. not a dependency of another duplicated ID). This whole duplicate code/logic is still fairly unsatisfying, think it will need further refactor, or maybe even re-design, at some point...
2021-08-19Cleanup: Blendwrite: Move code deciding if an ID should be written out of ID ↵Bastien Montagne
callbacks. This was not really useful, and added estra useless steps in case and ID should not actually be written. Further more, it prevented clearing the usercount on write, which can be cause a false positive 'chanhged' detection in undo/redo case.
2021-08-11Cleanup: rename BKE_collection_{free => free_data}Campbell Barton
This function doesn't free the collection, only it's memory.
2021-08-04Cleanup: rename restrict to hide/visibility in Object, Collection, MaskLayerBrecht Van Lommel
This makes the internal naming consistent with the public API. And also gives us a visibility_flag rather than restrictflag that can be extended with more flags.
2021-07-28Remove the code in `BKE_collection_move` to preserve LayerCollection flags.Bastien Montagne
This code was actually buggy (forcefully re-enabling excluded layers in some cases). Further more, it should not be needed now that layerCollection resync code reuses as much as possible existing layers instead of deleting and re-creating them all the time. Differential Revision: https://developer.blender.org/D12016
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-06Rename Scene's embeded collections from "Master Collection" to "Scene ↵Bastien Montagne
Collection" Note that this name is essentially never used anywhere, besides as 'information' mostly accessible from python console. Those embedded IDs are not in Main, so they are not accessible by name ever, and mostly unusable from animation perspective (either drivers or fcurves). Therefore, no breakage is expected in user scripts or addons, nor when loading in older versions of Blender. Reviewed By: dfelinto, brecht Differential Revision: https://developer.blender.org/D11812
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-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-09Cleanup: spelling in commentsCampbell Barton
2021-06-05Cleanup: spelling in commentsCampbell Barton
Also remove reference to function that never existed for adding `bNode`.
2021-06-03IDManagement: Collection: Fix several issues in relationships building code.Bastien Montagne
`BKE_main_collections_parent_relations_rebuild`, `BKE_collection_parent_relations_rebuild` anf their internal dependencies had two issues fixed by this commit: * Main one was that a same collection could be processed several times, sometimes even in an infinite loop (in some rare corner cases), by `collection_parents_rebuild_recursive`. * More exotic, code here would not ensure that the collections it was processing were actually in Main (or a master one from a scene in Main), which became an issue with some advanced ID management processes involving partially out-of-main remapping, like liboverride resync.
2021-05-31Fix (studio-reported) crash in collection management code.Bastien Montagne
Code checking for potential collection loop dependencies can be called in cases where we cannot guarantee that there is no NULL pointers, so we need to check those. Was already done for objects.
2021-05-27Cleanup: rename BKE_main_id_{clear_newpoins => newptr_and_tag_clear}Campbell Barton
It wasn't obvious this function cleared the tag as well.
2021-05-27Cleanup: remove duplicate LIB_TAG_NEW untag codeErik Abrahamsson
This patch removes unnecessary calls to `BKE_main_id_tag_all` where the same job is done by `BKE_main_id_clear_newpoins` on the following line. Reviewed By: campbellbarton, mont29 Ref D11379
2021-04-26Depsgraph: support depending on collection geometryJacques Lucke
This fixes T87666 and T83252. The boolean modifier and geometry nodes can depend on the geometry of an entire collection. Before, the modifiers had to manually create relations to all the objects in the collection. This worked for the most part, but was cumbersome and did not solve all issues. For example, the modifiers were not properly updated when objects were added/removed from the referenced collection. This commit introduces the concept of "collection geometry" in the depsgraph. The geometry of a collection depends on the transforms and geometry of all the objects in it. The boolean modifier and geometry nodes can now just depend on the collection geometry instead of creating all the dependencies themselves. Differential Revision: https://developer.blender.org/D11053
2021-04-23Fix bug/crash in ID bulk deletion code.Bastien Montagne
This is complex situation. Tagged ID deletion (used to delete several data-blocks at once) removes IDs to be deleted from Main. But when we remove deleted IDs' usages of other IDs (using `BKE_libblock_relink_ex`), some specific post-process is required on some types, like Collections. Those post-processes would in some cases rely on data actually being in Main. That failing condition would lead in existing code on missing processing the very ID (collection) we were working on, leading to missing removing some child collection pointers, leading to the crash (later on in LayerCollection resync process). For now we go with an optimization & fix that avoids processing all collections in Main when we actually know which one we are working one (case of `BKE_libblock_relink_ex`, but not of `BKE_libblock_remap_locked`). This is however yet another demonstration of the need to rework that whole collection/layer resync process, since it is not only extremely inneficient currently, but it also requires valid Main/ID state way too deep into the remapping code. NOTE: This fix may very well not catch/address all possible fail cases here, dealing with the double parent/child relationships of collections is challenging... Issue reported by @eyecandy from the studio, thanks.
2021-04-09Cleanup: use our own code style for doxy-gen comment blocksCampbell Barton
2021-04-09Fix use of uninitialized memory in BKE_scene_objects_as_gsetCampbell Barton
Share macro for setting BLI_Iterator defaults to ensure this doesn't happen again in cases the ITER_* macros aren't used. Oversight in 14d74fb34174a91190d35d7fe595f8dd64cb79d1.
2021-04-08Minor cleanup to `scene_collection_array`.Bastien Montagne
Use array allocation, and remove useless check.
2021-04-08BKE_collection: Add a util returning a gset with all objects in given ↵Bastien Montagne
scene's collections. This is internaly using the code of `BKE_scene_objects_iterator` and steals its gset. More efficient than using that iterator directly to rebuild another GSet...
2021-04-08Cleanup: Typos in comments.Bastien Montagne
2021-04-02Cleanup: Use const argumentsHans Goudey
2021-03-22Fix T86741: Remapping could create doublons of collections in hierarchy.Bastien Montagne
Code rebuilding/ensuring the sanity of the collection hierarchy was not checking for a same collection being child of the same parent multiple times. This was already prevented to happen in code adding collections to other collections, but not for the remapping case.
2021-03-18Fix T86594: Overrides: Possible collection "duplication".Bastien Montagne
Issue was actually in some Collection management code, a bit too eager to add collection to the scene master one when it was not actually needed.
2021-03-16Grease Pencil: Add LineArt modifierYimingWu
This adds the LineArt grease pencil modifier. It takes objects or collections as input and generates various grease pencil lines from these objects with the help of the active scene camera. For example it can generate contour lines, intersection lines and crease lines to name a few. This is really useful as artists can then use 3D meshes to automatically generate grease pencil lines for characters, enviroments or other visualization purposes. These lines can then be baked and edited as regular grease pencil lines. Reviewed By: Sebastian Parborg, Antonio Vazquez, Matias Mendiola Differential Revision: http://developer.blender.org/D8758
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-02-05Cleanup: use 'r_' prefix for return arguments, order lastCampbell Barton
2021-01-26Cleanup: Declare variables where initializedHans Goudey
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.
2021-01-11Fix Embedded IDs creation bypassing ID management completely.Bastien Montagne
No ID (even remotely) related to Main database should ever be created directly through MEM_mallocN. Using `BKE_libblock_alloc` is the bare minimum. Note that there is no behavior change expected here.
2021-01-05Cleanup: typos (repeated words)Campbell Barton