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-16Fix: crash when evaluating geometry nodes after deleting an unlinked nodeJacques Lucke
This was essentially a use-after-free issue. When a geometry nodes group changes it has to be preprocessed again before it can be evaluated. This part was working, the issue was that parent node groups have to be preprocessed as well, which was missing. The lazy-function graph cached on the parent node group was still referencing data that was freed when the child group changed. Now the depsgraph makes sure that all relevant geometry node groups are preprocessed again after a change. This issue was found by Simon Thommes.
2022-09-14ViewLayer: Lazy sync of scene data.Monique Dewanchand
When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885
2022-09-14Adding `const Scene*` parameter in many areas.Monique Dewanchand
Related to {D15885} that requires scene parameter to be added in many places. To speed up the review process the adding of the scene parameter was added in a separate patch. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15930
2022-09-13Revert hidden object optimization in depsgraphSergey Sharybin
The internal state tracking is not fully suited for such kind of optimization yet. It is probably not that much work to make them work, but the issue caused by the changes is serious enough for the studio so it feels better to revert changes for now and have a closer look into remaining issues without pressure.
2022-09-13Fix T101004: Crash when invisible object becomes visibleSergey Sharybin
A regression since ac20970bc208 The issue was caused by depsgraph clearing all id->recalc flags wrongly assuming that all IDs are fully evaluated. This change makes it so the depsgraph becomes aware of possibly incompletely evaluated IDs. Differential Revision: https://developer.blender.org/D15946
2022-09-13Geometry Nodes: new evaluation systemJacques Lucke
This refactors the geometry nodes evaluation system. No changes for the user are expected. At a high level the goals are: * Support using geometry nodes outside of the geometry nodes modifier. * Support using the evaluator infrastructure for other purposes like field evaluation. * Support more nodes, especially when many of them are disabled behind switch nodes. * Support doing preprocessing on node groups. For more details see T98492. There are fairly detailed comments in the code, but here is a high level overview for how it works now: * There is a new "lazy-function" system. It is similar in spirit to the multi-function system but with different goals. Instead of optimizing throughput for highly parallelizable work, this system is designed to compute only the data that is actually necessary. What data is necessary can be determined dynamically during evaluation. Many lazy-functions can be composed in a graph to form a new lazy-function, which can again be used in a graph etc. * Each geometry node group is converted into a lazy-function graph prior to evaluation. To evaluate geometry nodes, one then just has to evaluate that graph. Node groups are no longer inlined into their parents. Next steps for the evaluation system is to reduce the use of threads in some situations to avoid overhead. Many small node groups don't benefit from multi-threading at all. This is much easier to do now because not everything has to be inlined in one huge node tree anymore. Differential Revision: https://developer.blender.org/D15914
2022-09-08Cleanup: make meaning of base visibility flags more clearBrecht Van Lommel
Rename, add comments, and use flag in the depsgraph to ensure the logic matches. Differential Revision: https://developer.blender.org/D15883
2022-09-01Cleanup: make formatJacques Lucke
2022-08-31Fix T98525: depsgraph for indirectly referenced ID Properties in drivers.Alexander Gavrilov
If the RNA path of a Single Property variable goes through a pointer to a different ID, the property should be attached to that ID using the owner reference in the RNA pointer. This already happened when building some, but not all of the relations and nodes. This patch fixes the remaining cases. Differential Revision: https://developer.blender.org/D15323
2022-08-31Depsgraph: optimize out evaluation of hidden objectsSergey Sharybin
This change makes it so that objects which are temporary hidden from the viewport (the icon toggle in outliner) do not affect on the performance of the viewport. The attached file demonstrates the issue. Before this change hiding the object does not change FPS, after this change FPS goes high when the object is hidden. F13435936 Changing the object temporary visibility is already expected to tag scene for bases updates, which flushes down the stream to the object visibility update. So the only remaining topic was to ensure the graph does a special round of visibility update on such changes. Differential Revision: https://developer.blender.org/D15813
2022-08-31Fix unnecessary modifier visibility re-evaluationSergey Sharybin
While it is hard to measure the performance impact accurately, there is no need to perform per-modifier string lookup on every frame update. Implemented as an exceptional case in the code which flushes updates to the entire component. Sounds a bit suboptimal, but there are already other exception cases handled in the function. Differential Revision: https://developer.blender.org/D15812
2022-08-31Cleanup: break before the default case in switch statementsCampbell Barton
While missing the break before a default that only breaks isn't an error, it means adding new cases needs to remember to add the break for an existing case, changing the default case will also result in an unintended fall-through. Also avoid `default:;` and add an explicit break.
2022-08-17Cleanup: Remove unused functionHans Goudey
Also remove two DispList references I missed in the previous commit.
2022-08-17Cleanup: Fix outdated comments referring to DispListHans Goudey
2022-08-17Metaball: Evaluate metaball objects as mesh componentsHans Goudey
With the ultimate goal of simplifying drawing and evaluation, this patch makes the following changes and removes code: - Use `Mesh` instead of `DispList` for evaluated basis metaballs. - Remove all `DispList` drawing code, which is now unused. - Simplify code that converts evaluated metaballs to meshes. - Store the evaluated mesh in the evaluated geometry set. This has the following indirect benefits: - Evaluated meshes from metaball objects can be used in geometry nodes. - Renderers can ignore evaluated metaball objects completely - Cycles rendering no longer has to convert to mesh from `DispList`. - We get closer to removing `DispList` completely. - Optimizations to mesh rendering will also apply to metaball objects. The vertex normals on the evaluated mesh are technically invalid; the regular calculation wouldn't reproduce them. Metaball objects don't support modifiers though, so it shouldn't be a problem. Eventually we can support per-vertex custom normals (T93551). Differential Revision: https://developer.blender.org/D14593
2022-08-15Fix T100394: Regression: Duplicating a modifier causes a crashSergey Sharybin
Need to update relations when modifiers are added or removed since those create nodes in the dependency graph. Added an assert statement to point at possible culprit so that issues can be fixed more quickly.
2022-08-11Cleanup: spelling in commentsCampbell Barton
2022-08-10Depsgraph: Optimize evaluation of dependencies of disabled modifiersSergey Sharybin
Solves long-standing issue when dependencies of disabled modifiers are evaluated. Simple test case: no drivers or animation. Manually enabling modifier is expected to bring FPS up, enabling modifier will bring FPS (sine evaluation can not be avoided) F13336690 More complex test case: modifier visibility is driven by an animated property. In am ideal world FPS during property being zero is fast and when property is 1 the FPS is low. F13336691. Differential Revision: https://developer.blender.org/D15625
2022-08-10Depsgrapg: Add per-modifier graph nodesSergey Sharybin
No functional changes expected.
2022-08-05Cleanup: spelling, unused arg warningCampbell Barton
2022-08-05Cleanup: formatCampbell Barton
2022-08-04Cleanup: Better const correctness and inlined key construction in depsgraphSergey Sharybin
2022-08-04Cleanup: Remove unused ID from depsgraph time sourceSergey Sharybin
2022-08-04Depsgraph: More clear function name for transform dependnecySergey Sharybin
The name was confusing to a level that it sounded like the relation goes the opposite direction than it is intended.
2022-08-04Cleanup: Redundant check in depsgraph builderSergey Sharybin
The build_object_data_geometry() is never called on armatures.
2022-08-04Cleanup: spelling, code-blocksCampbell Barton
2022-08-03Fix assert failures in the dependency graphSergey Sharybin
Happens after recent changes in the area. The asserts were a bit too strict and were against the way how the ID_RECALC_ALL is handled. So remove them with explanation why things needs to be silent.
2022-08-02Fix undefined behavior in dependency graph taggingSergey Sharybin
The tagging code was iterating over bits set in the ID_RECALC_ALL and was casting the flag to IDRecalcFlag. This was triggering an undefined behavior warning in Clang since the bit might not have a corresponding value in the enumerator. The solution is to pre-define all reacalc flags for all bits. While this seems a bit annoying this seems to be the least fragile solution from all suggested ones. Differential Revision: https://developer.blender.org/D15602
2022-08-02Depsgraph: Make naming and recalc flag sign consistentSergey Sharybin
Always use unsigned int for the recalc flags. This allows to use all 32 bit of integer for the flags without worrying about the sign. Use full notation of `unsigned int` instead of short `uint` to avoid pulling more headers in. Whenever depsgraph API allows passing combined recalc flags call the variable `flags` and use `unsigned int` type for it. For a single flag use `IDRecalcFlag` flag. No functional changes expected.
2022-07-29Cleanup: Move RNA path functions into own C++ fileJulian Eisel
Adds `rna_path.cc` and `RNA_path.h`. `rna_access.c` is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on it's own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded `rna_path_parse()`, and found that some C++ features may help greatly with that. So having that code compile in C++ would be helpful to attempt that. Differential Revision: https://developer.blender.org/D15540 Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne
2022-07-27Fix T99976: Animated visibility not rendering properly in viewportSergey Sharybin
A mistake in the 0dcee6a3866 which made specific driven visibility to work, but did not properly handle actual time-based visibility. The basic idea of the change is to preserve recalculation flags of nodes which were tagged for update but were not evaluated due to visibility constraints. In the file from the report this makes it so tagging which is done first time ID is in the dependency graph are handled when the ID actually becomes visible. This is what solved the root of the problem from the report: there was missing geometry update since it was "swallowed" by the evaluation during the object being invisible. In other configurations this change allows to handle pending geometry updates due to animated modifiers be handled when object becomes visible without time change. This change also solves visibility issue of the synchronization component which also started to be handled badly since the previous fix attempt. Basically, the needed exception in its visibility handling did not happen and a regular logic was used for it. Tested with files from the T99733, T99976, and from the Heist project. Differential Revision: https://developer.blender.org/D15544
2022-07-26Cleanup: spelling in commentsCampbell Barton
2022-07-21Cleanup: Simplify relation flags assignmentSergey Sharybin
2022-07-21Cleanup: Unused forward declarationSergey Sharybin
2022-07-21Fix T99885: Invalid dependency graph state when curves surface is invisibleSergey Sharybin
Differential Revision: https://developer.blender.org/D15510
2022-07-21Fix T99733: Objects with driven visibility are evaluated when not neededSergey Sharybin
The issue was caused by the fact that objects with driven or animated visibility were considered visible by the dependency graph evaluation. This change makes it so the dependency graph evaluation is aware of visibility which might be changing. This is achieved by evaluating the path of the graph which affects objects visibility and adjusts to it before evaluating the rest of the graph. There is some time penalty to this, but there does not seem to be a way to fully avoid this penalty. With the production shot from the heist project the FPS drops by a tenth of a frame (~9.4 vs ~9.3 fps) when adding a driver to an object which keeps it visible. Note that this is a bit hard to measure since the FPS fluctuates quite a bit throughout the playback. On the other hand, having a driver on a visibility of a heavy object from character and setting visibility to false gives big speedup. Also worth noting that there is no penalty at all when there are no animated visibilities in the scene. Differential Revision: https://developer.blender.org/D15498
2022-07-21Depsgraph: Clear operation evaluation flags early onSergey Sharybin
The goal is to make it possible to evaluate the graph in multiple passes without evaluating the same node multiple times. Currently should not be any functional changes.
2022-07-19Depsgraph: Make animated properties API receive const IDSergey Sharybin
Semantically it is more correct as the cache does not modify the ID. There is need to do couple of const casts since the BKE (which is in C) does not easily allow to iterate into f-curves of const ID. Should be no functional changes.
2022-07-19Depsgraph: Cleanup, Make variable less ambiguous and more clearSergey Sharybin
2022-07-19Depsgraph: Make variable naming more clearSergey Sharybin
Disambiguate from nodes visibility flags.
2022-07-19Depsgraph: Cleanup, use nested namespace definitionSergey Sharybin
2022-07-19Depsgraph: Localize synchronization component visibility handlingSergey Sharybin
Move it from generic visibility handling to the synchronization component node implementation. Should be no functional changes.
2022-07-19Depsgraph: Cleanup, comments wrapping and spacing between linesSergey Sharybin
Should make it easier to read. No functional changes expected.
2022-07-19Depsgraph: Introduce operation code for visibility operationSergey Sharybin
No functional changes, just makes code more semantically clear.
2022-07-19Depsgraph: Cleanup, don't mic static function and anonymous namespaceSergey Sharybin
2022-07-19Depsgraph: Refactor evaluation into smaller reusable functionsSergey Sharybin
Should be no functional changes.
2022-07-19Depsgraph: Cleanup, use nested namespace definitionSergey Sharybin
2022-07-19Depsgraph: Make name and name tag optional in component nodeSergey Sharybin
Matches the builder API, making some code less verbose.
2022-07-19Depsgraph: Clarify comment in the component nodeSergey Sharybin
2022-07-19Depsgraph: Use single task pool during evaluationSergey Sharybin
Not sure why multiple pools were created: the pool should be able to handle two sets of tasks. Perhaps non-measurable improvement in terms of performance but this change simplifies code a bit.