Blender V4.3
armature_ops.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "RNA_access.hh"
10
11#include "WM_api.hh"
12#include "WM_types.hh"
13
14#include "ED_armature.hh"
15#include "ED_screen.hh"
16
17#include "armature_intern.hh"
18
19/* ************************** registration **********************************/
20
22{
23 /* Both operators `ARMATURE_OT_*` and `POSE_OT_*` are registered here. */
24
25 /* EDIT ARMATURE */
27
33
36
46
58
61
71
74
75 /* POSE */
78
81
87
90
92
100
105
108
110
112
114
115 /* POSELIB */
118
119 /* POSE SLIDING */
125}
126
128{
130 wmOperatorTypeMacro *otmacro;
131
133 "ARMATURE_OT_duplicate_move",
134 "Duplicate",
135 "Make copies of the selected bones within the same armature and move them",
137 WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
138 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
139 RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
140
141 ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move",
142 "Extrude",
143 "Create new bones from the selected joints and move them",
145 otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
146 RNA_boolean_set(otmacro->ptr, "forked", false);
147 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
148 RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
149
150 /* XXX would it be nicer to just be able to have standard extrude_move,
151 * but set the forked property separate?
152 * that would require fixing a properties bug #19733. */
153 ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked",
154 "Extrude Forked",
155 "Create new bones from the selected joints and move them",
157 otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
158 RNA_boolean_set(otmacro->ptr, "forked", true);
159 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
160 RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
161}
162
164{
165 wmKeyMap *keymap;
166
167 /* Armature ------------------------ */
168 /* only set in editmode armature, by space_view3d listener */
169 keymap = WM_keymap_ensure(keyconf, "Armature", SPACE_EMPTY, RGN_TYPE_WINDOW);
171
172 /* Pose ------------------------ */
173 /* only set in posemode, by space_view3d listener */
174 keymap = WM_keymap_ensure(keyconf, "Pose", SPACE_EMPTY, RGN_TYPE_WINDOW);
175 keymap->poll = ED_operator_posemode;
176}
@ RGN_TYPE_WINDOW
@ SPACE_EMPTY
bool ED_operator_editarmature(bContext *C)
bool ED_operator_posemode(bContext *C)
@ OPTYPE_UNDO
Definition WM_types.hh:162
@ OPTYPE_REGISTER
Definition WM_types.hh:160
void ARMATURE_OT_subdivide(wmOperatorType *ot)
void ARMATURE_OT_click_extrude(wmOperatorType *ot)
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 POSE_OT_hide(wmOperatorType *ot)
Definition pose_edit.cc:709
void ARMATURE_OT_select_similar(wmOperatorType *ot)
void ARMATURE_OT_select_all(wmOperatorType *ot)
void ARMATURE_OT_select_hierarchy(wmOperatorType *ot)
void ARMATURE_OT_assign_to_collection(wmOperatorType *ot)
void POSE_OT_armature_apply(wmOperatorType *ot)
void ARMATURE_OT_collection_create_and_assign(wmOperatorType *ot)
void POSE_OT_transforms_clear(wmOperatorType *ot)
void POSE_OT_breakdown(wmOperatorType *ot)
void POSE_OT_paths_range_update(wmOperatorType *ot)
Definition pose_edit.cc:483
void POSE_OT_select_parent(wmOperatorType *ot)
void ARMATURE_OT_select_mirror(wmOperatorType *ot)
void POSE_OT_paste(wmOperatorType *ot)
void POSE_OT_quaternions_flip(wmOperatorType *ot)
Definition pose_edit.cc:828
void ARMATURE_OT_parent_clear(wmOperatorType *ot)
void ARMATURE_OT_collection_deselect(wmOperatorType *ot)
void ARMATURE_OT_collection_remove(wmOperatorType *ot)
void ARMATURE_OT_collection_unassign_named(wmOperatorType *ot)
void POSE_OT_paths_update(wmOperatorType *ot)
Definition pose_edit.cc:359
void POSELIB_OT_apply_pose_asset(wmOperatorType *ot)
void ARMATURE_OT_select_less(wmOperatorType *ot)
void POSE_OT_visual_transform_apply(wmOperatorType *ot)
void POSE_OT_select_hierarchy(wmOperatorType *ot)
void POSE_OT_select_grouped(wmOperatorType *ot)
void POSE_OT_reveal(wmOperatorType *ot)
Definition pose_edit.cc:771
void POSE_OT_select_linked_pick(wmOperatorType *ot)
void ARMATURE_OT_collection_assign(wmOperatorType *ot)
void ARMATURE_OT_flip_names(wmOperatorType *ot)
void ARMATURE_OT_collection_add(wmOperatorType *ot)
void POSE_OT_select_mirror(wmOperatorType *ot)
void POSE_OT_flip_names(wmOperatorType *ot)
Definition pose_edit.cc:532
void ARMATURE_OT_collection_move(wmOperatorType *ot)
void POSE_OT_paths_clear(wmOperatorType *ot)
Definition pose_edit.cc:438
void POSE_OT_blend_with_rest(wmOperatorType *ot)
void ARMATURE_OT_parent_set(wmOperatorType *ot)
void POSE_OT_propagate(wmOperatorType *ot)
void ARMATURE_OT_autoside_names(wmOperatorType *ot)
void POSE_OT_select_all(wmOperatorType *ot)
void POSE_OT_select_constraint_target(wmOperatorType *ot)
void ARMATURE_OT_move_to_collection(wmOperatorType *ot)
void ARMATURE_OT_select_linked(wmOperatorType *ot)
void POSE_OT_autoside_names(wmOperatorType *ot)
Definition pose_edit.cc:585
void POSE_OT_paths_calculate(wmOperatorType *ot)
Definition pose_edit.cc:284
void POSE_OT_copy(wmOperatorType *ot)
void POSE_OT_rot_clear(wmOperatorType *ot)
void ARMATURE_OT_separate(wmOperatorType *ot)
void POSELIB_OT_blend_pose_asset(wmOperatorType *ot)
void POSE_OT_rotation_mode_set(wmOperatorType *ot)
Definition pose_edit.cc:642
void POSE_OT_relax(wmOperatorType *ot)
void ARMATURE_OT_select_linked_pick(wmOperatorType *ot)
void POSE_OT_loc_clear(wmOperatorType *ot)
void ARMATURE_OT_collection_unassign(wmOperatorType *ot)
void POSE_OT_push(wmOperatorType *ot)
void POSE_OT_scale_clear(wmOperatorType *ot)
void POSE_OT_select_linked(wmOperatorType *ot)
void ARMATURE_OT_select_more(wmOperatorType *ot)
void ARMATURE_OT_collection_select(wmOperatorType *ot)
void POSE_OT_user_transforms_clear(wmOperatorType *ot)
void ARMATURE_OT_shortest_path_pick(wmOperatorType *ot)
void POSE_OT_blend_to_neighbors(wmOperatorType *ot)
void ED_keymap_armature(wmKeyConfig *keyconf)
void ED_operatortypes_armature()
void ED_operatormacros_armature()
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool(* poll)(struct bContext *)
wmOperatorType * ot
Definition wm_files.cc:4125
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:897
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)