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-01-25Fix depsgraphs sharing IDs via evaluated edit meshSergey Sharybin
The evaluated mesh is a result of evaluated modifiers, and referencing other evaluated IDs such as materials. It can not be stored in the EditMesh structure which is intended to be re-used by many areas. Such sharing was causing ownership errors causing bugs like T93855: Cycles crash with edit mode and simultaneous viewport and final render The proposed solution is to store the evaluated edit mesh and its cage in the object's runtime field. The motivation goes as following: - It allows to avoid ownership problems like the ones in the linked report. - Object level is chosen over mesh level is because the evaluated mesh is affected by modifiers, which are on the object level. This patch allows to have modifier stack of an object which shares mesh with an object which is in edit mode to be properly taken into account (before the change the modifier stack from the active object will be used for all objects which share the mesh). There is a change in the way how copy-on-write is handled in the edit mode to allow proper state update when changing active scene (or having two windows with different scenes). Previously, the copt-on-write would have been ignored by skipping tagging CoW component. Now it is ignored from within the CoW operation callback. This allows to update edit pointers for objects which are not from the current depsgraph and where the edit_mesh was never assigned in the case when the depsgraph was evaluated prior the active depsgraph. There is no user level changes changes expected with the CoW handling changes: should not affect on neither performance, nor memory consumption. Tested scenarios: - Various modifiers configurations of objects sharing mesh and be part of the same scene. - Steps from the reports: T93855, T82952, T77359 This also fixes T76609, T72733 and perhaps other reports. Differential Revision: https://developer.blender.org/D13824
2022-01-06Cleanup: spelling in commentsCampbell Barton
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-09-02Fix regression in recent change 0708733c46cb6b50697c1b80a6541d6fb410267eCampbell Barton
Adding a mirror modifier in edit-mode crashed. Freeing meshes that hold a shallow copy happens in multiple places while calculating modifiers, making it impractical to clear the edit-mode pointer before freeing the mesh (as done in BKE_editmesh_free_derived_caches). Add a struct member to the edit-mesh struct so evaluated copies don't free the edit-mesh contents.
2021-07-16Cleanup: sort struct declarationsCampbell Barton
2021-07-13Cleanup: replace BKE_customdata.h in BKE_editmesh.hCampbell Barton
Only DNA_customdata_types.h is needed for BMEditMesh.
2021-07-13Cleanup: improve BMEditMesh docstringsCampbell Barton
Also remove white-space added last commit.
2021-07-13Cleanup: minor changes to edit-mesh API callsCampbell Barton
Rename: - EDBM_mesh_free -> EDBM_mesh_free_data BKE_editmesh_free -> BKE_editmesh_free_data Since this doesn't free the edit-mesh pointer. - BKE_editmesh_free_derivedmesh -> BKE_editmesh_free_derived_caches Since this no longer uses derived-mesh, match naming for the related object function BKE_object_free_derived_caches. Also remove `do_tessellate` argument from BKE_editmesh_create, since the caller can explicitly do this if it's needed, with the advantage that it can be combined with normal calculation which is faster on high-poly meshes.
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-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-14BMesh: support face-normal calculation in normal & looptri functionsCampbell Barton
Support calculating face normals when tessellating. When this is done before updating vertex normals it gives ~20% performance improvement. Now vertex normal calculation only needs to perform a single pass on the mesh vertices when called after tessellation. Extended versions of normal & looptri update functions have been added: - BM_mesh_calc_tessellation_ex - BM_mesh_normals_update_ex Most callers don't need to be aware of this detail by using: - BKE_editmesh_looptri_and_normals_calc - BKE_editmesh_looptri_and_normals_calc_with_partial - EDBM_update also takes advantage of this, where calling EDBM_update with calc_looptri & calc_normals enabled uses the faster normal updating logic.
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-12-16Cleanup: remove redundant struct declarationsCampbell Barton
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-10-14Fix T81511: Loop-cut overlay doesn't follow deformed cageCampbell Barton
With constructive + deform modifiers, loop-cut visualization wasn't following the displayed mesh. This now gets the coordinates from the cage when available.
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-03-02Cleanup: make remaining blenkernel headers work in C++Jacques Lucke
2020-01-07BMesh: remove BMEditMesh.ob pointerCampbell Barton
Remove this pointer since it's linking Mesh data back to the object, where a single edit-mesh may have multiple object users, causing incorrect assumptions in the code. Resolves dangling pointer part of the T72667 crash, although there are other issues which still need to be fixed. In EDBM_op_finish and EDBM_update_generic, full Main lookups have been added which should be replaced with mesh argument or the update tagging moved elsewhere.
2020-01-07BMesh: remove BMEditMesh.ob use BKE_editmesh_lnorspace_* APICampbell Barton
Note that this is a bit clumsy having both edit-mesh and mesh, BKE_editmesh_ensure_autosmooth & BKE_editmesh_lnorspace_update are often called together, these could be made into a single functions.
2020-01-07BMesh: remove BMEditMesh.ob use for vert coord access, projectionCampbell Barton
2019-12-24Cleanup: remove unused statvis code & struct membersCampbell Barton
This code has been moved into the draw manager.
2019-11-07Fix T69822: Switching sculpt objects breaks undoCampbell Barton
This introduces object mode tagging for data which hasn't yet been written back to the ID data. Now when selecting other sculpt objects, the original objects data is flushed back to the ID before writing a memfile undo step.
2019-09-27Cleanup: structs, cmake file listsCampbell Barton
2019-09-23Fix selection and snapping misusing texture space as boundboxBrecht Van Lommel
This fixes the regression from T70103 introduced by the fix for T70103.
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-08-25Cleanup: rename mesh looptri/tessface functionsCampbell Barton
Use consistent terminology.
2019-08-21Cleanup: vertex coordinate access, naming & minor changesCampbell Barton
This also splits vertex access and allocation so it's possible to copy coordinates into an existing array without allocating it.
2019-05-20Normal UI: for all ops needing autosmooth on, enable it if needed.Howard Trickey
Now Normal menu operations and rotate normals (r n) do not need manual enabling of autosmooth first. See T64324 for discussion of Normal UI changes.
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-03-07Refactor CDData masks, to have one mask per mesh elem type.Bastien Montagne
We already have different storages for cddata of verts, edges etc., 'simply' do the same for the mask flags we use all around Blender code to request some data, or limit some operation to some layers, etc. Reason we need this is that some cddata types (like Normals) are actually shared between verts/polys/loops, and we don’t want to generate clnors everytime we request vnors! As a side note, this also does final fix to T59338, which was the trigger for this patch (need to request computed loop normals for another mesh than evaluated one). Reviewers: brecht, campbellbarton, sergey Differential Revision: https://developer.blender.org/D4407
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-10-09Edit Mesh: replace DerivedMesh w/ MeshCampbell Barton
DerivedMesh is now removed from edit-mesh modifier evaluation.
2018-10-09Cleanup: remove unused EditDerivedBMeshCampbell Barton
2018-09-24Merge branch 'master' into blender2.8Brecht Van Lommel
2018-09-24Spelling fixes in comments and descriptions, patch by luzpaz.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D3719
2018-06-20Merge branch 'blender2.8' into soc-2018-bevelRohan Rathi
2018-06-17Merge branch 'master' into blender2.8Campbell Barton
2018-06-17Cleanup: trailing space for blenkernelCampbell Barton
2018-05-25Applied soc-2017-normal-toolsRohan Rathi
2018-04-16Depsgraph: remove EvaluationContext, pass Depsgraph instead.Brecht Van Lommel
The depsgraph was always created within a fixed evaluation context. Passing both risks the depsgraph and evaluation context not matching, and it complicates the Python API where we'd have to expose both which is not so easy to understand. This also removes the global evaluation context in main, which assumed there to be a single active scene and view layer. Differential Revision: https://developer.blender.org/D3152
2017-08-16Pass EvaluationContext instead of bContextCampbell Barton
2.8x branch added bContext arg in many places, pass eval-context instead since its not simple to reason about what what nested functions do when they can access and change almost anything. Also use const to prevent unexpected modifications. This fixes crash loading files with shadows, since off-screen buffers use a NULL context for rendering.
2017-07-21Pass EvaluationContext argument everywhereLuca Rood
Note that some little parts of code have been dissabled because eval_ctx was not available there. This should be resolved once DerivedMesh is replaced.
2017-05-25TexFace removal part 3Campbell Barton
- MTexPoly structure & layer type. - The 'Mesh.uv_textures' layers. - DerivedMesh TexFace drawing. - Scripts & UI.
2015-08-01Docs: doxy cleanup/minor editsCampbell Barton
2015-03-31Corrective Smooth Modifier (aka delta-mush)Campbell Barton
This modifier can be used to correct bad deformations, Original patch D1183 by @sazerac, with own modifications
2015-03-28Cleanup: redundant struct declarationsCampbell Barton
2015-03-21Cleanup: constify scene/modifiersCampbell Barton