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
2021-04-07Cleanup: Rename function, switch order of argumentsHans Goudey
The function name was not very specific, this makes it clearer that it works on instances rather than only real geometry. Also use `r_` prefix for the return argument.
2021-04-07Geometry Nodes: Rename grid output UV attributeHans Goudey
During review of D10730 it was discovered that the "uv" name causes issues for cycles, which uses it as a default internal data name. While that could be fixed in the future, there was no particular reason to use "uv" instead of "uv_map", so we use the latter instead here, which is consistent with the lowercase naming scheme chosen for attributes.
2021-04-07Geometry Nodes: Greatly improve speed of some mesh primitivesHans Goudey
Some of the BMesh primitive operators have a lot of overhead due to the fact that they use other operators like extrusion, removing doubles, and rotation, to build each shape rather than filling arrays directly. Implementing the primitives directly with the Mesh data structure is much more efficient, since it's simple to fill the result data based on the known inputs. It also allows also skip the conversion from BMesh to Mesh after the calculations. Speed matters more for procedural operations than for the existing operators accessible from the add menu, since they will be executed every evaluation rather than once before a destructive workflow. | Shape | Before (ms) | After (ms) | Speedup (x times faster) | | -------- | -------------| ------------| -------------------------| | Cylinder | 1.1676 | 0.31327 | 3.72 | | Cone | 4.5890 | 0.17762 | 25.8 | | Sphere | 64213.3 | 13.595 | 4720 | The downside of this change is that there will be two implementations for these three primitives, in these nodes and in `bmo_primitive.c`. One option would be re-implementing the BMesh primitives in terms of this code, but that would require `BMesh` to depend on `Mesh`, which is currently avoided. On the other hand, it will be easier to add new features to these nodes like different fill types for the top and the bottom of a cylinder, rings for a cylinder, and tagging the output with boolean attributes. Another factor to consider is that the add mesh object operator could be implemented with these nodes, just providing more benefit for a faster implementation. As a future cleanup, there is room to share code that generates the "rings" topology between different nodes that generate meshes. Differential Revision: https://developer.blender.org/D10730
2021-04-07Cleanup: Fix pessimizing move warning.Ankit Meel
2021-04-07Fix T87195: Boolean node multi-input socket only accepts one linkHans Goudey
The default insert link callback for nodes was trying to move the existing link away, since it didn't properly handle multi-input sockets (though the problem wasn't exposed for the join node). We can basically skip all of this "moving existing links" for multi-input sockets, unless we are at the link limit.
2021-04-07Cleanup: Various cleanup of node link handling functionsHans Goudey
Use LISTBASE_FOREACH macro, rename variables, comment formatting, simplification of logic, etc.
2021-04-07Geometry Nodes: Bounding Box NodeHans Goudey
This commit adds a simple node to output the min and max of an axis-aligned bounding box for the input geometry, as well a rectangular prism mesh created from these values for convenience. The initial use case for this node is a "bounding box boolean", where doing the boolean with just a bounding box could be signigicantly faster, for cases like cutting a hole in a wall for a window. But it's easy to imagine other cases where it could be useful. This node supports mesh and point cloud data right now, volume support will come as a separate patch. Also note that there is plenty of room to improve the performance of this node through parallelization. Differential Revision: https://developer.blender.org/D10420
2021-04-06Geometry Nodes: Use distance units for socket valuesWannes Malfait
This adds the property subtybe `PROP_DISTANCE` where appropriate. Differential Revision: https://developer.blender.org/D10900
2021-04-02Geometry Nodes: Separate grid primitive X and Y sizeHans Goudey
Since you can already specify a separate size for X and Y with the grid node, it makes sense to be able to specify the size separately for each axis also. This also avoids some awkward math with a Transform node afterwards when you want a specific size for each direction. Versioning (except for animation and drivers) is handled in this commit. Differential Revision: https://developer.blender.org/D10834
2021-04-02Geometry Nodes: Allow float input for point scale nodeHans Goudey
This allows easily changing the scale attribute with a uniform scale within a single simple node.
2021-04-02Geometry Nodes: Change point translate and scale node defaultsHans Goudey
Since these nodes are usually used for more basic operations and the attribute nodes are used when more complexity is necessary, it makes sense to give these nodes more accessible defaults-- hopefully this can make learning about the core concepts of geometry nodes a bit easier.
2021-04-02Fix T86874: Wireframe not drawing for geometry node mesh primitivesKris
The following primitives needed ME_EDGEDRAW, ME_EDGERENDER edge flags: * Grid * Circle Set flags on the inside edges for grid and circle triangle fan (mesh primitive nodes) so they are visible and selectable. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D10878
2021-04-02Cleanup: Remove unecessary C API for direct mesh booleanHans Goudey
The main goal here is to remove the need for a C API to the code in `mesh_boolean_convert.cc`. This is achieved by moving `MOD_boolean.c` to C++ and making the necessary changes for it to compile. On top of that there are some other slight simplifications possible to the direct mesh boolean code: it doesn't need to copy the material remaps, and the modifier code can use some other C++ types directly.
2021-04-01Geometry Nodes: Improve speed of boolean node, use multi-input socketHans Goudey
This commit improves the performance of the node by up to 40% in some cases when there are only two input meshes, mainly by skipping the conversion to and from BMesh. When there are more than two input meshes (note the distinction from "Geometries", a geometry set can have many mesh instances), the performance is actually worse, since boolean currently always does self intersection in that case. Theoretically this could be improved in the boolean code, or another option is automatically realizing instances for each input geometry set. Another improvement is using multi-input sockets for the inputs, which removes the need to have a separate boolean node for every operation, which can hopefully simplify some node trees. The changes necessary for transforms in `mesh_boolean_convert.cc` are somewhat subtle; they come from the fact that the collecting the geometry set instances already gives transforms in the local space of the modifier object. There is also a very small amount of cleanup to those lines, using `float4x4::identity()`. This commit also fixes T87078, where overlapping difference meshes makes the operation not work, though I haven't investigated why. Differential Revision: https://developer.blender.org/D10599
2021-04-01BLI: rename resource collector to resource scopeJacques Lucke
Differential Revision: https://developer.blender.org/D10857
2021-04-01Cleanup: use bool instead of intJacques Lucke
2021-04-01Cleanup: Remove unused codeHans Goudey
There was a note about reusing this for "texture nodes", but that will probably not be implemented in this way anyway.
2021-04-01Cleanup: move node_exec.c to c++Jacques Lucke
Doing this, because it might make it easier to replace the implementation of `bNodeInstanceHash`.
2021-04-01Cleanup: spellingCampbell Barton
2021-04-01Geometry Nodes: add socket value logging capabilityJacques Lucke
The node tree evaluator now calls a callback for every used socket with its corresponding value(s). Right now the callback does nothing. However, we can use it to collect attribute name hints, socket values for debugging or data that will be displayed in the spreadsheet. The main difficulty here was to also call the callback for sockets in nodes that are not directly executed (such as group nodes, muted nodes and reroutes). No functional changes are expected.
2021-03-31Fix T87094: Transforming geometry instances component is brokenHans Goudey
Caused by an incorrect transformation order in cleanup commit rBd037fef3bd1dc2e. The fix is to simply reverse the order.
2021-03-31Geometry Nodes: Rename "Grid" to "Density"Hans Goudey
For other "Attribute Name" fields we usually give a more specific name that relates to what the attribute is actually used for, like "Mask" in the point separate node. This is a similar situation, and would also be consistent with the naming planned in D10506.
2021-03-30Geometry Nodes: Set default grid vertices to 3 by 3Hans Goudey
This is a relatively arbitrary value, but a good starting point-- it's simple while also showing the possibility of the subdivisions. Ref T86819
2021-03-30Fix unused variable warning caused by recent cleanupHans Goudey
Caused by a cleanup, rBd037fef3bd1dc.
2021-03-30Cleanup: Fix incorrect socket list nameHans Goudey
2021-03-30Cleanup: Use float4x4 type and constructorHans Goudey
2021-03-29Fix T86972: transform node transforms shape keysJacques Lucke
2021-03-29Compositor: Add Anti-Aliasing nodeHabib Gahbiche
This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA) The algorithm was proposed by: Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez This node provides only SMAA 1x mode, so the operation will be done with no spatial multisampling nor temporal supersampling. See Patch for comparisons. The existing AA operation seems to be used only for binary images by some other nodes. Using SMAA for binary images needs no important parameter such as "threshold", so we perhaps can switch the operation to SMAA, though that changes existing behavior. Notes: 1. The program code assumes the screen coordinates are DirectX style that the vertical direction is upside-down, so "top" and "bottom" actually represent bottom and top, respectively. Thanks for Habib Gahbiche (zazizizou) to polish and finalize this patch. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D2411
2021-03-27Cleanup: clang-formatCampbell Barton
2021-03-26Cleanup: Use enum for "in" vs. "out" node socketsHans Goudey
2021-03-26Geometry Nodes: Rename "Plane" primitive to "Grid"Hans Goudey
Although "Grid" may not be techincally correct since a grid could be 3D, it was decided to rename the "Plane" primtive to "Grid". The primitive node allows subdivisions, so the name is more consistent with the operator in the 3D view. Ref T86819 This commit includes a file subversion bump for the versioning.
2021-03-26Geometry Nodes: Implicit conversion change for float/int/color to boolCharlie Jolly
Change `float to boolean` and `int32 to boolean` to return false for zero and negative values. This aligns with how artists would expect these values to work. This is in contrast to what a coder would expect. It was determined on blender.chat that this was a better default. This means that a negative float value would give a boolean false. Change `Color4f to boolean` to return false for zero and negative grayscale values. Likewise, for color to boolean, to account for negative value colors, the grayscale value would be used for determining if a colour was false or not. See {T86454} Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10685
2021-03-26Geometry Nodes: Add remaining operations to the Vector Math nodeLeon Leno
This patch adds support for the remaining operations of the Vector Math node within Geometry Nodes. While the operations are already available in the UI, they hadn't been implemented, yet. With this patch the node uses the implementation that was added for the Attribute Vector Math node - similar to how it's handled with the Math node and Attribute Math node. Differential Revision: https://developer.blender.org/D10650
2021-03-26Geometry Nodes: Add Attribute Clamp NodeCharlie Jolly
This adds a Clamp node for Geometry Nodes Attributes. Supports both Min-Max and Range clamp modes. Float, Vector, Color and Int data types supported. Reviewed By: HooglyBoogly, simonthommes Differential Revision: https://developer.blender.org/D10526
2021-03-26Geometry Nodes: Add Attribute Map Range NodeVictor-Louis De Gusseme
This commit adds a node with a "Map Range" operation for attributes just like the non-attribute version of the node. However, unlike the regular version of the node, it also supports operations on vectors. Differential Revision: https://developer.blender.org/D10344
2021-03-26Cleanup: clang-formatCampbell Barton
2021-03-26CMake: add headers to source lists, sort file-listsCampbell Barton
2021-03-26Fix: Geometry Nodes: Incorrect offsets for plane primitiveLeon Leno
The recent commit that changed the size (rB83df3545246aada) left out a few changed. This patch also adjusts the positioning and UV scale of the generated plane accordingly. Differential Revision: https://developer.blender.org/D10822
2021-03-25Cleanup: Pass instance group result vector as an argumentHans Goudey
This will allow retrieving the instance groups from multiple geometry sets and avoiding needing vectors of vectors to store the results. This is useful when retrieving instances from a multi-input socket of geometries.
2021-03-25BLI: simplify using DefaultHashJacques Lucke
2021-03-25Geometry Nodes: rename attribute domainsJacques Lucke
This patch renames two domains: * `Polygon` -> `Face` * `Corner` -> `Face Corner` For the change from `polygon` to `face` I did a "deep rename" where I updated all (most?) cases where we refere to the attribute domain in code as well. The change from `corner` to `face corner` is only a ui change. I did not see a real need to update all code the code for that. It does not seem to improve the code, more on the contrary. Ref T86818. Differential Revision: https://developer.blender.org/D10803
2021-03-24Fix T86875: "Show on Cage" crash for geometry nodes primitivesHans Goudey
Without `calc_object_remap` turned off in the conversion to and from BMesh for the primitive nodes, the `CD_ORIGINDEX` custom data layer has incorrect values. By using a different function to do the conversions, we can avoid this problem. Thanks to Jacques for finding the fix here. Differential Revision: https://developer.blender.org/D10805
2021-03-23Cleanup: use BLI_assert_unreachable in some placesJacques Lucke
2021-03-23Geometry Nodes: Make plane primitive size consistentHans Goudey
This means the "Size" input is treated as a "diameter" instead of a "radius", just like the 3D view primitives.
2021-03-23Nodes: Add Refract and Faceforward functions to Vector Maths nodesCharlie Jolly
Cycles, Eevee, OSL, Geo, Attribute Based on outdated refract patch D6619 by @cubic_sloth `refract` and `faceforward` are standard functions in GLSL, OSL and Godot shader languages. Adding these functions provides Blender shader artists access to these standard functions. Reviewed By: brecht Differential Revision: https://developer.blender.org/D10622
2021-03-23Cryptomatte: Node Size.Jeroen Bakker
Made it just a bit smaller (same size as renderlayers node).
2021-03-23Cryptomatte: Default Node Size.Jeroen Bakker
Set the min/max and default node size of the cryptomatte node.
2021-03-23Geometry Nodes: show domain in attribute fill nodeJacques Lucke
Differential Revision: https://developer.blender.org/D10789
2021-03-22Geometry Nodes: Remove location and rotation from mesh primitivesHans Goudey
Following some discussion among the geometry nodes team, it was decided that keeping the primitive nodes simpler and requiring a separate transform node to move the generated geometry from the origin would be better. - It's more consistent with the current general idea of "building block nodes" - It makes more sense for the future when it will be possible to use instancing to control the transforms. - It reduces UI clutter when the controls are not necessary.
2021-03-22Cleanup: remove unexposed nodesJacques Lucke
Those nodes are leftovers from my work on particle nodes and are not needed currently. They can be added back easily if they become necessary.