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-07-13Depsgraph: Implement 'ID_RECALC_GEOMETRY_DEFORM'Germano Cavalcante
During a mesh transformation in edit mode (Move, Rotate...), only part of the batch cache needs to be updated. This commit allows only update only the drawn batches seen in `BKE_object_data_eval_batch_cache_deform_tag` if the new `ID_RECALC_GEOMETRY_DEFORM` flag is used. This new flag is used in the transforms operation for edit-mesh and results in 1.6x overall speedup in heavy subdiv cube. Differential Revision: https://developer.blender.org/D11599
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-24Depsgraph: support flushing parameters without a full COW updateCampbell Barton
Avoid computationally expensive copying operations when only some settings have been modified. This is done by adding support for updating parameters without tagging for copy-on-write. Currently only mesh data blocks are supported, other data-blocks can be added individually. This prepares for changing values such as edit-mesh auto-smooth angle in edit-mode without duplicating all mesh-data. The benefit will only be seen when the user interface no longer tags all ID's for copy on write updates. ID_RECALC_GEOMETRY_ALL_MODES has been added to support situations where non edit-mode geometry is modified in edit-mode. While this isn't something user are likely to do, Python scripts may change the underlying mesh. Reviewed By: sergey Ref D11377
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-05-26LibOverride: add recursive resync.Bastien Montagne
Recursive resync means also resyncing overrides that are linked from other library files into current working file. Note that this allows to get 'working' files even when their dependencies are out of sync. However, since linked data is never written/saved, this has to be re-done every time the working file is loaded, until said dependencies are updated properly. NOTE: This is still missing the 'report' side of things, which is part of a larger task to enhance reports regarding both linking, and liboverrides (see T88393). ---------- Technical notes: Implementing this proved to be slightly more challenging than expected, mainly because one of the key aspects of the feature was never done in Blender before: manipulating, re-creating linked data. This ended up moving the whole resync code to use temp IDs out of bmain, which is better in the long run anyway (and more aligned with what we generally want to do when manipulating temp ID data). It should also give a marginal improvement in performances for regular resync. This commit also had to carefully 'sort' libraries by level of indirect usage, as we want to resync first the libraries that are the least directly used, i.e. libraries that are most used by other libraries.
2021-05-18Fix T88026: Repeated switch to rendered viewport crashesCampbell Barton
Resolve ownership ambiguity with shared physics pointers. Previously, LIB_ID_CREATE_NO_MAIN allowed pointer sharing with the source ID so physics caches can be shared between original and evaluated data: (Object.soft.shared & Object.rigidbody_object.shared). This only worked properly for LIB_TAG_COPIED_ON_WRITE ID's, as LIB_TAG_NO_MAIN can be used in situations where the original ID's lifetime limited by it's original data. This commit adds `LIB_ID_COPY_SET_COPIED_ON_WRITE` so ID's only share memory with original data for ID's evaluated in the depsgraph. For all other uses, a full copy of physics data is made. Ref D11228#287094
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-08LibOverride: Add a new 'leftover' flag to ID.Bastien Montagne
This flag is set for liboverride IDs that are detected as no longer needed by resync process, while having been user-edited, so auto-handling code cannot silently delete them. Exposing those to users will be part of the new incoming Override Outliner view. Part of D10855.
2021-03-24Tweak default ID types processing order, step 17: Group and comments.Bastien Montagne
Regroup ID type indices by categories, and add some comments about reasoning of current order.
2021-03-24Tweak default ID types processing order, step 16: Palettes.Bastien Montagne
Move Palettes type with other weird, not-really-data ID types (like PaintCurves and Brushes), higher in the process. Those preset-like types may use a lot of other ID types, but should only be used by UI-related (and Scene, for tool settings) types.
2021-03-24Tweak default ID types processing order, step 15: ShapeKeys.Bastien Montagne
Move shape keys type just after all obdata types, since they are some sort of sub-geometry data.
2021-03-24Tweak default ID types processing order, step 14: Fonts.Bastien Montagne
Move Font type toward the end of the list, this is a file-wrapper type with typically no dependency to any other ID.
2021-03-24Tweak default ID types processing order, step 13: Texts.Bastien Montagne
Move Texts type toward the end of the list, this is a file-wrapper type with typically no dependency to any other ID.
2021-03-24Tweak default ID types processing order, step 12: Sounds.Bastien Montagne
Move Sound type toward the end of the list, this is a file-wrapper type with typically no dependency to any other ID.
2021-03-24Tweak default ID types processing order, step 11: Worlds.Bastien Montagne
Move World type with the other shading types.
2021-03-24Tweak default ID types processing order, step 10: LineStyles.Bastien Montagne
Move LineStyles (Freestyle) type with the rest of the shading types.
2021-03-24Tweak default ID types processing order, step 09: Particles.Bastien Montagne
Move Particles next to the other physics/simulation types, after obdata types.
2021-03-24Tweak default ID types processing order, step 08: CacheFiles.Bastien Montagne
Move them with the rest of the simulation types.
2021-03-24Tweak default ID types processing order, step 07: MovieClips.Bastien Montagne
Move them with the other shading/image types, just before Images.
2021-03-24Tweak default ID types processing order, step 06: Brushes.Bastien Montagne
Move Brushes type with other weird, not-really-data ID types (like Palette and Brushes), higher in the process. Those preset-like types may use a lot of other ID types, but should only be used by UI-related (and Scene, for tool settings) types.
2021-03-24Tweak default ID types processing order, step 05: PaintCurve.Bastien Montagne
Move PaintCurve type with other weird, not-really-data ID types (like Palette and Brushes), higher in the process. Those preset-like types may use a lot of other ID types, but should only be used by UI-related (and Scene, for tool settings) types.
2021-03-24Tweak default ID types processing order, step 04: Screen.Bastien Montagne
Move Screen data type higher in the list, just after the other UI-related types, and before Scenes.
2021-03-24Tweak default ID types processing order, step 03: Mask.Bastien Montagne
Move it with the rest of the image/shading related types.
2021-03-24Tweak default ID types processing order, step 02: Simulations.Bastien Montagne
This is a fairly low-level ID type, so it needs to be higher in the list, for now put it just before the shading-related types.
2021-03-24Tweak default ID types processing order, step 01: Collections.Bastien Montagne
Move `OB_GR` processing just after scenes, and before objects. This is much more sensible in general, and fixes glitches in auto-resync process of library overrides in particular.
2021-03-11LibOverride: First stage of detection of 'need resync'.Bastien Montagne
We can fairly easily detect some resync-needed cases when applying the overrides operations on a Pointer RNA property. This should cover all cases where an existing override's ID pointer is changed in its linked data. We still have to add code to detect when a not-yet-overridden linked ID needs to become overridden (because its relations to other data-blocks changed in a way that requires it). Part of T83811 & D10649.
2021-03-08PyAPI: add bpy.types.BlendFile.temp_data for temporary library loadingCampbell Barton
This adds support for creating a `BlendFile` (internally called `Main`), which is limited to a context. Temporary data can now be created which can then use `.libraries.load()` the same as with `bpy.data`. To prevent errors caused by mixing the temporary ID's with data in `bpy.data` they are tagged as temporary so they can't be assigned to properties, however they can be passed as arguments to functions. Reviewed By: mont29, sybren Ref D10612
2021-03-05Cleanup: spellingCampbell Barton
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: Mention Correct Types In CommentsJeroen Bakker
2021-02-13Cleanup: spellingCampbell Barton
2021-02-10LibOverride: Refactor: Switch more code to using Main.relations.Bastien Montagne
This potentially could fix some missed cases in dependency tagging (when dealing with overrides hierarchies), since relying on tag in ID itself is not a good idea to check whether an ID has been propcessed or not (exterior code may have forced that tag on some IDs e.g., which would prevent them from ever being processed properly).
2021-02-09Cleanup: move eIconSizes, ID_Type enums into own fileCampbell Barton
This avoids adding DNA_ID.h into other headers, recently changed in cfa48c84d06ca8197f86b6d3ceef8a2c7c311a82 Note that other enums could be moved too, this is a smaller change to avoid indirectly including DNA_ID.h in many places.
2021-01-29Merge branch 'blender-v2.92-release'Brecht Van Lommel
2021-01-29Fix T83411: Crash when using a workspace/layout data path in a driverSergey Sharybin
Building IDs which are not covered by copy-on-write process was not implemented, which was causing parameters block not present, and, hence causing crashes in areas which expected parameters to present. First part of this change is related on making it so Copy-on-Write is optional for ID nodes in the dependency graph. Second part is related on using a generic builder for all ID types which were not covered by Copy-on-Write before. The final part is related on making it so build_id() is properly handling ParticleSettings and Grease Pencil Data. Before they were not covered there at all, and they need special handling because they do have own build functions. Not sure it worth trying to split those parts, as they are related to each other and are not really possible to be tested standalone. Open for a second opinion though. Possible nut-tightening is to re-organize build_id() function so that every branch does return and have an assert at the end, so that missing ID type in the switch statement is easier to spot even when using compilers which do not report missing switch cases. As for question "why not use default" the answer is: to make it more explicit and clear what is a decision when adding new ID types. We do not want to quietly fall-back to a non-copy-on-write case for a newly added ID types. Differential Revision: https://developer.blender.org/D10075
2021-01-27Merge branch 'blender-v2.92-release'Sergey Sharybin
2021-01-27Fix T84717: Missing viewport update after shading changesSergey Sharybin
Revert "Fix T83411: Crash when using a workspace/layout data path in a driver" The fix for the crash exposed design violation in the viewport shading updates, which is for some reason relying on dependency graph tag of interface data. The viewport module did not respond to the issue in 2 weeks, and the architect considered missing update for multiple users a more serious issue than a crash in a very specific case. This reverts commit 0f95f51361d73fbd8ba8d80b3b65da930dcf3b20.
2021-01-26Cleanup: Correct comments in ID type enumHans Goudey
2021-01-25LibOverride: refactor of relationships handling in library overrides.Bastien Montagne
First step towards a better handling of relationships between IDs in override context, especially when a resync is needed. First, introduce a new flag to override operations, `IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE`, for ID pointers. It keeps track of whether an RNA ID pointer has been kept to its 'natural overriden ID' (in override hierarchy context), or has actually been re-assigned to some other data-block. Second, refactor how we deal with relationships between IDs in override hierarchy code, especially in resync case. This will fixe several cases listed in T83811, especially the case where an ID pointer to an existing override needs to be updated to a new one due to a matching change in linked data.
2021-01-24Cleanup: spellingCampbell Barton
2021-01-20Cleanup: remove extra in trailing asteriskCampbell Barton
Comment blocks not conforming to convention.
2021-01-16Fix T84758: Revert "LibOverride: Also consider regular embedded IDs as ↵Bastien Montagne
virtual overrides." This made Blender considers all materials to be overridden. This reverts commit 2aa7bc06e7a6adb196e552fca3289ed7b7a18f3f.
2021-01-15LibOverride: Also consider regular embedded IDs as virtual overrides.Bastien Montagne
Those (aka root node trees and master collections) share same 'traits' as the shapekeys: RNA cannot assign them, so we need to handle them as sub-data of their owner IDs. Not sure how much this will help in improving support of overrides for scenes and nodetrees, but this is a mandatory step towards that goal for sure.
2021-01-13Fix T83411: Crash when using a workspace/layout data path in a driverSergey Sharybin
Building IDs which are not covered by copy-on-write process was not implemented, which was causing parameters block not present, and, hence causing crashes in areas which expected parameters to present. First part of this change is related on making it so Copy-on-Write is optional for ID nodes in the dependency graph. Second part is related on using a generic builder for all ID types which were not covered by Copy-on-Write before. The final part is related on making it so build_id() is properly handling ParticleSettings and Grease Pencil Data. Before they were not covered there at all, and they need special handling because they do have own build functions. Not sure it worth trying to split those parts, as they are related to each other and are not really possible to be tested standalone. Open for a second opinion though. Possible nut-tightening is to re-organize build_id() function so that every branch does return and have an assert at the end, so that missing ID type in the switch statement is easier to spot even when using compilers which do not report missing switch cases. As for question "why not use default" the answer is: to make it more explicit and clear what is a decision when adding new ID types. We do not want to quietly fall-back to a non-copy-on-write case for a newly added ID types. Differential Revision: https://developer.blender.org/D10075
2021-01-07RNA: document Python instancing for ID's and RNA typesCampbell Barton
Document some of the less obvious implications for re-using Python instances.
2020-12-16UI: Indicate asset data-blocks with an icon in Outliners & search menusJulian Eisel
It's useful to easily see which data-blocks are assets and which not. So just like we usually show the library linking/override icons, we show the asset icon there (these are mutually exclusive data-block states). Uses the `'MAT_SPHERE_SKY` icon, which wasn't used before (except by an add-on!) and is sorta fitting, but not quite. We should either change this one or add an own asset icon. Meanwhile this isn't too bad :) Also adds an internal macro to check if a data-block is an asset, consistent to how we do it for libraries and library overrides.
2020-12-15Asset System: Various changes to previews in preparation for Asset BrowserJulian Eisel
* Support defining (not necessarily rendering) icons in threads. Needed so the File Browser can expose file previews with an icon-id to scripts. ** For that, ported `icons.c` to C++, to be able to use scope based mutex locks (cleaner & safer code). Had to do some cleanups and minor refactoring for that. * Added support for ImBuf icons, as a decent way for icons to hold the file preview buffers. * Tag previews as "unfinished" while they render in a thread, for the File Browser to dynamically load previews as they get finished. * Better handle cases where threaded preview generation is requested, but the ID type doesn't support it (fallback to single threaded). This is for general sanity of the code (as in, safety and cleanness) * Enabled asset notifier for custom preview loading operator, was just disabled because `NC_ASSET` wasn't defined in master yet. Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9719 Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15Asset System: Data-block asset metadata storage, reading and APIJulian Eisel
Asset metadata is what turns a regular data-block into an asset. It is a small data-structure, but a key part of the technical design of the asset system. The design foresees that asset data-blocks store an `ID.asset_data` pointer of type `AssetMetaData`. This data **must not** have dependencies on other data-blocks or data-block data, it must be an independent unit. That way we can read asset-metadata from .blends without reading anything else from the file. The Asset Browser will use this metadata (together with the data-block name, preview and file path) to represent assets in the file list. Includes: * New `ID.asset_data` for asset metadata. * Asset tags, description and custom properties. * BKE code to manage asset meta-data and asset tags. * Code to read asset data from files, without reading IDs. * RNA for asset metadata (including tags) Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9716 Reviewed by: Bastien Montagne, Brecht Van Lommel
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-20Simulation: remove particle nodes with outdated designJacques Lucke
The design for how we approach the "Everything Nodes" project has changed. We will focus on a different part of the project initially. While future me will likely refer back to some of the code I remove here, there is no point in keeping this code around in master currently. It would just confuse other developers working on the project. This does not remove the simulation modifier and data block. Those are just cleaned up, so that the boilerplate code can be reused in the future.