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-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
2020-12-11Fix T83050: Crash dragging shared collection to master collectionHans Goudey
The flag syncing code expects to find collection flags in same view layer before and after the move, it even has an assert for it. However, there is one case where this doesn't happen, when dragging a collection that exists in two scenes to the master collection. This commit removes this assert, frees the temporary flag structs separately, and updates some comments with this information. There is more detail in the adjusted comment. Differential Revision: https://developer.blender.org/D9785
2020-11-30Fix (unreported) broken logic in `BKE_collection_add_from_collection`.Bastien Montagne
That function was adding given new collection to all ancestors of the reference one, instead of only to its immediate parents.
2020-11-16Merge branch 'blender-v2.91-release'Hans Goudey
2020-11-16Fix T82439: Crash moving collections between scenesHans Goudey
The original code for viewlayer collection flag syncing across moves from D9158 didn't consider the case where the collection could no longer be found in its original view layer (moving a collections betwen scenes). The fix is to just check if the collection starts in the same scene as it will be moved to before trying to do the flag syncing. I thought about this for a while and tried a couple other solutions, but I couldn't come up with a proper way to support syncing the layer collection flags across scenes without making too many changes. Differential Revision: https://developer.blender.org/D9568
2020-11-04Fix T82384: Custom Properties for ShaderNodeTree do not save in blend files.Bastien Montagne
Not sure why those were excluded, there is no reason not to write ID data itself for embedded IDs...
2020-11-04Fix (unreported) memory leak when freeing Master collections.Bastien Montagne
Potential ID properties there (or any other ID data itself) would not be freed.
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-29Refactor: move Collection .blend I/O to IDTypeInfo callbacksJacques Lucke
This one was a bit more tricky, because the file loading is mixed with versioning code and because collections are embedded into scenes. All tests that passed before, still pass.
2020-10-10Fix T81545: Moving nested collections changes view layer flagsHans Goudey
The code that restored collection flags after they are rebuilt when moving a collection didn't take into account collection children. The flag for the active collection was properly restored, but all of its children would take on the exclude flag of the collection the active collection was dragged into. This commit builds a temporary tree structure to store the flags for the moving collection and its children. Then it reapplies these flags after `BKE_main_collection_sync`. Differential Revision: https://developer.blender.org/D9158
2020-10-08Cleanup/refactor: move init of MovieClip to proper place.Bastien Montagne
2020-10-08Cleanup/refactor: move init of Collection to proper place.Bastien Montagne
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-09-16Fix tests after adding collection color taggingNathan Craddock
Fix a segfault caused by assuming all scenes have a master collection when applying versioning to old files.
2020-09-15Collections: Add color taggingNathan Craddock
This adds color tagging to collections. There are 8 color options which are themable in the user preferences, with an additional option for no color tag by default. This adds a new filled collection icon and 8 colored variants of the icon that can be themed in the user preferences. In this commit the only interface to setting the color tags is through Python, and there is nowhere in the interface where the collections are shown colored. Setting and viewing the color tags from the outliner will follow. Manifest Task: https://developer.blender.org/T77777 Differential Revision: https://developer.blender.org/D8622
2020-09-08Cleanup: consistent syntax for doxygen parametersCampbell Barton
Also use back-slash instead of '@'.
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