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-11-05Cleanup: Remove unnecessary node type registraction functionsHans Goudey
These functions provided little benefit compared to simply setting the function pointers directly.
2022-10-04Cleanup: replace UNUSED macro with commented args in C++ codeHans Goudey
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-09-25Cleanup: follow C++ type cast style guide in some filesJacques Lucke
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907.
2022-09-18Curves: Remove CurveEval and old Spline typesHans Goudey
`CurveEval` was added for the first iteration of geometry nodes curve support. Since then, it has been replaced by the new `Curves` type which is designed to be much faster for many curves and better integrated with the rest of Blender. Now that all curve nodes have been moved to use `Curves` (T95443), the type can be removed, along with the corresponding geometry component.
2022-09-18Curves: Port Curve to Points node to the new data-blockHans Goudey
This is the last node to use the `CurveEval` type. Since the curve to points node is basically the same as the resample node, now it just reuses the resample code and moves the curve point `CustomData` to a new point cloud at the end. I had to add support for sampling tangents and normals to the resampling. There is one behavior change: If the radius attribute doesn't exist, the node won't set the radius to 1 for the output point cloud anymore. Instead, the default radius for point clouds will be used. That issue was similar to T99814. Differential Revision: https://developer.blender.org/D16008
2022-07-26Fix: Fix attribute writer debug warnings in terminalHans Goudey
Use an imperfect solution, since this code will be replaced soon anyway.
2022-07-22Curves: support sculpting on deformed curvesJacques Lucke
Previously, curves sculpt tools only worked on original data. This was very limiting, because one could effectively only sculpt the curves when all procedural effects were turned off. This patch adds support for curves sculpting while looking the result of procedural effects (like deformation based on the surface mesh). This functionality is also known as "crazy space" support in Blender. For more details see D15407. Differential Revision: https://developer.blender.org/D15407
2022-07-08Geometry Nodes: new geometry attribute APIJacques Lucke
Currently, there are two attribute API. The first, defined in `BKE_attribute.h` is accessible from RNA and C code. The second is implemented with `GeometryComponent` and is only accessible in C++ code. The second is widely used, but only being accessible through the `GeometrySet` API makes it awkward to use, and even impossible for types that don't correspond directly to a geometry component like `CurvesGeometry`. This patch adds a new attribute API, designed to replace the `GeometryComponent` attribute API now, and to eventually replace or be the basis of the other one. The basic idea is that there is an `AttributeAccessor` class that allows code to interact with a set of attributes owned by some geometry. The accessor itself has no ownership. `AttributeAccessor` is a simple type that can be passed around by value. That makes it easy to return it from functions and to store it in containers. For const-correctness, there is also a `MutableAttributeAccessor` that allows changing individual and can add or remove attributes. Currently, `AttributeAccessor` is composed of two pointers. The first is a pointer to the owner of the attribute data. The second is a pointer to a struct with function pointers, that is similar to a virtual function table. The functions know how to access attributes on the owner. The actual attribute access for geometries is still implemented with the `AttributeProvider` pattern, which makes it easy to support different sources of attributes on a geometry and simplifies dealing with built-in attributes. There are different ways to get an attribute accessor for a geometry: * `GeometryComponent.attributes()` * `CurvesGeometry.attributes()` * `bke::mesh_attributes(const Mesh &)` * `bke::pointcloud_attributes(const PointCloud &)` All of these also have a `_for_write` variant that returns a `MutabelAttributeAccessor`. Differential Revision: https://developer.blender.org/D15280
2022-06-01Cleanup: use 'e' prefix for enum typesCampbell Barton
- CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage
2022-05-13Cleanup: spelling in comments, capitalize tagsCampbell Barton
Also add missing task-ID reference & remove colon after \note as it doesn't render properly in doxygen.
2022-05-11Cleanup: use '_num' suffix, mostly for curves & spline codeCampbell Barton
Replace tot/amount & size with num, in keeping with T85728.
2022-03-19Make Format ChangesHarley Acheson
Only formatting changes found by running "make format", no functional changes Committed without review, but with verbal approval by Hans Goudey
2022-03-16Geometry Nodes: Remove legacy node codeHans Goudey
This commit removes the implementations of legacy nodes, their type definitions, and related code that becomes unused. Now that we have two releases that included the legacy nodes, there is not much reason to include them still. Removing the code means refactoring will be easier, and old code doesn't have to be tested and maintained. After this commit, the legacy nodes will be undefined in the UI, so 3.0 or 3.1 should be used to convert files to the fields system. The net change is 12184 lines removed! The tooltip for legacy nodes mentioned that we would remove them before 4.0, which was purposefully a bit vague to allow us this flexibility. In a poll in a devtalk post showed that the majority of people were okay with removing the nodes. https://devtalk.blender.org/t/geometry-nodes-backward-compatibility-poll/20199 Differential Revision: https://developer.blender.org/D14353
2022-02-28Cleanup: Rename geometry set "curve" functions to "curves"Hans Goudey
Ref T95355
2022-02-28Geometry Nodes: Begin conversion to new curvesHans Goudey
This commit changes `CurveComponent` to store the new curve type by adding conversions to and from `CurveEval` in most nodes. This will temporarily make performance of curves in geometry nodes much worse, but as functionality is implemented for the new type and it is used in more places, performance will become better than before. We still use `CurveEval` for drawing curves, because the new `Curves` data-block has no evaluated points yet. So the `Curve` ID is still generated for rendering in the same way as before. It's also still needed for drawing curve object edit mode overlays. The old curve component isn't removed yet, because it is still used to implement the conversions to and from `CurveEval`. A few more attributes are added to make this possible: - `nurbs_weight`: The weight for each control point on NURBS curves. - `nurbs_order`: The order of the NURBS curve - `knots_mode`: Necessary for conversion, not defined yet. - `handle_type_{left/right}`: An 8 bit integer attribute. Differential Revision: https://developer.blender.org/D14145
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-01-29Fix T94476: Threading/performance issue with curve to points nodeHans Goudey
For every spline, *all* of the normals and tangents in the output were normalized. The node is multithreaded, so sometimes a thread overwrote the normalized result from another thread. Fixing this problem also made the node orders of magnitude faster when there are many splines.
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-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-04Cleanup: Remove bNodeType flag from base registration functionsAaron Carlisle
This flag is only used a few small cases, so instead of setting the flag for every node only set the required flag for the nodes that require it. Mostly the flag is used to set `ntype.flag = NODE_PREVIEW` For nodes that should have previews by default which is only some compositor nodes and some texture nodes. The frame node also sets the `NODE_BACKGROUND` flag. All other nodes were setting a flag of 0 which has no purpose. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13699
2021-12-17Cleanup: use new c++ guarded allocator api in some filesJacques Lucke
2021-12-15Node Editor: Link Drag Search MenuHans Goudey
This commit adds a search menu when links are dragged above empty space. When releasing the drag, a menu displays all compatible sockets with the source link. The "main" sockets (usually the first) are weighted above other sockets in the search, so they appear first when you type the name of the node. A few special operators for creating a reroute or a group input node are also added to the search. Translation is started after choosing a node so it can be placed quickly, since users would likely adjust the position after anyway. A small "+" is displayed next to the cursor to give a hint about this. Further improvements are possible after this first iteration: - Support custom node trees. - Better drawing of items in the search menu. - Potential tweaks to filtering of items, depending on user feedback. Thanks to Juanfran Matheu for developing an initial patch. Differential Revision: https://developer.blender.org/D8286
2021-12-15Fix T94082: Curve to point empty evaluated NURBS crashHans Goudey
This is basically the same as rBee4ed99866fbb7ab04, the fix is simply to check if the spline has evaluated points when deciding the offsets into the result points array.
2021-12-07Cleanup: Add macro and functions for node storageHans Goudey
The `node_storage` functions to retrieve const and mutable structs from a node are generated by a short macro that can be placed at the top of each relevant file. I use this in D8286 to make code snippets in the socket declarations much shorter, but I thought it would be good to use it consistently everywhere else too. The functions are also useful to avoid copy and paste errors, like the one corrected in the cylinder node in this commit. Differential Revision: https://developer.blender.org/D13491
2021-11-23Cleanup: Simplify geometry node function namesHans Goudey
With this commit, we no longer use the prefixes for every node type function like `geo_node_translate_instances_`. They just added more places to change when adding a new node, for no real benefit. Differential Revision: https://developer.blender.org/D13337
2021-11-23Geometry Nodes: add namespace for every fileJacques Lucke
This puts all static functions in geometry node files into a new namespace. This allows using unity build which can improve compile times significantly (P2578). * The name space name is derived from the file name. That makes it possible to write some tooling that checks the names later on. The file name extension (`cc`) is added to the namespace name as well. This also possibly simplifies tooling but also makes it more obvious that this namespace is specific to a file. * In the register function of every node, I added a namespace alias `namespace file_ns = blender::nodes::node_geo_*_cc;`. This avoids some duplication of the file name and may also simplify tooling, because this line is easy to detect. The name `file_ns` stands for "file namespace" and also indicates that this namespace corresponds to the current file. In the beginning I used `node_ns` but `file_ns` is more generic which may make it more suitable when we want to use unity builds outside of the nodes modules in the future. * Some node files contain code that is actually shared between different nodes. For now I left that code in the `blender::nodes` namespace and moved it to the top of the file (couldn't move it to the bottom in all cases, so I just moved it to the top everywhere). As a separate cleanup step, this shared code should actually be moved to a separate file. Differential Revision: https://developer.blender.org/D13330
2021-11-17Cleanup: change node socket availability in a single placeJacques Lucke
This cleans up part of the code that still set the flag manually. Also, this change helps with D13246 because it makes it easier to tag the node tree as changed when the availability of a socket changed.
2021-11-16Geometry Nodes: refactor virtual array systemJacques Lucke
Goals of this refactor: * Simplify creating virtual arrays. * Simplify passing virtual arrays around. * Simplify converting between typed and generic virtual arrays. * Reduce memory allocations. As a quick reminder, a virtual arrays is a data structure that behaves like an array (i.e. it can be accessed using an index). However, it may not actually be stored as array internally. The two most important implementations of virtual arrays are those that correspond to an actual plain array and those that have the same value for every index. However, many more implementations exist for various reasons (interfacing with legacy attributes, unified iterator over all points in multiple splines, ...). With this refactor the core types (`VArray`, `GVArray`, `VMutableArray` and `GVMutableArray`) can be used like "normal values". They typically live on the stack. Before, they were usually inside a `std::unique_ptr`. This makes passing them around much easier. Creation of new virtual arrays is also much simpler now due to some constructors. Memory allocations are reduced by making use of small object optimization inside the core types. Previously, `VArray` was a class with virtual methods that had to be overridden to change the behavior of a the virtual array. Now,`VArray` has a fixed size and has no virtual methods. Instead it contains a `VArrayImpl` that is similar to the old `VArray`. `VArrayImpl` should rarely ever be used directly, unless a new virtual array implementation is added. To support the small object optimization for many `VArrayImpl` classes, a new `blender::Any` type is added. It is similar to `std::any` with two additional features. It has an adjustable inline buffer size and alignment. The inline buffer size of `std::any` can't be relied on and is usually too small for our use case here. Furthermore, `blender::Any` can store additional user-defined type information without increasing the stack size. Differential Revision: https://developer.blender.org/D12986
2021-10-29Nodes: Add translation markers to new socket names and descriptionsHans Goudey
As part of the refactor to the node declaration builders, we had hoped to add a regular expression specifically for these socket names, but recent discussions have revealed that using the translation marker macros is the preferred solution. If the names and descriptions were exposed to RNA, these would not be necessary. However, that may be quite complicated, since sockets are all instances of the same RNA types. Differential Revision: https://developer.blender.org/D13033
2021-10-26Geometry Nodes: geometry component type warning systemJacques Lucke
Previously, every node had to create warnings for unsupported input geometry manually. Now this is automated. Nodes just have to specify the geometry types they support in the node declaration. Differential Revision: https://developer.blender.org/D12899
2021-10-26Geometry Nodes: remove reference to anonymous attributes in tooltipsJacques Lucke
This changes socket inspection for fields according to T91881. Differential Revision: https://developer.blender.org/D13006
2021-10-20Geometry Nodes: Fields version of Curve to Points nodeHans Goudey
This commit adds an updated version of the curve to points that supports fields. Only the position and radius are transferred by default now, which should improve performance. The other outputs like tangent and rotation are outputted with anonymous attributes. I took the opportunity to change a few other small things: - Name geometry sockets "Curve" and "Points" like other nodes. - Remove the radius multiple of 0.1, which was confusing. Thanks to @Johnny Matthews (guitargeek) for an initial patch. Differential Revision: https://developer.blender.org/D12887
2021-09-28Geometry Nodes: Move more nodes to legacyHans Goudey
- Curve to Points: Needs output sockets - Curve Endpoitns: Needs the same output sockets - Edge Split: Should have a selection input instead - Subdivision Surface: Should not use "crease" implicitly All new versions of these nodes should also not implicitly realize instances.
2021-09-20Cleanup: Fix/improve variable names and commentsHans Goudey
2021-09-19Cleanup: Rename curve node enumsHans Goudey
The enum called "interpolate" was really a choice of methods for mapping inputs to positions on the curve, whereas the "sample" enum was used to define a way to create a whole set of new points from the curve, without any input parameters. The "re-sample" vs. "sample" naming makes that distinction better.
2021-09-09Geometry Nodes: fields and anonymous attributesJacques Lucke
This implements the initial core framework for fields and anonymous attributes (also see T91274). The new functionality is hidden behind the "Geometry Nodes Fields" feature flag. When enabled in the user preferences, the following new nodes become available: `Position`, `Index`, `Normal`, `Set Position` and `Attribute Capture`. Socket inspection has not been updated to work with fields yet. Besides these changes at the user level, this patch contains the ground work for: * building and evaluating fields at run-time (`FN_fields.hh`) and * creating and accessing anonymous attributes on geometry (`BKE_anonymous_attribute.h`). For evaluating fields we use a new so called multi-function procedure (`FN_multi_function_procedure.hh`). It allows composing multi-functions in arbitrary ways and supports efficient evaluation as is required by fields. See `FN_multi_function_procedure.hh` for more details on how this evaluation mechanism can be used. A new `AttributeIDRef` has been added which allows handling named and anonymous attributes in the same way in many places. Hans and I worked on this patch together. Differential Revision: https://developer.blender.org/D12414
2021-09-07Fix T91093: off by one error in when resampling curveJacques Lucke
The bug existed in the Curve Resample and Curve to Points node. Differential Revision: https://developer.blender.org/D12416
2021-09-02Cleanup: Convert geometry nodes socket list to use new APIJohnny Matthews
The new API introduced in rB1e69a25043120c provides a shorted, more flexibly way to declare node socket inputs and outputs. This commit updates all geometry nodes to use the `NodeSocketBuilder` API, except the four nodes that need `SOCK_HIDE_VALUE` or `SOCK_MULTI_INPUT`. Differential Revisions: D12377, D12376, D12374, D12373, D12372
2021-07-07Geometry Nodes: Curve Endpoints NodeAngus Stanton
This node is quite similar to the curve to points node, but creates points for only the start and end of each spline. This is a separate node because the sampling from the curve to points node don't apply, and just for ease of use. All attributes from the curves are copied, including the data for instancing: tangents, normals, and the derived rotations. One simple use case is to make round caps on curves by instancinghalves of a sphere on each end of the splines. Differential Revision: https://developer.blender.org/D11719
2021-06-28Functions: improve CPPTypeJacques Lucke
* Reduce code duplication. * Give methods more standardized names (e.g. `move_to_initialized` -> `move_assign`). * Support wrapping arbitrary C++ types, even those that e.g. are not copyable.
2021-06-22Cleanup: Rename variables, use shorter namesHans Goudey
`src` and `dst` are perfectly clear, and avoid repeating unecessary characters when writing the variables many times, allowing more space for everything else.
2021-06-21Cleanup: Rename spline interpolation functionsHans Goudey
The names were slightly longer than they needed to be clear, and when they are shorter they tend to fit on one line better.
2021-06-16BLI: add threading namespaceJacques Lucke
This namespace groups threading related functions/classes. This avoids adding more threading related stuff to the blender namespace. Also it makes naming a bit easier, e.g. the c++ version of BLI_task_isolate could become blender::threading::isolate_task or something similar. Differential Revision: https://developer.blender.org/D11624
2021-06-14Geometry Nodes: Curve to Points Node for Evaluated DataHans Goudey
This node implements the second option of T87429, creating points along the input splines with the necessary evaluated information for instancing: `tangent`, `normal`, and `rotation` attributes. All generic curve point and spline attributes are copied to the result points as well. The "Count" and "Length" methods are just like the current options in the resample node, but the output is points instead of a curve. The "Evaluated" method uses the points you see on the curve directly, and therefore should be the fastest. The rotation data is retrieved from a transform matrix built with the same method that the curve to mesh node uses. The radius attribute is divided by 10 so the points don't look absurdly huge in the viewport. In the future that could be an option. For the implementation, one thing that could use an improvement is the amount of temporary allocations while resampling to evaluated points before the final points. I expect that reusing a buffer for each thread would give a nice improvement. Differential Revision: https://developer.blender.org/D11539