Blender  V2.93
armature_intern.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 /* internal exports only */
27 struct wmOperatorType;
28 
29 struct Base;
30 struct Object;
31 struct Scene;
32 struct bContext;
33 struct bPoseChannel;
34 
35 struct Bone;
36 struct EditBone;
37 struct bArmature;
38 
39 struct LinkData;
40 struct ListBase;
41 
42 /* ******************************************************* */
43 /* Armature EditMode Operators */
45 
46 void ARMATURE_OT_align(struct wmOperatorType *ot);
50 
52 
55 
65 
71 void ARMATURE_OT_hide(struct wmOperatorType *ot);
74 void ARMATURE_OT_fill(struct wmOperatorType *ot);
76 void ARMATURE_OT_split(struct wmOperatorType *ot);
77 
80 
84 
85 /* ******************************************************* */
86 /* Pose-Mode Operators */
87 void POSE_OT_hide(struct wmOperatorType *ot);
88 void POSE_OT_reveal(struct wmOperatorType *ot);
89 
92 
93 void POSE_OT_rot_clear(struct wmOperatorType *ot);
94 void POSE_OT_loc_clear(struct wmOperatorType *ot);
98 
99 void POSE_OT_copy(struct wmOperatorType *ot);
100 void POSE_OT_paste(struct wmOperatorType *ot);
101 
102 void POSE_OT_select_all(struct wmOperatorType *ot);
110 
111 void POSE_OT_group_add(struct wmOperatorType *ot);
113 void POSE_OT_group_move(struct wmOperatorType *ot);
114 void POSE_OT_group_sort(struct wmOperatorType *ot);
119 
124 
126 void POSE_OT_flip_names(struct wmOperatorType *ot);
127 
129 
131 
133 
134 /* ******************************************************* */
135 /* Pose Tool Utilities (for PoseLib, Pose Sliding, etc.) */
136 /* pose_utils.c */
137 
138 /* Temporary data linking PoseChannels with the F-Curves they affect */
139 typedef struct tPChanFCurveLink {
141 
143  struct Object *ob;
144 
149 
151  char *pchan_path;
152 
154  float oldloc[3];
155  float oldrot[3];
156  float oldscale[3];
157  float oldquat[4];
158  float oldangle;
159  float oldaxis[3];
160 
162  float roll1, roll2;
166  float ease1, ease2;
169 
173 
174 /* ----------- */
175 
176 struct Object *poseAnim_object_get(struct Object *ob_);
177 void poseAnim_mapping_get(struct bContext *C, ListBase *pfLinks);
178 void poseAnim_mapping_free(ListBase *pfLinks);
179 
180 void poseAnim_mapping_refresh(struct bContext *C, struct Scene *scene, struct Object *ob);
181 void poseAnim_mapping_reset(ListBase *pfLinks);
183  struct Scene *scene,
184  ListBase *pfLinks,
185  float cframe);
186 
187 LinkData *poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, const char *path);
188 
189 /* ******************************************************* */
190 /* PoseLib */
191 /* pose_lib.c */
192 
193 void POSELIB_OT_new(struct wmOperatorType *ot);
194 void POSELIB_OT_unlink(struct wmOperatorType *ot);
195 
197 
202 
205 
206 /* ******************************************************* */
207 /* Pose Sliding Tools */
208 /* pose_slide.c */
209 
210 void POSE_OT_push(struct wmOperatorType *ot);
211 void POSE_OT_relax(struct wmOperatorType *ot);
212 void POSE_OT_push_rest(struct wmOperatorType *ot);
213 void POSE_OT_relax_rest(struct wmOperatorType *ot);
214 void POSE_OT_breakdown(struct wmOperatorType *ot);
215 
216 void POSE_OT_propagate(struct wmOperatorType *ot);
217 
218 /* ******************************************************* */
219 /* Various Armature Edit/Pose Editing API's */
220 
221 /* Ideally, many of these defines would not be needed as everything would be strictly
222  * self-contained within each file,
223  * but some tools still have a bit of overlap which makes things messy -- Feb 2013
224  */
225 
226 struct EditBone *make_boneList(struct ListBase *edbo,
227  struct ListBase *bones,
228  struct Bone *actBone);
229 
230 /* duplicate method */
231 void preEditBoneDuplicate(struct ListBase *editbones);
232 void postEditBoneDuplicate(struct ListBase *editbones, struct Object *ob);
233 struct EditBone *duplicateEditBone(struct EditBone *cur_bone,
234  const char *name,
235  struct ListBase *editbones,
236  struct Object *ob);
237 
238 /* duplicate method (cross objects) */
239 /* editbones is the target list */
240 struct EditBone *duplicateEditBoneObjects(struct EditBone *cur_bone,
241  const char *name,
242  struct ListBase *editbones,
243  struct Object *src_ob,
244  struct Object *dst_ob);
245 
246 struct EditBone *add_points_bone(struct Object *obedit, float head[3], float tail[3]);
247 void bone_free(struct bArmature *arm, struct EditBone *bone);
248 
249 void armature_tag_select_mirrored(struct bArmature *arm);
250 void armature_select_mirrored_ex(struct bArmature *arm, const int flag);
251 void armature_select_mirrored(struct bArmature *arm);
252 void armature_tag_unselect(struct bArmature *arm);
253 
254 struct EditBone *ED_armature_pick_ebone(struct bContext *C,
255  const int xy[2],
256  bool findunsel,
257  struct Base **r_base);
259  const int xy[2],
260  bool findunsel,
261  struct Base **r_base);
262 struct Bone *ED_armature_pick_bone(struct bContext *C,
263  const int xy[2],
264  bool findunsel,
265  struct Base **r_base);
266 
268  uint bases_len,
269  const uint *buffer,
270  short hits,
271  bool findunsel,
272  bool do_nearest,
273  struct Base **r_base);
275  uint bases_len,
276  const uint *buffer,
277  short hits,
278  bool findunsel,
279  bool do_nearest,
280  struct Base **r_base);
281 struct Bone *ED_armature_pick_bone_from_selectbuffer(struct Base **bases,
282  uint bases_len,
283  const uint *buffer,
284  short hits,
285  bool findunsel,
286  bool do_nearest,
287  struct Base **r_base);
288 
289 int bone_looper(struct Object *ob,
290  struct Bone *bone,
291  void *data,
292  int (*bone_func)(struct Object *, struct Bone *, void *));
unsigned int uint
Definition: BLI_sys_types.h:83
#define C
Definition: RandGen.cpp:39
void ARMATURE_OT_reveal(struct wmOperatorType *ot)
void POSELIB_OT_unlink(struct wmOperatorType *ot)
Definition: pose_lib.c:282
void POSE_OT_relax_rest(struct wmOperatorType *ot)
Definition: pose_slide.c:1513
void ARMATURE_OT_bone_primitive_add(struct wmOperatorType *ot)
struct Bone * ED_armature_pick_bone(struct bContext *C, const int xy[2], bool findunsel, struct Base **r_base)
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:826
void ARMATURE_OT_symmetrize(struct wmOperatorType *ot)
void ARMATURE_OT_shortest_path_pick(struct wmOperatorType *ot)
void postEditBoneDuplicate(struct ListBase *editbones, struct Object *ob)
Definition: armature_add.c:335
void ARMATURE_OT_calculate_roll(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:290
void poseAnim_mapping_free(ListBase *pfLinks)
Definition: pose_utils.c:195
struct EditBone * add_points_bone(struct Object *obedit, float head[3], float tail[3])
Definition: armature_add.c:279
void preEditBoneDuplicate(struct ListBase *editbones)
Definition: armature_add.c:307
int bone_looper(struct Object *ob, struct Bone *bone, void *data, int(*bone_func)(struct Object *, struct Bone *, void *))
void POSE_OT_reveal(struct wmOperatorType *ot)
Definition: pose_edit.c:1145
void ARMATURE_OT_parent_set(struct wmOperatorType *ot)
void armature_tag_unselect(struct bArmature *arm)
void POSE_OT_scale_clear(struct wmOperatorType *ot)
void POSE_OT_group_deselect(struct wmOperatorType *ot)
Definition: pose_group.c:537
void POSE_OT_group_sort(struct wmOperatorType *ot)
Definition: pose_group.c:446
void POSE_OT_quaternions_flip(struct wmOperatorType *ot)
Definition: pose_edit.c:1201
void ARMATURE_OT_switch_direction(struct wmOperatorType *ot)
struct bPoseChannel * ED_armature_pick_pchan(struct bContext *C, const int xy[2], bool findunsel, struct Base **r_base)
void POSE_OT_autoside_names(struct wmOperatorType *ot)
Definition: pose_edit.c:631
struct EditBone * duplicateEditBoneObjects(struct EditBone *cur_bone, const char *name, struct ListBase *editbones, struct Object *src_ob, struct Object *dst_ob)
Definition: armature_add.c:902
void poseAnim_mapping_reset(ListBase *pfLinks)
Definition: pose_utils.c:234
void POSELIB_OT_apply_pose(struct wmOperatorType *ot)
Definition: pose_lib.c:1875
void POSE_OT_relax(struct wmOperatorType *ot)
Definition: pose_slide.c:1394
void POSELIB_OT_pose_rename(struct wmOperatorType *ot)
Definition: pose_lib.c:739
void POSELIB_OT_browse_interactive(struct wmOperatorType *ot)
Definition: pose_lib.c:1830
LinkData * poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, const char *path)
Definition: pose_utils.c:343
struct bPoseChannel * ED_armature_pick_pchan_from_selectbuffer(struct Base **bases, uint bases_len, const uint *buffer, short hits, bool findunsel, bool do_nearest, struct Base **r_base)
void ARMATURE_OT_select_more(struct wmOperatorType *ot)
void POSE_OT_group_move(struct wmOperatorType *ot)
Definition: pose_group.c:349
void POSE_OT_paths_calculate(struct wmOperatorType *ot)
Definition: pose_edit.c:335
void POSE_OT_group_remove(struct wmOperatorType *ot)
Definition: pose_group.c:125
void POSELIB_OT_pose_add(struct wmOperatorType *ot)
Definition: pose_lib.c:532
void POSE_OT_copy(struct wmOperatorType *ot)
void ARMATURE_OT_hide(struct wmOperatorType *ot)
void ARMATURE_OT_subdivide(struct wmOperatorType *ot)
struct Bone * ED_armature_pick_bone_from_selectbuffer(struct Base **bases, uint bases_len, const uint *buffer, short hits, bool findunsel, bool do_nearest, struct Base **r_base)
void ARMATURE_OT_delete(struct wmOperatorType *ot)
void POSE_OT_rot_clear(struct wmOperatorType *ot)
void POSELIB_OT_new(struct wmOperatorType *ot)
Definition: pose_lib.c:246
void POSE_OT_select_linked(struct wmOperatorType *ot)
Definition: pose_select.c:568
void POSE_OT_hide(struct wmOperatorType *ot)
Definition: pose_edit.c:1082
void ARMATURE_OT_select_linked(struct wmOperatorType *ot)
void POSE_OT_select_mirror(struct wmOperatorType *ot)
Definition: pose_select.c:1284
void ARMATURE_OT_split(struct wmOperatorType *ot)
void ARMATURE_OT_fill(struct wmOperatorType *ot)
void POSE_OT_group_assign(struct wmOperatorType *ot)
Definition: pose_group.c:241
void POSE_OT_flip_names(struct wmOperatorType *ot)
Definition: pose_edit.c:578
void ARMATURE_OT_flip_names(struct wmOperatorType *ot)
void POSE_OT_select_grouped(struct wmOperatorType *ot)
Definition: pose_select.c:1175
void POSE_OT_select_linked_pick(struct wmOperatorType *ot)
Definition: pose_select.c:504
struct EditBone * ED_armature_pick_ebone_from_selectbuffer(struct Base **bases, uint bases_len, const uint *buffer, short hits, bool findunsel, bool do_nearest, struct Base **r_base)
void ARMATURE_OT_dissolve(struct wmOperatorType *ot)
void POSE_OT_push_rest(struct wmOperatorType *ot)
Definition: pose_slide.c:1453
void armature_select_mirrored(struct bArmature *arm)
struct tPChanFCurveLink tPChanFCurveLink
void POSE_OT_visual_transform_apply(struct wmOperatorType *ot)
void ARMATURE_OT_click_extrude(struct wmOperatorType *ot)
Definition: armature_add.c:260
void ARMATURE_OT_align(struct wmOperatorType *ot)
void poseAnim_mapping_autoKeyframe(struct bContext *C, struct Scene *scene, ListBase *pfLinks, float cframe)
Definition: pose_utils.c:272
void POSE_OT_paths_range_update(struct wmOperatorType *ot)
Definition: pose_edit.c:530
void ARMATURE_OT_roll_clear(struct wmOperatorType *ot)
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:622
void POSE_OT_push(struct wmOperatorType *ot)
Definition: pose_slide.c:1334
void POSELIB_OT_pose_move(struct wmOperatorType *ot)
Definition: pose_lib.c:815
void ARMATURE_OT_select_hierarchy(struct wmOperatorType *ot)
void POSE_OT_bone_layers(struct wmOperatorType *ot)
Definition: pose_edit.c:932
struct EditBone * duplicateEditBone(struct EditBone *cur_bone, const char *name, struct ListBase *editbones, struct Object *ob)
Definition: armature_add.c:925
void poseAnim_mapping_get(struct bContext *C, ListBase *pfLinks)
Definition: pose_utils.c:149
void POSE_OT_propagate(struct wmOperatorType *ot)
Definition: pose_slide.c:1940
struct EditBone * make_boneList(struct ListBase *edbo, struct ListBase *bones, struct Bone *actBone)
void POSE_OT_rotation_mode_set(struct wmOperatorType *ot)
Definition: pose_edit.c:688
void POSE_OT_user_transforms_clear(struct wmOperatorType *ot)
void POSELIB_OT_pose_remove(struct wmOperatorType *ot)
Definition: pose_lib.c:650
void POSELIB_OT_action_sanitize(struct wmOperatorType *ot)
Definition: pose_lib.c:369
void armature_select_mirrored_ex(struct bArmature *arm, const int flag)
void POSE_OT_paths_update(struct wmOperatorType *ot)
Definition: pose_edit.c:409
void ARMATURE_OT_armature_layers(struct wmOperatorType *ot)
Definition: pose_edit.c:843
void POSE_OT_breakdown(struct wmOperatorType *ot)
Definition: pose_slide.c:1573
void POSE_OT_select_constraint_target(struct wmOperatorType *ot)
Definition: pose_select.c:734
void ARMATURE_OT_bone_layers(struct wmOperatorType *ot)
Definition: pose_edit.c:1008
void POSE_OT_select_parent(struct wmOperatorType *ot)
Definition: pose_select.c:669
void ARMATURE_OT_select_similar(struct wmOperatorType *ot)
void ARMATURE_OT_duplicate(struct wmOperatorType *ot)
void poseAnim_mapping_refresh(struct bContext *C, struct Scene *scene, struct Object *ob)
void armature_tag_select_mirrored(struct bArmature *arm)
void bone_free(struct bArmature *arm, struct EditBone *bone)
void POSE_OT_group_add(struct wmOperatorType *ot)
Definition: pose_group.c:91
void POSE_OT_transforms_clear(struct wmOperatorType *ot)
struct EditBone * ED_armature_pick_ebone(struct bContext *C, const int xy[2], bool findunsel, struct Base **r_base)
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:502
void POSE_OT_paths_clear(struct wmOperatorType *ot)
Definition: pose_edit.c:487
void POSE_OT_armature_apply(struct wmOperatorType *ot)
void ARMATURE_OT_layers_show_all(struct wmOperatorType *ot)
Definition: pose_edit.c:771
void ARMATURE_OT_extrude(struct wmOperatorType *ot)
void POSE_OT_paste(struct wmOperatorType *ot)
struct Object * poseAnim_object_get(struct Object *ob_)
Definition: pose_utils.c:139
Scene scene
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
char name[64]
Definition: BKE_armature.h:57
float tail[3]
Definition: BKE_armature.h:66
struct Bone * bone
Definition: BKE_armature.h:113
float head[3]
Definition: BKE_armature.h:65
wmOperatorType * ot
Definition: wm_files.c:3156