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-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-08LibOverride: Add 'hierarchy root ID' info.Bastien Montagne
This change will make handling of liboverrides hierarchies (especially resyncing) much easier and efficient. It should also make it more resilient to 'degenerate' cases, and allow proper support of things like parenting an override to another override of the same linked data (e.g. a override character parented to another override of the same character). NOTE: this commit only implements minimal changes to add that data and generate it for existing files on load. Actual refactor of resync code to take advantage of this new info will happen separately.
2022-02-07Curves: Rename "Hair" types, variables, and functions to "Curves"Hans Goudey
Based on discussions from T95355 and T94193, the plan is to use the name "Curves" to describe the data-block container for multiple curves. Eventually this will replace the existing "Curve" data-block. However, it will be a while before the curve data-block can be replaced so in order to distinguish the two curve types in the UI, "Hair Curves" will be used, but eventually changed back to "Curves". This patch renames "hair-related" files, functions, types, and variable names to this convention. A deep rename is preferred to keep code consistent and to avoid any "hair" terminology from leaking, since the new data-block is meant for all curve types, not just hair use cases. The downside of this naming is that the difference between "Curve" and "Curves" has become important. That was considered during design discussons and deemed acceptable, especially given the non-permanent nature of the somewhat common conflict. Some points of interest: - All DNA compatibility is lost, just like rBf59767ff9729. - I renamed `ID_HA` to `ID_CV` so there is no complete mismatch. - `hair_curves` is used where necessary to distinguish from the existing "curves" plural. - I didn't rename any of the cycles/rendering code function names, since that is also used by the old hair particle system. Differential Revision: https://developer.blender.org/D14007
2022-02-04Remove internal proxy code, and deprecate related DNA data.Bastien Montagne
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
2022-01-04Fix T94544: crash removing image used as camera background via pythonPhilipp Oeser
Since 2.8, background images are tied to cameras (in 2.79 these were tied to a View3D I think). Code in `BKE_library_id_can_use_idtype` wasnt taking this relation between `Camera` and `Image` into account, thus leading to ID deletion/ unlinking not working properly -- in particular `libblock_remap_data` not doing its thing (and leaving the camera as a user of the image), then things went downhill from there... Now make the "Camera-can-use-an-Image" relation clear in `BKE_library_id_can_use_idtype`. Maniphest Tasks: T94544 Differential Revision: https://developer.blender.org/D13722
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-10-29LibQuery: Remove last 'bool returns' from public API.Bastien Montagne
Those were used in a very few places to detect whether iteration should be stopped or not, but one can use `BKE_lib_query_foreachid_iter_stop` now for that. Also fix early break handling in embedded IDs processing. Fix T90922: Fix return policy inconsistency in `scene_foreach_id`.
2021-10-29LibQuery: Fix potential memleak in recursive case.Bastien Montagne
In case `library_foreach_ID_link` would return early in recursive process, it would not properly free its utils data. Also add proper iteration break in case some sub-calls requested it. Finally, make this function return a boolean to know whether iteration should be stopped or not (will be used in future commit to fix this handling in embedded IDs case). Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
2021-10-29Fix potential early-return in WM foreach_id process.Bastien Montagne
Add a function to check if iteration over ID usages should stop (using internal `IDWALK_STOP` status flag). Use it in `BKE_LIB_FOREACHID_PROCESS_` macros, and in `window_manager_foreach_id` to handle properly the active workspace case (previous code could skip the call to `BKE_workspace_active_set` in case iteration over ID usages was stopped by callback on that specific ID usage). Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
2021-10-29Cleanup: Add some comments to some sub-function of `foreach_id` process.Bastien Montagne
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-15Cleanup: doxy sections, parameter syntaxCampbell Barton
2021-08-26Cleanup: Use `ID_IS_LINKED` instead of direct `id.lib` pointer check.Bastien Montagne
2021-08-18LibOverride: Do not report embedded IDs as non-overridable in 'foreach_id' code.Bastien Montagne
Embedded IDs (root nodetrees, master collection, etc.) pointer itself is not editable, but their content may be overridden. LibOverride code is supposed to know how to handle those embedded IDs.
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-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-05-26ID management: Do not assume that `NO_MAIN` means `NO_USER_REFCOUNT`Bastien Montagne
While this is still very fuzzy in current code, this old behavior makes it close to impossible to efficiently use out-of-main temp data, as it implies that we'd need to update refcounts everytime we add something back into BMain (an 'un-refcount' ID usages when removing from BMain). Now that we have two separate flags/tags for those two different things, let's not merge them anymore. Note that this is somewhat on-going process, still needs more checks and cleanup. Related to T88555.
2021-05-06Cleanup: spellingCampbell Barton
2021-05-05LibQuery: Cleanup: Document more fields of `LibraryForeachIDData` struct.Bastien Montagne
2021-05-05LibOverride: Fix usage of IDProps that are not overridable.Bastien Montagne
Not all python-defined ID properties are overridable (yet), this needs to be detected by libquery 'foreach id' code, such that those ID pointers can be ignored by override code when working on override hierarchies. Fixes part of the issues found while investigating studio files (namely, some py-defined ID pointer properties from rigify that are not currently overridable would cause issues and false detections during resync).
2021-05-05LibOverride/LibQuery: Refactor 'non-overridable' status management.Bastien Montagne
Move the detection/decision of whether an ID pointer should be taken into account in library override hierarchy processing to the LibQuery area of code, by introducing a new callback flag. This allows to factorize the test logic, be explicit in liboverride code about ID relationships that can be ignored when exploring the override hierarchy, and adds the possibility to do more checks about pointers to be tagged as non-overridable in the future. Note that all but the 'special' ID pointers (loop-back, embedded, etc.) should be overridable. If some is not, relevant IDType 'foreach_id' callback code is reponsible to tag it properly. Python-defined IDProperties however are not systematicaly overridable (yet), so this should allow us to detect that case and act accordingly in an incomming commit. No behavioral change expected in this commit.
2021-03-12LibQuery: Add an option to process internal runtime ID pointers.Bastien Montagne
In some cases (advanced, low-level code) we also want to process ID pointers like `ID.newid` or `ID.orig_id`.
2021-03-04Cleanup: Main `foreach ID` code: Remove `MAX_LIBARRAY` and improve comments.Bastien Montagne
The `MAX_LIBARRAY` define was an annoying doublon to the `INDEX_ID_MAX` enum value now defined in `DNA_ID.h`, and it is no more useful. And comments were somewhat outdated. Also added an explanation about chosen order for the `INDEX_ID_<IDTYPE>` order.
2021-03-01Cleanup: spellingCampbell Barton
2021-02-25BKE_lib_query: Add a function to detect and tag all unused IDs.Bastien Montagne
With the option to detect orphaned data recursively (i.e. if ID `a` is the only user of ID `b`, and ID `a` is unused, ID `b` will also get tagged as unused). To be used by the Purge operation.
2021-02-04Fix: window manager can reference scenes and workspacesJacques Lucke
This also fixes T83592 for me. Differential Revision: https://developer.blender.org/D10046
2021-01-22Refactor BMain relations temp data.Bastien Montagne
`bmain.relations` is used to store temp data of relations between IDs, to speed-up some complex processes heavily relying on such information. Previous implementation was failry unclear/confusing, and required a not-so-nice hack to 'tag' some ID as processed. New code changes as such: * Using `from`/`to` naming (instead of `user`/`used`). * More clear separation between `to` `id_pointer` and `from` one, using an union instead of hacking around difference between `ID *` and `ID **` pointers. * Adds storage of `session_uuid` informations (mainly useful as debug/ensuring proper consistency of data currently). * Adds a structure per ID in the mapping. This enables possibility of storing tags (and potentially more data in the future) per-ID, without polluting the IDs themselves with very short-life info. Differential Revision: https://developer.blender.org/D10164
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-07-22Simulation: improve depsgraph integrationJacques Lucke
A simulation data block has an embedded node tree, which requires special handling in a couple of places. Some of those places were missing beforehand. This also adds a relation to make sure that the simulation is evaluated after animations on the embedded node tree are evaluated.
2020-05-26Cleanup: remove unused includes from lib_query.cBastien Montagne
2020-05-26Fix/refactor foreach_id handling of animdata.Bastien Montagne
Now callbacks for animdata, nla strip and fcurve are in their own proper BKE files (mimicking `foreach_id` callback of `IDTypeInfo`). This commit also fixes some missing handling of ID pointers (text ID and IDProperties of script fcurve modifier...).
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-21libquery: Cleanup: finish refactor by removing no more used code.Bastien Montagne
2020-05-21Libquery refactor: Cleanup (remove no more used macros).Bastien Montagne
2020-05-21Refactor: Move scene foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-21Refactor: Move object foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-20Refactor: Move collection foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-20Cleanup collection handling in lib_query code.Bastien Montagne
Now we do not need anymore that extra function...
2020-05-20Libquery: refactor: handle scene's master collection like any othe embedded ID.Bastien Montagne
2020-05-20Refactor: Move simulation foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-20Refactor: Move pointcloud and volume foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-20Refactor: Move hair foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-20Refactor: Move grease pencil foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-18Refactor: Move workspace foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-18Refactor: Move WindowManager and Screen foreach_id to new IDTypeInfo structure.Bastien Montagne
That one was a bit more complicated, and is still only partial refactor (ultimately we want to have a foreach_id callback in SpaceType itself I think...).
2020-05-18Refactor: Move action foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-15Refactor: Move linestyle foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-15Refactor: Move mask foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-15Refactor: Move movieclip foreach_id to new IDTypeInfo structure.Bastien Montagne
2020-05-15Refactor: Move particle foreach_id to new IDTypeInfo structure.Bastien Montagne