Blender  V3.3
bmo_mesh_convert.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
11 #include "DNA_key_types.h"
12 #include "DNA_mesh_types.h"
13 #include "DNA_object_types.h"
14 
15 #include "BLI_math.h"
16 
17 #include "bmesh.h"
19 
20 #include "BKE_global.h"
21 
23 {
24  Object *ob = BMO_slot_ptr_get(op->slots_in, "object");
25  Mesh *me = BMO_slot_ptr_get(op->slots_in, "mesh");
26  bool set_key = BMO_slot_bool_get(op->slots_in, "use_shapekey");
27 
29  me,
30  (&(struct BMeshFromMeshParams){
31  .use_shapekey = set_key,
32  .active_shapekey = ob->shapenr,
33  }));
34 
35  if (me->key && ob->shapenr > me->key->totkey) {
36  ob->shapenr = me->key->totkey - 1;
37  }
38 }
39 
41 {
42  Object *ob = BMO_slot_ptr_get(op->slots_in, "object");
43  /* Scene *scene = BMO_slot_ptr_get(op, "scene"); */
44  Mesh *me = ob->data;
45 
46  BMO_op_callf(bm, op->flag, "bmesh_to_mesh mesh=%p object=%p", me, ob);
47 }
48 
50 {
51  Mesh *me = BMO_slot_ptr_get(op->slots_in, "mesh");
52  /* Object *ob = BMO_slot_ptr_get(op, "object"); */
53 
54  BM_mesh_bm_to_me(G.main,
55  bm,
56  me,
57  (&(struct BMeshToMeshParams){
58  .calc_object_remap = true,
59  }));
60 }
Object is a sort of wrapper for general info.
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *me, const struct BMeshFromMeshParams *params)
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMeshParams *params)
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
void * BMO_slot_ptr_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
#define G(x, y, z)
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
int totkey
Definition: DNA_key_types.h:91
struct Key * key
short shapenr
void * data