97 bContext *
C,
Object *ob,
int *r_totmirr,
int *r_totfail,
bool use_topology)
101 int totmirr = 0, totfail = 0;
103 *r_totmirr = *r_totfail = 0;
127 fp1 = ((
float *)kb->
data) +
i1 * 3;
133 if (tag_elem[
i1] == 0 && tag_elem[i2] == 0) {
134 fp1 = ((
float *)kb->
data) +
i1 * 3;
135 fp2 = ((
float *)kb->
data) + i2 * 3;
146 tag_elem[
i1] = tag_elem[i2] = 1;
161 const int pntsu_half = (lt->
pntsu / 2) + (lt->
pntsu % 2);
170 for (u = 0; u < pntsu_half; u++) {
171 int u_inv = (lt->
pntsu - 1) - u;
175 fp1 = ((
float *)kb->
data) +
i1 * 3;
183 fp1 = ((
float *)kb->
data) +
i1 * 3;
184 fp2 = ((
float *)kb->
data) + i2 * 3;
201 *r_totmirr = totmirr;
202 *r_totfail = totfail;
272 ot->
name =
"Add Shape Key";
273 ot->
idname =
"OBJECT_OT_shape_key_add";
288 "Create the new shape key from the existing mix of keys");
301 bool changed =
false;
332 if (
STREQ(prop_id,
"apply_mix") && !do_all) {
346 TIP_(
"Apply current visible shape to the object data, and delete all shape keys"));
355 ot->
name =
"Remove Shape Key";
356 ot->
idname =
"OBJECT_OT_shape_key_remove";
374 "Apply current mix of shape keys to the geometry before removing them");
406 ot->
name =
"Clear Shape Keys";
408 ot->
idname =
"OBJECT_OT_shape_key_clear";
444 ot->
name =
"Re-Time Shape Keys";
445 ot->
description =
"Resets the timing for absolute shape keys";
446 ot->
idname =
"OBJECT_OT_shape_key_retime";
465 int totmirr = 0, totfail = 0;
480 ot->
name =
"Mirror Shape Key";
481 ot->
idname =
"OBJECT_OT_shape_key_mirror";
482 ot->
description =
"Mirror the current shape key along the local X axis";
497 "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
519 const int totkey = key->
totkey;
520 const int act_index = ob->
shapenr - 1;
529 new_index = totkey - 1;
534 new_index = (totkey + act_index +
type) % totkey;
558 ot->
name =
"Move Shape Key";
559 ot->
idname =
"OBJECT_OT_shape_key_move";
560 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)
float * BKE_key_evaluate_object_ex(struct Object *ob, int *r_totelem, float *arr, size_t arr_size, struct ID *obdata)
struct Key * BKE_key_from_object(struct Object *ob)
struct KeyBlock * BKE_keyblock_from_object(struct Object *ob)
int BKE_lattice_index_from_uvw(struct Lattice *lt, int u, int v, int w)
General operations, lookup, etc. for blender objects.
struct KeyBlock * BKE_object_shapekey_insert(struct Main *bmain, struct Object *ob, const char *name, 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])
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
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.
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)
int mesh_get_x_mirror_vert(struct Object *ob, struct Mesh *me_eval, int index, bool use_topology)
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 char * shape_key_remove_get_description(bContext *UNUSED(C), wmOperatorType *UNUSED(ot), PointerRNA *ptr)
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)
static bool shape_key_remove_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
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))
const char * RNA_property_identifier(const PropertyRNA *prop)
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)
char *(* get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *)
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
bool(* poll_property)(const struct bContext *C, struct wmOperator *op, const PropertyRNA *prop) 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)