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-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-16Cleanup: spelling in commentsCampbell Barton
2022-09-13Geometry Nodes: new evaluation systemJacques Lucke
This refactors the geometry nodes evaluation system. No changes for the user are expected. At a high level the goals are: * Support using geometry nodes outside of the geometry nodes modifier. * Support using the evaluator infrastructure for other purposes like field evaluation. * Support more nodes, especially when many of them are disabled behind switch nodes. * Support doing preprocessing on node groups. For more details see T98492. There are fairly detailed comments in the code, but here is a high level overview for how it works now: * There is a new "lazy-function" system. It is similar in spirit to the multi-function system but with different goals. Instead of optimizing throughput for highly parallelizable work, this system is designed to compute only the data that is actually necessary. What data is necessary can be determined dynamically during evaluation. Many lazy-functions can be composed in a graph to form a new lazy-function, which can again be used in a graph etc. * Each geometry node group is converted into a lazy-function graph prior to evaluation. To evaluate geometry nodes, one then just has to evaluate that graph. Node groups are no longer inlined into their parents. Next steps for the evaluation system is to reduce the use of threads in some situations to avoid overhead. Many small node groups don't benefit from multi-threading at all. This is much easier to do now because not everything has to be inlined in one huge node tree anymore. Differential Revision: https://developer.blender.org/D15914
2022-09-09Nodes: fix memory leakJacques Lucke
2022-09-08Silence warnings/assert about invalid embedded IDs for older blendfiles.Bastien Montagne
there is no point in warning about files that are not supposed to be 'correct' in that regard.
2022-09-08IDManagement: change `IDTypeInfo.owner_get` to instead return address of the ↵Bastien Montagne
owner_id pointer. Also rename the callback. That way, we can keep moving toward a more generic handling of those embedded IDs (think e.g. about copy code).
2022-09-07IDManagement: Add some assert to ensure lib consistency in embedded IDs.Bastien Montagne
From re-checking related code, it seems that we already always ensure consistency of the `lib` pointer between embedded IDs and their owners. This commit only adds some asserts in ambedded ID read code to double-check this.
2022-09-07Cleanup: spelling in comments, correct doxy slashes, replace '/w'Campbell Barton
2022-09-06Cleanup: IDManagement: Simplify `owner_get` calllback of IDTypeInfo.Bastien Montagne
Now that all embedded IDs have a loopback pointer to their owner, we do need anymore extra parameters for this accessor.
2022-09-06Address to some extent issues with invalid embedded IDs in existing files.Bastien Montagne
Many existing .blend files (including startup ones) seem to have invalid embedded IDs (they are not properly tagged with `LIB_EMBEDDED_DATA`). We cannot `do_version` this so just fix it on the fly when detecting the issue. User then need to re-save these files. We also need to update some release files (default factory startup is OK, but e.g. the VSE template one is not). Keeping the assert is important here, as such missing flag is a critical data corruption that can potentially have many serious consequences throughout the ID management code.
2022-09-06Fix T100850: Regression: Gpencil: crash on material color and other ↵Bastien Montagne
properties change. rBcd49fee74114 forgot to add proper support for calls to `ntreeAddTree` with a NULL Main (which should generate `NO_MAIN` ntrees).
2022-09-05IDMAnagement: Add owner ID pointer to embedded ones.Bastien Montagne
Add a dedicated `owner_id` pointer to ID types that can be embedded (Collections and NodeTrees), and modify slightly come code to make handling those more safe and consistent. This implements first part of T69169. Reviewed By: brecht Differential Revision: https://developer.blender.org/D15838
2022-09-04Cleanup: Replace recursive quadratic node link mute operationHans Goudey
The previous implementation iterated over all links multiple times recursively. Instead, use the node tree topology cache, only iterate over all links once, and use a stack to propagate the mute upsteam and downstream.
2022-09-03Cleanup: use more standard variable name for node socketsHans Goudey
2022-08-31Nodes: move NodeTreeRef functionality into node runtime dataJacques Lucke
The purpose of `NodeTreeRef` was to speed up various queries on a read-only `bNodeTree`. Not that we have runtime data in nodes and sockets, we can also store the result of some queries there. This has some benefits: * No need for a read-only separate node tree data structure which increased complexity. * Makes it easier to reuse cached queries in more parts of Blender that can benefit from it. A downside is that we loose some type safety that we got by having different types for input and output sockets, as well as internal and non-internal links. This patch also refactors `DerivedNodeTree` so that it does not use `NodeTreeRef` anymore, but uses `bNodeTree` directly instead. To provide a convenient API (that is also close to what `NodeTreeRef` has), a new approach is implemented: `bNodeTree`, `bNode`, `bNodeSocket` and `bNodeLink` now have C++ methods declared in `DNA_node_types.h` which are implemented in `BKE_node_runtime.hh`. To make this work, `makesdna` now skips c++ sections when parsing dna header files. No user visible changes are expected. Differential Revision: https://developer.blender.org/D15491
2022-08-31Node: Mix nodeCharlie Jolly
This patch is a response to T92588 and is implemented as a Function/Shader node. This node has support for Float, Vector and Color data types. For Vector it supports uniform and non-uniform mixing. For Color it now has the option to remove factor clamping. It replaces the Mix RGB for Shader and Geometry node trees. As discussed in T96219, this patch converts existing nodes in .blend files. The old node is still available in the Python API but hidden from the menus. Reviewed By: HooglyBoogly, JacquesLucke, simonthommes, brecht Maniphest Tasks: T92588 Differential Revision: https://developer.blender.org/D13749
2022-08-30Cleanup: formatCampbell Barton
2022-08-29I18n: translate newly created node group socketsDamien Picard
Translate: - new group socket names - default names Input and Output - on connecting a link from another node - new geometry nodes input and output socket names Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15763
2022-08-12IDType `get_owner`: add an optional hint about owner ID.Bastien Montagne
In some cases, there is a chance code already knows who might be the owner of the given ID, in which case it can be more efficient to check it first (especially in cases like embedded node trees or scene collections, where the only other way is to loop over all possible owners currently). Will be used in next commit in some Outliner fix.
2022-08-10Fix T100308: Removing scene time node does not update relationsHans Goudey
Similar to the fix in 734c6a4405f21078270e71.
2022-07-29Fix (unreported) lib-linking of ID properties not taking library parameter.Bastien Montagne
While this was not a critical issue (that lib pointer is only used for some kind of sanity check that no linked data uses local ID pointers), better to keep `IDP_BlendReadLib` in sync with all other lib-linking code.
2022-07-27Geometry Nodes: Rename "Field on Domain" to "Interpolate Domain"Hans Goudey
This name doesn't require understanding of fields, and is phrased as an action which is consistent with other nodes. Discussed in the latest geometry nodes sub-module meeting.
2022-07-27Geometry Nodes: Shortest Paths nodesErik Abrahamsson
This adds three new nodes: * `Shortest Edge Paths`: Actually finds the shortest paths. * `Edge Paths to Curves`: Converts the paths to separate curves. This may generate a quadratic amount of data, making it slow for large meshes. * `Edge Paths to Selection`: Generates an edge selection that contains all edges that are part of a path. This can be used with the Separate Geometry node to only keep the edges that are part of a path. For large meshes, this approach can be much faster than the `Edge Paths to Curves` node, because less data is created. Differential Revision: https://developer.blender.org/D15274
2022-07-08Curves: support deforming curves on surfaceJacques Lucke
Curves that are attached to a surface can now follow the surface when it is modified using shape keys or modifiers (but not when the original surface is deformed in edit or sculpt mode). The surface is allowed to be changed in any way that keeps uv maps intact. So deformation is allowed, but also some topology changes like subdivision. The following features are added: * A new `Deform Curves on Surface` node, which deforms curves with attachment information based on the surface object and uv map set in the properties panel. * A new `Add Rest Position` checkbox in the shape keys panel. When checked, a new `rest_position` vector attribute is added to the mesh before shape keys and modifiers are applied. This is necessary to support proper deformation of the curves, but can also be used for other purposes. * The `Add > Curve > Empty Hair` operator now sets up a simple geometry nodes setup that deforms the hair. It also makes sure that the rest position attribute is added to the surface. * A new `Object (Attach Curves to Surface)` operator in the `Set Parent To` (ctrl+P) menu, which attaches existing curves to the surface and sets the surface object as parent. Limitations: * Sculpting the procedurally deformed curves will be implemented separately. * The `Deform Curves on Surface` node is not generic and can only be used for one specific purpose currently. We plan to generalize this more in the future by adding support by exposing more inputs and/or by turning it into a node group. Differential Revision: https://developer.blender.org/D14864
2022-07-02Revert "Start of Bevel V2, as being worked on with task T98674."Howard Trickey
This reverts commit 9bb2afb55e50f9353cfc76cf2d8df7521b0b5feb. Oops, did not intend to commit this to master.
2022-07-02Start of Bevel V2, as being worked on with task T98674.Howard Trickey
This is the start of a geometry node to do edge, vertex, and face bevels. It doesn't yet do anything but analyze the "Vertex cap" around selected vertices for vertex bevel.
2022-06-29Geometry Nodes: UV Unwrap and Pack Islands NodesAleksi Juvani
This commit adds new Unwrap and Pack Islands nodes, with equivalent functionality to the existing Unwrap and Pack Islands operators. The Unwrap node uses generic boolean attributes to determine seams instead of looking at the seam flags in the mesh geometry. Unlike the Unwrap operator, the Unwrap node doesn't perform aspect ratio correction, because this is trivial for the user to implement with a Vector Math node if it is desired. The Unwrap node implicitly performs a Pack Islands operation upon completion, because the results may not be generally useful otherwise. This matches the behaviour of the Unwrap operator. The nodes use the existing Vector socket type, and do not introduce a new 2D Vector type (see T92765). Differential Revision: https://developer.blender.org/D14389
2022-06-29Geometry Nodes: Add Mesh To Volume NodeErik Abrahamsson
This adds a Mesh To Volume Node T86838 based on the existing modifier. The mesh to volume conversion is implemented in the geometry module, and shared between the node and the modifier. Currently the node outputs a grid with the name "density". This may change in the future depending on the decisions made in T91668. The original patch was by Kris (@Metricity), further implementation by Geramy Loveless (@GeramyLoveless), then finished by Erik Abrahamsson (@erik85). Differential Revision: https://developer.blender.org/D10895
2022-06-25Geometry Nodes: Field on Domain NodeHans Goudey
As described in T98943, this commit adds a node that can evaluate a field on a separate domain in a larger field context. This is potentially useful in many cases, to avoid relying on a separate capture attribute node, which can make it easier to build reusable fields that don't need geometry inputs. Internally, the node just evaluates the input field in the larger field context and then uses the generic domain interpolation, so the code is simple. One future optimization might be using the input selection to only evaluate part of the input field, but then the selection has to be interpolated as well, and that might not always be worth it. Differential Revision: https://developer.blender.org/D15289
2022-06-25Geometry Nodes: Add Points NodeJohnny Matthews
This node takes a point count,a vector field, and float field and creates a pointcloud with n points at the positions indicated in the vector field with the radii specified in the float field.The node is placed in the "Point" menu. Differential Revision: https://developer.blender.org/D13920 Maniphest Task: https://developer.blender.org/T93044
2022-06-17Geometry Nodes: new Volume Cube nodeChris Clyne
This commit adds a Volume Cube primitive node. It outputs a volume that contains a single "density" float grid. The density per voxel can be controlled with a field that depends on the voxel position (using the existing Position node). Other field inputs are not supported. The density field is evaluated on every voxel. Possible future improvements are listed in D15198. Differential Revision: https://developer.blender.org/D15198
2022-06-06Geometry Nodes: Add Instance Scale Input NodeJohnny Matthews
A field input node for the scale of each top-level instance transform. The scale can be set with the "Scale Instances" node, but previously could not be retrieved. Differential Revision: https://developer.blender.org/D15132
2022-06-06Geometry Nodes: Instance Rotation NodeJohnny Matthews
A field input node for the rotation of each top-level instance transform. The rotation can be set with the "Rotate Instances" node, but previously could not be retrieved. Differential Revision: https://developer.blender.org/D15131
2022-05-30Nodes: add separately allocated runtime data for nodes and socketsJacques Lucke
This is a follow up to rBbb0fc675822f313c5546a2498a162472c2571ecb. Now the same kind of run-time data is added to nodes and sockets. Differential Revision: https://developer.blender.org/D15060
2022-05-30Nodes: add separately allocated run-time data for bNodeTreeJacques Lucke
`bNodeTree` has a lot of run-time embedded in it currently. Having a separately allocated run-time struct has some benefits: * Run-time data is not stored in files. * Makes it easy to use c++ types as run-time data. * More clear distinction between what data only exists at run-time and which doesn't. This commit doesn't move all run-time data to the new struct yet, only the data where I know for sure how it is used. The remaining data can be moved separately. Differential Revision: https://developer.blender.org/D15033
2022-05-30Nodes: call init function for new node trees in ntreeAddTreeJacques Lucke
Issue found in D15033, for some more info see comments there.
2022-05-18Merge branch 'blender-v3.2-release'Sergey Sharybin
2022-05-18Fix T98157: improve animation fps with better check in depsgraphJacques Lucke
Previously, the depsgraph assumed that every node tree might contain a reference to a video. This resulted noticeable overhead when there was no video. Checking whether a node tree contained a video was relatively expensive to do in the depsgraph. It is cheaper now due to the structure of the new node tree updater. This also adds an additional run-time field to `bNodeTree` (there are quite a few already). We should move those to a separate run-time struct, but not as part of a bug fix. Differential Revision: https://developer.blender.org/D14957
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-04Nodes: Add general Combine/Separate Color nodesHallam Roberts
Inspired by D12936 and D12929, this patch adds general purpose "Combine Color" and "Separate Color" nodes to Geometry, Compositor, Shader and Texture nodes. - Within Geometry Nodes, it replaces the existing "Combine RGB" and "Separate RGB" nodes. - Within Compositor Nodes, it replaces the existing "Combine RGBA/HSVA/YCbCrA/YUVA" and "Separate RGBA/HSVA/YCbCrA/YUVA" nodes. - Within Texture Nodes, it replaces the existing "Combine RGBA" and "Separate RGBA" nodes. - Within Shader Nodes, it replaces the existing "Combine RGB/HSV" and "Separate RGB/HSV" nodes. Python addons have not been updated to the new nodes yet. **New shader code** In node_color.h, color.h and gpu_shader_material_color_util.glsl, missing methods hsl_to_rgb and rgb_to_hsl are added by directly converting existing C code. They always produce the same result. **Old code** As requested by T96219, old nodes still exist but are not displayed in the add menu. This means Python scripts can still create them as usual. Otherwise, versioning replaces the old nodes with the new nodes when opening .blend files. Differential Revision: https://developer.blender.org/D14034
2022-05-01Nodes: Fix T90233Lukas Tönne
- Fix default_value initialization of custom node tree interface: This was crashing when adding a custom interface socket to a tree. The node_socket_set_typeinfo function was called too early, creating a default float socket, which then doesn't match the socket type after changing to the custom type. The node_socket_set_typeinfo only allocates and initializes default_value when it isn't already set. That is because the function is used either when creating new sockets or to initialize typeinfo after loading files. So default_value has to be either null or has to be matching the current type already. - Fix RNA flag for string return value of the valid_socket_type callback: String return values of registerable RNA functions need a PROP_THICK_WRAP flag since they don't have a fixed buffer to write into.
2022-04-28Geometry Nodes: Add default attribute name to field inputs/outputsHans Goudey
Geometry node group inputs and outputs get a new property that controls the attribute name used for that field input/output when assigning the node group to a modifier for the first time. If the default name is assigned to an input, the default "Use attribute name" is true . In order to properly detect when a node group is first assigned, the modifier now clears its properties when clearing the node group. Ref T96707 Differential Revision: https://developer.blender.org/D14761
2022-04-13Cover some DNA files with C++ utility macrosSergey Sharybin
Solves compilation warning with Clang, and moves manipulation with DNA structures to the designed way for C++. The tests and few other places are update to the new code by Jacques. Ref T96847 Maniphest Tasks: T96847 Differential Revision: https://developer.blender.org/D14625
2022-04-08Painting: Canvas switcher for painting brushes/tools.Jeroen Bakker
This patch adds color attributes to TexPaintSlot. This allows an easier selection when painting color attributes. Previously when selecting a paint tool the user had to start a stroke, before the UI reflected the correct TexPaintSlot. Now when switching the slot the active tool is checked and immediate the UI is drawn correctly. In the future the canvas selector will also be used to select an image or image texture node to paint on. Basic implementation has already been done inside this patch. A limitation of this patch is that is isn't possible anymore to rename images directly from the selection panel. This is currently allowed in master. But as CustomDataLayers aren't ID fields and not owned by the material supporting this wouldn't be easy. {F12953989} In the future we should update the create slot operator to also include color attributes. Sources could also be extended to use other areas of the object that use image textures (particles, geom nodes, etc... ). Reviewed By: brecht Maniphest Tasks: T96709 Differential Revision: https://developer.blender.org/D14455
2022-04-06Fix badly broken caches handling during undo/redo.Bastien Montagne
Original rework of caches during undo/redo (see D8183) had a very bad flaw hidden in it: using the key of a ghash as source of data. While this was effectively working then (cache pointer itself being part of the key, and said cache pointers not being cleared on file write), this is a general very bad way to do things. Now that cache pointers are more and more cleared on file write (as part of clearing runtime-data to reduce false-positives when checking if an ID has changed or not), this has to be fixed properly by: * Not storing the cache pointer itself in the IDCacheKey. * In undo context, in readfile code trying to preserve caches, store the cache pointers as values of the mapping, together with the usages counter The first change potentially affects all usages of `BKE_idtype_id_foreach_cache`, but in practice this code is only used by memfile reading code (i.e. undo) currently. Related to T97015. Reviewed By: brecht Maniphest Tasks: T97015 Differential Revision: https://developer.blender.org/D14559
2022-03-21Cleanup: add image_format.cc for functions related to ImageFormatDataBrecht Van Lommel
Also fixes missing code to read/write/free/copy color management settings in various places. This can't be set through the UI currently, but still should be handled consistently.
2022-03-18Cleanup: Redundant parenthesisSergey Sharybin
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-03-14Geometry Nodes: Add named attribute nodes behind experimental flagHans Goudey
This commit adds three nodes: - `Remove Attribute`: Removes an attribute with the given name - `Named Attribute`: A field input node - `Store Named Attribute`: Puts results of a field in a named attribute They are added behind a new experimental feature flag, because further development of attribute search and name dependency visualization will happen as separate steps. Ref T91742 Differential Revision: https://developer.blender.org/D12685
2022-03-14Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton