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-08-12Cleanup: replace misleading use of 'true' for the bit-field sizeCampbell Barton
Also use a bit-field for SnapObjectParams.keep_on_same_target
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-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-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2021-12-03Cleanup: move public doc-strings into headers for 'bmesh'Campbell Barton
Some minor improvements to doc-strings too. Ref T92709
2021-07-16Cleanup: sort struct declarationsCampbell Barton
2021-06-07Cleanup: split bmesh normal calculation into separate filesCampbell Barton
2021-06-05Edit Mesh: partial updates for normal and face tessellationCampbell Barton
This patch exposes functionality for performing partial mesh updates for normal calculation and face tessellation while transforming a mesh. The partial update data only needs to be generated once, afterwards the cached connectivity information can be reused (with the exception of changing proportional editing radius). Currently this is only used for transform, in the future it could be used for other operators as well as the transform panel. The best-case overall speedup while transforming geometry is about 1.45x since the time to update a small number of normals and faces is negligible. For an additional speedup partial face tessellation is multi-threaded, this gives ~15x speedup on my system (timing tessellation alone). Exact results depend on the number of CPU cores available. Ref D11494 Reviewed By: mano-wii
2020-09-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-07-09BMesh: add utility functionsCampbell Barton
- BM_edge_uv_share_vert_check - BM_face_uv_calc_center_median_weighted - BM_loop_at_index_find
2020-06-10Mesh Edit: preserve Custom Normal vectors in topology operators.Alexander Gavrilov
Custom Loop Normals are normally encoded relative to the default normals, similar to normal maps, allowing them to naturally follow mesh deformations. Changes to mesh topology however often result in nonsensical effects that are not desired. The Remove Doubles operation especially (now known as Merge By Distance) is intended as a purely topological operation, and definitely should not change the vector of the custom normals. This patch implements that behavior by converting the relative encoding into an absolute vector layer for the duration of the operation. It also modifies other Merge types in this way for consistency, the Rip operator as their inverse counterpart; and also Delete, Dissolve, Connect Path and Knife operators as other examples more related to topology than shape. On the technical side, this ports mesh_normals_loop_custom_set to BMesh, and then uses a temporary Custom Data layer to store the normals as vectors for the duration of the above mentioned operations. When the normals are converted back to custom data, the caller can choose whether to mark edges as sharp to preserve distinct normals, or just average them instead. All but Remove Doubles choose to average for now. Differential Revision: https://developer.blender.org/D4994
2020-04-07Cleanup: remove unused BM_total_loop_select functionCampbell Barton
2020-03-06Cleanup: Fix forward declaration of headersDalai Felinto
2019-11-21Object: edit-mode data support for object vertex coordinate accessCampbell Barton
Allows to access/transform/restore edit-mode coordinates in a generic way.
2019-06-16Fix T65809: Blender crash while using the Normal's "merge" option in edit mode.Bastien Montagne
Merge code will generate temp normal editing data for affected loops, but since it will later (by setting some edges/faces to smooth) alter and extend affected clnor spaces, it will also need temp normal editing data for some other loops around those vertices... Using those clnor editing data in that code is a bit of an abuse, but on the other hand that struct stores exactly what we need. So simply added an option to generate that editing data for all clnors of affected vertices.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-11-27Revert "Fix texture space not updating in edit mode."Campbell Barton
This reverts commit 3a038db576e97c0e720a92af05a218ed71ed121a. Caused CoW crash switching from edit to sculpt mode.
2018-11-26Fix texture space not updating in edit mode.mano-wii
2018-10-24Merge branch 'master' into blender2.8Campbell Barton
2018-10-24BMesh: inline index lookupsCampbell Barton
For release builds this is now the same as indexing the array directly.
2018-08-10Cleanup: styleCampbell Barton
2018-07-02Merge branch 'blender2.8' into soc-2018-bevelRohan Rathi
2018-06-27Cleanup: remove BKE's modifiers_bmesh.c, other DM removal/cleanup in BMesh code.Bastien Montagne
2018-06-11Added ability to harden normals.Rohan Rathi
Uses 2 different params: mode and strength. There are still some hiccups with how 2.8 interacts with normals. Will resolve as support gets better
2018-05-25Applied soc-2017-normal-toolsRohan Rathi
2018-05-09Expanded BMALLOC_TEMPLATE_FROM_ME to accept two meshesSybren A. Stüvel
2018-04-16Multi-Object EditingCampbell Barton
This adds initial multi-object editing support. - Selected objects are used when entering edit & pose modes. - Selection & tools work on all objects however many tools need porting See: T54641 for remaining tasks. Indentation will be done separately. See patch: D3101
2018-04-16Cleanup: indentationCampbell Barton
2018-03-01Refactor: Merge non-functional-change part of 'edit normals' 2017 GSoC.Bastien Montagne
This merges changes in internals, runtime-only of existing custom normals code, which make sense as of themselves, and will make diff of soc branch easier/lighter to review. In the details, it mostly changes two things: * Now, smooth fans (aka MLoopNorSpaceArray) can store either loop indices, or pointers to BMLoop themselves. This makes sense since in BMesh, it's relatively easy to get index from a BMElement, but nearly impracticable to go the other way around. * First change enforces another, now we cannot rely anymore on `loops` being NULL in MLoopNorSpace to detect single-loop fans, so we instead store that info in a new flag. Again, these are expected to be totally non-functional changes.
2018-02-22Fix (unreported) meshes changing shading when creating empty clnors data.Bastien Montagne
When you were using autosmooth to generate some custom normals, and created empty custom loop normal data, you would go back to an 'all smooth' shading, cancelling some sharp edges generated by the mesh's smooth threshold. Now we will first tag such edges as sharp, such that shading remains the same. This is not crucial in current master, but it is for clnors editing gsoc branch!
2017-05-06bmesh: use 'uint' instead of 'unsigned int'Campbell Barton
no functional changes.
2016-07-02BMesh: utility function to resize bmesh elementsCampbell Barton
This can be used to re-allocate bmesh data with/without tool flags. Needed for Symmetrize since it uses bmesh operators from dyntopo.
2016-07-01BMesh: make toolflags optionalCampbell Barton
Saves 8 bytes per vert/edge/face. Gives overall ~20-25% memory saving for dyntopo sculpting and modifiers that use BMesh.
2015-12-11BMesh: Add option to use BMesh boolean modifierCampbell Barton
This uses a bmesh-intersection, BLI_kdtree and watertight intersections to perform boolean operations. For now keep both BMesh and Carve booleans usable at once for testing & bug reports, however we plan to phase out Carve by next release.
2015-04-25Cleanup: use 8 space indent for multi-line argsCampbell Barton
2015-04-20Editmesh select nearest fixesCampbell Barton
- distance from edge check wasn't clamping 0-1 - vertex bias wasn't taking pixelsize into account. - index & pass counter were floats Also some improvements - use BMesh lookup tables when available. - use structs to avoid issues getting out of sync.
2015-02-05Add Custom Loop Normals.Bastien Montagne
This is the core code for it, tools (datatransfer and modifier) will come in next commits). RNA api is already there, though. See the code for details, but basically, we define, for each 'smooth fan' (which is a set of adjacent loops around a same vertex that are smooth, i.e. have a single same normal), a 'loop normal space' (or lnor space), using auto-computed normal and relevant edges, and store custom normal as two angular factors inside that space. This allows to have custom normals 'following' deformations of the geometry, and to only save two shorts per loop in new clnor CDLayer. Normal manipulation (editing, mixing, interpolating, etc.) shall always happen with plain 3D vectors normals, and be converted back into storage format at the end. Clnor computation has also been threaded (at least for Mesh case, not for BMesh), since the process can be rather heavy with high poly meshes. Also, bumping subversion, and fix mess in 2.70 versioning code.
2015-01-19Make use/computation of lnors consistant.Bastien Montagne
Issue was, when requesting (building) lnors for a mesh that has autosmooth disabled, one would expect to simply get vnors as lnors. Until now, it wasn't the case, which was bad e.g. for normal projections of loops in recent remap code (projecting along split loop normals when you would expect projection along vertex normals...). Also, removed the 'angle' parameter from RNA's `mesh.calc_normals_split`. This should *always* use mesh settings (both autosmooth and smoothresh), otherwise once again we'd get inconsistencies in some cases. Will update fbx and obj addons too.
2014-08-22Cleanup: BMesh arg nameCampbell Barton
2014-08-07BMesh: use existing lookup tables when remappingCampbell Barton
2014-04-13Split Normals I (2/5): Add basic BMesh support of split normals.Bastien Montagne
* Merely a re-implementation of core split algorithm for BMesh, taking advantage of topological data available. * This code needs valid loop indices, so added BM_LOOP support to BM_mesh_elem_index_ensure() & co. Reviewers: campbellbarton Reviewed By: campbellbarton CC: brecht Differential Revision: https://developer.blender.org/D366
2014-04-03Code cleanup: strict flags for bmesh_logCampbell Barton
2014-02-12Fix Editderivedmeshes vertices normals computation.Bastien Montagne
Those derived meshes (used in Edit mode) were using simple sum of neighbor poly normals to get vertex normals, while everywhere else in Blender we use weighted sum of such poly normals. Patch: D311 Reviewed and enhanced by Campbell, thanks!
2013-10-28move bmesh array lookup data and utility functions from editmesh into bmesh,Campbell Barton
since enough bmesh operations can also take advantage of direct index lookups on verts/edges/faces. developers note: - EDBM_index_arrays_init/ensure/free -> BM_mesh_elem_table_ensure/init/free - EDBM_vert/edge/face_at_index -> BM_vert/edge/face_at_index - EDBM_uv_element_map_create/free -> BM_uv_element_map_create/free - ED_uv_element_get -> BM_uv_element_get
2013-10-27rename BM_vert_at_index -> BM_vert_at_index_find (since this searches the ↵Campbell Barton
mempool). needed for other changes - coming.