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/blender/editors/object/object_modifier.c | |
parent | 92395bb93cf862c5d19a40942ba3c8fbc94de962 (diff) |
2.5/Multires:
* Added back multires delete higher levels (new operator + button)
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 28 |
1 files changed, 28 insertions, 0 deletions
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) |