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-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-13Refactor: Move normals out of MVert, lazy calculationHans Goudey
As described in T91186, this commit moves mesh vertex normals into a contiguous array of float vectors in a custom data layer, how face normals are currently stored. The main interface is documented in `BKE_mesh.h`. Vertex and face normals are now calculated on-demand and cached, retrieved with an "ensure" function. Since the logical state of a mesh is now "has normals when necessary", they can be retrieved from a `const` mesh. The goal is to use on-demand calculation for all derived data, but leave room for eager calculation for performance purposes (modifier evaluation is threaded, but viewport data generation is not). **Benefits** This moves us closer to a SoA approach rather than the current AoS paradigm. Accessing a contiguous `float3` is much more efficient than retrieving data from a larger struct. The memory requirements for accessing only normals or vertex locations are smaller, and at the cost of more memory usage for just normals, they now don't have to be converted between float and short, which also simplifies code In the future, the remaining items can be removed from `MVert`, leaving only `float3`, which has similar benefits (see T93602). Removing the combination of derived and original data makes it conceptually simpler to only calculate normals when necessary. This is especially important now that we have more opportunities for temporary meshes in geometry nodes. **Performance** In addition to the theoretical future performance improvements by making `MVert == float3`, I've done some basic performance testing on this patch directly. The data is fairly rough, but it gives an idea about where things stand generally. - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms), showing that accessing just `MVert` is now more efficient. - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight change that at least shows there is no regression. - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small but observable speedup. - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms), shows that using normals in geometry nodes is faster. - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms), shows that calculating normals is slightly faster now. - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB), Normals are not saved in files, which can help with large meshes. As for memory usage, it may be slightly more in some cases, but I didn't observe any difference in the production files I tested. **Tests** Some modifiers and cycles test results need to be updated with this commit, for two reasons: - The subdivision surface modifier is not responsible for calculating normals anymore. In master, the modifier creates different normals than the result of the `Mesh` normal calculation, so this is a bug fix. - There are small differences in the results of some modifiers that use normals because they are not converted to and from `short` anymore. **Future improvements** - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier already retrieves normals if they are needed anyway. - Copy normals as part of a better CoW system for attributes. - Make more areas use lazy instead of eager normal calculation. - Remove `BKE_mesh_normals_tag_dirty` in more places since that is now the default state of a new mesh. - Possibly apply a similar change to derived face corner normals. Differential Revision: https://developer.blender.org/D12770
2021-12-13GPencil: New Shrinkwrap modifierAntonio Vazquez
his new modifier is equals to the existing mesh modifier but adapted to grease pencil. The underlying functions used to calculate the shrink are the same used in meshes. {F11794101} Reviewed By: pepeland, HooglyBoogly Differential Revision: https://developer.blender.org/D13192
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-10-18Cleanup: spelling in commentsCampbell Barton
2021-07-05Cleanup: spelling in commentsCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2020-10-23Cleanup: make formatAaron Carlisle
2020-10-15Improve Voxel Remesher volume projection artifacts on sharp edgesLeha
The voxel remesher was using the voxel size to limit the shrink-wrap projection distance. Now that distance is increased to help preserving more detail on hard surface edges. Reviewed By: pablodp606 Differential Revision: https://developer.blender.org/D6204
2020-10-14Cleanup: spellingCampbell Barton
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-10-03Cleanup: Remove/replace C standard library assert() and header usagesJulian Eisel
We have our own assert implementation, `BLI_assert()` that is prefered over the C standard library one. Its output is more consistent across compilers and makes termination on assert failure optional (through `WITH_ASSERT_ABORT`). In many places we'd include the C library header without ever accessing it.
2020-08-07Cleanup: declare arrays arrays where possibleCampbell Barton
2020-08-07Cleanup: Blenkernel, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/blenkernel` module. No functional changes.
2020-06-15Fix crash using shrink-wrap modifier in edit-modeCampbell Barton
Regression in deaff945d0b96.
2020-05-09Cleanup: spellingCampbell Barton
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-06Cleanup: use 'BKE_' prefix for BKE_deform API callsCampbell Barton
- Use 'BKE_object_defgroup' prefix for object functions. - Rename 'defvert_verify_index' to 'defvert_ensure_index' since this adds the group if it isn't found.
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2020-01-27Cleanup: fix compiler warningsBrecht Van Lommel
2019-12-25Shrinkwrap: improve triangle boundary stability in Target Normal Project.Alexander Gavrilov
Rewrite the checks for determining if the solution is actually within the triangle to fix stability issues when the correct solution is on an edge, and step is very small, i.e. the solution is already very close. Also, comment more clearly what is happening geometrically. This should fix problems when vertices that should project exactly onto an edge actually miss, resulting in weird spikes. This made Target Normal Project unusable for the voxel remesher.
2019-11-06Merge branch 'blender-v2.81-release'Pablo Dobarro
2019-11-06Fix Voxel Remesher preserve volume artifactsPablo Dobarro
Should Fix T70326 This implements the shrinkwrap options suggested in D5933. I did a few test and it seems much more stable than the previous options. Reviewed By: jbakker Maniphest Tasks: T70326 Differential Revision: https://developer.blender.org/D6176
2019-10-20Shrinkwrap: improve numerical stability of Target Normal Project.Alexander Gavrilov
* Add proper adjustment for scale in the solver epsilon computation. * Run at least one full iteration of the solver, even if the initial state meets the epsilon requirement. * When applying offset, blend normal into the offset direction as the initial point moves very close to the target mesh. Also random improvements to debug trace output in the console.
2019-10-08Sculpt: Fix projection artifacts by changing the voxel remesh isovaluePablo Dobarro
This should fix most of the shrinkwrap artifacts when the preserve volume option is active. After this commit the default voxel remehser settings should not fail in the default cube. Reviewed By: zeddb Differential Revision: https://developer.blender.org/D6010
2019-09-26Voxel Remesh: Fix poles and preserve volumePablo Dobarro
This commit fixes most of the issues we currently have in the voxel remesher. Mesh volume is preserved when doing multiple iterations, so the sculpt won't shrink and smooth each time you run the remesher. Mesh topology is much better, fixing most issues related to mask extraction and other topology based operations. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D5863
2019-09-10Sculpt: Mask Extract operatorPablo Dobarro
This operator extracts the paint mask to a new mesh object. It can extract the paint mask creating a boundary loop in the geometry, making it ready for adding a subdivision surface modifier. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5384
2019-09-07Cleanup: style, spellingCampbell Barton
2019-07-30BLI_task: Cleanup: rename some structs to make them more generic.Bastien Montagne
TLS and Settings can be used by other types of parallel 'for loops', so removing 'Range' from their names. No functional changes expected here.
2019-05-01ClangFormat: run with ReflowComments on source/Campbell Barton
Prepare for enabling ReflowComments.
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-22Cleanup: style, use braces for blenkernelCampbell Barton
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-11Fix T61391: MeshDeform Modifier does not work on a solidified planar mesh.Bastien Montagne
`BKE_modifier_get_evaluated_mesh_from_evaluated_object()` used by modifiers needing access to other objects' geometry probably skipped out of the radar when cage and final evaluated meshes were added to BMEditMesh? In any case, we do not need to duplicate (and then free!) a temp mesh from editdata anymore, and we can even add instead a parameter to get cage instead of final. Also makes modifiers code a bit simpler.
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-10Fix T60285: allow negative offsets in shrinkwrap (worked in 2.79).Alexander Gavrilov
2019-01-06Cleanup: add trailing commas to structsCampbell Barton
Needed for clang formatting to workaround bug/limit, see: T53211
2018-12-08Shrinkwrap: use polygon normals for flat faces in Align To Normal.Alexander Gavrilov
Hit normal originates from tesselated triangles and isn't the actual normal used for shading of flat faces. Thus, it is better to use the actual polygon normals when available.
2018-12-07Fix modifiers evaluation outside of depsgraph/CoW context.Bastien Montagne
Fix T58237: Exporters: Curve Modifier not applied when "apply modifiers" are selected. Fix T58856: Python: "to_mesh" broken in 2.8. ...And many other cases... ;) Thing is, we need target IDs to always be evaluated ones (at least I cannot see any case where having orig ones is desired effect here). Depsgraph/Cow system ensures us that when modifiers are evaluated by it, but they can also be called outside of this context, e.g. when doing binding, or object conversion... So we need to ensure in modifiers code that we actually are always working with eval data for those targets. Note that I did not touch to physics modifiers, those are a bit touchy and rather not 'fix' something there until proven broken!
2018-11-27Shrinkwrap: minor simplification of code.Bastien Montagne
2018-11-27Fix typos.Bastien Montagne
2018-11-26MOD_shrinkwrap: do not compute mesh when not needed.Bastien Montagne
This modifier only uses mesh to get vgroup, which is only needed in case modified object is indeed a mesh! Building a mesh from curve here is not only useless and time-consuming, it will also easily fail the assert about same number of vertices! Note that surface_project and subsurf option also need more work at some point, but this is probably not that urgent for now. Also, use MOD_get_vgroup() helper in modifier code itself and pass resulting MDeformVert & index to BKE_shrinkwrap's `shrinkwrapModifier_deform()`, this is simpler and avoids duplicating vgroup handling code. Related to T57972.
2018-11-14Merge branch 'master' into blender2.8Campbell Barton
2018-11-14Cleanup: comment block tabsCampbell Barton
2018-11-07Cleanup: styleCampbell Barton
2018-11-06Shrinkwrap: new mode that projects along the target normal.Alexander Gavrilov
The Nearest Surface Point shrink method, while fast, is neither smooth nor continuous: as the source point moves, the projected point can both stop and jump. This causes distortions in the deformation of the shrinkwrap modifier, and the motion of an animated object with a shrinkwrap constraint. This patch implements a new mode, which, instead of using the simple nearest point search, iteratively solves an equation for each triangle to find a point which has its interpolated normal point to or from the original vertex. Non-manifold boundary edges are treated as infinitely thin cylinders that cast normals in all perpendicular directions. Since this is useful for the constraint, and having multiple objects with constraints targeting the same guide mesh is a quite reasonable use case, rather than calculating the mesh boundary edge data over and over again, it is precomputed and cached in the mesh. Reviewers: mont29 Differential Revision: https://developer.blender.org/D3836
2018-10-19Cleanup: compiler warningsCampbell Barton