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-03-25Implement C++ methods for DNA structuresSergey Sharybin
This change makes it possible to add implementation of common C++ methods for DNA structures which helps ensuring unsafe operations like shallow copy are done explicitly. For example, creating a shallow copy used to be: Object temp_object = *input_object; In the C++ context it was seen like the temp_object is properly decoupled from the input object, while in the reality is it not. Now this code becomes: Object temp_object = blender::dna::shallow_copy(*input_object); The copy and move constructor and assignment operators are now explicitly disabled. Other than a more explicit resource management this change also solves a lot of warnings generated by the implicitly defined copy constructors w.r.t dealing with deprecated fields. These warnings were generated by Apple Clang when a shallow object copy was created via implicitly defined copy constructor. In order to enable C++ methods for DNA structures a newly added macro `DNA_DEFINE_CXX_METHODS()` is to be used: tpyedef struct Object { DNA_DEFINE_CXX_METHODS(Object) ... } Object; For the shallow copy use `blender::dna::shallow_copy()`. The implementation of the memcpy is hidden via an internal DNA function to avoid pulling `string.h` into every DNA header. This means that the solution does not affect on the headers dependencies. --- Ideally `DNA_shallow_copy` would be defined in a more explicit header, but don;t think we have a suitable one already. Maybe we can introduce `DNA_access.h` ? Differential Revision: https://developer.blender.org/D14427
2022-03-25Revert "Implement C++ methods for DNA structures"Sergey Sharybin
This reverts commit 8c44793228750537c08ea7b19fc18df0138f9501. Apparently, this generated a lot of warnings in GCC. Didn't find a quick solution and is it not something I want to be trading between (more quiet Clang in an expense of less quiet GCC). Will re-iterate on the patch are re-commit it.
2022-03-25Implement C++ methods for DNA structuresSergey Sharybin
This change makes it possible to add implementation of common C++ methods for DNA structures which helps ensuring unsafe operations like shallow copy are done explicitly. For example, creating a shallow copy used to be: Object temp_object = *input_object; In the C++ context it was seen like the temp_object is properly decoupled from the input object, while in the reality is it not. Now this code becomes: Object temp_object = blender::dna::shallow_copy(*input_object); The copy and move constructor and assignment operators are now explicitly disabled. Other than a more explicit resource management this change also solves a lot of warnings generated by the implicitly defined copy constructors w.r.t dealing with deprecated fields. These warnings were generated by Apple Clang when a shallow object copy was created via implicitly defined copy constructor. In order to enable C++ methods for DNA structures a newly added macro `DNA_DEFINE_CXX_METHODS()` is to be used: tpyedef struct Object { DNA_DEFINE_CXX_METHODS(Object) ... } Object; For the shallow copy use `blender::dna::shallow_copy()`. The implementation of the memcpy is hidden via an internal DNA function to avoid pulling `string.h` into every DNA header. This means that the solution does not affect on the headers dependencies. --- Ideally `DNA_shallow_copy` would be defined in a more explicit header, but don;t think we have a suitable one already. Maybe we can introduce `DNA_access.h` ? Differential Revision: https://developer.blender.org/D14427
2022-03-14Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
2022-03-10Cleanup: spelling in comments & some minor clarificationsCampbell Barton
2022-03-08Cleanup: Clang tidyHans Goudey
2022-03-07GPencil: Temporary fix to avoid crashes on startupFalk David
This quick fix will populate the runtime orig pointers to avoid crashes when a grease pencil object uses layer transforms, parenting or modifiers. This will have to be revisited and fixed with a better solution.
2022-03-07Merge branch 'blender-v3.1-release'Jacques Lucke
2022-03-07Fix T96180: driver in node tree not updating in real timeJacques Lucke
Differential Revision: https://developer.blender.org/D14260
2022-03-02Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-03-02Fix T94609: geometry nodes always re-evaluated with image texture nodesBrecht Van Lommel
previously_visible_components_mask was not preserved for Image ID nodes, which meant it was always detected as newly visible and tagged to be updated, which in turn caused the geometry nodes using it to be always updated also. Reviewed By: sergey, JacquesLucke Maniphest Tasks: T94609 Differential Revision: https://developer.blender.org/D14217
2022-02-28Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-02-28Fix T96054: Switching vertex group does not update displaySergey Sharybin
Caused by 0f89bcdbebf5 and was not fully addressed by 6f9828289f39: tagging an ID with flag 0 is to be seen as an explicit tag for copy on write. Would be nice to either consolidate code paths of flag 0 and explicit component tag, or get rid of tagging with 0 flag, but that is above of what we can do for the upcoming release.
2022-02-19Merge branch 'blender-v3.1-release'Hans Goudey
2022-02-18Fix part of T95848: missing updates editing light object nodesBrecht Van Lommel
Make relation match material and world nodes. Does not address the reported issue regarding muted nodes, but another missing update found investigating.
2022-02-18Cleanup: Rename original curve object type enumHans Goudey
This commit renames enums related the "Curve" object type and ID type to add `_LEGACY` to the end. The idea is to make our aspirations clearer in the code and to avoid ambiguities between `CURVE` and `CURVES`. Ref T95355 To summarize for the record, the plans are: - In the short/medium term, replace the `Curve` object data type with `Curves` - In the longer term (no immediate plans), use a proper data block for 3D text and surfaces. Differential Revision: https://developer.blender.org/D14114
2022-02-13Cleanup: Clang tidyHans Goudey
Use using instead of typedef, remove redundant string init, use "empty", address qualified auto, use nullptr.
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-11Cleanup: clang-formatCampbell Barton
2022-02-10Merge branch 'blender-v3.1-release'Jacques Lucke
2022-02-10Fix T95624: video texture not refreshing when changing offset in nodeJacques Lucke
The main issue is that the image and image user is not updated correctly in `rna_ImageUser_update`. `BKE_image_user_frame_calc` does not set the correct frame, because the image is null. Also `IMA_GPU_REFRESH` is not set for the same reason. When gpu materials are first created, it is expected that the frame is set correctly, and the flag is set if necessary. Therefore, somewhere during depsgraph evaluation, those have to be updated. The depsgraph node to do the update existed already. Now there is a new relation so that it is executed when the node tree changed, not only when the frame changed.
2022-02-10GPencil: Update-on-write using update cacheFalk David
This implements the update cache described in T95401. The cache is currently only used for drawing strokes and sculpting (using the push brush). **Note: Making use of the cache throughout grease pencil will have to be done incrementally in other patches. ** The update cache stores what elements have changed in the original data-block since the last time the eval object was updated. Additionally, the update cache can store multiple updates to the data and minimizes the number of elements that need to be copied. Elements can be tagged using `BKE_gpencil_tag_full_update` and `BKE_gpencil_tag_light_update`. A full update means that the element itself will be copied but also all of the content inside. E.g. when a layer is tagged for a full update, the layer, all the frames inside the layer and all the strokes inside the frames will be copied. A light update means that only the properties of the element are copied without any of the content. E.g. if a layer is tagged with a light update, it will copy the layer name, opacity, transform, etc. When the update cache is in use (e.g. elements have been tagged) then the depsgraph will not trigger a copy-on-write, but an update-on-write. This means that the update cache will be used to determine what elements have changed and then only those elements will be copied over to the eval object. If the update cache is empty or the data block was tagged with a full update, we always fall back to a copy-on-write. Currently, the update cache is only used by the active depsgraph. This is because we need to free the update cache after an update-on-write so it's reset and we need to make sure it is not freed or read by other depsgraphs. Co-authored-by: @yann-lty This patch was contributed by The SPA Studios. Reviewed By: sergey, antoniov, #dependency_graph, pepeland, mendio Maniphest Tasks: T95401 Differential Revision: https://developer.blender.org/D13984
2022-02-09Cleanup: make file headers more consistentCampbell Barton
Also some descriptive text into doc-strings.
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-04Cleanup: Grammar in comments and tooltipsHans Goudey
- "own" -> "its own" - "it's" -> "its" - Use proper plural
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-02-03Fix T66913: undo after frame-change doesn't refresh properlyCampbell Barton
Use the ID.recalc flag to detect when updates after frame-change is needed. Since comparing the last calculated frame doesn't take undo into account (see code-comment for details). `ID_RECALC_AUDIO_SEEK` has been renamed to `ID_RECALC_FRAME_CHANGE` since this is not only related to audio however internally this flag is still categorized in `NodeType::AUDIO`. Reviewed By: sergey Ref D13942
2022-02-03Fix assert in original modifiers pointer update functionSergey Sharybin
The issue was happening with a specific file where the ID management code was not fully copying all modifiers because of the extra check in the `BKE_object_support_modifier_type_check()`. While it is arguable that copy-on-write should be a 1:1 copy there is no real need to maintain the per-modifier pointer to its original. Use its SessionUUID to perform lookup in the original datablock. Downside of this approach is that it is a linear lookup instead of direct pointer access, but the upside is that there is less pointers to manage and that the file with unsupported modifiers does behave correct without any asserts. Differential Revision: https://developer.blender.org/D13993
2022-02-03Despgraph: Remove asserts from object modifier backupSergey Sharybin
The modifiers are mapped between original and evaluated objects based on their session IDs. The pointer to original modifier is no longer needed for the backup: it remained from the initial implementation which was rewritten at some point. This is a preparation for removal of the pointer to original modifier.
2022-02-01Fix T95356: Crash in armature edit mode and certain conditionSergey Sharybin
Blender would have crashed when renaming bone in Edit Mode, Saving, and than selecting/deselecting. Caused by a mistake in the 0f89bcdbebf5: can not "short-circuit" the CoW update if it was explicitly requested. Safest for now solution seems to be to store whether the CoW component has been explicitly tagged, so that the following configuration can be supported: DEG_id_tag_update(id, ID_RECALC_GEOMETRY); DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); Differential Revision: https://developer.blender.org/D13966
2022-01-25Fix depsgraphs sharing IDs via evaluated edit meshSergey Sharybin
The evaluated mesh is a result of evaluated modifiers, and referencing other evaluated IDs such as materials. It can not be stored in the EditMesh structure which is intended to be re-used by many areas. Such sharing was causing ownership errors causing bugs like T93855: Cycles crash with edit mode and simultaneous viewport and final render The proposed solution is to store the evaluated edit mesh and its cage in the object's runtime field. The motivation goes as following: - It allows to avoid ownership problems like the ones in the linked report. - Object level is chosen over mesh level is because the evaluated mesh is affected by modifiers, which are on the object level. This patch allows to have modifier stack of an object which shares mesh with an object which is in edit mode to be properly taken into account (before the change the modifier stack from the active object will be used for all objects which share the mesh). There is a change in the way how copy-on-write is handled in the edit mode to allow proper state update when changing active scene (or having two windows with different scenes). Previously, the copt-on-write would have been ignored by skipping tagging CoW component. Now it is ignored from within the CoW operation callback. This allows to update edit pointers for objects which are not from the current depsgraph and where the edit_mesh was never assigned in the case when the depsgraph was evaluated prior the active depsgraph. There is no user level changes changes expected with the CoW handling changes: should not affect on neither performance, nor memory consumption. Tested scenarios: - Various modifiers configurations of objects sharing mesh and be part of the same scene. - Steps from the reports: T93855, T82952, T77359 This also fixes T76609, T72733 and perhaps other reports. Differential Revision: https://developer.blender.org/D13824
2022-01-24Cleanup: sort struct forward declarationsCampbell Barton
2022-01-18Fix T95006: missing modifier update after frame changeJacques Lucke
The previous optimization did not work in general yet, unfortunately. This change makes the code more correct, but also brings back some unnecessary updates (e.g. when creating a node group).
2022-01-13Fix T94874: Drivers using bone custom properties don't work on modifiersSergey Sharybin
2022-01-12Revert "BLI: Refactor vector types & functions to use templates"Clément Foucault
Includes unwanted changes This reverts commit 46e049d0ce2bce2f53ddc41a0dbbea2969d00a5d.
2022-01-12BLI: Refactor vector types & functions to use templatesClment Foucault
This patch implements the vector types (i.e:`float2`) by making heavy usage of templating. All vector functions are now outside of the vector classes (inside the `blender::math` namespace) and are not vector size dependent for the most part. In the ongoing effort to make shaders less GL centric, we are aiming to share more code between GLSL and C++ to avoid code duplication. ####Motivations: - We are aiming to share UBO and SSBO structures between GLSL and C++. This means we will use many of the existing vector types and others we currently don't have (uintX, intX). All these variations were asking for many more code duplication. - Deduplicate existing code which is duplicated for each vector size. - We also want to share small functions. Which means that vector functions should be static and not in the class namespace. - Reduce friction to use these types in new projects due to their incompleteness. - The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a bit of a let down. Most clases are incomplete, out of sync with each others with different codestyles, and some functions that should be static are not (i.e: `float3::reflect()`). ####Upsides: - Still support `.x, .y, .z, .w` for readability. - Compact, readable and easilly extendable. - All of the vector functions are available for all the vectors types and can be restricted to certain types. Also template specialization let us define exception for special class (like mpq). - With optimization ON, the compiler unroll the loops and performance is the same. ####Downsides: - Might impact debugability. Though I would arge that the bugs are rarelly caused by the vector class itself (since the operations are quite trivial) but by the type conversions. - Might impact compile time. I did not saw a significant impact since the usage is not really widespread. - Functions needs to be rewritten to support arbitrary vector length. For instance, one can't call `len_squared_v3v3` in `math::length_squared()` and call it a day. - Type cast does not work with the template version of the `math::` vector functions. Meaning you need to manually cast `float *` and `(float *)[3]` to `float3` for the function calls. i.e: `math::distance_squared(float3(nearest.co), positions[i]);` - Some parts might loose in readability: `float3::dot(v1.normalized(), v2.normalized())` becoming `math::dot(math::normalize(v1), math::normalize(v2))` But I propose, when appropriate, to use `using namespace blender::math;` on function local or file scope to increase readability. `dot(normalize(v1), normalize(v2))` ####Consideration: - Include back `.length()` method. It is quite handy and is more C++ oriented. - I considered the GLM library as a candidate for replacement. It felt like too much for what we need and would be difficult to extend / modify to our needs. - I used Macros to reduce code in operators declaration and potential copy paste bugs. This could reduce debugability and could be reverted. - This touches `delaunay_2d.cc` and the intersection code. I would like to know @howardt opinion on the matter. - The `noexcept` on the copy constructor of `mpq(2|3)` is being removed. But according to @JacquesLucke it is not a real problem for now. I would like to give a huge thanks to @JacquesLucke who helped during this and pushed me to reduce the duplication further. Reviewed By: brecht, sergey, JacquesLucke Differential Revision: https://developer.blender.org/D13791
2022-01-12Revert "BLI: Refactor vector types & functions to use templates"Clément Foucault
Reverted because the commit removes a lot of commits. This reverts commit a2c1c368af48644fa8995ecbe7138cc0d7900c30.
2022-01-12BLI: Refactor vector types & functions to use templatesClément Foucault
This patch implements the vector types (i.e:float2) by making heavy usage of templating. All vector functions are now outside of the vector classes (inside the blender::math namespace) and are not vector size dependent for the most part. In the ongoing effort to make shaders less GL centric, we are aiming to share more code between GLSL and C++ to avoid code duplication. Motivations: - We are aiming to share UBO and SSBO structures between GLSL and C++. This means we will use many of the existing vector types and others we currently don't have (uintX, intX). All these variations were asking for many more code duplication. - Deduplicate existing code which is duplicated for each vector size. - We also want to share small functions. Which means that vector functions should be static and not in the class namespace. - Reduce friction to use these types in new projects due to their incompleteness. - The current state of the BLI_(float|double|mpq)(2|3|4).hh is a bit of a let down. Most clases are incomplete, out of sync with each others with different codestyles, and some functions that should be static are not (i.e: float3::reflect()). Upsides: - Still support .x, .y, .z, .w for readability. - Compact, readable and easilly extendable. - All of the vector functions are available for all the vectors types and can be restricted to certain types. Also template specialization let us define exception for special class (like mpq). - With optimization ON, the compiler unroll the loops and performance is the same. Downsides: - Might impact debugability. Though I would arge that the bugs are rarelly caused by the vector class itself (since the operations are quite trivial) but by the type conversions. - Might impact compile time. I did not saw a significant impact since the usage is not really widespread. - Functions needs to be rewritten to support arbitrary vector length. For instance, one can't call len_squared_v3v3 in math::length_squared() and call it a day. - Type cast does not work with the template version of the math:: vector functions. Meaning you need to manually cast float * and (float *)[3] to float3 for the function calls. i.e: math::distance_squared(float3(nearest.co), positions[i]); - Some parts might loose in readability: float3::dot(v1.normalized(), v2.normalized()) becoming math::dot(math::normalize(v1), math::normalize(v2)) But I propose, when appropriate, to use using namespace blender::math; on function local or file scope to increase readability. dot(normalize(v1), normalize(v2)) Consideration: - Include back .length() method. It is quite handy and is more C++ oriented. - I considered the GLM library as a candidate for replacement. It felt like too much for what we need and would be difficult to extend / modify to our needs. - I used Macros to reduce code in operators declaration and potential copy paste bugs. This could reduce debugability and could be reverted. - This touches delaunay_2d.cc and the intersection code. I would like to know @Howard Trickey (howardt) opinion on the matter. - The noexcept on the copy constructor of mpq(2|3) is being removed. But according to @Jacques Lucke (JacquesLucke) it is not a real problem for now. I would like to give a huge thanks to @Jacques Lucke (JacquesLucke) who helped during this and pushed me to reduce the duplication further. Reviewed By: brecht, sergey, JacquesLucke Differential Revision: http://developer.blender.org/D13791
2022-01-12Fix T94797: crash when playing animation in eevee rendered viewJacques Lucke
The issue was caused by rBd09b1d2759861aa012ab2e7e4ce2ffa2. Since this commit, the image users in gpu materials were updated during depsgraph evaluation as well. However, there was a race condition when one thread is deleting gpu materials in `BKE_material_eval` while another thread is updating the image users at the same time. The solution is to make sure that deleting gpu materials is done before iterating over all gpu materials, by adding a new depsgraph relation.
2022-01-12Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
2022-01-10Fix T94766: texture coordinates from other object do not refreshJacques Lucke
The core issue is that flushing dependencies are created from an object to a node tree when it contains e.g. a Texture Coordinate node. That is an issue because the evaluation of the node tree itself does not depend on the object (node tree evaluation is essentially a no-op). Only other systems that parse and evaluate the node tree in a specific context actually depend on e.g. the position of the referenced object. It can even be the case that the node tree depends on objects that the actual evaluator (geometry nodes modifier/material) does not depend on, because a node is not connected to the output. Geometry nodes makes the distinction between dependencies to the node tree and to the evaluator already. Shader nodes do not. Therefore, shader nodes need a flushing relation from node groups to their parent node groups. This brings back some unnecessary updates from rB7e712b2d6a0d (e.g. when creating a node group from nodes that are not connected to the output). This is a bit unfortunate, but refactoring how dependencies work with shader nodes is a out of scope for this fix.
2022-01-07Fix T94078: Wrong Bound Box calculated for curvesGermano Cavalcante
`DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN` creates temporary objects that correspond to duplicates or instances. These temporary objects can share same pointers with the original object as in the case of Bounding Box. Bound Box of temporary objects is marked dirty in `BKE_object_replace_data_on_shallow_copy` since `ob->data` is different. This causes the original Bounding Box, calculated for the evaluated geometry, to be lost. The solution in this commit is to change the boundbox reference of the temporary objects, so the boundbox of the non-temporary object (with the data curve) is not marked dirty. Differential Revision: https://developer.blender.org/D13581
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2022-01-06Depsgraph: only link 'IK Constraint -> Init IK Tree' if animated.Alexander Gavrilov
This relation is intended to ensure that the properties of the IK constraint are ready by the time the IK solver tree is built. This however can cause spurious dependency cycles, because there is only one init tree node for the whole armature, and the relation actually implies dependency on all properties of the bone. This patch reduces spurious dependencies by only creating the relation if any properties of the IK constraint specifically are animated. Differential Revision: https://developer.blender.org/D13714
2022-01-06Depsgraph: fix spurious cycles with identically named idprops on bones.Alexander Gavrilov
If multiple bones have a custom property with the same name, depsgraph didn't distinguish between them, potentially leading to spurious cycles. This patch moves ID_PROPERTY operation nodes for bone custom properties from the parameters component to individual bone components, thus decoupling them. Differential Revision: https://developer.blender.org/D13729
2022-01-06Cleanup: spelling in commentsCampbell Barton
2022-01-03Depsgraph: Remove object-level visibility from geometry buildersSergey Sharybin
Continuation of the D13404 which finished the design of not having geometry-level nodes dependent on object-level. Differential Revision: https://developer.blender.org/D13405
2021-12-31Fix T94464: video texture is not refreshingJacques Lucke
In the past that worked because the `GPUMaterial` referenced the `ImageUser` from the image node. However, that design was incompatible with the recent node tree update refactor (rB7e712b2d6a0d257d272e). Also, in general it is a bad idea to have references between data that is owned by two different data blocks. This incompatibility was resolved by copying the image user from the node to the `GPUMaterial` (rB28df0107d4a8). Unfortunately, eevee depended on this reference, because the image user on the node was update when the frame changed. Because the image user was copied, the image user in the `GPUMaterial` did not receive the frame update anymore. This frame update is added back by this commit. The main change is that the image user iterator now also iterates over image users in `GPUMaterial`s on material and world data blocks. An issue is that these materials don't exist on the original data blocks and that caused the check in `build_animation_images` in the depsgraph to give the wrong answer. Therefore the check is extended. Right now the check is not optimal, because it results in more depsgraph nodes than are necessary. This can be improved when it becomes cheaper to check if a node tree contains any references to a video texture. The node tree update refactor mentioned before makes it much easier to construct this kind of run-time data from the bottom up, instead of scanning the entire node tree recursively every time some information is needed.
2021-12-21Nodes: refactor node tree update handlingJacques Lucke
Goals of this refactor: * More unified approach to updating everything that needs to be updated after a change in a node tree. * The updates should happen in the correct order and quadratic or worse algorithms should be avoided. * Improve detection of changes to the output to avoid tagging the depsgraph when it's not necessary. * Move towards a more declarative style of defining nodes by having a more centralized update procedure. The refactor consists of two main parts: * Node tree tagging and update refactor. * Generally, when changes are done to a node tree, it is tagged dirty until a global update function is called that updates everything in the correct order. * The tagging is more fine-grained compared to before, to allow for more precise depsgraph update tagging. * Depsgraph changes. * The shading specific depsgraph node for node trees as been removed. * Instead, there is a new `NTREE_OUTPUT` depsgrap node, which is only tagged when the output of the node tree changed (e.g. the Group Output or Material Output node). * The copy-on-write relation from node trees to the data block they are embedded in is now non-flushing. This avoids e.g. triggering a material update after the shader node tree changed in unrelated ways. Instead the material has a flushing relation to the new `NTREE_OUTPUT` node now. * The depsgraph no longer reports data block changes through to cycles through `Depsgraph.updates` when only the node tree changed in ways that do not affect the output. Avoiding unnecessary updates seems to work well for geometry nodes and cycles. The situation is a bit worse when there are drivers on the node tree, but that could potentially be improved separately in the future. Avoiding updates in eevee and the compositor is more tricky, but also less urgent. * Eevee updates are triggered by calling `DRW_notify_view_update` in `ED_render_view3d_update` indirectly from `DEG_editors_update`. * Compositor updates are triggered by `ED_node_composite_job` in `node_area_refresh`. This is triggered by calling `ED_area_tag_refresh` in `node_area_listener`. Removing updates always has the risk of breaking some dependency that no one was aware of. It's not unlikely that this will happen here as well. Adding back missing updates should be quite a bit easier than getting rid of unnecessary updates though. Differential Revision: https://developer.blender.org/D13246
2021-12-14Cleanup: resolve parameter mis-matches in doc-stringsCampbell Barton
Renamed or removed parameters which no longer exist.