Clear skin root flag on new vertices created by extruding.
Skin modifier documentation: http://wiki.blender.org/index.php/User:Nicholasbishop/SkinModifier
This commit is contained in:
@@ -26,9 +26,13 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "DNA_meshdata_types.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_array.h"
|
||||
|
||||
#include "BKE_customdata.h"
|
||||
|
||||
#include "bmesh.h"
|
||||
|
||||
#include "intern/bmesh_operators_private.h" /* own include */
|
||||
@@ -167,6 +171,16 @@ static void bm_extrude_copy_face_loop_attributes(BMesh *bm, BMFace *f, BMEdge *e
|
||||
BM_elem_attrs_copy(bm, bm, l_src_1, l_dst_b);
|
||||
}
|
||||
|
||||
/* Disable the skin root flag on the input vert, assumes that the vert
|
||||
data includes an CD_MVERT_SKIN layer */
|
||||
static void bm_extrude_disable_skin_root(BMesh *bm, BMVert *v)
|
||||
{
|
||||
MVertSkin *vs;
|
||||
|
||||
vs = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_MVERT_SKIN);
|
||||
vs->flag &= ~MVERT_SKIN_ROOT;
|
||||
}
|
||||
|
||||
void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
|
||||
{
|
||||
BMOIter siter;
|
||||
@@ -184,6 +198,13 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
|
||||
BMO_op_initf(bm, &dupeop, "dupe geom=%fve", EXT_INPUT);
|
||||
BMO_op_exec(bm, &dupeop);
|
||||
|
||||
/* disable root flag on all new skin nodes */
|
||||
if (CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN)) {
|
||||
BMO_ITER(v1, &siter, bm, &dupeop, "newout", BM_VERT) {
|
||||
bm_extrude_disable_skin_root(bm, v1);
|
||||
}
|
||||
}
|
||||
|
||||
for (e = BMO_iter_new(&siter, bm, &dupeop, "boundarymap", 0); e; e = BMO_iter_step(&siter)) {
|
||||
e2 = BMO_iter_map_value(&siter);
|
||||
e2 = *(BMEdge **)e2;
|
||||
@@ -224,9 +245,12 @@ void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op)
|
||||
BMOIter siter;
|
||||
BMVert *v, *dupev;
|
||||
BMEdge *e;
|
||||
const int has_vskin = CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN);
|
||||
|
||||
for (v = BMO_iter_new(&siter, bm, op, "verts", BM_VERT); v; v = BMO_iter_step(&siter)) {
|
||||
dupev = BM_vert_create(bm, v->co, v);
|
||||
if (has_vskin)
|
||||
bm_extrude_disable_skin_root(bm, v);
|
||||
|
||||
e = BM_edge_create(bm, v, dupev, NULL, FALSE);
|
||||
|
||||
@@ -324,6 +348,13 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
|
||||
BMO_slot_copy(op, &dupeop, "edgefacein", "geom");
|
||||
BMO_op_exec(bm, &dupeop);
|
||||
|
||||
/* disable root flag on all new skin nodes */
|
||||
if (CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN)) {
|
||||
BMO_ITER(v, &siter, bm, &dupeop, "newout", BM_VERT) {
|
||||
bm_extrude_disable_skin_root(bm, v);
|
||||
}
|
||||
}
|
||||
|
||||
if (bm->act_face && BMO_elem_flag_test(bm, bm->act_face, EXT_INPUT))
|
||||
bm->act_face = BMO_slot_map_ptr_get(bm, &dupeop, "facemap", bm->act_face);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user