diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
commit | dfe2f8dc03267e041102837e92f547fb04881510 (patch) | |
tree | d9582c4667ce5b9e39e2adce40832aa4f44b4fe7 /source/blender/editors/object/object_modifier.c | |
parent | d7e08f2d33207fdf76b1b597ef0de9dec26e3987 (diff) | |
parent | 00e46ef739cf2bfddb8805af056aa59fd3b3c71c (diff) |
Merged changes in the trunk up to revision 28247.
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index a43f3de9b14..18cc0adab8a 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -389,32 +389,44 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, ModifierData *md) { + ModifierTypeInfo *mti= modifierType_getInfo(md->type); + + if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md, 0))) { + BKE_report(reports, RPT_ERROR, "Modifier is disabled, skipping apply"); + return 0; + } + if (ob->type==OB_MESH) { DerivedMesh *dm; Mesh *me = ob->data; + MultiresModifierData *mmd= find_multires_modifier(ob); + if( me->key) { BKE_report(reports, RPT_ERROR, "Modifier cannot be applied to Mesh with Shape Keys"); return 0; } - + mesh_pmv_off(ob, me); - + /* Multires: ensure that recent sculpting is applied */ if(md->type == eModifierType_Multires) multires_force_update(ob); - - dm = mesh_create_derived_for_modifier(scene, ob, md); - if (!dm) { - BKE_report(reports, RPT_ERROR, "Modifier is disabled or returned error, skipping apply"); - return 0; + + if (mmd && mti->type==eModifierTypeType_OnlyDeform) { + multiresModifier_reshapeFromDeformMod (mmd, ob, md); + } else { + dm = mesh_create_derived_for_modifier(scene, ob, md); + if (!dm) { + BKE_report(reports, RPT_ERROR, "Modifier is returned error, skipping apply"); + return 0; + } + + DM_to_mesh(dm, me); + + dm->release(dm); } - - DM_to_mesh(dm, me); - - dm->release(dm); } else if (ELEM(ob->type, OB_CURVE, OB_SURF)) { - ModifierTypeInfo *mti = modifierType_getInfo(md->type); Curve *cu; int numVerts; float (*vertexCos)[3]; @@ -427,11 +439,6 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, cu = ob->data; BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tesselated/bevel vertices"); - if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md, 0))) { - BKE_report(reports, RPT_ERROR, "Modifier is disabled, skipping apply"); - return 0; - } - vertexCos = curve_getVertexCos(cu, &cu->nurb, &numVerts); mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0, 0); curve_applyVertexCos(cu, &cu->nurb, vertexCos); @@ -829,11 +836,6 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) Object *ob= ptr.id.data, *secondob= NULL; MultiresModifierData *mmd= ptr.data; - if(ob->derivedFinal == NULL || ob->derivedFinal->type != DM_TYPE_CCGDM) { - BKE_report(op->reports, RPT_ERROR, "Active objects multires is disabled, can't reshape multires data."); - return OPERATOR_CANCELLED; - } - CTX_DATA_BEGIN(C, Object*, selob, selected_editable_objects) { if(selob->type == OB_MESH && selob != ob) { secondob= selob; |