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-08IDManagement: change `IDTypeInfo.owner_get` to instead return address of the ↵Bastien Montagne
owner_id pointer. Also rename the callback. That way, we can keep moving toward a more generic handling of those embedded IDs (think e.g. about copy code).
2022-09-06Fix (unreported) bad handling of embedded IDs on owner copying.Bastien Montagne
Completely forgot in rBcd49fee74114 to handle the owner ID copying case (this code now also needs to re-assign to `owner_id` pointer of the newly copied embedded IDs to their rightful owner).
2022-04-02Cycles: Add support for light groupsLukas Stockner
Light groups are a type of pass that only contains lighting from a subset of light sources. They are created in the View layer, and light sources (lamps, objects with emissive materials and/or the environment) can be assigned to a group. Currently, each light group ends up generating its own version of the Combined pass. In the future, additional types of passes (e.g. shadowcatcher) might be getting their own per-lightgroup versions. The lightgroup creation and assignment is not Cycles-specific, so Eevee or external render engines could make use of it in the future. Note that Lightgroups are identified by their name - therefore, the name of the Lightgroup in the View Layer and the name that's set in an object's settings must match for it to be included. Currently, changing a Lightgroup's name does not update objects - this is planned for the future, along with other features such as denoising for light groups and viewing them in preview renders. Original patch by Alex Fuller (@mistaed), with some polishing by Lukas Stockner (@lukasstockner97). Differential Revision: https://developer.blender.org/D12871
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-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-10-29LibQuery: Add macro to help break looping when requested.Bastien Montagne
The new `BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL` execute the given statement and then check status of `LibraryForeachIDData` data, and return in case stop of iteration is requested. This is very similar to the other `BKE_LIB_FOREACHID_PROCESS_` existing macros, and allows us to properly break iteration when a sub-function has requested it. Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
2021-09-22Initial implementation of local ID re-use when appending.Bastien Montagne
This commit adds to ID struct a new optional 'weak reference' to a linked ID (in the form of a blend file library path and full ID name). This can then be used on next append to try to find a matching local ID instead of re-making the linked data local again. Ref. T90545 NOTE: ID re-use will be disabled for regular append for the time being (3.0 release), and only used for assets. Therefore, this commit should not change anything user-wise. Differential Revision: https://developer.blender.org/D12545
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-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-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
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-07Refactor: Remove `BKE_XXX_localize()`, in favor of using regular ID copying ↵Bastien Montagne
code. Besides the NodeTree case (which remains unchanged), the localize code is only used in one place (to generate previews of shading data-blocks). This commit introduces a new `LIB_ID_CREATE_LOCAL` option for ID creation/copying, which essentially implements the behavior of the removed `BKE_XXX_localize()` functions into regular mainstream ID copy code. When this option is set: - new ID is tagged with `LIB_TAG_LOCALIZED`; - Some ID copying callbacks have specific behaviors, mainly the root nodetree of shading IDs gets duplicated with specialized `ntreeLocalize()` function. Note that I would not consider getting rid of `ntreeLocalize` for now, this function is recursive, which should ideally never happen within ID management copying code (this introduces all kind of complications). No behavioral change expected from this commit.
2020-10-01Fix T81248: World nodetree action is linked after duplicationPhilipp Oeser
This was already changed for Material nodetrees on duplication in rBa75ac18638f4. Since it is not obvious from the UI how change World actions - and to be consistent with Material actions, it is best to copy the action as the default behavior. So use generic BKE_id_copy functions with LIB_ID_COPY_ACTIONS flag [which also enables us to get rid of `BKE_world_copy`] Note: taking the User Preference `USER_DUP_ACT` into account here (for both material and world actions) could be a followup step. Maniphest Tasks: T81248 Differential Revision: https://developer.blender.org/D9046
2020-09-10Refactor: move World .blend I/O to IDTypeInfo callbacksJacques Lucke
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-05-13Refactor: Move world foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-13Cleanup: Keep IDTypeInfo separated from ID type specific API.Bastien Montagne
Also do not define IDTypeInfo callback when default generic code is enough...
2020-04-20Cleanup: rename "nested" to "embedded"Jacques Lucke
Reviewers: mont29 Differential Revision: https://developer.blender.org/D7476
2020-04-03Cleanup: Animation, move AnimData API to `anim_data.c`/`BKE_anim_data.h`Sybren A. Stüvel
The `BKE_animsys.h` and `anim_sys.c` files already had a an "AnimData API" section. The code in that section has now been split off, and placed into `BKE_anim_data.h` and `anim_data.c`. All files that used to include `BKE_animsys.h` have been adjusted to only include the animation headers they need (sometimes none). No functional changes.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-09Cleanup: Move `BKE_animdata_free()` call out of each IDType free data.Bastien Montagne
This has been long standing TODO... Note that remaining usages of BKE_xxx_delete should all be carefully checked for and utilmately nuked in favor of `BKE_id_delete()`, think we still have quiet a few bugs hidden in those (code seems to usually assume those functions do a full ID deletion, which is not the case).
2020-03-06Cleanup: move camera, lights, world to IDTypeInfoBrecht Van Lommel
2020-03-04Refactor ID make local to use a single flag parameter.Bastien Montagne
Instead of using anonymous booleans flags, also allows to keep the same behavior in all cases, without needing special handling from calling code for our beloved oddballs object proxies...
2020-03-04Cleanup: ID make local: remove `id_in_bmain` argument.Bastien Montagne
This info is now stored in ID tags themselves, so no need to pass an extra anonymous boolean parameter around, yay!
2020-03-04Cleanup: Rename 'make local' functions to new scheme.Bastien Montagne
Also removed some only used locally from the header, `BKE_lib_id.h` is already way too big, no need to overload it with unused things.
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.
2019-09-12Fix T69789: Assert when create a new Full Copy scene base on 2D template.Bastien Montagne
Private ID data (nodetrees and scene collections...) need special care and handling of their copy flags, and checks must be adapted too. In that case, issue came from the fact that even though those IDs have to be copied outside of bmain, we may still require usercount handling. That commit also fixes a somewhat related issue - we cannot use the non-id private data copying flag for private IDs copying, due to difference in handling of usercount again.
2019-09-11DNA: defaults for ID typesCampbell Barton
2019-09-02DatablockManagement: Fix/sanitize handling of flags for private ID data in ↵Bastien Montagne
copy functions. Not sure exactly why that was working with nodetrees in depsgraph (could be some special code in the despgraph), but we always want to allocate memory for the nodetrees here!
2019-08-22Revert "Fix T68971: Copy As New Driver from Material node creates a bad ↵Bastien Montagne
reference." This reverts commits 54fd8176d7e91, 4c5becb6b1 and 8f578150e. Those kind of commits must be reviewed and approved by project owners. That one: * Broke Collada building by not properly updating all calls to modified function. * Broke *whole* ID management by not properly updating library_query.c. And in general, I am strongly against backward ID pointers, those are *always* a serious PITA for ID management. Sometimes they cannot be avoided, but in general other ways to get that kind of info should be investigated first.
2019-08-22NodeTree: also assign the owner pointer when copying.Alexander Gavrilov
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-22Cleanup: style, use braces for 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-03-12Cleanup: BLI_utildefines struct macrosCampbell Barton
Use the term "AFTER" instead of "OFS" since it wasn't obvious these macros operate on everything after the struct member passed. Avoid casting to non-const types when only reading.
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-05Cleanup: typo in comment.Bastien Montagne
2019-02-05Cleanup: replace BKE_id_copy_ex by BKE_id_copy where possible.Bastien Montagne
That way it is obvious when we are using default ID copy behaviour, and when we are using advanced/specialized ones.
2019-02-05Cleanup: BKE_library: rename id_copy to BKE_id_copy.Bastien Montagne
Time to follow conventions for that one as well.
2019-02-05Cleanup: BKE_library: remove 'test' param of id_copy.Bastien Montagne
This was used in *one* place only... much better to have a dedicated helper for that kind of things. ;)
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
2018-12-14Attempt to sanitize node tree deletionSergey Sharybin
Make it explicit when freeing node tree which is owned by other ID or when freeing node tree which is outside of a bmain.
2018-12-12Merge branch 'master' into blender2.8Campbell Barton
2018-12-12Cleanup: use colon separator after parameterCampbell Barton
Helps separate variable names from descriptive text. Was already used in some parts of the code, double space and dashes were used elsewhere.
2018-12-04Fix for assert failure in material previewSergey Sharybin
All localized datablocks are not supposed to have animation data associated with them. There was an easy way to reproduce assert failure: toggle animation decorator for Viewport Display -> Color.