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-01-18Cleanup: quite old-style-declaration warning, strip trailing spaceCampbell Barton
2022-01-18Geometry Nodes: Set Handle Type Node: Left and right by defaultHans Goudey
This node's UI uses a multi-select enum to allow adjusting the type of both handle sides with the same node. Since usually the user wants to affect both handles, and it's the multi-select behavior isn't obvious, selecting both by default is an improvement.
2022-01-17Geometry Nodes: Improve conversion from NURBS to BezierPiotr Makal
This patch improves conversion method from NURBS to Bezier curves, resulting in exact shape between those two types when provided with a 3rd degree NURBS curve. Part of T86086. See the differential revision for more comparisons. The node still cannot account properly for a NURBS "order" other than 4 and it does not take into account control point weights. Differential Revision: https://developer.blender.org/D13546
2022-01-15Geometry Nodes: Rename transfer attribute geometry inputHans Goudey
Conceptually, this is the geometry that data is taken from, not the target of an operation, so rename it from "Target" to "Source". This was common user feedback and agreed on in a recent sub-module meeting.
2022-01-15Fix T94852: Geometry Proximity crash when unsuccessfulHans Goudey
Before rB644e6c7a3e99ae1d43ed, `fill` was used in the error cases, but now `fill_indices` is used, which doesn't work when the span is empty (when only one output is used). The fix is just to check for that case.
2022-01-14Nodes: Support link-drag search with compare node outputsHans Goudey
The search list only displayed the "Result" output socket in this case, which is unexpected since dragging from an input gives the operations in the list as well. Also use integer mode when connecting to boolean sockets.
2022-01-14Fix T94827: Group Input/Output cannot connect to custom socketsPhilipp Oeser
Caused by rBa5c59fb90ef9. Since Group Input and Output sockets happen to be of type `SOCK_CUSTOM` [and since rBa5c59fb90ef9 custom py defined sockets are too :)] a check introduced in rB513066e8ad6f that prevents connections for `SOCK_CUSTOM` triggered. Now refine the check, so it specifically looks for NODE_GROUP_INPUT / NODE_GROUP_OUTPUT, too (this keeps the intention intact to not connect group inputs to group outputs and vice versa, but allows custom py defined sockets to connect again) and put it in new utility function. Maniphest Tasks: T94827 Differential Revision: https://developer.blender.org/D13817
2022-01-14Fix: Compilation error caused by missing target relationRay Molenkamp
bf_nodes/bf_nodes_composite depend on DNA headers
2022-01-14Cleanup: spelling in comments, C++ style comments for disabled codeCampbell Barton
Also ensure space at end of comment.
2022-01-13Refactor: Move normals out of MVert, lazy calculationHans Goudey
As described in T91186, this commit moves mesh vertex normals into a contiguous array of float vectors in a custom data layer, how face normals are currently stored. The main interface is documented in `BKE_mesh.h`. Vertex and face normals are now calculated on-demand and cached, retrieved with an "ensure" function. Since the logical state of a mesh is now "has normals when necessary", they can be retrieved from a `const` mesh. The goal is to use on-demand calculation for all derived data, but leave room for eager calculation for performance purposes (modifier evaluation is threaded, but viewport data generation is not). **Benefits** This moves us closer to a SoA approach rather than the current AoS paradigm. Accessing a contiguous `float3` is much more efficient than retrieving data from a larger struct. The memory requirements for accessing only normals or vertex locations are smaller, and at the cost of more memory usage for just normals, they now don't have to be converted between float and short, which also simplifies code In the future, the remaining items can be removed from `MVert`, leaving only `float3`, which has similar benefits (see T93602). Removing the combination of derived and original data makes it conceptually simpler to only calculate normals when necessary. This is especially important now that we have more opportunities for temporary meshes in geometry nodes. **Performance** In addition to the theoretical future performance improvements by making `MVert == float3`, I've done some basic performance testing on this patch directly. The data is fairly rough, but it gives an idea about where things stand generally. - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms), showing that accessing just `MVert` is now more efficient. - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight change that at least shows there is no regression. - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small but observable speedup. - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms), shows that using normals in geometry nodes is faster. - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms), shows that calculating normals is slightly faster now. - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB), Normals are not saved in files, which can help with large meshes. As for memory usage, it may be slightly more in some cases, but I didn't observe any difference in the production files I tested. **Tests** Some modifiers and cycles test results need to be updated with this commit, for two reasons: - The subdivision surface modifier is not responsible for calculating normals anymore. In master, the modifier creates different normals than the result of the `Mesh` normal calculation, so this is a bug fix. - There are small differences in the results of some modifiers that use normals because they are not converted to and from `short` anymore. **Future improvements** - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier already retrieves normals if they are needed anyway. - Copy normals as part of a better CoW system for attributes. - Make more areas use lazy instead of eager normal calculation. - Remove `BKE_mesh_normals_tag_dirty` in more places since that is now the default state of a new mesh. - Possibly apply a similar change to derived face corner normals. Differential Revision: https://developer.blender.org/D12770
2022-01-13Geometry Nodes: Rename String to Curves socketErik
Today many users seem to think the output from this node is a single curve with multiple splines. This patch renames the geometry output socket from "Curves" to "Curve Instances" to avoid confusion. Differential Revision: https://developer.blender.org/D13693
2022-01-13Cleanup: fix building all geometry nodes in one translation unitJacques Lucke
There were a couple of function name collisions which were caused by sharing code with the mask modifier. I just removed the dependence on the mask modifier now. The code that I duplicated for that purpose is only in a legacy node, so it can be expected to be removed soonish.
2022-01-13Cleanup: follow code-style for float suffixCampbell Barton
2022-01-12DNA: Add space clip editor defaultsSimon Lenz
This is my attempt of adding defaults for the space clip editor struct (in line with https://developer.blender.org/T80164). It adds the default allocation for `SpaceClip` and `node_composite_movieclip.cc`. This also solves the error below (for C++ files using the DNA_default_alloc), which was put forward by Sergey Sharybin. Differential Revision: https://developer.blender.org/D13367 Reviewed by: Julian Eisel
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 @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
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-12Compositor: Add Scene Time Node, Rename Time nodeNathan Rozendaal
Fixes issue T94603 It adds a new compositor node called Scene Time which is already present as a geo node, having the same basic nodes available in all node trees is a nice thing to have. Renames "Time" node to "Time Curve", this is done to avoid confusion between the Time node and the Scene Time node. Reviewed By: jbakker Maniphest Tasks: T94603 Differential Revision: https://developer.blender.org/D13762
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 T94812: render layer sockets are missing after file loadJacques Lucke
The main issue was the use of `G_MAIN` during file load. This patch refactors the code so that iterating over `G_MAIN` is not necessary anymore. See D13800 for more details. Differential Revision: https://developer.blender.org/D13800
2022-01-12Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
2022-01-11Cleanup: Fix build warnings with MSVCRay Molenkamp
our UNUSED macro is essentially a no-op for MSVC, which lead to the situation where this well meant macro was emitting the following warning: C4189: 'UNUSED_i': local variable is initialized but not referenced However since we have been on c++17 for a while now the UNUSED macro can be replaced with the standard [[maybe_unused]] attribute in cpp files. This changes cleans up the use of the UNUSED macro in the bf_nodes_geometry project. Differential Revision: https://developer.blender.org/D12915 Reviewed by: JacquesLucke, Severin, Sergey, HooglyBoogly
2022-01-11Cleanup: use unity build for composite nodesAaron Carlisle
GIves about a 2.1x improvement in compilation times.
2022-01-11Cleanup: Composite nodes: add namespace for every fileAaron Carlisle
This puts all static functions in composite node files into a new namespace. This allows using unity build which can improve compile times significantly. This is a follow up on rB1df8abff257030ba79bc23dc321f35494f4d91c5 but for compositor nodes. The namespace name is derived from the file name. That makes it possible to write some tooling that checks the names later on. The filename extension (`cc`) is added to the namespace name as well. his also possibly simplifies tooling but also makes it more obvious that this namespace is specific to a file. Reviewed By: JacquesLucke, HooglyBoogly, jbakker Differential Revision: https://developer.blender.org/D13466
2022-01-11Geometry Nodes: Move normal field input to be usable elsewhereHans Goudey
This commit moves the normal field input to `BKE_geometry_set.hh` from the node file so that normals can be used as an implicit input to other nodes. Differential Revision: https://developer.blender.org/D13779
2022-01-10Fix T94111: nurb normal calculation does not workJacques Lucke
The normals were computed with an uninitialized tilt.
2022-01-10Compositing Convert color space nodeJeroen Bakker
Compositor node to convert between color spaces. Conversion is skipped when converting between the same color spaces or to or from data spaces. Implementation done for tiled and full frame compositor. Reviewed By: Blendify, jbakker Differential Revision: https://developer.blender.org/D12481
2022-01-10Cleanup: Missing internationization for socket descriptionAaron Carlisle
2022-01-10Fix mistake in previous commitAaron Carlisle
2022-01-10Cleanup: redundent semicolons after function bracesAaron Carlisle
2022-01-10Cleanup: Use new socket builder APIAaron Carlisle
2022-01-09Cleanup: Remove no op socket templatesAaron Carlisle
2022-01-09Cleanup: Nodes: Begin splitting shader node buttons into individual filesAaron Carlisle
Currently, most node buttons are defined in `drawnode.cc` however, this is inconvenient because it requires editing many files when adding new nodes. The goal is to minimize the number of files needed to add or update a node. This commit moves most of the node layout functions for shader nodes into their respected source/blender/nodes/shader/nodes file. In the future, these functions will be simplified to node_layout. Some nodes were left in `drawnode.cc` as this would require duplicating code while this is likely fine it is best to leave that to a seperate commit.
2022-01-09Cleanup: Use new socket builder APIAaron Carlisle
2022-01-09Cleanup: Remove no op socket templatesAaron Carlisle
2022-01-08Cleanup: Use new socket builder APIAaron Carlisle
2022-01-08Cleanup: Loop through socket listbase instead of arrayAaron Carlisle
The socket arrays will be removed when using the new socket builder. So instead we have to loop through the node outputs list.
2022-01-08Cleanup: Remove unused code from BKE_node.hHans Goudey
Remove a variety of unused functions, declarations without definitions, incorrect comments, and defines that have been commented for years
2022-01-07Fix T94659: crash when deleting instances (part 2)Jacques Lucke
This was missing from rB3e92b4ed2408eacd126c0. Before only the Separate Geometry node was fixed, because that node was used in the file from the bug report. The same issue existed in the Delete Geometry node as well though.
2022-01-07Fix T94707: inverted output of separate geometry node incorrectJacques Lucke
This was an oversight in rB3e92b4ed2408eacd126c0.
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-07Cleanup: Fix spelling in filenameAaron Carlisle
2022-01-07Cleanup: Add `bf_nodes_texture` libraryAaron Carlisle
For sake of consistencey with other node tree types, create its own cmake module. This change helps keep `bf_nodes` focused on generic nodes files. Texture nodes are end of life and hopefully for Blender 4.0 they can be removed. It is not expected that these will see the updates that the other nodes are getting. This change also helps isolate the end of life files, we may move some texture specific node tree execution code out of `node_exec` and into a `node_texture_exec` files. Differential Revision: https://developer.blender.org/D13743
2022-01-07Cleanup: Use new socket builder APIAaron Carlisle
This commit converts most shader or bsdf nodes.
2022-01-06Cleanup: use correct file namespace nameJacques Lucke
2022-01-06Cleanup: sort cmake file listsCampbell Barton
2022-01-06Cleanup: remove unnecessary slashes and quotes from paths in CMakeCampbell Barton
2022-01-06Cleanup: spelling in commentsCampbell Barton
2022-01-06Cleanup: Use snake case for file namesAaron Carlisle
This is so that we can have "proper" file namespace names in D13466