Blender  V3.3
armature_ops.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2009 Blender Foundation. All rights reserved. */
3 
8 #include "RNA_access.h"
9 
10 #include "WM_api.h"
11 #include "WM_types.h"
12 
13 #include "ED_armature.h"
14 #include "ED_screen.h"
15 
16 #include "armature_intern.h"
17 
18 /* ************************** registration **********************************/
19 
21 {
22  /* Both operators `ARMATURE_OT_*` and `POSE_OT_*` are registered here. */
23 
24  /* EDIT ARMATURE */
26 
32 
35 
45 
57 
60 
64 
65  /* POSE */
68 
71 
77 
80 
82 
90 
99 
104 
107 
109 
111 
113 
115 
116  /* POSELIB */
121 
126 
129 
131 
132  /* POSE SLIDING */
139 }
140 
142 {
144  wmOperatorTypeMacro *otmacro;
145 
147  "ARMATURE_OT_duplicate_move",
148  "Duplicate",
149  "Make copies of the selected bones within the same armature and move them",
151  WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
152  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
153  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
154 
155  ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move",
156  "Extrude",
157  "Create new bones from the selected joints and move them",
159  otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
160  RNA_boolean_set(otmacro->ptr, "forked", false);
161  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
162  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
163 
164  /* XXX would it be nicer to just be able to have standard extrude_move,
165  * but set the forked property separate?
166  * that would require fixing a properties bug T19733. */
167  ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked",
168  "Extrude Forked",
169  "Create new bones from the selected joints and move them",
171  otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
172  RNA_boolean_set(otmacro->ptr, "forked", true);
173  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
174  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
175 }
176 
178 {
179  wmKeyMap *keymap;
180 
181  /* Armature ------------------------ */
182  /* only set in editmode armature, by space_view3d listener */
183  keymap = WM_keymap_ensure(keyconf, "Armature", 0, 0);
184  keymap->poll = ED_operator_editarmature;
185 
186  /* Pose ------------------------ */
187  /* only set in posemode, by space_view3d listener */
188  keymap = WM_keymap_ensure(keyconf, "Pose", 0, 0);
189  keymap->poll = ED_operator_posemode;
190 }
bool ED_operator_posemode(struct bContext *C)
Definition: screen_ops.c:530
bool ED_operator_editarmature(struct bContext *C)
Definition: screen_ops.c:466
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
void ARMATURE_OT_subdivide(wmOperatorType *ot)
void ARMATURE_OT_click_extrude(wmOperatorType *ot)
Definition: armature_add.c:244
void ARMATURE_OT_duplicate(wmOperatorType *ot)
void ARMATURE_OT_symmetrize(wmOperatorType *ot)
void ARMATURE_OT_extrude(wmOperatorType *ot)
void ARMATURE_OT_bone_primitive_add(wmOperatorType *ot)
void ARMATURE_OT_hide(wmOperatorType *ot)
void ARMATURE_OT_delete(wmOperatorType *ot)
void ARMATURE_OT_roll_clear(wmOperatorType *ot)
void ARMATURE_OT_fill(wmOperatorType *ot)
void ARMATURE_OT_align(wmOperatorType *ot)
void ARMATURE_OT_calculate_roll(wmOperatorType *ot)
void ARMATURE_OT_switch_direction(wmOperatorType *ot)
void ARMATURE_OT_dissolve(wmOperatorType *ot)
void ARMATURE_OT_reveal(wmOperatorType *ot)
void ARMATURE_OT_split(wmOperatorType *ot)
void POSELIB_OT_unlink(struct wmOperatorType *ot)
Definition: pose_lib.c:270
void POSE_OT_relax_rest(struct wmOperatorType *ot)
Definition: pose_slide.c:1618
void ARMATURE_OT_select_less(struct wmOperatorType *ot)
void ARMATURE_OT_select_all(struct wmOperatorType *ot)
void POSE_OT_select_hierarchy(struct wmOperatorType *ot)
Definition: pose_select.c:810
void ARMATURE_OT_shortest_path_pick(struct wmOperatorType *ot)
void ARMATURE_OT_select_mirror(struct wmOperatorType *ot)
void ARMATURE_OT_separate(struct wmOperatorType *ot)
void POSE_OT_group_unassign(struct wmOperatorType *ot)
Definition: pose_group.c:275
void POSE_OT_reveal(struct wmOperatorType *ot)
Definition: pose_edit.c:1093
void ARMATURE_OT_parent_set(struct wmOperatorType *ot)
void POSE_OT_scale_clear(struct wmOperatorType *ot)
void POSE_OT_group_deselect(struct wmOperatorType *ot)
Definition: pose_group.c:522
void POSE_OT_group_sort(struct wmOperatorType *ot)
Definition: pose_group.c:431
void POSE_OT_quaternions_flip(struct wmOperatorType *ot)
Definition: pose_edit.c:1149
void POSE_OT_autoside_names(struct wmOperatorType *ot)
Definition: pose_edit.c:583
void POSELIB_OT_apply_pose(struct wmOperatorType *ot)
Definition: pose_lib.c:1876
void POSE_OT_relax(struct wmOperatorType *ot)
Definition: pose_slide.c:1505
void POSELIB_OT_pose_rename(struct wmOperatorType *ot)
Definition: pose_lib.c:734
void POSELIB_OT_browse_interactive(struct wmOperatorType *ot)
Definition: pose_lib.c:1829
void ARMATURE_OT_select_more(struct wmOperatorType *ot)
void POSE_OT_group_move(struct wmOperatorType *ot)
Definition: pose_group.c:334
void POSE_OT_paths_calculate(struct wmOperatorType *ot)
Definition: pose_edit.c:286
void POSE_OT_group_remove(struct wmOperatorType *ot)
Definition: pose_group.c:110
void POSELIB_OT_pose_add(struct wmOperatorType *ot)
Definition: pose_lib.c:522
void POSE_OT_copy(struct wmOperatorType *ot)
void POSE_OT_rot_clear(struct wmOperatorType *ot)
void POSELIB_OT_apply_pose_asset(struct wmOperatorType *ot)
Definition: pose_lib_2.c:549
void POSELIB_OT_new(struct wmOperatorType *ot)
Definition: pose_lib.c:232
void POSE_OT_select_linked(struct wmOperatorType *ot)
Definition: pose_select.c:557
void POSE_OT_hide(struct wmOperatorType *ot)
Definition: pose_edit.c:1030
void ARMATURE_OT_select_linked(struct wmOperatorType *ot)
void POSE_OT_select_mirror(struct wmOperatorType *ot)
Definition: pose_select.c:1266
void POSE_OT_group_assign(struct wmOperatorType *ot)
Definition: pose_group.c:226
void POSE_OT_flip_names(struct wmOperatorType *ot)
Definition: pose_edit.c:530
void ARMATURE_OT_flip_names(struct wmOperatorType *ot)
void POSE_OT_select_grouped(struct wmOperatorType *ot)
Definition: pose_select.c:1157
void POSE_OT_select_linked_pick(struct wmOperatorType *ot)
Definition: pose_select.c:490
void POSE_OT_push_rest(struct wmOperatorType *ot)
Definition: pose_slide.c:1561
void POSE_OT_visual_transform_apply(struct wmOperatorType *ot)
void POSE_OT_paths_range_update(struct wmOperatorType *ot)
Definition: pose_edit.c:482
void ARMATURE_OT_parent_clear(struct wmOperatorType *ot)
void ARMATURE_OT_select_linked_pick(struct wmOperatorType *ot)
void POSE_OT_select_all(struct wmOperatorType *ot)
Definition: pose_select.c:611
void POSE_OT_push(struct wmOperatorType *ot)
Definition: pose_slide.c:1448
void POSELIB_OT_pose_move(struct wmOperatorType *ot)
Definition: pose_lib.c:812
void ARMATURE_OT_select_hierarchy(struct wmOperatorType *ot)
void POSE_OT_bone_layers(struct wmOperatorType *ot)
Definition: pose_edit.c:884
void POSE_OT_blend_to_neighbors(struct wmOperatorType *ot)
Definition: pose_slide.c:1725
void POSE_OT_propagate(struct wmOperatorType *ot)
Definition: pose_slide.c:2094
void POSE_OT_rotation_mode_set(struct wmOperatorType *ot)
Definition: pose_edit.c:640
void POSE_OT_user_transforms_clear(struct wmOperatorType *ot)
void POSELIB_OT_pose_remove(struct wmOperatorType *ot)
Definition: pose_lib.c:643
void POSELIB_OT_action_sanitize(struct wmOperatorType *ot)
Definition: pose_lib.c:357
void POSE_OT_paths_update(struct wmOperatorType *ot)
Definition: pose_edit.c:361
void ARMATURE_OT_armature_layers(struct wmOperatorType *ot)
Definition: pose_edit.c:795
void POSE_OT_breakdown(struct wmOperatorType *ot)
Definition: pose_slide.c:1675
void POSE_OT_select_constraint_target(struct wmOperatorType *ot)
Definition: pose_select.c:718
void ARMATURE_OT_bone_layers(struct wmOperatorType *ot)
Definition: pose_edit.c:960
void POSE_OT_select_parent(struct wmOperatorType *ot)
Definition: pose_select.c:658
void ARMATURE_OT_select_similar(struct wmOperatorType *ot)
void POSE_OT_group_add(struct wmOperatorType *ot)
Definition: pose_group.c:76
void POSE_OT_transforms_clear(struct wmOperatorType *ot)
void POSE_OT_loc_clear(struct wmOperatorType *ot)
void ARMATURE_OT_autoside_names(struct wmOperatorType *ot)
void POSE_OT_group_select(struct wmOperatorType *ot)
Definition: pose_group.c:487
void POSELIB_OT_blend_pose_asset(struct wmOperatorType *ot)
Definition: pose_lib_2.c:580
void POSE_OT_paths_clear(struct wmOperatorType *ot)
Definition: pose_edit.c:439
void POSE_OT_armature_apply(struct wmOperatorType *ot)
void ARMATURE_OT_layers_show_all(struct wmOperatorType *ot)
Definition: pose_edit.c:723
void POSE_OT_paste(struct wmOperatorType *ot)
void ED_operatortypes_armature(void)
Definition: armature_ops.c:20
void ED_operatormacros_armature(void)
Definition: armature_ops.c:141
void ED_keymap_armature(wmKeyConfig *keyconf)
Definition: armature_ops.c:177
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:4874
bool(* poll)(struct bContext *)
wmOperatorType * ot
Definition: wm_files.c:3479
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition: wm_keymap.c:852
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))