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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-03-17 18:08:31 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-03-17 18:41:43 +0300
commit24e44143a192053f552e4c4b1655146be3aaed61 (patch)
treecd0e026b8f0f7c9cd9d7b0cb4f67225d85266e05 /source/blender/blenkernel/intern/multires_reshape.h
parent628d799c85965191d5f6231b3433bbae425e59f0 (diff)
Multires: Fix Apply Base when there are deform modifiers
Their effect was applied twice after hitting Apply Base since the operator was also applying deformation caused by those modifiers.
Diffstat (limited to 'source/blender/blenkernel/intern/multires_reshape.h')
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/multires_reshape.h b/source/blender/blenkernel/intern/multires_reshape.h
index bdadc1f2800..deeb885e15a 100644
--- a/source/blender/blenkernel/intern/multires_reshape.h
+++ b/source/blender/blenkernel/intern/multires_reshape.h
@@ -36,6 +36,11 @@ struct Subdiv;
struct SubdivCCG;
typedef struct MultiresReshapeContext {
+ /* NOTE: Only available when context is initialized from object. */
+ struct Depsgraph *depsgraph;
+ struct Object *object;
+ struct MultiresModifierData *mmd;
+
/* Base mesh from original object.
* NOTE: Does NOT include any leading modifiers in it. */
struct Mesh *base_mesh;
@@ -142,6 +147,9 @@ struct Subdiv *multires_reshape_create_subdiv(struct Depsgraph *depsgraph,
struct Object *object,
const struct MultiresModifierData *mmd);
+/* NOTE: Initialized base mesh to object's mesh, the Subdiv is created from the deformed
+ * mesh prior to the multires modifier if depsgraph is not NULL. If the depsgraph is NULL
+ * then Subdiv is created from base mesh (without any deformation applied). */
bool multires_reshape_context_create_from_object(MultiresReshapeContext *reshape_context,
struct Depsgraph *depsgraph,
struct Object *object,
@@ -302,6 +310,12 @@ void multires_reshape_apply_base_update_mesh_coords(MultiresReshapeContext *resh
void multires_reshape_apply_base_refit_base_mesh(MultiresReshapeContext *reshape_context);
/* Refine subdivision surface to the new positions of the base mesh. */
-void multires_reshape_apply_base_refine_subdiv(MultiresReshapeContext *reshape_context);
+void multires_reshape_apply_base_refine_from_base(MultiresReshapeContext *reshape_context);
+
+/* Refine subdivision surface to the new positions of the deformed mesh (base mesh with all
+ * modifiers leading the multires applied).
+ *
+ * NOTE: Will re-evaluate all leading modifiers, so it's not cheap. */
+void multires_reshape_apply_base_refine_from_deform(MultiresReshapeContext *reshape_context);
#endif /* __BKE_INTERN_MULTIRES_RESHAPE_H__ */