155 static bool pose_has_protected_selected(
Object *ob,
short warn)
173 error(
"Cannot change Proxy protected bones");
214 bool free_depsgraph =
false;
232 free_depsgraph =
false;
236 free_depsgraph =
true;
255 if (free_depsgraph) {
338 ot->
name =
"Calculate Bone Paths";
339 ot->
idname =
"POSE_OT_paths_calculate";
357 "First frame to calculate bone paths on",
366 "Last frame to calculate bone paths on",
375 "Which point on the bones is used when calculating paths");
412 ot->
name =
"Update Bone Paths";
413 ot->
idname =
"POSE_OT_paths_update";
414 ot->
description =
"Recalculate paths for bones that already have them";
430 bool skipped =
false;
450 if (skipped ==
false) {
490 ot->
name =
"Clear Bone Paths";
492 ot->
description =
"Clear path caches for all bones, hold Shift key for selected bones only";
504 ot->
srna,
"only_selected",
false,
"Only Selected",
"Only clear paths from selected bones");
533 ot->
name =
"Update Range from Scene";
534 ot->
idname =
"POSE_OT_paths_range_update";
535 ot->
description =
"Update frame range for motion paths from the Scene's current frame range";
583 ot->
description =
"Flips (and corrects) the axis suffixes of the names of selected bones";
596 "Try to remove right-most dot-number from flipped names.\n"
597 "Warning: May result in incoherent naming in some cases");
634 {0,
"XAXIS", 0,
"X-Axis",
"Left/Right"},
635 {1,
"YAXIS", 0,
"Y-Axis",
"Front/Back"},
636 {2,
"ZAXIS", 0,
"Z-Axis",
"Top/Bottom"},
641 ot->
name =
"Auto-Name by Axis";
642 ot->
idname =
"POSE_OT_autoside_names";
644 "Automatically renames the selected bones according to which side of the target axis they "
691 ot->
name =
"Set Rotation Mode";
692 ot->
idname =
"POSE_OT_rotation_mode_set";
693 ot->
description =
"Set the rotation representation used by selected bones";
744 bool layers[32] = {
false};
757 for (
int i = 0; i < maxLayers; i++) {
774 ot->
name =
"Show All Layers";
775 ot->
idname =
"ARMATURE_OT_layers_show_all";
787 ot->
srna,
"all", 1,
"All Layers",
"Enable all layers or just the first 16 (top row)");
846 ot->
name =
"Change Armature Layers";
847 ot->
idname =
"ARMATURE_OT_armature_layers";
860 ot->
srna,
"layers", 32,
NULL,
"Layer",
"Armature layers to make visible");
869 bool layers[32] = {0};
876 for (bit = 0; bit < 32; bit++) {
877 layers[bit] = (pchan->
bone->
layer & (1u << bit)) != 0;
935 ot->
name =
"Change Bone Layers";
937 ot->
description =
"Change the layers that the selected bones belong to";
949 ot->
srna,
"layers", 32,
NULL,
"Layer",
"Armature layers that bone belongs to");
958 bool layers[32] = {0};
965 for (bit = 0; bit < 32; bit++) {
966 if (ebone->layer & (1u << bit)) {
1011 ot->
name =
"Change Bone Layers";
1012 ot->
idname =
"ARMATURE_OT_bone_layers";
1013 ot->
description =
"Change the layers that the selected bones belong to";
1025 ot->
srna,
"layers", 32,
NULL,
"Layer",
"Armature layers that bone belongs to");
1056 bool changed_multi =
false;
1061 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1072 changed_multi =
true;
1085 ot->
name =
"Hide Selected";
1087 ot->
description =
"Tag selected bones to not be visible in Pose Mode";
1125 bool changed_multi =
false;
1129 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1135 changed_multi =
true;
1148 ot->
name =
"Reveal Selected";
1170 bool changed_multi =
false;
1175 bool changed =
false;
1190 changed_multi =
true;
1205 ot->
idname =
"POSE_OT_quaternions_flip";
1207 "Flip quaternion values to achieve desired rotations, while maintaining the same "
Blender kernel action and pose functionality.
void animviz_free_motionpath(struct bMotionPath *mpath)
struct bMotionPath * animviz_verify_motionpaths(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan)
void BKE_pose_ensure(struct Main *bmain, struct Object *ob, struct bArmature *arm, const bool do_id_user)
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_END
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
#define FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN(_ob, _pchan)
bool bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail)
#define CTX_DATA_BEGIN_WITH_ID(C, Type, instance, member, Type_id, instance_id)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ReportList * CTX_wm_reports(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
#define FOREACH_OBJECT_IN_MODE_END
#define FOREACH_OBJECT_IN_MODE_BEGIN(_view_layer, _v3d, _object_type, _object_mode, _instance)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_pose_armature_get(struct Object *ob)
struct Object ** BKE_object_pose_array_get_unique(struct ViewLayer *view_layer, struct View3D *v3d, unsigned int *r_objects_len)
void BKE_report(ReportList *reports, ReportType type, const char *message)
struct LinkData * BLI_genericNodeN(void *data)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE void negate_v4(float r[4])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define POINTER_FROM_INT(i)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_AS_INT(i)
struct Depsgraph Depsgraph
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_graph_free(Depsgraph *graph)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
#define ID_IS_LINKED(_id)
@ MOTIONPATH_BAKE_HAS_PATHS
Object is a sort of wrapper for general info.
@ ANIMVIZ_CALC_RANGE_FULL
@ ANIMVIZ_CALC_RANGE_CURRENT_FRAME
@ ANIMVIZ_CALC_RANGE_CHANGED
@ POSE_PATH_CALC_RANGE_CURRENT_FRAME
@ POSE_PATH_CALC_RANGE_CHANGED
@ POSE_PATH_CALC_RANGE_FULL
#define ANIM_KS_LOC_ROT_SCALE_ID
struct Object * ED_object_context(const struct bContext *C)
bool ED_operator_posemode(struct bContext *C)
bool ED_operator_posemode_local(struct bContext *C)
bool ED_operator_editarmature(struct bContext *C)
bool ED_operator_posemode_exclusive(struct bContext *C)
check for pose mode (no mixed modes)
Read Guarded memory(de)allocation.
Platform independent time functions.
Utility defines for timing/benchmarks.
#define TIMEIT_START(var)
StructRNA RNA_AnimVizMotionPaths
void animviz_calc_motionpaths(Depsgraph *depsgraph, Main *bmain, Scene *scene, ListBase *targets, eAnimvizCalcRange range, bool restore)
void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
Depsgraph * animviz_depsgraph_build(Main *bmain, Scene *scene, ViewLayer *view_layer, ListBase *targets)
int bone_looper(struct Object *ob, struct Bone *bone, void *data, int(*bone_func)(struct Object *, struct Bone *, void *))
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
void ED_armature_bones_flip_names(Main *bmain, bArmature *arm, ListBase *bones_names, const bool do_strip_numbers)
void ED_armature_edit_refresh_layer_used(bArmature *arm)
const Depsgraph * depsgraph
bool ED_autokeyframe_pchan(bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks)
KeyingSet * ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[])
void(* MEM_freeN)(void *vmemh)
static void error(const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static int pose_clear_paths_exec(bContext *C, wmOperator *op)
static int pose_update_paths_range_exec(bContext *C, wmOperator *UNUSED(op))
void POSE_OT_hide(wmOperatorType *ot)
void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob, ePosePathCalcRange range)
void POSE_OT_paths_range_update(wmOperatorType *ot)
static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int armature_bone_layers_exec(bContext *C, wmOperator *op)
static int pose_autoside_names_exec(bContext *C, wmOperator *op)
void POSE_OT_quaternions_flip(wmOperatorType *ot)
void ARMATURE_OT_bone_layers(wmOperatorType *ot)
void POSE_OT_paths_update(wmOperatorType *ot)
static int armature_bone_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool ED_object_posemode_enter(bContext *C, Object *ob)
static int pose_bone_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bArmature * armature_layers_get_data(Object **ob)
static void ED_pose_clear_paths(Object *ob, bool only_selected)
static int pose_bone_layers_exec(bContext *C, wmOperator *op)
static int show_pose_bone_cb(Object *ob, Bone *bone, void *data)
void ARMATURE_OT_layers_show_all(wmOperatorType *ot)
void POSE_OT_reveal(wmOperatorType *ot)
static eAnimvizCalcRange pose_path_convert_range(ePosePathCalcRange range)
Object * ED_pose_object_from_context(bContext *C)
static int hide_pose_bone_fn(Object *ob, Bone *bone, void *ptr)
bool ED_object_posemode_enter_ex(struct Main *bmain, Object *ob)
void POSE_OT_flip_names(wmOperatorType *ot)
void POSE_OT_paths_clear(wmOperatorType *ot)
static int pose_reveal_exec(bContext *C, wmOperator *op)
bool ED_object_posemode_exit_ex(struct Main *bmain, Object *ob)
static bool armature_layers_poll(bContext *C)
static int pose_flip_quats_exec(bContext *C, wmOperator *UNUSED(op))
static int armature_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void POSE_OT_autoside_names(wmOperatorType *ot)
static int pose_calculate_paths_exec(bContext *C, wmOperator *op)
void POSE_OT_paths_calculate(wmOperatorType *ot)
static int pose_flip_names_exec(bContext *C, wmOperator *op)
static int pose_clear_paths_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void POSE_OT_rotation_mode_set(wmOperatorType *ot)
static int pose_bone_rotmode_exec(bContext *C, wmOperator *op)
static int pose_hide_exec(bContext *C, wmOperator *op)
static int pose_update_paths_exec(bContext *C, wmOperator *UNUSED(op))
static int pose_armature_layers_showall_exec(bContext *C, wmOperator *op)
static int armature_layers_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_armature_layers(wmOperatorType *ot)
static bool pose_update_paths_poll(bContext *C)
bool ED_object_posemode_exit(bContext *C, Object *ob)
void POSE_OT_bone_layers(wmOperatorType *ot)
void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const bool *values)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const EnumPropertyItem rna_enum_motionpath_bake_location_items[]
PropertyRNA * RNA_def_boolean_layer_member(StructOrFunctionRNA *cont_, const char *identifier, int len, bool *default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_object_rotation_mode_items[]
unsigned int layer_protected
struct bPoseChannel * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)