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:
authorCampbell Barton <ideasman42@gmail.com>2009-12-15 02:35:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-12-15 02:35:13 +0300
commit9633d198fbe4ca0f27b8d955ccd29d473364ce6e (patch)
tree7aaa656ae05133daa3451beaed2a3dd26e4c0f0b /source/blender/editors/mesh/editmesh_mods.c
parent6d59a84732e818e8574e67d6f357dbb0317c45fd (diff)
solidify from 2.4x (ported from python to C)
- shell_angle_to_dist() was using degrees
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mods.c')
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 30dc6114097..1d8b2b05592 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -4542,3 +4542,46 @@ void MESH_OT_flip_normals(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
+
+static int solidify_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ Object *obedit= CTX_data_edit_object(C);
+ EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data));
+ float nor[3] = {0,0,1};
+
+ float thickness= RNA_float_get(op->ptr, "thickness");
+
+ extrudeflag(obedit, em, SELECT, nor);
+ EM_make_hq_normals(em);
+ EM_solidify(em, thickness);
+
+
+ /* update vertex normals too */
+ recalc_editnormals(em);
+
+ BKE_mesh_end_editmesh(obedit->data, em);
+
+ DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+
+ return OPERATOR_FINISHED;
+}
+
+
+void MESH_OT_solidify(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Solidify";
+ ot->description= "Make the mesh solid.";
+ ot->idname= "MESH_OT_solidify";
+
+ /* api callbacks */
+ ot->exec= solidify_exec;
+ ot->poll= ED_operator_editmesh;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_float(ot->srna, "thickness", 0.1f, -FLT_MAX, FLT_MAX, "thickness", "", -10.0f, 10.0f);
+}