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:
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r--source/blender/editors/object/object_modifier.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 04bcc4e3717..68b8c4a6a14 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -46,6 +46,7 @@
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
+#include "BKE_multires.h"
#include "BKE_report.h"
#include "BKE_object.h"
#include "BKE_particle.h"
@@ -367,6 +368,32 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot)
RNA_def_enum(ot->srna, "type", modifier_type_items, 0, "Type", "");
}
+static int multires_subdivide_exec(bContext *C, wmOperator *op)
+{
+ Object *ob = CTX_data_active_object(C);
+ MultiresModifierData *mmd = find_multires_modifier(ob);
+
+ if(mmd) {
+ multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple);
+ WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
+{
+ ot->name= "Multires Subdivide";
+ ot->description= "Add a new level of subdivision.";
+ ot->idname= "OBJECT_OT_multires_subdivide";
+ ot->poll= ED_operator_object_active;
+
+ ot->exec= multires_subdivide_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
#if 0
static void modifiers_add(void *ob_v, int type)
{