diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-09-03 21:45:04 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-09-03 21:45:04 +0400 |
commit | 9250ab0619387d80964c64738334e437a92c25cf (patch) | |
tree | 8ff7ab234a0b2b78060a7780f3afa98427985852 /source | |
parent | 92395bb93cf862c5d19a40942ba3c8fbc94de962 (diff) |
2.5/Multires:
* Added back multires delete higher levels (new operator + button)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 28 | ||||
-rw-r--r-- | source/blender/editors/object/object_ops.c | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 27f80186bf9..8eaa388cdf0 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -109,6 +109,7 @@ void OBJECT_OT_modifier_apply(struct wmOperatorType *ot); void OBJECT_OT_modifier_convert(struct wmOperatorType *ot); void OBJECT_OT_modifier_copy(struct wmOperatorType *ot); void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot); +void OBJECT_OT_multires_higher_levels_delete(struct wmOperatorType *ot); void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot); void OBJECT_OT_hook_reset(struct wmOperatorType *ot); void OBJECT_OT_hook_recenter(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 0b8fedd2eda..f9e2ac2f4de 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -676,6 +676,34 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/************* multires delete higher levels operator ****************/ + +static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier); + Object *ob= ptr.id.data; + MultiresModifierData *mmd= ptr.data; + + if(mmd) { + multiresModifier_del_levels(mmd, ob, 1); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + } + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot) +{ + ot->name= "Delete Higher Levels"; + ot->idname= "OBJECT_OT_multires_higher_levels_delete"; + ot->poll= ED_operator_object_active; + + ot->exec= multires_higher_levels_delete_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /****************** multires subdivide operator *********************/ static int multires_subdivide_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 5e90ed85625..09a27e9e613 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -119,6 +119,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_convert); WM_operatortype_append(OBJECT_OT_modifier_copy); WM_operatortype_append(OBJECT_OT_multires_subdivide); + WM_operatortype_append(OBJECT_OT_multires_higher_levels_delete); WM_operatortype_append(OBJECT_OT_meshdeform_bind); WM_operatortype_append(OBJECT_OT_hook_reset); WM_operatortype_append(OBJECT_OT_hook_recenter); |