diff options
author | Ben Batt <benbatt@gmail.com> | 2006-09-08 05:05:57 +0400 |
---|---|---|
committer | Ben Batt <benbatt@gmail.com> | 2006-09-08 05:05:57 +0400 |
commit | 824fbff02ce7a7b39f80e3c582ad5d24919d4347 (patch) | |
tree | 32f213abb1158eaeaad71481787e84d834a5a77e | |
parent | 4b5badf9cb1f8cda8ab4fe573a710180114c4370 (diff) |
Fix to enable copying of the vertex group field for the Curve, Lattice,
Armature and Hook modifiers, and the flag field for the Mirror modifier. These
modifiers should all be copied correctly now.
This fix also means that converting modifiers to mesh with Alt-C now works
correctly (the convertmenu function copies the modifers before applying them,
so it wasn't always giving correct results for the above modifiers before).
The convertmenu function has also been changed to use DM_to_mesh instead of
converting to DispListMesh and using displistmesh_to_mesh, which means that
extra mesh data such as dverts is preserved.
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 11 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 0a9fcd7d1c1..bf8d8218e59 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -179,6 +179,7 @@ static void curveModifier_copyData(ModifierData *md, ModifierData *target) CurveModifierData *tcmd = (CurveModifierData*) target; tcmd->object = cmd->object; + strncpy(tcmd->name, cmd->name, 32); } static int curveModifier_isDisabled(ModifierData *md) @@ -243,6 +244,7 @@ static void latticeModifier_copyData(ModifierData *md, ModifierData *target) LatticeModifierData *tlmd = (LatticeModifierData*) target; tlmd->object = lmd->object; + strncpy(tlmd->name, lmd->name, 32); } static int latticeModifier_isDisabled(ModifierData *md) @@ -1076,6 +1078,7 @@ static void mirrorModifier_copyData(ModifierData *md, ModifierData *target) MirrorModifierData *tmmd = (MirrorModifierData*) target; tmmd->axis = mmd->axis; + tmmd->flag = mmd->flag; tmmd->tolerance = mmd->tolerance; } @@ -1258,10 +1261,10 @@ static void edgesplitModifier_initData(ModifierData *md) static void edgesplitModifier_copyData(ModifierData *md, ModifierData *target) { EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md; - EdgeSplitModifierData *tamd = (EdgeSplitModifierData*) target; + EdgeSplitModifierData *temd = (EdgeSplitModifierData*) target; - tamd->split_angle = emd->split_angle; - tamd->flags = emd->flags; + temd->split_angle = emd->split_angle; + temd->flags = emd->flags; } typedef struct SmoothMesh { @@ -3055,6 +3058,7 @@ static void armatureModifier_copyData(ModifierData *md, ModifierData *target) tamd->object = amd->object; tamd->deformflag = amd->deformflag; + strncpy(tamd->defgrp_name, amd->defgrp_name, 32); } static int armatureModifier_isDisabled(ModifierData *md) @@ -3134,6 +3138,7 @@ static void hookModifier_copyData(ModifierData *md, ModifierData *target) thmd->totindex = hmd->totindex; thmd->indexar = MEM_dupallocN(hmd->indexar); memcpy(thmd->parentinv, hmd->parentinv, sizeof(hmd->parentinv)); + strncpy(thmd->name, hmd->name, 32); } static void hookModifier_freeData(ModifierData *md) diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index ea8305cde95..753353b24ff 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2359,7 +2359,6 @@ void convertmenu(void) if(ob->flag & OB_DONE); else if(ob->type==OB_MESH && ob->modifiers.first) { /* converting a mesh with no modifiers causes a segfault */ - DispListMesh *dlm; DerivedMesh *dm; int needsfree=0; @@ -2390,8 +2389,8 @@ void convertmenu(void) dm= mesh_get_derived_final(ob1, &needsfree); //dm= mesh_create_derived_no_deform(ob1, NULL); this was called original (instead of get_derived). man o man why! (ton) - dlm= dm->convertToDispListMesh(dm, 0); - displistmesh_to_mesh(dlm, ob1->data); + DM_to_mesh(dm, ob1->data); + if(needsfree) dm->release(dm); object_free_modifiers(ob1); /* after derivedmesh calls! */ |