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-05-05Docs: add doc-string for BMFace.mat_nr struct memberCampbell Barton
2022-04-28Fix: Incorrect conversion from C bitfield syntaxHans Goudey
Recent cleanups 9a8669ac81b99b2 and 1c790555a02bfc3 incorrectly interpereted the bitfield width syntax as a default value. Also resolve two other compilation warnings.
2022-04-25Cleanup: spelling in commentsCampbell Barton
2022-04-24Cleanup: clang-formatCampbell Barton
2022-04-23Fix a failing bmesh_bevel test by fixing buffer overflow.Howard Trickey
The uv fix just submitted had a bug where I forgot to wrap around after adding 1. This apparently worked anyway in a debug build but not in release build, hence the buildbot tests were failing.
2022-04-22Cleanup: Clang tidy, unused variable warningsHans Goudey
Also remove unnecessary uses of `struct` and add const in one place.
2022-04-22Re-fix some comments in bmesh_bevel.c.Howard Trickey
The UV fix just committed had gotten out of sync with some changes that had been made inside some comments (spelling and folding).
2022-04-22BMesh: Add additional attribute access macrosMartijn Versteegh
Add macros to get/set boolean attributes, to set float2/float3 attributes and to get float2/float3 attributes via pointer access. Needed for D14365 and further generic attribute integration. Differential Revision: https://developer.blender.org/D14708
2022-04-22Fix T56625: Bevel sometimes made zero area UV faces.Howard Trickey
This substantially redoes the logic by which bevel chooses, for the middle segment when there are an odd number of segments, which face to interpolate in, and which vertices to snap to which edges before doing that interpolation. It changes the UV layouts of a number of the regression tests, for the better. An example, in the reference bug, is a cube with all seams, unwrapped and then packed with some margin around them, now looks much better in UV space when there are an odd number of segments.
2022-04-20Cleanup: Rename CD_MLOOPCOL to CD_PROP_BYTE_COLORHans Goudey
The "PROP" in the name reflects its generic status, and removing "LOOP" makes sense because it is no longer associated with just mesh face corners. In general the goal is to remove extra semantic meaning from the custom data types.
2022-04-13Cleanup: use C++ comments for disabled codeCampbell Barton
Also ensure space around text in C-comment blocks.
2022-04-07Cleanup: clang-formatCampbell Barton
2022-04-05Refactor: Unify vertex and sculpt colors into newJoseph Eagar
color attribute system. This commit removes sculpt colors from experimental status and unifies it with vertex colors. It introduces the concept of "color attributes", which are any attributes that represents colors. Color attributes can be represented with byte or floating-point numbers and can be stored in either vertices or face corners. Color attributes share a common namespace (so you can no longer have a floating-point sculpt color attribute and a byte vertex color attribute with the same name). Note: this commit does not include vertex paint mode, which is a separate patch, see: https://developer.blender.org/D14179 Differential Revision: https://developer.blender.org/D12587 Ref D12587
2022-03-28Cleanup: use "num" as a suffix in: source/blender/modifiersCampbell Barton
Also rename DNA struct members.
2022-03-25Cleanup: use count or num instead of nbrCampbell Barton
Follow conventions from T85728.
2022-03-23Cleanup: move documentation to headers, other minor correctionsCampbell Barton
2022-03-22Cleanup: Use bool for BMesh creation paramsHans Goudey
These boolean options are passed as uint, but they would be easier to understand if using bool. Differential Revision: https://developer.blender.org/D14405
2022-03-22Fix T96308: Mesh to BMesh conversion doesn't calculate vertex normalsHans Goudey
Currently there is a "calc_face_normal" argument to mesh to bmesh conversion, but vertex normals had always implicitly inherited whatever dirty state the mesh input's vertex normals were in. Probably they were most often assumed to not be dirty, but this was never really correct in the general case. Ever since the refactor to move vertex normals out of mesh vertices, cfa53e0fbeed7178c7, the copying logic has been explicit: copy the normals when they are not dirty. But it turns out that more control is needed, and sometimes normals should be calculated for the resulting BMesh. This commit adds an option to the conversion to calculate vertex normals, true by default. In almost all places except the decimate and edge split modifiers, I just copied the value of the "calc_face_normals" argument. Differential Revision: https://developer.blender.org/D14406
2022-03-18Cleanup: Compilation warningsSergey Sharybin
Mainly -Wset-but-unused-variable. Makes default compilation on macOS way less noisy. Differential Revision: https://developer.blender.org/D14357
2022-03-16Cleanup: rename cnt to countCampbell Barton
Follow naming from T85728.
2022-03-11Cleanup: use M_PI_2 and M_PI_4 where possibleHallam Roberts
The constant M_PI_4 is added to GLSL to ensure it works there too. Differential Revision: https://developer.blender.org/D14288
2022-03-08Cleanup: spelling in commentsCampbell Barton
2022-03-08Cleanup: spelling in comments, use C++ comments for disabled codeCampbell Barton
2022-03-07Cleanup: fix various typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14203
2022-03-07Merge branch 'blender-v3.1-release'Campbell Barton
2022-03-07Fix T96205: Active shape key gets lost upon edit mode undoCampbell Barton
Regression in d961adb866cc2d7a95e4c6a7f06c49e346ec1abe, it's important that for the Mesh used for undo storage matches the shape-key instead of using the coordinates of the Basis key. Prior to bfdbc78466ac14d45f353db9aa39cb21bb962701 a different method of restoring the basis shape-key coordinates was used (restoring from the input `Mesh.mvert` array). When undo wrote the edit-mesh into the mesh this was always NULL so the basis shape keys coordinates were never used. Now a parameter has been added so undo can use the active shape for the meshes vertex coordinates. Reviewed By: sergey Maniphest Tasks: T96205 Ref D14258
2022-03-03UV: Edge selection supportSiddhartha Jejurkar
This patch adds edge selection support for UV editing (refer T76545). Developed as a part of GSoC 2021 project - UV Editor Improvements. Previously, selections in the UV editor always flushed down to vertices and this caused multiple issues such as T76343, T78757 and T26676. This patch fixes that by adding edge selection support for all UV operators and adding support for flushing selections between vertices and edges. Updating UV select modes is now done using a separate operator, which also handles select mode flushing and undo for UV select modes. Drawing edges (in UV edge mode) is also updated to match the edit-mesh display in the 3D viewport. Notes on technical changes made with this patch: * MLOOPUV_EDGESEL flag is restored (was removed in rB9fa29fe7652a). * Support for flushing selection between vertices and edges. * Restored the BMLoopUV.select_edge boolean in the Python API. * New operator to update UV select modes and flushing. * UV select mode is now part of editmesh undo. TODOs added with this patch: * Edge support for shortest path operator (currently uses vertex path logic). * Change default theme color instead of reducing contrast with edge-select. * Proper UV element selections for Reveal Hidden operator. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D12028
2022-03-03Merge branch 'blender-v3.1-release'Campbell Barton
2022-03-03Fix T96135: Mesh coordinates are set to the last edited shape-keyCampbell Barton
When exiting edit-mode set the vertex coordinates to the basis-shape when editing non-basis keys. Regression in bfdbc78466ac14d45f353db9aa39cb21bb962701. Reviewed By: sergey Ref D14234
2022-03-02UI: Comments Misspellings of Vertex/VerticesNikhil Shringarpurey
Correct misspellings in code comments of "vertex" and "vertices". See D13932 for more details. Differential Revision: https://developer.blender.org/D13932 Reviewed by Harley Acheson
2022-02-24Merge branch 'blender-v3.1-release'Hans Goudey
2022-02-24Fix: Crash switching between sculpt and edit modeHans Goudey
Also fix a couple other places where normals layers weren't properly tagged dirty or reallocated when the mesh changes. Caused by cfa53e0fbeed7178. When the size of a mesh changes, the normal layers need to be reallocated. There were a couple of places that cleared other runtime data with `BKE_mesh_runtime_clear_geometry` but didn't deal with normals properly. Clearing the runtime "geometry" is different from clearing the normals, because sometimes the size of the normal layers doesn't have to change, in which case simply tagging them dirty is fine.
2022-02-24Merge branch 'blender-v3.1-release'Jacques Lucke
2022-02-24Fix T95985: crash when assigning a name for an output attributeJacques Lucke
This was a double free error which happened because `BM_mesh_bm_from_me` was taking ownership of arrays that were still owned by the Mesh. Note that this only happens when the mesh is empty but some custom data layers still have a non-null data pointer. While usually the data pointer should be null in this case for performance reasons, other functions should still be able to handle this situation. Differential Revision: https://developer.blender.org/D14181
2022-02-23Cleanup: Remove repeated word in commentsCampbell Barton
2022-02-22Merge branch 'blender-v3.1-release'Hans Goudey
2022-02-22Fix T95839: Data race when lazily creating mesh normal layersHans Goudey
Currently, when normals are calculated for a const mesh, a custom data layer might be added if it doesn't already exist. Adding a custom data layer to a mesh is not thread-safe, so this can be a problem in some situations. This commit moves derived mesh normals for polygons and vertices out of `CustomData` to `Mesh_Runtime`. Most of the hard work for this was already done by rBcfa53e0fbeed7178. Some changes to logic elsewhere are necessary/helpful: - No need to call both `BKE_mesh_runtime_clear_cache` and `BKE_mesh_normals_tag_dirty`, since the former also does the latter. - Cleanup/simplify mesh conversion and copying since normals are handled with other runtime data. Storing these normals like other runtime data clarifies their status as derived data, meaning custom data moves more towards storing original/editable data. This means normals won't automatically benefit from the planned copy-on-write refactor (T95845), so it will have to be added manually like for the other runtime data. Differential Revision: https://developer.blender.org/D14154
2022-02-22Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-22Fix T44415: Shape keys get out of sync when using undo in edit-modeCampbell Barton
This is an alternate fix for T35170 since it caused T44415. Having the undo system manipulate the key-block coordinates is error prone as (in the case of T44415) there are situations when it's important to apply the difference with the original shape key. This reverts dab0bd9de65a9be5e8ababba0e2799f994d5d12f, and instead avoids the problem by not using the data in `Mesh.key` as a reference for updating shape-keys when exiting edit-mode. The assumption that the `Mesh.key` in edit-mode won't be modified until leaving edit-mode isn't always true. Leading to synchronization errors. (details noted in code-comments). Resolve this by using shape-key data stored in the BMesh. Resolving both T35170 & T44415. Details: - Remove use of the original vertices when exiting edit mode. - Remove use of the original shape-key coordinates when exiting edit-mode (except as a last resort). - Move shape-key synchronization into a separate function: `bm_to_mesh_key`. - Split the synchronization loop into two branches, depending on the existence of BMesh shape-key coordinates. - Always write shape-key values back to the BMesh CD_SHAPEKEY layers. This was only done in some cases but is now necessary for all shape-keys as these are used to calculate offsets where the `Mesh.key` was previously used. - Report a warning when the shape-key layer isn't found as this uses an imperfect method of restoring coordinates which should only be used as a last resort. Reviewed By: mont29 Ref D14127
2022-02-21Cleanup: avoid reallocating arrays at the same sizeCampbell Barton
2022-02-18Mesh: Avoid creating incorrect original index layersHans Goudey
Currently, whenever any BMesh is converted to a Mesh (except for edit mode switching), original index (`CD_ORIGINDEX`) layers are added. This is incorrect, because many operations just convert some Mesh into a BMesh and then back, but they shouldn't make any assumption about where their input mesh came from. It might even come from a primitive in geometry nodes, where there are no original indices at all. Conceptually, mesh original indices should be filled by the modifier stack when first creating the evaluated mesh. So that's where they're moved in this patch. A separate function now fills the indices with their default (0,1,2,3...) values. The way the mesh wrapper system defers the BMesh to Mesh conversion makes this a bit less obvious though. The old behavior is incorrect, but it's also slower, because three arrays the size of the mesh's vertices, edges, and faces had to be allocated and filled during the BMesh to Mesh conversion, which just ends up putting more pressure on the cache. In the many cases where original indices aren't used, I measured an **8% speedup** for the conversion (from 76.5ms to 70.7ms). Generally there is an assumption that BMesh is "original" and Mesh is "evaluated". After this patch, that assumption isn't quite as strong, but it still exists for two reasons. First, original indices are added whenever converting a BMesh "wrapper" to a Mesh. Second, original indices are not added to the BMesh at the beginning of evaluation, which assumes that every BMesh in the viewport is original and doesn't need the mapping. Differential Revision: https://developer.blender.org/D14018
2022-02-11File headers: add missing copyright, add MIT to SPDX licensesCampbell Barton
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-11Merge branch 'blender-v3.1-release'Henrik Dick
2022-02-11Fix: Bevel vertex didn't use weights in some casesHenrik Dick
Bevel Vertices did not use vertex/bevel weights if the Width Type was set to Width or Depth.
2022-02-08Mesh: add option to select vertices by similar vertex creaseKévin Dietrich
This adds an option to the "Select Similar" operator in edit mode to select vertices based on vertex crease similarity. The implementation follows that of the edge crease, with a 1-dimensional KD-tree used to store and retrieve vertex indices base on crease values. To maintain compatibility with old files (scripts), the `SIMEDGE_CREASE` enumeration identifier remains `CREASE`, while the one for the new `SIMVERT_CREASE` is `VCREASE` to follow the naming convention of other enum values. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D14037
2022-02-07Cleanup: spelling in commentsCampbell Barton
2022-02-07Fix Bevel intersection continuity.Henrik Dick
This patch from Henrik Dick improves the continuity between the grid forming corners and the edge polyons on multisegment bevels. For details, see patch D13867.
2022-02-04Cleanup: Clang tidy, use bracesHans Goudey
Braces missed in b73d3b80fdcb72446
2022-01-30Cleanup: Cmake: remove unnecessary definitions for internationalizationAaron Carlisle
Previously, macros were ifdefed using the cmake option `WITH_INTERNATIONAL` However, the is unnecessary as withen the functions themselves have checks for building without internationalization. This also means that many `add_definitions(-DWITH_INTERNATIONAL)` are also unnecessary. Reviewed By: mont29, LazyDodo Differential Revision: https://developer.blender.org/D13929