コード例 #1
0
ファイル: bmo_mesh_conv.c プロジェクト: Ichthyostega/blender
void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
{
	Object *ob   = BMO_slot_ptr_get(op->slots_in,  "object");
	Mesh *me     = BMO_slot_ptr_get(op->slots_in,  "mesh");
	bool set_key = BMO_slot_bool_get(op->slots_in, "use_shapekey");

	BM_mesh_bm_from_me(
	        bm, me, (&(struct BMeshFromMeshParams){
	             .use_shapekey = set_key, .active_shapekey = ob->shapenr,
	        }));
コード例 #2
0
/* keep this operator fast, its used in a modifier */
void bmo_split_edges_exec(BMesh *bm, BMOperator *op)
{
	const int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");

	BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, FALSE);

	if (use_verts) {
		/* this slows down the operation but its ok because the modifier doesn't use */
		BMO_slot_buffer_hflag_enable(bm, op->slots_in, "verts", BM_VERT, BM_ELEM_TAG, FALSE);
	}

	/* this is where everything happens */
	BM_mesh_edgesplit(bm, use_verts, TRUE);

	BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_INTERNAL_TAG);
}