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-10-03Cleanup: remove unnecessary bracesJacques Lucke
2022-10-03Geometry Nodes: new Sample UV Surface nodeJacques Lucke
This node allows sampling an attribute on a mesh surface based on a UV coordinate. Internally, this has to do a "reverse uv lookup", i.e. the node has to find the polygon that corresponds to the uv coordinate. Therefore, the uv map of the mesh should not have overlapping faces. Differential Revision: https://developer.blender.org/D15440
2022-10-03Cleanup: sort cmake file listsCampbell Barton
2022-10-03CMake: add missing headersCampbell Barton
2022-09-29Cleanup: Naming in edge vertices nodeHans Goudey
- Use `enum class` - Use shorter names for field input classes for better line wrapping - Use "Vert" instead of "Vertex"
2022-09-29Fix: Spline Parameter node produces NaN when curve is a single pointJacques Lucke
Issue found in file from T101256.
2022-09-29Fix T101410: ignore dangling reroute inputsJacques Lucke
For consistency with other node systems in Blender and older versions of geometry nodes, dangling reroute inputs should not affect the output. When an input socket is linked to dangling reroutes, its own value should be used instead.
2022-09-29UI: Nodes typo in "distribute points in volume" nodeDalai Felinto
Distribute Points In Volume → Distribute Points in Volume.
2022-09-29Cleanup; Warning about missing override for virtual functionSergey Sharybin
2022-09-29Cleanup: formatCampbell Barton
2022-09-28Geometry Nodes: Curve and mesh topology access nodesHans Goudey
This patch contains an initial set of nodes to access basic mesh topology information, as explored in T100020. The nodes allow six direct topology mappings for meshes: - **Corner -> Face** The face a corner is in, the index in the face - **Vertex -> Edge** Choose an edge attached to the vertex - **Vertex -> Corner** Choose a corner attached to the vertex - **Corner -> Edge** The next and previous edge at each face corner - **Corner -> Vertex** The vertex associated with a corner - **Corner -> Corner** Offset a corner index within a face And two new topology mappings for curves: - **Curve -> Points** Choose a point within a curve - **Point -> Curve** The curve a point is in, the index in the curve The idea is that some of the 16 possible mesh mappings are more important, and that this is a useful set of nodes to start exploring this area. For mappings with an arbitrary number of connections, we must sort them and use an index to choose a single element, because geometry nodes does not support list fields. Note that the sort index has repeating behavior as it goes over the "Total" number of connections, and negative sort indices choose from the end. Currently which of the "start" elements is used is determined by the field context, so the "Field at Index" and "Interpolate Domain" nodes will be quite important. Also, currently the "Sort Index" inputs are clamped to the number of connections. One important feature that isn't implemented here is using the winding order for the output elements. This can be a separate mode for some of these nodes. It will be optional because of the performance impact. There are several todos for separate commits after this: - Rename "Control Point Neighbors" to be consistent with this naming - Version away the "Vertex Neighbors" node which is fully redundant now - Implement a special case for when no weights are used for performance - De-duplicating some of the sorting logic between the nodes - Improve performance and memory use of topology mappings - Look into caching some of the mappings on meshes Differential Revision: https://developer.blender.org/D16029
2022-09-28Geometry Nodes: viewport previewJacques Lucke
This adds support for showing geometry passed to the Viewer in the 3d viewport (instead of just in the spreadsheet). The "viewer geometry" bypasses the group output. So it is not necessary to change the final output of the node group to be able to see the intermediate geometry. **Activation and deactivation of a viewer node** * A viewer node is activated by clicking on it. * Ctrl+shift+click on any node/socket connects it to the viewer and makes it active. * Ctrl+shift+click in empty space deactivates the active viewer. * When the active viewer is not visible anymore (e.g. another object is selected, or the current node group is exit), it is deactivated. * Clicking on the icon in the header of the Viewer node toggles whether its active or not. **Pinning** * The spreadsheet still allows pinning the active viewer as before. When pinned, the spreadsheet still references the viewer node even when it becomes inactive. * The viewport does not support pinning at the moment. It always shows the active viewer. **Attribute** * When a field is linked to the second input of the viewer node it is displayed as an overlay in the viewport. * When possible the correct domain for the attribute is determined automatically. This does not work in all cases. It falls back to the face corner domain on meshes and the point domain on curves. When necessary, the domain can be picked manually. * The spreadsheet now only shows the "Viewer" column for the domain that is selected in the Viewer node. * Instance attributes are visualized as a constant color per instance. **Viewport Options** * The attribute overlay opacity can be controlled with the "Viewer Node" setting in the overlays popover. * A viewport can be configured not to show intermediate viewer-geometry by disabling the "Viewer Node" option in the "View" menu. **Implementation Details** * The "spreadsheet context path" was generalized to a "viewer path" that is used in more places now. * The viewer node itself determines the attribute domain, evaluates the field and stores the result in a `.viewer` attribute. * A new "viewer attribute' overlay displays the data from the `.viewer` attribute. * The ground truth for the active viewer node is stored in the workspace now. Node editors, spreadsheets and viewports retrieve the active viewer from there unless they are pinned. * The depsgraph object iterator has a new "viewer path" setting. When set, the viewed geometry of the corresponding object is part of the iterator instead of the final evaluated geometry. * To support the instance attribute overlay `DupliObject` was extended to contain the information necessary for drawing the overlay. * The ctrl+shift+click operator has been refactored so that it can make existing links to viewers active again. * The auto-domain-detection in the Viewer node works by checking the "preferred domain" for every field input. If there is not exactly one preferred domain, the fallback is used. Known limitations: * Loose edges of meshes don't have the attribute overlay. This could be added separately if necessary. * Some attributes are hard to visualize as a color directly. For example, the values might have to be normalized or some should be drawn as arrays. For now, we encourage users to build node groups that generate appropriate viewer-geometry. We might include some of that functionality in future versions. Support for displaying attribute values as text in the viewport is planned as well. * There seems to be an issue with the attribute overlay for pointclouds on nvidia gpus, to be investigated. Differential Revision: https://developer.blender.org/D15954
2022-09-27Fix curves sculpting in deformed space when using Subdivide nodePhilipp Oeser
Needs a call to remember_deformed_curve_positions_if_necessary, missed in rB1f94b56d7744. Thx @JacquesLucke for the solution! Differential Revision: https://developer.blender.org/D16078
2022-09-27Cleanup: Fix brace-scalar-init warningSergey Sharybin
2022-09-26Geometry Nodes: Miscellaneous changes in control point neighbors nodeHans Goudey
- Use const and whitespace more consistently - Fix "Offset Valid" output only working on point domain - Use the smallest output array that can contain the result. - Consistent include ordering - Use "data-block" term instead of "object" in tooltip - Remove unnecessary call to set default output values
2022-09-26Geometry Nodes: Control Point Neighbors NodeJohnny Matthews
This node allows access to the indices of neighboring control points within a curve via an offset. This includes taking into consideration curves that are cyclic. Differential Revision: D13373
2022-09-26Cleanup: use ELEM/STR_ELEM/STREQ macrosCampbell Barton
2022-09-26Fix T101309: crash when executing geometry nodes without loggerJacques Lucke
2022-09-25Geometry Nodes: decentralize implicit input definitionsJacques Lucke
Previously, all implicit inputs where stored in a centralized place. Now the information which nodes have which implicit inputs is stored in the nodes directly.
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-25Cleanup: remove redundant parenthesis (especially with macros)Campbell Barton
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: replace static_casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: remove redundant double parenthesisCampbell Barton
2022-09-25Cleanup: format, spelling in commentsCampbell Barton
2022-09-24Cleanup: simplify accessing mesh looptrisJacques Lucke
2022-09-24Cleanup: typo in static node typeJacques Lucke
2022-09-23Geometry Nodes: Split transfer attribute nodeHans Goudey
This patch replaces the existing transfer attribute node with three nodes, "Sample Nearest Surface", "Sample Index", and "Sample Nearest". This follows the design in T100010, allowing for new nodes like UV sampling in the future. There is versioning so the new nodes replace the old ones and are relinked as necessary. The "Sample Nearest Surface" node is meant for the more complex sampling algorithms that only work on meshes and interpolate values inside of faces. The new "Sample Index" just retrieves attributes from a geometry at specific indices. It doesn't have implicit behavior like the old transfer mode, which should make it more predictable. In order to not change the behavior from existing files, the node has a has a "Clamp", which is off by default for consistency with the "Field at Index" node. The "Sample Nearest" node returns the index of the nearest element on a geometry. It can be combined with the "Sample Index" node for the same functionality as the old transfer node. This node can support curves in the future. Backwards compatibility is handled by versioning, but old versions can not understand these nodes. The warning from 680fa8a523e0 should make this explicit in 3.3 and earlier. Differential Revision: https://developer.blender.org/D15909
2022-09-23Mesh: Move selection flags to generic attributesHans Goudey
Using the attribute name semantics from T97452, this patch moves the selection status of mesh elements from the `SELECT` of vertices, and edges, and the `ME_FACE_SEL` of faces to generic boolean attribute Storing this data as generic attributes can significantly simplify and improve code, as described in T95965. The attributes are called `.select_vert`, `.select_edge`, and `.select_poly`. The `.` prefix means they are "UI attributes",so they still contain original data edited by users, but they aren't meant to be accessed procedurally by the user in arbitrary situations. They are also be hidden in the spreadsheet and the attribute list. Until 4.0, the attributes are still written to and read from the mesh in the old way, so neither forward nor backward compatibility are affected. This means memory requirements will be increased by one byte per element when selection is used. When the flags are removed completely, requirements will decrease. Further notes: * The `MVert` flag is empty at runtime now, so it can be ignored. * `BMesh` is unchanged, otherwise the change would be much larger. * Many tests have slightly different results, since the selection attribute uses more generic propagation. Previously you couldn't really rely on edit mode selections being propagated procedurally. Now it mostly works as expected. Similar to 2480b55f216c Ref T95965 Differential Revision: https://developer.blender.org/D15795
2022-09-23Mesh: Move edge crease out of MEdgeHans Goudey
This is very similar to D14077. There are two differences though. First is that vertex creases are already stored in a separate layer, and second is that we can now completely remove use of `Mesh.cd_flag`, since that information is now inherent to whether the layers exist. There are two functional differences here: * Operators are used to add and remove layers instead of a property. * The "crease" attribute can be created and removed by geometry nodes. The second change should make various geometry nodes slightly faster, since the "crease" attribute was always processed before. Creases are now interpolated generically in the CustomData API too, which should help maintain the values across edits better. Meshes get an `edge_creases` RNA property like the existing vertex property, to provide more efficient access to the data in Cycles. One test failure is expected, where different rounding between float the old char storage means that 5 additional points are scattered in a geometry nodes test. Differential Revision: https://developer.blender.org/D15927
2022-09-23Cleanup: Grammar fix in lazy functionHans Goudey
2022-09-23Fix: Add missing drag link search item for store named attribute nodeHans Goudey
The search didn't add an item for the geometry output socket.
2022-09-22Geometry Nodes: Add Self Object NodeHans Goudey
From the nodes' description: "Retrieve the object that contains the geometry nodes modifier currently being executed". This was discussed in the most recent geometry nodes module meeting. Because the node allows you to retrieve the position of the modifier object, it has to add a depsgraph relation to object transform. Expect that modifiers will be reevaluated when moving the object. In the future, better static analysis of node trees could make this check smarter. Differential Revision: https://developer.blender.org/D16037
2022-09-22Cleanup: Use const arguments for node group poll functionHans Goudey
Also make the disabled hint argument optional.
2022-09-21Attributes: Allow calling "finish" on empty accessorsHans Goudey
This removes some boilerplate when creating many optional attributes.
2022-09-21Attributes: Correct implementation of typed "write_only" methodHans Goudey
The typed "lookup_or_add_for_write_only" function is meant to do the same thing as the non-typed version of the function. Instead, it still initialized values of new attribute arrays, which isn't meant to happen. Missed in 4c91c24bc7cbe2c4f97be373. I also had to correct one place that used the "write_only" function but didn't intialize all values.
2022-09-21Cleanup: Miscellaneous cleanup in distribute points in volume nodeHans Goudey
- Fix unused variable warning - Change whitespace - Use standard variable names - Use standard method to remove non-pointcloud components
2022-09-21Revert "Cleanup: Fix warning unused variable 'mode' when doing make lite"Dalai Felinto
Sorry, this was working before I rebased. I believe the warning was fixed and the rebase still applied. The commit as it was introduced building problems This reverts commit ae21319d7f7d3e779c25b08d07a1458d6c054560.
2022-09-21Cleanup: Fix warning unused variable 'mode' when doing make liteDalai Felinto
2022-09-20Fix T101208: Missing original index handling in extrude nodeHans Goudey
The extrude node must set the original indices for new faces to "None" in edge mode as well. Same for new edges in vertex mode.
2022-09-20Cleanup: Improve consistency when nodes run without OpenVDBHans Goudey
Use a consistent order of expressions and formatting. Also use consistent error message text.
2022-09-20Cleanup: Strict compiler warningSergey Sharybin
Resolves -Wunneeded-internal-declaration warning generated by Clang.
2022-09-20Fix T101214: hidden link can cause cycle in node treeJacques Lucke
Links that are linked to unavailable sockets should be ignored.
2022-09-20Geometry Nodes: improve evaluator with lazy threadingJacques Lucke
In large node setup the threading overhead was sometimes very significant. That's especially true when most nodes do very little work. This commit improves the scheduling by not using multi-threading in many cases unless it's likely that it will be worth it. For more details see the comments in `BLI_lazy_threading.hh`. Differential Revision: https://developer.blender.org/D15976
2022-09-19Geometry Nodes: Distribute Points in VolumeIyad Ahmed
This commit adds a node to distribute points inside of volume grids. The "Random" mode usese OpenVDB's "point scatter" implementation, and there is also a "Grid" mode for uniform distributions. Both methods operate on all of the float grids in the volume, using every voxel with a value higher than the threshold. The random method is not stable as the input volume deforms. Based on a patch by Angus Stanton (@abstanton), which was based on a patch by Kenzie (@kenziemac130). Differential Revision: https://developer.blender.org/D15375
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-09-18Build: limit Py_ENABLE_SHARED to modules using Python headersBrecht Van Lommel
And remove Python flags from nodes, no longer needed.
2022-09-18Geometry Nodes: New Face Set Boundaries nodeWannes Malfait
With the recent addition of the UV unwrapping node, there is a need to be able to create seams easily. This node does that by outputting a selection of the boundaries between different input face sets. In the context of UV mapping, one inputs the "patches" you want, and the node gives you the seams needed to make those patches. Differential Revision: https://developer.blender.org/D15423
2022-09-18BLI: Add generic utlity for gathering values with indicesMattias Fredriksson
Add new functions to `array_utils` namespace called `gather(..)`. Versions of `GVArray::materialize_compressed_to_uninitialized(..)` with threading have been reimplemented locally in multiple geometry node contexts. The purpose of this patch is therefore to: * Assemble these implementations in a single file. * Provide a naming convention that is easier to recognize. Differential Revision: https://developer.blender.org/D15786