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-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
2022-01-06Cleanup: Remove empty node socket template arrayAaron Carlisle
2022-01-06Cleanup: Use new socket builder APIAaron Carlisle
Instead of looping through the old socket template array looper through the node output listbase.
2022-01-05Cleanup: Use new socket builder APIAaron Carlisle
2022-01-05Cleanup: Use new socket builder APIAaron Carlisle
Also enables translation of socket names
2022-01-05Cleanup: Remove unused `node_type_exec` for shader nodeAaron Carlisle
From what I can tell these are left over from Blender Internal render. Test still pass locally, also tested a couple eevee scenes. Reviewed By: JacquesLucke, brecht Differential Revision: https://developer.blender.org/D13732
2022-01-05Fix T94659: crash when deleting instancesJacques Lucke
The crash was caused by using `modify_geometry_sets` to modify instances, which does not generally work unfortunately. The intended behavior was wrong anyway. In instances mode, only top level instances should be deleted. Also removed the old error handling because it doesn't look like it ever worked. all_is_error remained false all the time. Furthermore, updating it was not thread safe. Differential Revision: https://developer.blender.org/D13736
2022-01-05Cleanup: Use new socket builder APIAaron Carlisle
2022-01-05Nodes: Consistent link drag search for math and vector math nodesHans Goudey
Previously operations for the math node when connecting to outputs weren't added. It also used a different method to check whether the link would be valid.
2022-01-05Cleanup: Make shade node util header CPP onlyAaron Carlisle
Now that all shader nodes are converted to CPP this header can now be made into a CPP header.
2022-01-04Cleanup: Dont use relative includeAaron Carlisle
Instead let cmake determine the path for file includes
2022-01-04Cleanup: Nodes: Convert generic shader node files to c++Aaron Carlisle
Along with the general changes to CPP this commit does the following - Use static casts where possible - Use new CPP MEM library functions instead of cast - Use listbase macros where possible - Declare variables where initialized Reviewed By: HooglyBoogly, JacquesLucke Differential Revision: https://developer.blender.org/D13718