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-03-02Geometry Nodes: show "Show Texture in texture tab" buttonPhilipp Oeser
This enables the quick access button [to show the relevant Texture in the Properties Editor] for textures used in geometry nodes. This goes in line to what we do for other textures: - modifier textures have this button - particle textures have this button - brush textures will soon have it, too (see D9813) When outside of the Properties Editor, the button will always show (if a texture is actually assigned), but will be inactive if no suiting Properties Editor to show the texture in can be found. Note this also changes the behavior to not show the button if _no_ texture is assigned (as in: we are still showing the "New" button). Previously it was always there (e.g. for modifier textures), even if it would take us to an empty texture tab. (Sure, we could add a texture there then, but imho it makes more sense to just start showing it once a texture is already there) For this to work with geometry nodes, the following chages were done: - implement foreachTexLink for geonode modifiers - new buttons_texture_user_node_property_add() that stores prop as well as node - also use NODE_ACTIVE_TEXTURE flag in geometry nodetrees notes: - this still uses the first suiting (as in: pinning does not interfere) Properties Editor it finds, this should (maybe?) find the _closest_ Property Editor instead (see related feedback in D9813). - this will already show the button for brush textures as well (disabled), but there is another mandatory change in an upcomming commit to make it work there as well (see D9813) ref. T85278 Maniphest Tasks: T85278 Differential Revision: https://developer.blender.org/D10293
2021-02-24Geometry Nodes: store available attribute names in node ui storageJacques Lucke
This information will be used by the attribute search in string sockets. Ref T85657. Differential Revision: https://developer.blender.org/D10462
2021-02-22Fix: Geometry nodes not depending on instanced collections properlySebastian Parborg
Geometry nodes were not adding referenced instanced collections as dependencies to depsgraph. This would lead to meshes and data not being ready on evaluation in certain cases.
2021-02-22Change Exact Boolean modifier to skip round trip through BMesh.Howard Trickey
The Exact modifier code had been written to avoid using BMesh but in the initial release the modifier still converted all Meshes to BMeshes, and then after running the boolean code on the BMeshes, converted the result back to a Mesh. This change skips that. Most of the work here is in getting the Custom Data layers right. The approach taken is to merge default layers from all operand meshes into the final result, and then use the original verts, edges, polys, and loops to copy or interpolate the appropriate custom data layers from all operands into the result.
2021-02-17BLI: add BLI_simd.h header to wrap SSE includesBrecht Van Lommel
In preparation of adding Neon support. Ref D8237, T78710
2021-02-17Geometry Nodes: Node error messagesHans Goudey
This patch adds icons to the right side of nodes when they encounter a a problem. When hovered, a tooltip displays describing the encountered while evaluating the node. Some examples are: attribute doesn't exist, mesh has no faces, incorrect attribute type, etc. Exposing more messages to the system will be an ongoing process. Multiple warnings per node are supported. The system is implemented somewhat generically so that the basic structure can also be used to store more information from evaluation for the interface, like a list of available attributes. Currently the messages are just button tooltips. They could be styled differently in the future. Another limitation is that every instance of a node group in a parent node tree will have the same error messages, the "evaluation context" used to decide when to display the tooltips must be extended to support node tree paths. Differential Revision: https://developer.blender.org/D10290
2021-02-16Cleanup: Used derived node in geometry exec paramsHans Goudey
Since the derived node tree is already build for the evaluation system, it's simpler to pass a derived node to the params struct. This will also allow context lookups in nested node groups for node error messages, since the derived node has that information readily accessible.
2021-02-12Geometry Nodes: Add dependency relation for collection objectsHans Goudey
Currently moving or changing an object references in a node modifier's node group does not trigger re-evaluation. Because there is no collection relation in the dependency graph, we must add the relation to all objects in the collection individually.
2021-02-06UI: Fix Typos in Comments and Docsluzpaz
Approximately 91 spelling corrections, almost all in comments. Differential Revision: https://developer.blender.org/D10288 Reviewed by Harley Acheson
2021-02-05Geometry Nodes: add Volume to Mesh nodeJacques Lucke
This node takes a volume and generates a mesh on it's "surface". The surface is defined by a threshold value. Currently, the node only works on volumes generated by the Points to Volume node. This limitation will be resolved soonish. Ref T84605. Differential Revision: https://developer.blender.org/D10243
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-02-05Cleanup: cmake indentation, white-spaceCampbell Barton
2021-02-03macOS: Fix build error due to std::optional<T>::valueAnkit Meel
Added in rBc5514d3a2a03242ddc43f83be4bb72df7f85469f
2021-02-03Geometry Nodes: Multi-Input SocketsFabian Schempp
Normally sockets only have one input link. This commit adds the back-end changes needed to use multiple input links per socket. Multi-input sockets can be defined with a new flag in `bNodeSocketType`. The changes necessary to make the sockets work in the geometry nodes evaluator are generalizing input socket values as a vector of values, and supporting this in the derived node tree structure. This patch should contain no functional changes. Two upcoming patches will use this system for the "Join Geometry" node and expose link picking and updated display in the UI: D10069 and D10181. Reviewed By: Jacques Lucke, Hans Goudey Differential Revision: https://developer.blender.org/D10067
2021-01-28Surface Deform: fix binding vertex artifacts causing spikes.Alexander Gavrilov
There are two issues here. First, like in T81988 there are cases where the modifier would deform some vertices immediately after bind. This is caused by wrong assumptions in the code about the possible relative angles between various vectors, which can cause negative weights that don't blend correctly to appear. Specifically, it seems originally the code assumes that the centroid-point vector in the polygon plane lies somewhere between the mid-edge vectors. This is however not necessarily the case for distant vertices, because the polygon is not guaranteed to be truly planar, so normal projection may be a bit off. The code has to use signed angles and checks to support all possible angular arrangements. The second issue is very thin and long triangles, which tend to be very spatially unstable in their thin dimension, resulting in excess deformation. The code was weighting distance using the distances between the centroid and the mid-edge points, which in this case end up as nearly opposite vectors of sizable length and don't correctly represent how thin the triangle actually is. It is thus better to use centroid-to-line distances, and an additional even stricter value for the midpoint that will use only 3 vertices at evaluation time. Differential Revision: https://developer.blender.org/D10065
2021-01-25Merge branch 'blender-v2.92-release'Hans Goudey
2021-01-25Fix: Unable to animate nodes modifier exposed propertiesHans Goudey
The RNA path used for animating the settings passed to the node tree is incorrect. Currently it's just `settings.property_name`, but it's the path from the ID, not the modifier, so it should be `modifiers[modifier_name].settings.property_name`. However, the "Settings" struct is separated in RNA and DNA, which means that the callback to get the RNA path does not know about the modifier's name in order to fill the above path, so some reference to the modifier in the "Settings" struct would be necessary, which would create a convoluted layout in the `ModifierData` struct. Instead, this commit simply removes the "Settings" struct from RNA, which isn't as elegant from the point of view of the Python API, but otherwise it's a nice simplification. Note that we don't remove the "Settings" struct from DNA, because it would break reading old files. Differential Revision: https://developer.blender.org/D10175
2021-01-22Merge branch 'blender-v2.92-release'Hans Goudey
2021-01-22Fix: Mouse presses in some areas do not set active modifierHans Goudey
There are a couple of operations that are meant to set the active modifier that currently don't. The first is a mouse press on the drag icon on the right of the header, and the second is mouse presses on modifier sub-panels headers. This was an oversight in the implementation, especially the second, because the blank space on the right of a sub-panel header often looks just like the blank space elsewhere on the modifier's panel that *does* set the active modifier. Note that this purposefully doesn't include collapsing and expanding the modifier as operations that set the active, since regardless of whether that makes sense, it wasn't in the agreed upon design, which would ideally not need changing for 2.92. Differential Revision: https://developer.blender.org/D10155
2021-01-20Cleanup: remove extra in trailing asteriskCampbell Barton
Comment blocks not conforming to convention.
2021-01-19Refactor modifier copying code.Bastien Montagne
Things like pointers to particle systems, or softbody data being stored outside of its modifier, make it impossible for internal modifier copy data code to be self-contained currently. It requires extra processing. In existing code this was handled in several different places, in several ways, and alltogether fairly inconsistently. Some cases were even not properly handled, causing e.g. crashes as in T82945. This commit addresses those issues by: * Adding comments about the hackish/unsafe parts `psys` implies when copying some modifier data (since we need to ensure particle system copying and remapping of those pointers separately). * Adding as-best-as-possible handling of those cases to `BKE_object_copy_modifier` (note that it remains fragile, but is expected to behave 'good enough' in any practical usecase). * Remove special handling for specific editor code (`copy_or_reuse_particle_system`). This should never have been accepted in ED code area, and is now handled by `BKE_object_copy_modifier`. * Factorize copying of the whole modifier stack into new `BKE_object_modifier_stack_copy`, now used by both `object_copy_data` and `BKE_object_link_modifiers`. Note that this implies that `BKE_object_copy_modifier` and `BKE_object_copy_gpencil_modifier` are now to be used exclusively to copy single modifiers. Full modifier stack copy should always use `BKE_object_modifier_stack_copy` instead. Fix T82945: Crash when dragging modifiers in Outliner. Maniphest Tasks: T82945 Differential Revision: https://developer.blender.org/D10148
2021-01-19Refactor modifier copying code.Bastien Montagne
Things like pointers to particle systems, or softbody data being stored outside of its modifier, make it impossible for internal modifier copy data code to be self-contained currently. It requires extra processing. In existing code this was handled in several different places, in several ways, and alltogether fairly inconsistently. Some cases were even not properly handled, causing e.g. crashes as in T82945. This commit addresses those issues by: * Adding comments about the hackish/unsafe parts `psys` implies when copying some modifier data (since we need to ensure particle system copying and remapping of those pointers separately). * Adding as-best-as-possible handling of those cases to `BKE_object_copy_modifier` (note that it remains fragile, but is expected to behave 'good enough' in any practical usecase). * Remove special handling for specific editor code (`copy_or_reuse_particle_system`). This should never have been accepted in ED code area, and is now handled by `BKE_object_copy_modifier`. * Factorize copying of the whole modifier stack into new `BKE_object_modifier_stack_copy`, now used by both `object_copy_data` and `BKE_object_link_modifiers`. Note that this implies that `BKE_object_copy_modifier` and `BKE_object_copy_gpencil_modifier` are now to be used exclusively to copy single modifiers. Full modifier stack copy should always use `BKE_object_modifier_stack_copy` instead. Fix T82945: Crash when dragging modifiers in Outliner. Maniphest Tasks: T82945 Differential Revision: https://developer.blender.org/D10148
2021-01-19Geometry Nodes: pass depsgraph to nodes during executionJacques Lucke
The depsgraph will have to be accessed in an upcoming patch.
2021-01-14MeshCache: add error handling to `fread()` callsSybren A. Stüvel
Handle return value of `fread()`, by showing an error message when the file cannot be read from and stopping further processing. Not only is error handing a good idea, it also prevents GCC from warning that the return value of `fread()` should not be ignored. This is similar to {D9916}. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D10079
2021-01-13UI: Revert design changes to data-block selector for the 2.92 releaseJulian Eisel
Partially reverts 2250b5cefee7. Removing the user count and fake user count icons was controversial (which was expected) and there are a few further changes needed, that won't make it in time for the release, see D9946. While there is a design to bring back the user count and fake user indicators, a new design idea was proposed that the UI team wants to follow. This came too late for the 2.92 release, the new design is targeted at the 2.93 release now. Meanwhile, UI team decision was to simply revert the design changes. The new design is being worked on in https://developer.blender.org/T84669. Note that this commit does not revert some internal changes done in 2250b5cefee7. Namely the introduction of `ed_util_ops.c` and data-block operators in there. These will still be needed in the new design.
2021-01-13Cleanup: Remove unecessary namespace prefixesHans Goudey
2021-01-13Geometry Nodes: Enable exposing object and collection socketsHans Goudey
This patch allows connecting wires for object and collection socket types to the "Group Input" node, which exposes them to be adjusted in the modifier. Thanks to @angavrilov's recent work in rB8964c02348f6, it is now possible to edit pointer IDProperties in the interface when they are drawn with `uiItemPointerR`. This patch is composed of a few changes: - Add code to create pointer properties in the modifier settings for object and collection sockets, and also to draw them in the UI. - Also search through the modifier's `IDProperty` settings to find IDs used by the modifier. - Change the setting's UI layout to support the change. Differential Revision: https://developer.blender.org/D10056
2021-01-11Collision: allow disabling collision without removing the modifier.Alexander Gavrilov
The `object.collision.use` flag was treated as a redundant marker of the existence of the modifier, going as far as adding/removing it when the value was changed, which is not actually very useful. Removing the modifier loses its position in the stack, and requires a dependency graph rebuild. It feels it may be a legacy flag? What would be useful however is the ability to toggle collisions dynamically without removing the modifier. This patch adjusts the code to keep the modifier when the flag is disabled, and add it if it doesn't exist when the flag is enabled. The modifier now checks the flag at the start and quickly exits after cleaning up stale data. The redesigned setting is exposed in the UI. Collisions can't be disabled by simply using the modifier enable flags because the modifier merely saves a snapshot of the mesh at a certain point of the modifier stack for other objects to use, and thus has to be able to clear the stale data. Differential Revision: https://developer.blender.org/D10064
2021-01-11Geometry Nodes: transform Object Info outputs to local spaceJacques Lucke
Ref T83670. Differential Revision: https://developer.blender.org/D10071
2021-01-09Geometry Nodes: Don't start with empty group nodes selectedHans Goudey
The nodes were selected in new node groups because they are by default, but there's no particular reason for them to be selected, and it can be distracting.
2021-01-08Surface Deform: the Strength setting is not bind-specific.Alexander Gavrilov
It is used during evaluation so it shouldn't be greyed out in the UI. Ref D10040
2021-01-08Surface Deform: optimize memory allocation in the evaluation code.Alexander Gavrilov
Using malloc to allocate a temporary array for each vertex, which most commonly contains just 4 elements, is not efficient. Checking the mode with a switch is also better. Differential Revision: https://developer.blender.org/D10040
2021-01-07Surface Deform: optimize handling of the vertex group weight.Alexander Gavrilov
There is no need to first copy weights to a separate array, or create the data layer if it doesn't exist. The threaded code can retrieve the weight directly from the layer. Differential Revision: https://developer.blender.org/D10015
2021-01-05Fix T84364: Sculpt symmetrize fails with shape keysCampbell Barton
Use the BMesh symmetrize operator instead of using the modifier code. While we could support shape-keys with the existing code used by the mirror modifier, we'd need to add code-paths for evaluated mesh & bmesh conversion to handle shape-keys differently just for this one case, since we want to avoid copying & processing shape-keys layers for evaluated meshes in general.
2021-01-05Cleanup: typos (repeated words)Campbell Barton
2021-01-04Cleanup: redundant code, minor inconsistenciesCampbell Barton
- Remove ternary operators when both values are the same. - Remove break after return. - Remove redundant NULL checks for code which handles those cases immediately beforehand.
2020-12-28Add operator to copy a modifier to all selected objectsErik Abrahamsson
These two operators (one for grease pencil, one for other objects) copy a single modifier from the active object to all selected objects. The operators are exposed in the dropdown menus in modifier headers. Note that It's currently possible to drag and drop modifiers between objects in the outliner, but that only works for dragging to one object at a time. Modifiers can also be copied with the "Make Links" operator, but that copies *all* modifiers rather than just one. The placement and scope of these new operators allow for more useful poll messages and error messages as well. Every object type that supports modifiers is supported. Although hook and collision modifiers aren't supported because of an unexplained comment in `BKE_object_copy_modifier`, other than that, every modifier type is supported, including particle systems, nodes modifiers, etc. The new modifiers are set active, which required two small tweaks to `object.c` and `particle.c`. Reviewed By: Hans Goudey (with additional edits) Differential Revision: https://developer.blender.org/D9537
2020-12-18UI: Redesigned data-block selectorsJulian Eisel
The previous design is rather old and has a couple of problems: * Scalability: The current solution of adding little icon buttons next to the data-block name field doesn't scale well. It only works if there's a small number of operations. We need to be able to place more items there for better data-block management. Especially with the introduction of library overrides. * Discoverability: It's not obvious what some of the icons do. They appear and disappear, but it's not obvious why some are available at times and others not. * Unclear Status: Currently their library status (linked, indirectly linked, broken link, library override) isn't really clear. * Unusual behavior: Some of the icon buttons allow Shift or Ctrl clicking to invoke alternative behaviors. This is not a usual pattern in Blender. This patch does the following changes: * Adds a menu to the right of the name button to access all kinds of operations (create, delete, unlink, user management, library overrides, etc). * Make good use of the "disabled hint" for tooltips, to explain why buttons are disabled. The UI team wants to establish this as a good practise. * Use superimposed icons for duplicate and unlink, rather than extra buttons (uses less space, looks less distracting and is a nice + consistent design language). * Remove fake user and user count button, they are available from the menu now. * Support tooltips for superimposed icons (committed mouse hover feedback to master already). * Slightly increase size of the name button - it was already a bit small before, and the move from real buttons to superimposed icons reduces usable space for the name itself. * More clearly differentiate between duplicate and creating a new data-block. The latter is only available in the menu. * Display library status icon on the left (linked, missing library, overridden, asset) * Disables "Make Single User" button - in review we weren't sure if there are good use-cases for it, so better to see if we can remove it. Note that I do expect some aspects of this design to change still. I think some changes are problematic, but others disagreed. I will open a feedback thread on devtalk to see what others think. Differential Revision: https://developer.blender.org/D8554 Reviewed by: Bastien Montagne Design discussed and agreed on with the UI team, also see T79959.
2020-12-18Geometry Nodes: support randomly picking instances from collectionJacques Lucke
This uses the "id" attribute to randomly pick instances from a collection for each point. There is one issue. When the collection is updated (e.g. when an object is added to it), the nodes modifier is not automatically updated. It seems like we don't have the infrastructure to support this dependency yet. The same issue exists in the Boolean modifier and with collision collections. This should be solved separately soonish. When "Whole Collection" is disabled, one direct child of the input collection is instanced at each point. A direct child can be an object or a collection. Currently, all objects are picked approximately equally often. In the future, we will provide more control over which point gets which instance. Differential Revision: https://developer.blender.org/D9884 Ref T82372.
2020-12-18Geometry Nodes: do not crash when there are undefined nodesJacques Lucke
Undefined geometry nodes will just output a default value now.
2020-12-16Cleanup: sort struct blocksCampbell Barton
2020-12-15Move Point Cloud object back to Experimental FeaturesDalai Felinto
The geometry-nodes features no longer depend on the point cloud object. Therefore the point cloud object, although important in the future, can be postponed until we have render and edit mode fully working. This reverts commits: * ea74ed5a7a2031b614d401e394f2e0146fc90155. * dc614c68ef2c8ca8b076a000974b5a20a4145a42.
2020-12-15Cleanup: reduce indirect DNA header inclusionCampbell Barton
Remove DNA headers, using forward declarations where possible. Also removed duplicate header, header including it's self and unnecessary inclusion of libc system headers from BKE header.
2020-12-14Geometry Nodes: enabled supports-mapping in nodes modifierJacques Lucke
Sometimes the geometry nodes modifier does support mapping and sometimes it does not. We have no infrastruture to determine this ahead of time currently. In order to support common use cases, it makes sense to add this flag to the modifier. One such common use case is to use the mesh as surface that other things are distributed on. Often, the distribution is controlled by vertex groups. Therefore, it would be helpful if the modifier is evaluated when the object is in vertex paint mode. This allows the user to see the distributed objects while painting. If the nodes modifier transforms the mesh in any way, vertex painting might not work as expected anymore, because the `deformMatrices` callback is not implemented. I'm not sure how this can be solved nicely, yet.
2020-12-14Geometry Nodes: require vertex groups data in nodes modifierJacques Lucke
Without this, the modifier evaluation code might remove any vertex groups from the mesh for performance reasons. We can't say for sure whether the node group will need the vertex groups, but it is quite likely. Ref T83357.
2020-12-14Blenkernel: move DerivedMesh.c to c++Jacques Lucke
Required changes to make it compile with clang tidy: * Use c++ includes like (e.g. climits instead limits.h). * Insert type casts when casting from void* to something else. * Replace NULL with nullptr. * Insert casts from int to enum. * Replace designed initializers (not supported in C++ yet). * Use blender::Vector instead of BLI_array_staticdeclare (does not compile with C++). * Replace typedef statements. Ref T83357.
2020-12-14Fix missing string escape for RNA path creationCampbell Barton
2020-12-14UI: Click modifier icon to set active modifierHans Goudey
This should be a final piece of the changes for the active modifier interface. Before, it was necessary to click on the blank space of a modifier panel to set it active (not the header), this commit allows clicking on the icon also. The spacing with the spacing with the expand button would ideally be a bit larger, but the layout system doesn't offer much flexibility here.
2020-12-11Geometry Nodes: support collection socketsJacques Lucke
Part of D9739.
2020-12-11GeometryNodes: Make properties exposed in modifier overridable.Bastien Montagne