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>2011-11-23 19:44:20 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-23 19:44:20 +0400
commitf48cc83b3e7327565c17fc18f42881099941b4bf (patch)
tree3891c78d813b0d753023db03c452abb7a46dfba7 /source/blender/editors/object/object_relations.c
parent0f3b1d23de1177e10628eaeb5dded6c172175c26 (diff)
Fix #29367: Vertex parent regression
Regression was introduced in svn rev40343. It was caused by re-creating EditMesh structure which was needed to solve issues with parenting to vertices after topology changes. This would also erase derivedMesh. Problem reported now is caused by missing derivedMesh which is used to solve parenting and apply inverted matrix on ob->parentin, so parented object used to stay at exactly the same position it used to stay before parenting. Not very nice solving of this issue: re-create derivedMesh after re-creating EditMesh when parenting. Nicer solution would require bigger changes and probably ful lrefactor of this tools.
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r--source/blender/editors/object/object_relations.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 94e2f0aae00..3a4cd6135cf 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -61,6 +61,7 @@
#include "BKE_constraint.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
+#include "BKE_DerivedMesh.h"
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_fcurve.h"
@@ -128,7 +129,11 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
load_editMesh(scene, obedit);
make_editMesh(scene, obedit);
- em = BKE_mesh_get_editmesh(me);
+ em= BKE_mesh_get_editmesh(me);
+
+ /* derivedMesh might be needed for solving parenting,
+ so re-create it here */
+ makeDerivedMesh(scene, obedit, em, CD_MASK_BAREMESH);
eve= em->verts.first;
while(eve) {