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-09-11Geometry Nodes: add field support for socket inspectionJacques Lucke
Since fields were committed to master, socket inspection did not work correctly for all socket types anymore. Now the same functionality as before is back. Furthermore, fields that depend on some input will now show the inputs in the socket inspection. I added support for evaluating constant fields more immediately. This has the benefit that the same constant field is not evaluated more than once. It also helps with making the field independent of the multi-functions that it uses. We might still want to change the ownership handling for the multi-functions of nodes a bit, but that can be done separately. Differential Revision: https://developer.blender.org/D12444
2021-09-10Modifiers: export motion blur velocity through attributeBrecht Van Lommel
Previously fluid simulation and Alembic modifiers had a dedicated function to query the velocity for motion blur. Now use a more generic system where those modifiers output a velocity attribute. Advantages: * Geometry and particle nodes can output velocity through the same mechanism, or read the attribute coming from earlier modifiers. * The velocity can be preserved through modifiers like subdivision surface or auto smooth. * USD and Alembic previously only output velocity from fluid simulation, now they work with velocity from other sources too. * Simplifies the code for renderers like Cycles and exporters like Alembic and USD. This breaks compatibility: * External renderers and exporters accessing these velocities through the Python API now need to use the attribute instead. * Existing modifier node setups that create an attribute named "velocity" will render differently with motion blur. Differential Revision: https://developer.blender.org/D12305
2021-09-09Geometry Nodes: Allow exposing color sockets to the modifierHans Goudey
This commit allows connecting color sockets to the group input and changing the input values in the modifier. Before there was an error since this was more complicated to support with the previous IDProperty UI data storage method. Differential Revision: https://developer.blender.org/D12437
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-09Modifier: add support for vertex groupsMaxime Casas
Allow blending the imported cache with the modifiers stack above the MeshCache modifier. This is particularly useful for instance when dealing with cloth simulations performed in another software, where some parts of the cloth are completely pinned (non-simulated, following the armature). Indeed, this would allow modifying the animation in some areas without having to rebake the other parts or the cloth, resulting in a much more flexible workflow. Reviewed By: #modeling, campbellbarton, mont29 Ref D9898
2021-09-09Fix: Incorrect default for exposed geometry nodes vectorsHans Goudey
2021-08-31Cleanup: Use C style comments for descriptive textCampbell Barton
2021-08-27Refactor IDProperty UI data storageHans Goudey
The storage of IDProperty UI data (min, max, default value, etc) is quite complicated. For every property, retrieving a single one of these values involves three string lookups. First for the "_RNA_UI" group property, then another for a group with the property's name, then for the data value name. Not only is this inefficient, it's hard to reason about, unintuitive, and not at all self-explanatory. This commit replaces that system with a UI data struct directly in the IDProperty. If it's not used, the only cost is of a NULL pointer. Beyond storing the description, name, and RNA subtype, derived structs are used to store type specific UI data like min and max. Note that this means that addons using (abusing) the `_RNA_UI` custom property will have to be changed. A few places in the addons repository will be changed after this commit with D9919. **Before** Before, first the _RNA_UI subgroup is retrieved the _RNA_UI group, then the subgroup for the original property, then specific UI data is accessed like any other IDProperty. ``` prop = rna_idprop_ui_prop_get(idproperties_owner, "prop_name", create=True) prop["min"] = 1.0 ``` **After** After, the `id_properties_ui` function for RNA structs returns a python object specifically for managing an IDProperty's UI data. ``` ui_data = idproperties_owner.id_properties_ui("prop_name") ui_data.update(min=1.0) ``` In addition to `update`, there are now other functions: - `as_dict`: Returns a dictionary of the property's UI data. - `clear`: Removes the property's UI data. - `update_from`: Copy UI data between properties, even if they have different owners. Differential Revision: https://developer.blender.org/D9697
2021-08-27Cleanup: clang-tidyCampbell Barton
2021-08-27Modifier: smooth interpolation supportHenrik Dick
Add an option to the mask modifier to use the vertex weights to generate smooth in between geometry, instead of just deleting non complete faces. This can be used to make all sorts of smooth dissolve animations directly with geometry, which are usually hacked together with shaders. It also allows for implicit function plotting using geometry nodes and boolean like operations on non manifold geometry with the proximity modifier. Reviewed By: campbellbarton Ref D10979
2021-08-26Cleanup: spelling in commentsCampbell Barton
2021-08-24Fix invalid mask use for the UV-project modifierCampbell Barton
Mistake in a30a8179331d689c9e599fb9a530c0b6b155f689.
2021-08-20Cleanup, use BKE_scene_uses_cycles_experimental_featuresKévin Dietrich
2021-08-20Functions: remove multi-function networkJacques Lucke
The multi-function network system was able to compose multiple multi-functions into a new one and to evaluate that efficiently. This functionality was heavily used by the particle nodes prototype a year ago. However, since then we only used multi-functions without the need to compose them in geometry nodes. The upcoming "fields" in geometry nodes will need a way to compose multi-functions again. Unfortunately, the code removed in this commit was not ideal for this different kind of function composition. I've been working on an alternative that will be added separately when it becomes needed. I've had to update all the function nodes, because their interface depended on the multi-function network data structure a bit. The actual multi-function implementations are still the same though.
2021-08-20Cleanup: unused warningsCampbell Barton
2021-08-20Cleanup, formatKévin Dietrich
2021-08-19Cycles: experimental integration of Alembic procedural in viewport renderingKévin Dietrich
This patch exposes the Cycles Alembic Procedural through the MeshSequenceCache modifier in order to use and test it from Blender. To enable it, one has to switch the render feature set to experimental and activate the Procedural in the modifier. An Alembic Procedural is then created for each CacheFile from Blender set to use the Procedural, and each Blender object having a MeshSequenceCache modifier is added to list of objects of the right procedural. The procedural's parameters derive from the CacheFile's properties which are already exposed in the UI through the modifier, although more Cycles specific options might be added in the future. As there is currently no cache controls and since we load all the data at the beginning of the render session, the procedural is only available during viewport renders at the moment. When an Alembic procedural is rendered, data from the archive are not read on the Blender side. If a Cycles render is not active and the CacheFile is set to use the Cycles Procedural, bounding boxes are used to display the objects in the scene as a signal that the objects are not processed by Blender anymore. This is standard in other DCCs. However this does not reduce the memory usage from Blender as the Alembic data was already loaded either during an import or during a .blend file read. This is mostly a hack to test the Cycles Alembic procedural until we have a better Blender side mechanism for letting renderers load their own geometry, which will be based on import and export settings on Collections (T68933). Ref T79174, D3089 Reviewed By: brecht, sybren Maniphest Tasks: T79174 Differential Revision: https://developer.blender.org/D10197
2021-08-13Cleanup: split BKE_mesh_calc_normals_poly function in twoCampbell Barton
Remove the 'only_face_normals' argument. - BKE_mesh_calc_normals_poly for polygon normals. - BKE_mesh_calc_normals_poly_and_vertex for poly and vertex normals. Order arguments logically: - Pair array and length arguments. - Position normal array arguments (to be filled) last.
2021-08-11Modifier: use high quality normals for vertex offsetHenrik Dick
Using high quality normals for vertex offset when set for higher precision offsets. This was only used for calculating even-offset. Reviewed By: campbellbarton Ref D12176
2021-08-05Cleanup: replace short with boolean for zero area arrayCampbell Barton
Also remove redundant fabsf on the area of a quad/tri & reduce indentation using continue in for loop.
2021-08-05Cleanup: license headersCampbell Barton
These were removed globally in 65ec7ec524e667ec95ce947a95f6273088dffee6. Some files re-introduced these conventions since.
2021-08-04Modifier: warn if the ocean simulation fails to allocate memoryJeroen Bakker
While most modifies don't handle out of memory cases, ocean simulation could attempt huge allocations: 2048 gb at the maximum resolution. Resolves T83952.
2021-08-03USD: add USD importerMichael Kowalski
This is an initial implementation of a USD importer. This work is comprised of Tangent Animation's open source USD importer, combined with features @makowalski had implemented. The design is very similar to the approach taken in the Alembic importer. The core functionality resides in a collection of "reader" classes, each of which is responsible for converting an instance of a USD prim to the corresponding Blender Object representation. The flow of control for the conversion can be followed in the `import_startjob()` and `import_endjob()` functions in `usd_capi.cc`. The `USDStageReader` class is responsible for traversing the USD stage and instantiating the appropriate readers. Reviewed By: sybren, HooglyBoogly Differential Revision: https://developer.blender.org/D10700
2021-08-03Cleanup: deduplicate type conversion logicJacques Lucke
2021-08-03Fix T89691: Solidify modifier simple/complex inconsistencyMiguel G
Maintain the sign when clamping non zero offset. Reviewed By: campbellbarton, weasel Ref D11832
2021-08-02Cleanup: separate base and geometry nodes specific socket cpp typeJacques Lucke
This simplifies changing how geometry nodes handles different socket types without affecting other systems.
2021-07-31Cleanup: Voxel remesh function namingHans Goudey
- Remove BKE prefix for static functions - Make specific intermediate functions static - Avoid unecessary "_to_mesh_nomain" suffix
2021-07-24Weld Modifier: add "loose_edges" optionFredrik Hansson
This improve the cloth modeling workflow by allowing you to weld only the edges that are used for the sewing forces. Reviewed By: mano-wii, weasel Differential Revision: https://developer.blender.org/D10710
2021-07-23Cleanup: code comments punctuation / spacingCampbell Barton
2021-07-23Geometry Nodes: Display Node Warnings in ModifierHans Goudey
With this commit, node warnings added to nodes during evaluation (not "Info" warnings) will also draw in the modifier. In the future there could be a "search for this node" button as well. Differential Revision: https://developer.blender.org/D11983
2021-07-21UI: Use more descriptive wording for particle modifier conversionsSmitty van Bodegom
Currently the wording is a bit unclear: it doesn't specify //what// the particles will be converted into. This clarifies it by stating what the particles will be converted into: they will either be converted to a mesh or the instances will be made real. Reviewed By: Blendify Differential Revision: https://developer.blender.org/D11795
2021-07-20Cleanup: use single back-tick quoting in commentsCampbell Barton
While doxygen supports both, conform to our style guide. Note that single back-tick's are already used in a majority of comments.
2021-07-16Surface Deform: support sparse binding mode for improving performance.Alexander Gavrilov
When a vertex group is used to limit the influence of the modifier to a subset of vertices, binding data for vertices with zero weight is not needed. This wastes memory, disk space and CPU cycles. If the vertex group contents is known to be final and constant, it is reasonable to optimize by only storing data group vertices. This has to be an option in case the group can change. Supporting this requires adding a vertex index field and spliting the vertex count into mesh and bind variants, but both happen to fit in available padding. The old numverts field is renamed to the new bound vertex count field to maintain the array length invariant. Versioning is used to initialize the other new fields. If a file with sparse binding is opened in an old blender version, it is corrupted into a non-sparse bind with vertex count mismatch, preventing the modifier from working until rebind. Differential Revision: https://developer.blender.org/D11924
2021-07-15Cleanup: unused variable captureJacques Lucke
2021-07-14Fix T89771: Cloth disk cache is not read on library overrides in some cases.Bastien Montagne
Issue would happen when the original, linked data already had 'Disk Cache' setting enabled. Override would then see no difference with linked data, and not create any rule for it (as expected). Root of the issue was that in Cloth modifier copy code, those disk cache settings were not copied at all, so every time local overrides were re-generated by copying linked data, those flags would be reset to their default values. NOTE: this might exist in other PointCache usages as well, but this code is in such a bad state that I'd rather do minimal strictly needed changes there, on a case-by-case basis. Proper recode of that whole system is wayyyyy out of scope here.
2021-07-13Refactor: Move vertex group names to object dataHans Goudey
This commit moves the storage of `bDeformGroup` and the active index to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility functions are added to allow easy access to the vertex groups given an object or an ID. As explained in T88951, the list of vertex group names is currently stored separately per object, even though vertex group data is stored on the geometry. This tends to complicate code and cause bugs, especially as geometry is created procedurally and tied less closely to an object. The "Copy Vertex Groups to Linked" operator is removed, since they are stored on the geometry anyway. This patch leaves the object-level python API for vertex groups in place. Creating a geometry-level RNA API can be a separate step; the changes in this commit are invasive enough as it is. Note that opening a file saved in 3.0 in an earlier version means the vertex groups will not be available. Differential Revision: https://developer.blender.org/D11689
2021-07-12Cleanup: improve naming and comments of scene frame/ctime functionsBrecht Van Lommel
Confusingly, BKE_scene_frame_get did not match the frame number as expected by BKE_scene_frame_set. Instead it return the value after time remapping, which is commonly named "ctime". * Rename BKE_scene_frame_get to BKE_scene_ctime_get * Add a new BKE_scene_frame_get that matches BKE_scene_frame_set * Use int/float depending if fractional frame is expected
2021-07-12Fix T89765: boolean modifier collection refcount issuePhilipp Oeser
The 'collection' property is flagged PROP_ID_REFCOUNT, so the modifiers foreachIDLink functions should walk with IDWALK_CB_USER (instead of IDWALK_CB_NOP). Otherwise the modifier wont be included as a user for the collection (e.g. on file read); removing the collection from the modifier will decrement usercount though (which in worst case scenario makes the collection orphan and will result in data loss) Maniphest Tasks: T89765 Differential Revision: https://developer.blender.org/D11877
2021-07-11Cleanup: correct spelling in comments, remove profanityCampbell Barton
2021-07-08Fix: instances are made real when they shouldn't beJacques Lucke
The original assumption that the `modifyMesh` function is only called when the modifier is applied was wrong. There are still a couple of other places calling it through `BKE_modifier_modify_mesh`. Now there is an extra check that makes sure instances are only realized when the modifier is actually applied.
2021-07-07Geometry Nodes: refactor logging during geometry nodes evaluationJacques Lucke
Many ui features for geometry nodes need access to information generated during evaluation: * Node warnings. * Attribute search. * Viewer node. * Socket inspection (not in master yet). The way we logged the required information before had some disadvantages: * Viewer node used a completely separate system from node warnings and attribute search. * Most of the context of logged information is lost when e.g. the same node group is used multiple times. * A global lock was needed every time something is logged. This new implementation solves these problems: * All four mentioned ui features use the same underlying logging system. * All context information for logged values is kept intact. * Every thread has its own local logger. The logged informatiton is combined in the end. Differential Revision: https://developer.blender.org/D11785
2021-07-05Cleanup: spelling, punctuationCampbell Barton
2021-07-05Geometry Nodes: new Viewer nodeJacques Lucke
This adds a viewer node similar to the one in the compositor. The icon in the headers of nodes is removed because it served the same purpose and is not necessary anymore. Node outputs can be connected to the active viewer using ctrl+shift+LMB, just like in the compositor. Right now this collides with the shortcut used in the node wrangler addon, which will be changed separately. As of now, the viewed geometry is only visible in the spreadsheet. Viewport visualization will be added separately. There are a couple of benefits of using a viewer node compared to the old approach with the icon in the node header: * Better support for nodes that have more than one geometry output. * It's more consistent with the compositor. * If attributes become decoupled from geometry in the future, the viewer can have a separate input for the attribute to visualize. * The viewer node could potentially have visualization settings. * Allows to keep "visualization points" around by having multiple viewer nodes. * Less visual clutter in node headers. Differential Revision: https://developer.blender.org/D11470
2021-07-05BMesh: remove redundant mesh-backups from EDBM_op_* APICampbell Barton
Using BMesh operators through the edit-mesh API created a full copy of the mesh so it was possible to restore the mesh in case one of the operators raised an error. Remove support for automatic backup/restore from the EDBM_op_* API's as it adds significant overhead and was rarely used. Operators that need this can use the BMBackup API to backup & restore the mesh in case of failure. Add warning levels to BMO_error_raise so operators can report problems without it being interpreted as a request to cancel the operation. For high-poly meshes creating and freeing a full copy is an expensive operation, removing this gives a speedup of ~1.77x for most operators except for "connect_verts" / "connect_vert_pair" which still uses this functionality.
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-02Cleanup: spelling in commentsCampbell Barton
2021-06-30Cleanup: variable naming for texture/material SocketPropertyTypePhilipp Oeser
Copy-Pasting error in rB3025c348253a Maniphest Tasks: T88701 Differential Revision: https://developer.blender.org/D11755
2021-06-30Cleanup: use const arguments for accessor functionsCampbell Barton
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-26Cleanup: remove redundant/outdated commentsCampbell Barton