108 bContext *
C,
Object *ob,
int *r_totmirr,
int *r_totfail,
bool use_topology)
112 int totmirr = 0, totfail = 0;
114 *r_totmirr = *r_totfail = 0;
138 fp1 = ((
float *)kb->
data) +
i1 * 3;
144 if (tag_elem[
i1] == 0 && tag_elem[i2] == 0) {
145 fp1 = ((
float *)kb->
data) +
i1 * 3;
146 fp2 = ((
float *)kb->
data) + i2 * 3;
157 tag_elem[
i1] = tag_elem[i2] = 1;
172 const int pntsu_half = (lt->
pntsu / 2) + (lt->
pntsu % 2);
181 for (u = 0; u < pntsu_half; u++) {
182 int u_inv = (lt->
pntsu - 1) - u;
186 fp1 = ((
float *)kb->
data) +
i1 * 3;
194 fp1 = ((
float *)kb->
data) +
i1 * 3;
195 fp2 = ((
float *)kb->
data) + i2 * 3;
212 *r_totmirr = totmirr;
213 *r_totfail = totfail;
283 ot->
name =
"Add Shape Key";
284 ot->
idname =
"OBJECT_OT_shape_key_add";
299 "Create the new shape key from the existing mix of keys");
312 bool changed =
false;
334 ot->
name =
"Remove Shape Key";
335 ot->
idname =
"OBJECT_OT_shape_key_remove";
378 ot->
name =
"Clear Shape Keys";
380 ot->
idname =
"OBJECT_OT_shape_key_clear";
416 ot->
name =
"Re-Time Shape Keys";
417 ot->
description =
"Resets the timing for absolute shape keys";
418 ot->
idname =
"OBJECT_OT_shape_key_retime";
437 int totmirr = 0, totfail = 0;
452 ot->
name =
"Mirror Shape Key";
453 ot->
idname =
"OBJECT_OT_shape_key_mirror";
454 ot->
description =
"Mirror the current shape key along the local X axis";
469 "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
491 const int totkey = key->
totkey;
492 const int act_index = ob->
shapenr - 1;
501 new_index = totkey - 1;
506 new_index = (totkey + act_index +
type) % totkey;
530 ot->
name =
"Move Shape Key";
531 ot->
idname =
"OBJECT_OT_shape_key_move";
532 ot->
description =
"Move the active shape key up/down in the list";
struct Main * CTX_data_main(const bContext *C)
bool BKE_keyblock_move(struct Object *ob, int org_index, int new_index)
struct Key * BKE_key_from_object(const struct Object *ob)
struct KeyBlock * BKE_keyblock_from_object(struct Object *ob)
int BKE_lattice_index_from_uvw(struct Lattice *lt, const int u, const int v, const int w)
General operations, lookup, etc. for blender objects.
struct KeyBlock * BKE_object_shapekey_insert(struct Main *bmain, struct Object *ob, const char *name, const bool from_mix)
bool BKE_object_shapekey_remove(struct Main *bmain, struct Object *ob, struct KeyBlock *kb)
bool BKE_object_shapekey_free(struct Main *bmain, struct Object *ob)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object is a sort of wrapper for general info.
int mesh_get_x_mirror_vert(struct Object *ob, struct Mesh *me_eval, int index, const bool use_topology)
void ED_mesh_report_mirror(struct wmOperator *op, int totmirr, int totfail)
void ED_mesh_mirror_spatial_table_begin(struct Object *ob, struct BMEditMesh *em, struct Mesh *me_eval)
void ED_mesh_mirror_spatial_table_end(struct Object *ob)
struct Object * ED_object_context(const struct bContext *C)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint i1
Read Guarded memory(de)allocation.
return(oflags[bm->toolflag_index].f &oflag) !=0
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static bool shape_key_move_poll(bContext *C)
static bool object_shape_key_mirror(bContext *C, Object *ob, int *r_totmirr, int *r_totfail, bool use_topology)
void OBJECT_OT_shape_key_remove(wmOperatorType *ot)
static int shape_key_remove_exec(bContext *C, wmOperator *op)
void OBJECT_OT_shape_key_retime(wmOperatorType *ot)
static void ED_object_shape_key_add(bContext *C, Object *ob, const bool from_mix)
static bool shape_key_mode_exists_poll(bContext *C)
static int shape_key_retime_exec(bContext *C, wmOperator *UNUSED(op))
static bool shape_key_mode_poll(bContext *C)
void OBJECT_OT_shape_key_mirror(wmOperatorType *ot)
void OBJECT_OT_shape_key_add(wmOperatorType *ot)
static int shape_key_add_exec(bContext *C, wmOperator *op)
static bool shape_key_poll(bContext *C)
static int shape_key_mirror_exec(bContext *C, wmOperator *op)
void OBJECT_OT_shape_key_move(wmOperatorType *ot)
static bool object_shapekey_remove(Main *bmain, Object *ob)
static int shape_key_move_exec(bContext *C, wmOperator *op)
void OBJECT_OT_shape_key_clear(wmOperatorType *ot)
static int shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_event_add_notifier(const bContext *C, uint type, void *reference)