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-02Use C++ API for vertex group dataHans Goudey
2022-09-02Use new API for retrieving vertex group data in some placesHans Goudey
2022-08-31Use C++ methods to retrieve geometry dataHans Goudey
2022-08-31Cleanup, fixesHans Goudey
2022-08-31Merge branch 'master' into refactor-mesh-remove-pointersHans Goudey
2022-08-31Fix compile error from merge.Joseph Eagar
2022-08-31Merge branch 'blender-v3.3-release'Joseph Eagar
2022-08-31Core: Remove color attribute limit from CustomData APIJoseph Eagar
Note: does not fix the limit in PBVH draw which is caused by VBO limits not MAX_MCOL.
2022-08-31Mesh: Move material indices to a generic attributeHans Goudey
This patch moves material indices from the mesh `MPoly` struct to a generic integer attribute. The builtin material index was already exposed in geometry nodes, but this makes it a "proper" attribute accessible with Python and visible in the "Attributes" panel. The goals of the refactor are code simplification and memory and performance improvements, mainly because the attribute doesn't have to be stored and processed if there are no materials. However, until 4.0, material indices will still be read and written in the old format, meaning there may be a temporary increase in memory usage. Further notes: * Completely removing the `MPoly.mat_nr` after 4.0 may require changes to DNA or introducing a new `MPoly` type. * Geometry nodes regression tests didn't look at material indices, so the change reveals a bug in the realize instances node that I fixed. * Access to material indices from the RNA `MeshPolygon` type is slower with this patch. The `material_index` attribute can be used instead. * Cycles is changed to read from the attribute instead. * BMesh isn't changed in this patch. Theoretically it could be though, to save 2 bytes per face when less than two materials are used. * Eventually we could use a 16 bit integer attribute type instead. Ref T95967 Differential Revision: https://developer.blender.org/D15675
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-31Cleanup: break before the default case in switch statementsCampbell Barton
While missing the break before a default that only breaks isn't an error, it means adding new cases needs to remember to add the break for an existing case, changing the default case will also result in an unintended fall-through. Also avoid `default:;` and add an explicit break.
2022-08-31Mesh: Avoid redundant custom data layer initializationHans Goudey
In all these cases, it was clear that the layer values were set right after the layer was created anyway. So there's no point in using calloc or setting the values to zero first. See 25237d2625078c6d for more info.
2022-08-30Attributes: Improve custom data initialization optionsHans Goudey
When allocating new `CustomData` layers, often we do redundant initialization of arrays. For example, it's common that values are allocated, set to their default value, and then set to some other value. This is wasteful, and it negates the benefits of optimizations to the allocator like D15082. There are two reasons for this. The first is array-of-structs storage that makes it annoying to initialize values manually, and the second is confusing options in the Custom Data API. This patch addresses the latter. The `CustomData` "alloc type" options are rearranged. Now, besides the options that use existing layers, there are two remaining: * `CD_SET_DEFAULT` sets the default value. * Usually zeroes, but for colors this is white (how it was before). * Should be used when you add the layer but don't set all values. * `CD_CONSTRUCT` refers to the "default construct" C++ term. * Only necessary or defined for non-trivial types like vertex groups. * Doesn't do anything for trivial types like `int` or `float3`. * Should be used every other time, when all values will be set. The attribute API's `AttributeInit` types are updated as well. To update code, replace `CD_CALLOC` with `CD_SET_DEFAULT` and `CD_DEFAULT` with `CD_CONSTRUCT`. This doesn't cause any functional changes yet. Follow-up commits will change to avoid initializing new layers where the correctness is clear. Differential Revision: https://developer.blender.org/D15617
2022-08-30Merge branch 'master' into refactor-mesh-remove-pointersHans Goudey
2022-08-30Geometry Nodes: Use separate field context for each geometry typeHans Goudey
Using the same `GeometryComponentFieldContext` for all situations, even when only one geometry type is supported is misleading, and mixes too many different abstraction levels into code that could be simpler. With the attribute API moved out of geometry components recently, the "component" system is just getting in the way here. This commit adds specific field contexts for geometry types: meshes, curves, point clouds, and instances. There are also separate field input helper classes, to help reduce boilerplate for fields that only support specific geometry types. Another benefit of this change is that it separates geometry components from fields, which makes it easier to see the purpose of the two concepts, and how they relate. Because we want to be able to evaluate a field on just `CurvesGeometry` rather than the full `Curves` data-block, the generic "geometry context" had to be changed to avoid using `GeometryComponent`, since there is no corresponding geometry component type. The resulting void pointer is ugly, but only turns up in three places in practice. When Apple clang supports `std::variant`, that could be used instead. Differential Revision: https://developer.blender.org/D15519
2022-08-26Cleanup: reduce variable scopeCampbell Barton
2022-08-25Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-25Fix T100255: Make RigidBodyWorld (and effector_weights) collections refcounted.Bastien Montagne
Those collections were so far mainly just tagged as fake user (even though a few places in code already incremented usercount on them). Since we now clear the fakeuser flag when linking/appending data, ensure that these collections are preserved by making these usages regular ID refcounting ones. Reviewed By: brecht Differential Revision: https://developer.blender.org/D15783
2022-08-24Rename polygons to polys and vertices to vertsHans Goudey
2022-08-24Merge branch 'master' into refactor-mesh-remove-pointersHans Goudey
2022-08-23Merge branch 'blender-v3.3-release'Philipp Oeser
2022-08-23Fix T100578: Surface Deform modifier displays wrong in editmodePhilipp Oeser
This was the case when the "Show in Editmode" option was used and a vertexgroup affected the areas. Probably an oversight in {rBdeaff945d0b9}?, seems like deforming modifiers always need to call `BKE_mesh_wrapper_ensure_mdata` in `deformVertsEM` when a vertex group is used. Maniphest Tasks: T100578 Differential Revision: https://developer.blender.org/D15756
2022-08-23Cleanup: match names between functions & declarationsCampbell Barton
2022-08-16Cleanup: some refactoring in mapped mesh extractionBrecht Van Lommel
* Flip the logic to first detect if we are dealing with an unmodified mesh in editmode. And then if not, detect if we need a mapping or not. * runtime.is_original is only valid for the bmesh wrapper. Rename it to clarify that and only check it when the mesh is a bmesh wrapper. * Remove MR_EXTRACT_MAPPED and instead check only for the existence of the origindex arrays. Previously it would sometimes access those arrays without MR_EXTRACT_MAPPED set, which according to a comment means they are invalid. Differential Revision: https://developer.blender.org/D15676
2022-08-12Cleanup: remove use_normals arugment to MOD_deform_mesh_eval_getCampbell Barton
Accessing the normals creates them on demand so there was no need to pass an argument requesting them.
2022-08-12Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-12Fix T100191: Crash with the wave modifier using normals in edit-modeCampbell Barton
2022-08-12Cleanup: screw modifier comments & namingCampbell Barton
Rename dist to dist_sq as it's the squared distance, also prefer __func__ in temporary allocated arrays.
2022-08-11Mesh: Move hide flags to generic attributesHans Goudey
This commit moves the hide status of mesh vertices, edges, and faces from the `ME_FLAG` to optional generic boolean attributes. Storing this data as generic attributes can significantly simplify and improve code, as described in T95965. The attributes are called `.hide_vert`, `.hide_edge`, and `.hide_poly`, using the attribute name semantics discussed in T97452. 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 by default, 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 the hide status is used. When the flags are removed completely, requirements will decrease when hiding is unused. Further notes: * Some code can be further simplified to skip some processing when the hide attributes don't exist. * The data is still stored in flags for `BMesh`, necessitating some complexity in the conversion to and from `Mesh`. * Access to the "hide" property of mesh elements in RNA is slower. The separate boolean arrays should be used where possible. Ref T95965 Differential Revision: https://developer.blender.org/D14685
2022-08-11Cleanup: remove redundant MEM_SAFE_FREECampbell Barton
MEM_SAFE_FREE isn't necessary when the memory is known to be allocated and clearing the value afterwards isn't necessary.
2022-08-09Merge branch 'master' into refactor-mesh-remove-pointersHans Goudey
2022-08-09I18n: make more parts of the UI translatableDamien Picard
- "Name collisions" label in mesh properties - "Threshold" labels in Vertex Weight Edit modifier - "Particle System" label in Particle Instance modifier - Slot number in the Shader Editor - Status bar keymap items during modal operations: add TIP_() macro to status bar interface template - On dumping messages, sort preset files so their messages are stable between runs Ref. T43295 Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15607
2022-08-09I18n: make more parts of the UI translatableDamien Picard
- "Name collisions" label in mesh properties - "Threshold" labels in Vertex Weight Edit modifier - "Particle System" label in Particle Instance modifier - Slot number in the Shader Editor - Status bar keymap items during modal operations: add TIP_() macro to status bar interface template - On dumping messages, sort preset files so their messages are stable between runs Ref. T43295 Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15607
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-08-08Merge branch 'refactor-mesh-hide-generic' into refactor-mesh-remove-pointersHans Goudey
2022-08-08Merge branch 'master' into refactor-mesh-hide-genericHans Goudey
2022-08-04Depsgraph: More clear function name for transform dependnecySergey Sharybin
The name was confusing to a level that it sounded like the relation goes the opposite direction than it is intended.
2022-08-01Fix modifiers testHans Goudey
2022-08-01Fix mesh mergeHans Goudey
2022-07-31Merge branch 'master' into refactor-mesh-hide-genericHans Goudey
2022-07-31Merge branch 'master' into refactor-mesh-remove-pointersHans Goudey
2022-07-31Cleanup: Remove mesh edge "tmp tag"Hans Goudey
Ref T95966. Also fixes modification of input mesh, which should be considered constant.
2022-07-31More progressHans Goudey
2022-07-31Merge branch 'refactor-mesh-hide-generic' into refactor-mesh-remove-pointersHans Goudey
2022-07-31Merge branch 'master' into refactor-mesh-hide-genericHans Goudey
2022-07-28Cleanup: Use new IDProperty creation API for geometry ndoes modifierHans Goudey
Use the API from 36068487d076bfd8 instead of the uglier `IDPropertyTemplate` API.
2022-07-28Geometry Nodes: add assert to check if node supports lazynessIliay Katueshenock
Only nodes supporting lazyness can mark inputs as unused. For other nodes, this is done automatically of all outputs are unused. Differential Revision: https://developer.blender.org/D15409
2022-07-24ProgressHans Goudey
2022-07-23ProgressHans Goudey
2022-07-23Squashed commit of the following:Hans Goudey
commit 33f9897ebe5848b6437e95fb934b6dbda8d58e3b Merge: fcb6a57b8df 80b2fc59d11 Author: Hans Goudey <h.goudey@me.com> Date: Fri Jul 22 19:13:57 2022 -0500 Merge branch 'master' into refactor-mesh-hide-generic commit 80b2fc59d11d5814afe7e219c535525a8d494c17 Author: Hans Goudey <h.goudey@me.com> Date: Fri Jul 22 15:49:53 2022 -0500 Fix T99873: Use evaluated vertex groups in armature modifier Geometry nodes has added the ability to modify mesh vertex groups during evaluation (see 3b6ee8cee7080af2). However, the armature modifier always uses the vertex groups from the original object. This is wrong for the modifier stack, where each modifier is meant to use the output of the previous. This commit makes the armature modifier use the evaluated vertex groups if they are available. Otherwise it uses the originals like before. Differential Revision: https://developer.blender.org/D15515 commit 7d8b651268df74157f89858eda9ddce9fd452138 Author: Clément Foucault <foucault.clem@gmail.com> Date: Fri Jul 22 21:03:06 2022 +0200 EEVEE-Next: Add exposure awareness to denoising This uses the exposure to get a better approximation of the perceptual brighness of a sample before accumulating it. Note that we do not modify exposure of the image. Only the samples weights are computed differently. commit 676a2f690c3e3fffe2e515208d4d308e0a96e8e6 Author: Clément Foucault <foucault.clem@gmail.com> Date: Fri Jul 22 20:32:17 2022 +0200 EEVEE-Next: Fix render not working The swaps during accumulation were ignored because of the way the `SwapChain<>` implementation works. Using external references and updating them fixes the issue. commit 35843ddcd80e5957656b157650da950f228d2808 Author: Hans Goudey <h.goudey@me.com> Date: Fri Jul 22 11:36:55 2022 -0500 Fix T99835: Incorrect title case for two node names commit 98395e0bdfc849e2d2770052c6e8651a42500608 Author: Hans Goudey <h.goudey@me.com> Date: Fri Jul 22 10:49:09 2022 -0500 Cleanup: Use r_ prefix for boolean return parameters Also rearrange some lines to simplify logic. commit c40971d79a887820d621705b29f65f833d9b9f52 Author: Hans Goudey <h.goudey@me.com> Date: Fri Jul 22 10:31:10 2022 -0500 Fix T99873: Store named attribute node cannot write to vertex groups Since fd5e5dac8946b13599, the node would remove the attribute before adding it again, which lost the vertex group status of an attribute, meaning they were written as arbitrary attributes. Now, the node first tries to write to attributes with the same domain and data-type, which covers the vertex group case. Then it falls back to removing the attribute and adding it again. Even that can fail though, so I added an error message to make that a bit clearer. Differential Revision: https://developer.blender.org/D15514 commit e4eaf424b9ce4800e64d35ddfebe28f986b14647 Author: Germano Cavalcante <germano.costa@ig.com.br> Date: Fri Jul 22 12:17:22 2022 -0300 Fix nodes not transforming Error in {rB98bf714b37c1} commit 6bcda04d1f1cc396dcc188678997105b09231bde Author: Hans Goudey <h.goudey@me.com> Date: Fri Jul 22 09:59:28 2022 -0500 Geometry Nodes: Port sample curves node to new data-block Use the newer more generic sampling and interpolation functions developed recently (ab444a80a280) instead of the `CurveEval` type. Functions are split up a bit more internally, to allow a separate mode for supplying the curve index directly in the future (T92474). In one basic test, the performance seems mostly unchanged from 3.1. Differential Revision: https://developer.blender.org/D14621 commit 1f94b56d774440d08eb92f2a7a47b9a6a7aa7b84 Author: Jacques Lucke <jacques@blender.org> Date: Fri Jul 22 15:39:41 2022 +0200 Curves: support sculpting on deformed curves Previously, curves sculpt tools only worked on original data. This was very limiting, because one could effectively only sculpt the curves when all procedural effects were turned off. This patch adds support for curves sculpting while looking the result of procedural effects (like deformation based on the surface mesh). This functionality is also known as "crazy space" support in Blender. For more details see D15407. Differential Revision: https://developer.blender.org/D15407 commit 98bf714b37c1f1b05a162b6ffdaca367b312de1f Author: Germano Cavalcante <mano-wii> Date: Thu Jul 21 23:44:39 2022 -0300 Refactor: arrange transform convert functions in 'TransConvertTypeInfo' Simplify the transform code by bundling the TransData creation, Data recalculation, and special updates into a single struct. So similar functions and parameters can be accessed without special type checks. Differential Revision: https://developer.blender.org/D15494 commit 185eeeaaac01bf24930f7e8b25c96f9fa9503073 Author: Campbell Barton <campbell@blender.org> Date: Fri Jul 22 22:13:10 2022 +1000 GHOST/Wayland: Fix mouse wheel events for Sway Compositor (use seat v5) Bump the requested seat version to v5, use discreet scroll callback. Tested with gnome, river & sway. commit 003dfae270781bfa642a2c5804fa190edd4dfca4 Author: Xavier Hallade <xavier.hallade@intel.com> Date: Fri Jul 22 13:00:46 2022 +0200 Cycles: enable oneAPI in Linux release builds 0f50ae131f54d51f778424d4c9655128cafbbefc didn't do it reliably since it was deactivated explicitly a bit above. commit e0d4aede4da8a1f670f53fe597140111b9726234 Author: Campbell Barton <campbell@blender.org> Date: Fri Jul 22 16:49:37 2022 +1000 BMesh: move bmesh_mesh to C++ This allows parts of the code to be threaded more easily. commit 95e60b4ffd6c325d2658f318d05ab52d712ca953 Author: Jacques Lucke <jacques@blender.org> Date: Fri Jul 22 12:33:08 2022 +0200 Cleanup: move crazyspace.c to c++ Doing this in preparation for D15407. commit 087f27a52f7857887e90754d87a7a73715ebc3fb Author: Campbell Barton <campbell@blender.org> Date: Fri Jul 22 13:57:04 2022 +1000 Fix T87779: Asymmetric vertex positions in circles primitives Add sin_cos_from_fraction which ensures each quadrant has matching values when their sign is flipped. commit 08c5d99e88ee3e9f807dfe69c188660eae347f31 Author: Campbell Barton <campbell@blender.org> Date: Fri Jul 22 13:05:26 2022 +1000 Cleanup: add BKE_image_find_nearest_tile_with_offset Every caller BKE_image_find_nearest_tile was calculating the tile offset so add a version of this function that returns the offset too. commit 72e249974aa7f6a3bd6d5c35c5d5e59cd1c3bded Author: Campbell Barton <campbell@blender.org> Date: Fri Jul 22 12:25:10 2022 +1000 Fix crash loading factory settings in image paint mode Loading factory settings left the region NULL, causing the brushes poll function to crash. commit d3db38cfb1f223b81ab89c38bae0652a0d40c03e Author: Campbell Barton <campbell@blender.org> Date: Fri Jul 22 12:23:33 2022 +1000 Cleanup: quiet nonull-compare warnings with GCC commit 77257405437336dbd91a481926013f8c747cacae Author: Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> Date: Fri Jul 22 10:47:28 2022 +1000 UV: Edge support for select shortest path operator Calculating shortest path selection in UV edge mode was done using vertex path logic. Since the UV editor now supports proper edge selection [0], this approach can sometimes give incorrect results. This problem is now fixed by adding separate logic to calculate the shortest path in UV edge mode. Resolves T99344. [0]: ffaaa0bcbf477c30cf3665b9330bbbb767397169 Reviewed By: campbellbarton Ref D15511. commit aa1ffc093c4711a40932c854670730944008118b Author: Hans Goudey <h.goudey@me.com> Date: Thu Jul 21 19:44:06 2022 -0500 Fix T99884: Crash when converting to old curve type The conversion from Curves to CurveEval used an incorrect type for one of the builtin attributes. Also, an incorrect default was used for reading the nurbs_weight attribute. commit fcb6a57b8dfdc9d18cb370f71f82d6f82f8d917d Author: Hans Goudey <h.goudey@me.com> Date: Thu Jul 21 19:11:50 2022 -0500 Fix BMesh conversion commit d07a18e49b64d475f02b9edf24e3808adfbf4cfb Author: Hans Goudey <h.goudey@me.com> Date: Thu Jul 21 19:09:34 2022 -0500 Remove bad assert commit 520cc7073a9ac8fd25425e7112f6c7d4dea6a43d Author: Hans Goudey <h.goudey@me.com> Date: Thu Jul 21 19:09:23 2022 -0500 Don't create layers when unnecessary commit d39fde3662c792800945270a19612f81a4b8e8fd Author: Hans Goudey <h.goudey@me.com> Date: Thu Jul 21 18:35:16 2022 -0500 Parallelize flag copying commit 76bdacec1bf299de6b36dbc6e45d7922ca15d969 Author: Hans Goudey <h.goudey@me.com> Date: Thu Jul 21 18:19:46 2022 -0500 Cleanup variables names, add "finish" calls commit e91eff347a9f855d3c0e757a94962078cd2e8d60 Author: Hans Goudey <h.goudey@me.com> Date: Thu Jul 21 18:12:35 2022 -0500 Remove "new" in comment