code cleanup: naming - pose/armature/image
authorCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2012 16:03:57 +0000 (16:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2012 16:03:57 +0000 (16:03 +0000)
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.

121 files changed:
source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_image.h
source/blender/blenkernel/BKE_lamp.h
source/blender/blenkernel/BKE_lattice.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_speaker.h
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/booleanops_mesh.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/lamp.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/ocean.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/speaker.c
source/blender/blenkernel/intern/texture.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationImporter.cpp
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/collada/SkinInfo.cpp
source/blender/collada/SkinInfo.h
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poseUtils.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/include/ED_keyframing.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_transform.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/screen_context.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_view3d/drawanimviz.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/gpu/intern/gpu_draw.c
source/blender/ikplugin/intern/iksolver_plugin.c
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/makesdna/DNA_action_types.h
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_util.c
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/nodes/composite/nodes/node_composite_outputFile.c
source/blender/nodes/composite/nodes/node_composite_splitViewer.c
source/blender/nodes/composite/nodes/node_composite_viewer.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_ArmatureObject.h
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_SkinDeformer.cpp

index b9d7fb8..a326b51 100644 (file)
@@ -122,7 +122,7 @@ void action_groups_add_channel(struct bAction *act, struct bActionGroup *agrp, s
 void action_groups_remove_channel(struct bAction *act, struct FCurve *fcu);
 
 /* Find a group with the given name */
-struct bActionGroup *action_groups_find_named(struct bAction *act, const char name[]);
+struct bActionGroup *BKE_action_group_find_name(struct bAction *act, const char name[]);
 
 /* Clear all 'temp' flags on all groups */
 void action_groups_clear_tempflags(struct bAction *act);
@@ -133,71 +133,71 @@ void action_groups_clear_tempflags(struct bAction *act);
  * Deallocates a pose channel.
  * Does not free the pose channel itself.
  */
-void free_pose_channel(struct bPoseChannel *pchan);
+void BKE_pose_channel_free(struct bPoseChannel *pchan);
 
 /**
  * Removes and deallocates all channels from a pose.
  * Does not free the pose itself.
  */
-void free_pose_channels(struct bPose *pose);
+void BKE_pose_channels_free(struct bPose *pose);
 
 /**
  * Removes the hash for quick lookup of channels, must
  * be done when adding/removing channels.
  */
-void make_pose_channels_hash(struct bPose *pose);
-void free_pose_channels_hash(struct bPose *pose);
+void BKE_pose_channels_hash_make(struct bPose *pose);
+void BKE_pose_channels_hash_free(struct bPose *pose);
 
 /** 
  * Removes and deallocates all data from a pose, and also frees the pose.
  */
-void free_pose(struct bPose *pose);
+void BKE_pose_free(struct bPose *pose);
 
 /**
  * Allocate a new pose on the heap, and copy the src pose and it's channels
  * into the new pose. *dst is set to the newly allocated structure, and assumed to be NULL.
  */ 
-void copy_pose(struct bPose **dst, struct bPose *src, int copyconstraints);
+void BKE_pose_copy_data(struct bPose **dst, struct bPose *src, int copyconstraints);
 
 /**
  * Copy the internal members of each pose channel including constraints
  * and ID-Props, used when duplicating bones in editmode.
  */
-void duplicate_pose_channel_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
+void BKE_pose_channel_copy_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
 
 /**
  * Return a pointer to the pose channel of the given name
  * from this pose.
  */
-struct bPoseChannel *get_pose_channel(const struct bPose *pose, const char *name);
+struct bPoseChannel *BKE_pose_channel_find_name(const struct bPose *pose, const char *name);
 
 /**
  * Return a pointer to the active pose channel from this Object.
  * (Note: Object, not bPose is used here, as we need layer info from Armature)
  */
-struct bPoseChannel *get_active_posechannel(struct Object *ob);
+struct bPoseChannel *BKE_pose_channel_active(struct Object *ob);
 
 /** 
  * Looks to see if the channel with the given name
  * already exists in this pose - if not a new one is
  * allocated and initialized.
  */
-struct bPoseChannel *verify_pose_channel(struct bPose* pose, const char* name);
+struct bPoseChannel *BKE_pose_channel_verify(struct bPose* pose, const char* name);
 
 /* Copy the data from the action-pose (src) into the pose */
 void extract_pose_from_pose(struct bPose *pose, const struct bPose *src);
 
 /* sets constraint flags */
-void update_pose_constraint_flags(struct bPose *pose);
+void BKE_pose_update_constraint_flags(struct bPose *pose);
 
 /* return the name of structure pointed by pose->ikparam */
-const char *get_ikparam_name(struct bPose *pose);
+const char *BKE_pose_ikparam_get_name(struct bPose *pose);
 
 /* allocate and initialize pose->ikparam according to pose->iksolver */
-void init_pose_ikparam(struct bPose *pose);
+void BKE_pose_ikparam_init(struct bPose *pose);
 
 /* initialize a bItasc structure with default value */
-void init_pose_itasc(struct bItasc *itasc);
+void BKE_pose_itasc_init(struct bItasc *itasc);
 
 /* clears BONE_UNKEYED flags for frame changing */
 // XXX to be depreceated for a more general solution in animsys...
@@ -206,10 +206,10 @@ void framechange_poses_clear_unkeyed(void);
 /* Bone Groups API --------------------- */    
 
 /* Adds a new bone-group */
-void pose_add_group(struct Object *ob);
+void BKE_pose_add_group(struct Object *ob);
 
 /* Remove the active bone-group */
-void pose_remove_group(struct Object *ob);
+void BKE_pose_remove_group(struct Object *ob);
 
 /* Assorted Evaluation ----------------- */    
 
@@ -217,9 +217,9 @@ void pose_remove_group(struct Object *ob);
 void what_does_obaction(struct Object *ob, struct Object *workob, struct bPose *pose, struct bAction *act, char groupname[], float cframe);
 
 /* for proxy */
-void copy_pose_result(struct bPose *to, struct bPose *from);
+void BKE_pose_copy_result(struct bPose *to, struct bPose *from);
 /* clear all transforms */
-void rest_pose(struct bPose *pose);
+void BKE_pose_rest(struct bPose *pose);
 
 #ifdef __cplusplus
 };
index 72d4521..b8c2c42 100644 (file)
@@ -75,28 +75,28 @@ typedef struct PoseTree
 extern "C" {
 #endif
 
-struct bArmature *add_armature(const char *name);
-struct bArmature *get_armature(struct Object *ob);
-void free_bonelist (struct ListBase *lb);
+struct bArmature *BKE_armature_add(const char *name);
+struct bArmature *BKE_armature_from_object(struct Object *ob);
+void BKE_armature_bonelist_free (struct ListBase *lb);
 void BKE_armature_free(struct bArmature *arm);
 void BKE_armature_make_local(struct bArmature *arm);
 struct bArmature *BKE_armature_copy(struct bArmature *arm);
 
 /* Bounding box. */
-struct BoundBox *BKE_armature_get_bb(struct Object *ob);
+struct BoundBox *BKE_armature_boundbox_get(struct Object *ob);
 
 int bone_autoside_name (char name[64], int strip_number, short axis, float head, float tail);
 
-struct Bone *get_named_bone (struct bArmature *arm, const char *name);
+struct Bone *BKE_armature_find_bone_name (struct bArmature *arm, const char *name);
 
 float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float r1, float r2, float rdist);
 
-void where_is_armature (struct bArmature *arm);
-void where_is_armature_bone(struct Bone *bone, struct Bone *prevbone);
-void armature_rebuild_pose(struct Object *ob, struct bArmature *arm);
-void where_is_pose (struct Scene *scene, struct Object *ob);
-void where_is_pose_bone(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime, int do_extra);
-void where_is_pose_bone_tail(struct bPoseChannel *pchan);
+void BKE_armature_where_is(struct bArmature *arm);
+void BKE_armature_where_is_bone(struct Bone *bone, struct Bone *prevbone);
+void BKE_pose_rebuild(struct Object *ob, struct bArmature *arm);
+void BKE_pose_where_is(struct Scene *scene, struct Object *ob);
+void BKE_pose_where_is_bone(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime, int do_extra);
+void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan);
 
 /* get_objectspace_bone_matrix has to be removed still */
 void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int root, int posed);
@@ -106,23 +106,23 @@ void mat3_to_vec_roll(float mat[][3], float *vec, float *roll);
 int get_selected_defgroups(struct Object *ob, char *defbase_sel, int defbase_len);
 
 /* Common Conversions Between Co-ordinate Spaces */
-void armature_mat_world_to_pose(struct Object *ob, float inmat[][4], float outmat[][4]);
-void armature_loc_world_to_pose(struct Object *ob, const float inloc[3], float outloc[3]);
-void armature_mat_pose_to_bone(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
-void armature_loc_pose_to_bone(struct bPoseChannel *pchan, const float inloc[3], float outloc[3]);
-void armature_mat_bone_to_pose(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
-void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4]);
+void BKE_armature_mat_world_to_pose(struct Object *ob, float inmat[][4], float outmat[][4]);
+void BKE_armature_loc_world_to_pose(struct Object *ob, const float inloc[3], float outloc[3]);
+void BKE_armature_mat_pose_to_bone(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
+void BKE_armature_loc_pose_to_bone(struct bPoseChannel *pchan, const float inloc[3], float outloc[3]);
+void BKE_armature_mat_bone_to_pose(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
+void BKE_armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4]);
 
-void armature_mat_pose_to_bone_ex(struct Object *ob, struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
+void BKE_armature_mat_pose_to_bone_ex(struct Object *ob, struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
 
-void pchan_mat3_to_rot(struct bPoseChannel *pchan, float mat[][3], short use_compat);
-void pchan_apply_mat4(struct bPoseChannel *pchan, float mat[][4], short use_comat);
-void pchan_to_mat4(struct bPoseChannel *pchan, float chan_mat[4][4]);
-void pchan_calc_mat(struct bPoseChannel *pchan);
+void BKE_pchan_mat3_to_rot(struct bPoseChannel *pchan, float mat[][3], short use_compat);
+void BKE_pchan_apply_mat4(struct bPoseChannel *pchan, float mat[][4], short use_comat);
+void BKE_pchan_to_mat4(struct bPoseChannel *pchan, float chan_mat[4][4]);
+void BKE_pchan_calc_mat(struct bPoseChannel *pchan);
 
 /* Get the "pchan to pose" transform matrix. These matrices apply the effects of
  * HINGE/NO_SCALE/NO_LOCAL_LOCATION options over the pchan loc/rot/scale transformations. */
-void pchan_to_pose_mat(struct bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4]);
+void BKE_pchan_to_pose_mat(struct bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4]);
 
 /* Rotation Mode Conversions - Used for PoseChannels + Objects... */
 void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode);
index d9a656a..563f066 100644 (file)
@@ -48,12 +48,12 @@ struct ImageFormatData;
 /* call from library */
 void   BKE_image_free(struct Image *me);
 
-void   BKE_stamp_info(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf);
+void   BKE_imbuf_stamp_info(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf);
 void   BKE_stamp_buf(struct Scene *scene, struct Object *camera, unsigned char *rect, float *rectf, int width, int height, int channels);
-int            BKE_alphatest_ibuf(struct ImBuf *ibuf);
-int            BKE_write_ibuf_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
-int            BKE_write_ibuf(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
-int     BKE_write_ibuf_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy);
+int            BKE_imbuf_alpha_test(struct ImBuf *ibuf);
+int            BKE_imbuf_write_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
+int            BKE_imbuf_write(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
+int     BKE_imbuf_write_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy);
 void   BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames);
 int            BKE_add_image_extension(char *string, const char imtype);
 char   BKE_ftype_to_imtype(const int ftype);
@@ -72,11 +72,11 @@ void    BKE_imformat_defaults(struct ImageFormatData *im_format);
 
 struct anim *openanim(const char *name, int flags, int streamindex);
 
-void   image_de_interlace(struct Image *ima, int odd);
+void   BKE_image_de_interlace(struct Image *ima, int odd);
 
 void   BKE_image_make_local(struct Image *ima);
 
-void   tag_image_time(struct Image *ima);
+void   BKE_image_tag_time(struct Image *ima);
 void   free_old_images(void);
 
 /* ********************************** NEW IMAGE API *********************** */
@@ -136,9 +136,9 @@ struct Image *BKE_image_load(const char *filepath);
 struct Image *BKE_image_load_exists(const char *filepath);
 
 /* adds image, adds ibuf, generates color or pattern */
-struct Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
+struct Image *BKE_image_add_generated(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
 /* adds image from imbuf, owns imbuf */
-struct Image *BKE_add_image_imbuf(struct ImBuf *ibuf);
+struct Image *BKE_image_add_from_imbuf(struct ImBuf *ibuf);
 
 /* for reload, refresh, pack */
 void BKE_image_signal(struct Image *ima, struct ImageUser *iuser, int signal);
@@ -150,8 +150,8 @@ struct Image *BKE_image_verify_viewer(int type, const char *name);
 void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf);
 
 /* called on frame change or before render */
-void BKE_image_user_calc_frame(struct ImageUser *iuser, int cfra, int fieldnr);
-int BKE_image_user_get_frame(const struct ImageUser *iuser, int cfra, int fieldnr);
+void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
+int  BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr);
 
 /* sets index offset for multilayer files */
 struct RenderPass *BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser);
index fd19794..f9137e5 100644 (file)
@@ -38,10 +38,10 @@ extern "C" {
 
 struct Lamp;
 
-void *add_lamp(const char *name);
+void *BKE_lamp_add(const char *name);
 struct Lamp *BKE_lamp_copy(struct Lamp *la);
 struct Lamp *localize_lamp(struct Lamp *la);
-void make_local_lamp(struct Lamp *la);
+void BKE_lamp_make_local(struct Lamp *la);
 void BKE_lamp_free(struct Lamp *la);
 
 #ifdef __cplusplus
index 251f02f..9a952fc 100644 (file)
@@ -41,8 +41,8 @@ struct DerivedMesh;
 struct BPoint;
 struct MDeformVert;
 
-void resizelattice(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
-struct Lattice *add_lattice(const char *name);
+void BKE_lattice_resize(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
+struct Lattice *BKE_lattice_add(const char *name);
 struct Lattice *BKE_lattice_copy(struct Lattice *lt);
 void BKE_lattice_free(struct Lattice *lt);
 void BKE_lattice_make_local(struct Lattice *lt);
@@ -69,11 +69,11 @@ void armature_deform_verts(struct Object *armOb, struct Object *target,
                            float (*defMats)[3][3], int numVerts, int deformflag,
                            float (*prevCos)[3], const char *defgrp_name);
 
-float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3];
-void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3]);
-void lattice_calc_modifiers(struct Scene *scene, struct Object *ob);
+float (*BKE_lattice_vertexcos_get(struct Object *ob, int *numVerts_r))[3];
+void    BKE_lattice_vertexcos_apply(struct Object *ob, float (*vertexCos)[3]);
+void    BKE_lattice_modifiers_calc(struct Scene *scene, struct Object *ob);
 
-struct MDeformVert* lattice_get_deform_verts(struct Object *lattice);
+struct MDeformVert* BKE_lattice_deform_verts_get(struct Object *lattice);
 
 #endif
 
index 8a93366..e8dff66 100644 (file)
@@ -82,7 +82,7 @@ void name_uiprefix_id(char *name, struct ID *id);
 void test_idbutton(char *name);
 void text_idbutton(struct ID *id, char *text);
 void BKE_library_make_local(struct Main *bmain, struct Library *lib, int untagged_only);
-struct ID *find_id(const char *type, const char *name);
+struct ID *BKE_libblock_find_name(const char *type, const char *name);
 void clear_id_newpoins(void);
 
 void IDnames_to_pupstring(const char **str, const char *title, const char *extraops,
index 3257031..801724d 100644 (file)
@@ -50,11 +50,11 @@ void BKE_material_free(struct Material *sc);
 void test_object_materials(struct ID *id);
 void resize_object_material(struct Object *ob, const short totcol);
 void init_material(struct Material *ma);
-struct Material *add_material(const char *name);
+struct Material *BKE_material_add(const char *name);
 struct Material *BKE_material_copy(struct Material *ma);
 struct Material *localize_material(struct Material *ma);
 struct Material *give_node_material(struct Material *ma); /* returns node material or self */
-void make_local_material(struct Material *ma);
+void BKE_material_make_local(struct Material *ma);
 void extern_local_matarar(struct Material **matar, short totcol);
 
 void automatname(struct Material *);
index 34289a2..256d4b1 100644 (file)
@@ -120,7 +120,7 @@ void mesh_flush_hidden_from_verts(const struct MVert *mvert,
 
 void unlink_mesh(struct Mesh *me);
 void BKE_mesh_free(struct Mesh *me, int unlink);
-struct Mesh *add_mesh(const char *name);
+struct Mesh *BKE_mesh_add(const char *name);
 struct Mesh *BKE_mesh_copy(struct Mesh *me);
 void mesh_update_customdata_pointers(struct Mesh *me, const short do_ensure_tess_cd);
 
@@ -130,7 +130,7 @@ void tex_space_mesh(struct Mesh *me);
 float *get_mesh_orco_verts(struct Object *ob);
 void transform_mesh_orco_verts(struct Mesh *me, float (*orco)[3], int totvert, int invert);
 int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr);
-struct Mesh *get_mesh(struct Object *ob);
+struct Mesh *BKE_mesh_from_object(struct Object *ob);
 void set_mesh(struct Object *ob, struct Mesh *me);
 void mball_to_mesh(struct ListBase *lb, struct Mesh *me);
 int nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *totvert,
index 5ff881e..52c177f 100644 (file)
@@ -33,9 +33,9 @@
  *  \brief General operations for speakers.
  */
 
-void *add_speaker(const char *name);
+void *BKE_speaker_add(const char *name);
 struct Speaker *BKE_speaker_copy(struct Speaker *spk);
-void make_local_speaker(struct Speaker *spk);
+void BKE_speaker_make_local(struct Speaker *spk);
 void BKE_speaker_free(struct Speaker *spk);
 
 #endif
index aa6f56c..ed58620 100644 (file)
@@ -81,7 +81,7 @@ struct MTex *add_mtex(void);
 struct MTex *add_mtex_id(struct ID *id, int slot);
 struct Tex *BKE_texture_copy(struct Tex *tex);
 struct Tex *localize_texture(struct Tex *tex);
-void make_local_texture(struct Tex *tex);
+void BKE_texture_make_local(struct Tex *tex);
 void autotexname(struct Tex *tex);
 
 struct Tex *give_current_object_texture(struct Object *ob);
index addbde1..90cfb9a 100644 (file)
@@ -69,7 +69,7 @@
  * - Pose is the local (object level) component of armature. The current
  *   object pose is saved in files, and (will be) is presorted for dependency
  * - Actions have fewer (or other) channels, and write data to a Pose
- * - Currently ob->pose data is controlled in where_is_pose only. The (recalc)
+ * - Currently ob->pose data is controlled in BKE_pose_where_is only. The (recalc)
  *   event system takes care of calling that
  * - The NLA system (here too) uses Poses as interpolation format for Actions
  * - Therefore we assume poses to be static, and duplicates of poses have channels in
@@ -383,7 +383,7 @@ void action_groups_remove_channel(bAction *act, FCurve *fcu)
 }
 
 /* Find a group with the given name */
-bActionGroup *action_groups_find_named (bAction *act, const char name[])
+bActionGroup *BKE_action_group_find_name (bAction *act, const char name[])
 {
        /* sanity checks */
        if (ELEM3(NULL, act, act->groups.first, name) || (name[0] == 0))
@@ -410,7 +410,7 @@ void action_groups_clear_tempflags(bAction *act)
 /* *************** Pose channels *************** */
 
 /* usually used within a loop, so we got a N^2 slowdown */
-bPoseChannel *get_pose_channel(const bPose *pose, const char *name)
+bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name)
 {
        if (ELEM(NULL, pose, name) || (name[0] == 0))
                return NULL;
@@ -423,7 +423,7 @@ bPoseChannel *get_pose_channel(const bPose *pose, const char *name)
 
 /* Use with care, not on Armature poses but for temporal ones */
 /* (currently used for action constraints and in rebuild_pose) */
-bPoseChannel *verify_pose_channel(bPose *pose, const char *name)
+bPoseChannel *BKE_pose_channel_verify(bPose *pose, const char *name)
 {
        bPoseChannel *chan;
        
@@ -454,13 +454,13 @@ bPoseChannel *verify_pose_channel(bPose *pose, const char *name)
        chan->protectflag = OB_LOCK_ROT4D;      /* lock by components by default */
        
        BLI_addtail(&pose->chanbase, chan);
-       free_pose_channels_hash(pose);
+       BKE_pose_channels_hash_free(pose);
        
        return chan;
 }
 
 /* Find the active posechannel for an object (we can't just use pose, as layer info is in armature) */
-bPoseChannel *get_active_posechannel (Object *ob)
+bPoseChannel *BKE_pose_channel_active (Object *ob)
 {
        bArmature *arm= (ob) ? ob->data : NULL;
        bPoseChannel *pchan;
@@ -478,7 +478,7 @@ bPoseChannel *get_active_posechannel (Object *ob)
        return NULL;
 }
 
-const char *get_ikparam_name(bPose *pose)
+const char *BKE_pose_ikparam_get_name(bPose *pose)
 {
        if (pose) {
                switch (pose->iksolver) {
@@ -491,7 +491,7 @@ const char *get_ikparam_name(bPose *pose)
        return NULL;
 }
 /* dst should be freed already, makes entire duplicate */
-void copy_pose(bPose **dst, bPose *src, int copycon)
+void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon)
 {
        bPose *outPose;
        bPoseChannel *pchan;
@@ -503,7 +503,7 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
        }
        
        if (*dst==src) {
-               printf("copy_pose source and target are the same\n");
+               printf("BKE_pose_copy_data source and target are the same\n");
                *dst=NULL;
                return;
        }
@@ -536,7 +536,7 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
        *dst=outPose;
 }
 
-void init_pose_itasc(bItasc *itasc)
+void BKE_pose_itasc_init(bItasc *itasc)
 {
        if (itasc) {
                itasc->iksolver = IKSOLVER_ITASC;
@@ -553,13 +553,13 @@ void init_pose_itasc(bItasc *itasc)
                itasc->dampeps = 0.15;
        }
 }
-void init_pose_ikparam(bPose *pose)
+void BKE_pose_ikparam_init(bPose *pose)
 {
        bItasc *itasc;
        switch (pose->iksolver) {
        case IKSOLVER_ITASC:
                itasc = MEM_callocN(sizeof(bItasc), "itasc");
-               init_pose_itasc(itasc);
+               BKE_pose_itasc_init(itasc);
                pose->ikparam = itasc;
                break;
        case IKSOLVER_LEGACY:
@@ -569,7 +569,7 @@ void init_pose_ikparam(bPose *pose)
        }
 }
 
-void make_pose_channels_hash(bPose *pose) 
+void BKE_pose_channels_hash_make(bPose *pose) 
 {
        if (!pose->chanhash) {
                bPoseChannel *pchan;
@@ -580,7 +580,7 @@ void make_pose_channels_hash(bPose *pose)
        }
 }
 
-void free_pose_channels_hash(bPose *pose) 
+void BKE_pose_channels_hash_free(bPose *pose) 
 {
        if (pose->chanhash) {
                BLI_ghash_free(pose->chanhash, NULL, NULL);
@@ -589,7 +589,7 @@ void free_pose_channels_hash(bPose *pose)
 }
 
 
-void free_pose_channel(bPoseChannel *pchan)
+void BKE_pose_channel_free(bPoseChannel *pchan)
 {
 
        if (pchan->mpath) {
@@ -605,25 +605,25 @@ void free_pose_channel(bPoseChannel *pchan)
        }
 }
 
-void free_pose_channels(bPose *pose) 
+void BKE_pose_channels_free(bPose *pose) 
 {
        bPoseChannel *pchan;
        
        if (pose->chanbase.first) {
                for (pchan = pose->chanbase.first; pchan; pchan=pchan->next)
-                       free_pose_channel(pchan);
+                       BKE_pose_channel_free(pchan);
                
                BLI_freelistN(&pose->chanbase);
        }
 
-       free_pose_channels_hash(pose);
+       BKE_pose_channels_hash_free(pose);
 }
 
-void free_pose(bPose *pose)
+void BKE_pose_free(bPose *pose)
 {
        if (pose) {
                /* free pose-channels */
-               free_pose_channels(pose);
+               BKE_pose_channels_free(pose);
                
                /* free pose-groups */
                if (pose->agroups.first)
@@ -665,8 +665,8 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan
 
 /* makes copies of internal data, unlike copy_pose_channel_data which only
  * copies the pose state.
- * hint: use when copying bones in editmode (on returned value from verify_pose_channel) */
-void duplicate_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
+ * hint: use when copying bones in editmode (on returned value from BKE_pose_channel_verify) */
+void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
 {
        /* copy transform locks */
        pchan->protectflag = pchan_from->protectflag;
@@ -709,7 +709,7 @@ void duplicate_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *pchan_
  * can do more constraints flags later 
  */
 /* pose should be entirely OK */
-void update_pose_constraint_flags(bPose *pose)
+void BKE_pose_update_constraint_flags(bPose *pose)
 {
        bPoseChannel *pchan, *parchan;
        bConstraint *con;
@@ -792,7 +792,7 @@ void framechange_poses_clear_unkeyed(void)
 /* ************************** Bone Groups ************************** */
 
 /* Adds a new bone-group */
-void pose_add_group(Object *ob)
+void BKE_pose_add_group(Object *ob)
 {
        bPose *pose= (ob) ? ob->pose : NULL;
        bActionGroup *grp;
@@ -809,7 +809,7 @@ void pose_add_group(Object *ob)
 }
 
 /* Remove the active bone-group */
-void pose_remove_group(Object *ob)
+void BKE_pose_remove_group(Object *ob)
 {
        bPose *pose= (ob) ? ob->pose : NULL;
        bActionGroup *grp = NULL;
@@ -1072,7 +1072,7 @@ void extract_pose_from_pose(bPose *pose, const bPose *src)
 }
 
 /* for do_all_pose_actions, clears the pose. Now also exported for proxy and tools */
-void rest_pose(bPose *pose)
+void BKE_pose_rest(bPose *pose)
 {
        bPoseChannel *pchan;
        
@@ -1094,7 +1094,7 @@ void rest_pose(bPose *pose)
 }
 
 /* both poses should be in sync */
-void copy_pose_result(bPose *to, bPose *from)
+void BKE_pose_copy_result(bPose *to, bPose *from)
 {
        bPoseChannel *pchanto, *pchanfrom;
        
@@ -1104,13 +1104,13 @@ void copy_pose_result(bPose *to, bPose *from)
        }
 
        if (to==from) {
-               printf("copy_pose_result source and target are the same\n");
+               printf("BKE_pose_copy_result source and target are the same\n");
                return;
        }
 
 
        for (pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) {
-               pchanto= get_pose_channel(to, pchanfrom->name);
+               pchanto= BKE_pose_channel_find_name(to, pchanfrom->name);
                if (pchanto) {
                        copy_m4_m4(pchanto->pose_mat, pchanfrom->pose_mat);
                        copy_m4_m4(pchanto->chan_mat, pchanfrom->chan_mat);
@@ -1136,7 +1136,7 @@ void copy_pose_result(bPose *to, bPose *from)
  */
 void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, char groupname[], float cframe)
 {
-       bActionGroup *agrp= action_groups_find_named(act, groupname);
+       bActionGroup *agrp= BKE_action_group_find_name(act, groupname);
        
        /* clear workob */
        BKE_object_workob_clear(workob);
@@ -1243,9 +1243,9 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src,
        
        /* are we also blending with matching bones? */
        if (strip->prev && strip->start>=strip->prev->start) {
-               bPoseChannel *dpchan= get_pose_channel(dst, strip->offs_bone);
+               bPoseChannel *dpchan= BKE_pose_channel_find_name(dst, strip->offs_bone);
                if (dpchan) {
-                       bPoseChannel *spchan= get_pose_channel(src, strip->offs_bone);
+                       bPoseChannel *spchan= BKE_pose_channel_find_name(src, strip->offs_bone);
                        if (spchan) {
                                float vec[3];
                                
@@ -1397,11 +1397,11 @@ static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float
                        if (foundvert) {
                                /* bring it into armature space */
                                sub_v3_v3v3(min, max, min);
-                               bone= get_named_bone(ob->data, strip->offs_bone);       /* weak */
+                               bone= BKE_armature_find_bone_name(ob->data, strip->offs_bone);  /* weak */
                                if (bone) {
                                        mul_mat3_m4_v3(bone->arm_mat, min);
                                        
-                                       /* dominant motion, cyclic_offset was cleared in rest_pose */
+                                       /* dominant motion, cyclic_offset was cleared in BKE_pose_rest */
                                        if (strip->flag & (ACTSTRIP_CYCLIC_USEX | ACTSTRIP_CYCLIC_USEY | ACTSTRIP_CYCLIC_USEZ)) {
                                                if (strip->flag & ACTSTRIP_CYCLIC_USEX) pose->cyclic_offset[0]= time*min[0];
                                                if (strip->flag & ACTSTRIP_CYCLIC_USEY) pose->cyclic_offset[1]= time*min[1];
@@ -1457,8 +1457,8 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
        int     doit, dostride;
        
        if (blocktype==ID_AR) {
-               copy_pose(&tpose, ob->pose, 1);
-               rest_pose(ob->pose);            // potentially destroying current not-keyed pose
+               BKE_pose_copy_data(&tpose, ob->pose, 1);
+               BKE_pose_rest(ob->pose);                // potentially destroying current not-keyed pose
        }
        else {
                key= ob_get_key(ob);
@@ -1504,7 +1504,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
                        if (striptime>=0.0) {
                                
                                if (blocktype==ID_AR) 
-                                       rest_pose(tpose);
+                                       BKE_pose_rest(tpose);
                                
                                /* To handle repeat, we add 0.1 frame extra to make sure the last frame is included */
                                if (striptime < 1.0f + 0.1f/length) {
@@ -1656,7 +1656,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
        
        /* free */
        if (tpose)
-               free_pose(tpose);
+               BKE_pose_free(tpose);
        if (chanbase.first)
                BLI_freelistN(&chanbase);
 }
index 66c91c0..de70ffc 100644 (file)
@@ -425,7 +425,7 @@ void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const cha
                        /* if grouped... */
                        if (fcu->grp) {
                                /* make sure there will be a matching group on the other side for the migrants */
-                               agrp = action_groups_find_named(dstAct, fcu->grp->name);
+                               agrp = BKE_action_group_find_name(dstAct, fcu->grp->name);
                                
                                if (agrp == NULL) {
                                        /* add a new one with a similar name (usually will be the same though) */
index 56275f5..814e9d5 100644 (file)
@@ -75,7 +75,7 @@
 
 /* **************** Generic Functions, data level *************** */
 
-bArmature *add_armature(const char *name)
+bArmature *BKE_armature_add(const char *name)
 {
        bArmature *arm;
 
@@ -86,14 +86,14 @@ bArmature *add_armature(const char *name)
        return arm;
 }
 
-bArmature *get_armature(Object *ob)
+bArmature *BKE_armature_from_object(Object *ob)
 {
        if (ob->type == OB_ARMATURE)
                return (bArmature *)ob->data;
        return NULL;
 }
 
-void free_bonelist(ListBase *lb)
+void BKE_armature_bonelist_free(ListBase *lb)
 {
        Bone *bone;
 
@@ -102,7 +102,7 @@ void free_bonelist(ListBase *lb)
                        IDP_FreeProperty(bone->prop);
                        MEM_freeN(bone->prop);
                }
-               free_bonelist(&bone->childbase);
+               BKE_armature_bonelist_free(&bone->childbase);
        }
 
        BLI_freelistN(lb);
@@ -111,7 +111,7 @@ void free_bonelist(ListBase *lb)
 void BKE_armature_free(bArmature *arm)
 {
        if (arm) {
-               free_bonelist(&arm->bonebase);
+               BKE_armature_bonelist_free(&arm->bonebase);
 
                /* free editmode data */
                if (arm->edbo) {
@@ -245,7 +245,7 @@ static Bone *get_named_bone_bonechildren(Bone *bone, const char *name)
 
 
 /* Walk the list until the bone is found */
-Bone *get_named_bone(bArmature *arm, const char *name)
+Bone *BKE_armature_find_bone_name(bArmature *arm, const char *name)
 {
        Bone *bone = NULL, *curBone;
 
@@ -909,7 +909,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
                                defnrToPC = MEM_callocN(sizeof(*defnrToPC) * defbase_tot, "defnrToBone");
                                defnrToPCIndex = MEM_callocN(sizeof(*defnrToPCIndex) * defbase_tot, "defnrToIndex");
                                for (i = 0, dg = target->defbase.first; dg; i++, dg = dg->next) {
-                                       defnrToPC[i] = get_pose_channel(armOb->pose, dg->name);
+                                       defnrToPC[i] = BKE_pose_channel_find_name(armOb->pose, dg->name);
                                        /* exclude non-deforming bones */
                                        if (defnrToPC[i]) {
                                                if (defnrToPC[i]->bone->flag & BONE_NO_DEFORM) {
@@ -1099,7 +1099,7 @@ void get_objectspace_bone_matrix(struct Bone* bone, float M_accumulatedMatrix[][
 /* **************** Space to Space API ****************** */
 
 /* Convert World-Space Matrix to Pose-Space Matrix */
-void armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
 {
        float obmat[4][4];
 
@@ -1117,7 +1117,7 @@ void armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
 /* Convert World-Space Location to Pose-Space Location
  * NOTE: this cannot be used to convert to pose-space location of the supplied
  *       pose-channel into its local space (i.e. 'visual'-keyframing) */
-void armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3])
+void BKE_armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3])
 {
        float xLocMat[4][4] = MAT4_UNITY;
        float nLocMat[4][4];
@@ -1126,7 +1126,7 @@ void armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3
        copy_v3_v3(xLocMat[3], inloc);
 
        /* get bone-space cursor matrix and extract location */
-       armature_mat_world_to_pose(ob, xLocMat, nLocMat);
+       BKE_armature_mat_world_to_pose(ob, xLocMat, nLocMat);
        copy_v3_v3(outloc, nLocMat[3]);
 }
 
@@ -1165,7 +1165,7 @@ static void get_offset_bone_mat(Bone *bone, float offs_bone[][4])
  *       pose-channel into its local space (i.e. 'visual'-keyframing).
  *       (note: I don't understand that, so I keep it :p --mont29).
  */
-void pchan_to_pose_mat(bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4])
+void BKE_pchan_to_pose_mat(bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4])
 {
        Bone *bone, *parbone;
        bPoseChannel *parchan;
@@ -1254,14 +1254,14 @@ void pchan_to_pose_mat(bPoseChannel *pchan, float rotscale_mat[][4], float loc_m
 /* Convert Pose-Space Matrix to Bone-Space Matrix.
  * NOTE: this cannot be used to convert to pose-space transforms of the supplied
  *       pose-channel into its local space (i.e. 'visual'-keyframing) */
-void armature_mat_pose_to_bone(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_pose_to_bone(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
 {
        float rotscale_mat[4][4], loc_mat[4][4], inmat_[4][4];
 
        /* Security, this allows to call with inmat == outmat! */
        copy_m4_m4(inmat_, inmat);
 
-       pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
+       BKE_pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
        invert_m4(rotscale_mat);
        invert_m4(loc_mat);
 
@@ -1270,14 +1270,14 @@ void armature_mat_pose_to_bone(bPoseChannel *pchan, float inmat[][4], float outm
 }
 
 /* Convert Bone-Space Matrix to Pose-Space Matrix. */
-void armature_mat_bone_to_pose(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_bone_to_pose(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
 {
        float rotscale_mat[4][4], loc_mat[4][4], inmat_[4][4];
 
        /* Security, this allows to call with inmat == outmat! */
        copy_m4_m4(inmat_, inmat);
 
-       pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
+       BKE_pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
 
        mult_m4_m4m4(outmat, rotscale_mat, inmat_);
        mul_v3_m4v3(outmat[3], loc_mat, inmat_[3]);
@@ -1286,7 +1286,7 @@ void armature_mat_bone_to_pose(bPoseChannel *pchan, float inmat[][4], float outm
 /* Convert Pose-Space Location to Bone-Space Location
  * NOTE: this cannot be used to convert to pose-space location of the supplied
  *       pose-channel into its local space (i.e. 'visual'-keyframing) */
-void armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float outloc[3])
+void BKE_armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float outloc[3])
 {
        float xLocMat[4][4] = MAT4_UNITY;
        float nLocMat[4][4];
@@ -1295,29 +1295,29 @@ void armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float
        copy_v3_v3(xLocMat[3], inloc);
 
        /* get bone-space cursor matrix and extract location */
-       armature_mat_pose_to_bone(pchan, xLocMat, nLocMat);
+       BKE_armature_mat_pose_to_bone(pchan, xLocMat, nLocMat);
        copy_v3_v3(outloc, nLocMat[3]);
 }
 
-void armature_mat_pose_to_bone_ex(Object *ob, bPoseChannel *pchan, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_pose_to_bone_ex(Object *ob, bPoseChannel *pchan, float inmat[][4], float outmat[][4])
 {
        bPoseChannel work_pchan = *pchan;
 
        /* recalculate pose matrix with only parent transformations,
         * bone loc/sca/rot is ignored, scene and frame are not used. */
-       where_is_pose_bone(NULL, ob, &work_pchan, 0.0f, FALSE);
+       BKE_pose_where_is_bone(NULL, ob, &work_pchan, 0.0f, FALSE);
 
        /* find the matrix, need to remove the bone transforms first so this is
         * calculated as a matrix to set rather then a difference ontop of whats
         * already there. */
        unit_m4(outmat);
-       pchan_apply_mat4(&work_pchan, outmat, FALSE);
+       BKE_pchan_apply_mat4(&work_pchan, outmat, FALSE);
 
-       armature_mat_pose_to_bone(&work_pchan, inmat, outmat);
+       BKE_armature_mat_pose_to_bone(&work_pchan, inmat, outmat);
 }
 
 /* same as BKE_object_mat3_to_rot() */
-void pchan_mat3_to_rot(bPoseChannel *pchan, float mat[][3], short use_compat)
+void BKE_pchan_mat3_to_rot(bPoseChannel *pchan, float mat[][3], short use_compat)
 {
        switch (pchan->rotmode) {
                case ROT_MODE_QUAT:
@@ -1336,17 +1336,17 @@ void pchan_mat3_to_rot(bPoseChannel *pchan, float mat[][3], short use_compat)
 
 /* Apply a 4x4 matrix to the pose bone,
  * similar to BKE_object_apply_mat4() */
-void pchan_apply_mat4(bPoseChannel *pchan, float mat[][4], short use_compat)
+void BKE_pchan_apply_mat4(bPoseChannel *pchan, float mat[][4], short use_compat)
 {
        float rot[3][3];
        mat4_to_loc_rot_size(pchan->loc, rot, pchan->size, mat);
-       pchan_mat3_to_rot(pchan, rot, use_compat);
+       BKE_pchan_mat3_to_rot(pchan, rot, use_compat);
 }
 
 /* Remove rest-position effects from pose-transform for obtaining
  * 'visual' transformation of pose-channel.
  * (used by the Visual-Keyframing stuff) */
-void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4])
+void BKE_armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4])
 {
        float imat[4][4];
 
@@ -1496,7 +1496,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3])
 
 /* recursive part, calculates restposition of entire tree of children */
 /* used by exiting editmode too */
-void where_is_armature_bone(Bone *bone, Bone *prevbone)
+void BKE_armature_where_is_bone(Bone *bone, Bone *prevbone)
 {
        float vec[3];
 
@@ -1529,19 +1529,19 @@ void where_is_armature_bone(Bone *bone, Bone *prevbone)
        /* and the kiddies */
        prevbone = bone;
        for (bone = bone->childbase.first; bone; bone = bone->next) {
-               where_is_armature_bone(bone, prevbone);
+               BKE_armature_where_is_bone(bone, prevbone);
        }
 }
 
 /* updates vectors and matrices on rest-position level, only needed
  * after editing armature itself, now only on reading file */
-void where_is_armature(bArmature *arm)
+void BKE_armature_where_is(bArmature *arm)
 {
        Bone *bone;
 
        /* hierarchical from root to children */
        for (bone = arm->bonebase.first; bone; bone = bone->next) {
-               where_is_armature_bone(bone, NULL);
+               BKE_armature_where_is_bone(bone, NULL);
        }
 }
 
@@ -1561,7 +1561,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
         * to avoid crashing check for possible errors here */
        for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
                if (pchan->bone->layer & layer_protected) {
-                       if (get_pose_channel(frompose, pchan->name) == NULL) {
+                       if (BKE_pose_channel_find_name(frompose, pchan->name) == NULL) {
                                printf("failed to sync proxy armature because '%s' is missing pose channel '%s'\n",
                                       from->id.name, pchan->name);
                                error = 1;
@@ -1573,7 +1573,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
                return;
 
        /* clear all transformation values from library */
-       rest_pose(frompose);
+       BKE_pose_rest(frompose);
 
        /* copy over all of the proxy's bone groups */
                /* TODO for later
@@ -1585,7 +1585,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
        pose->active_group = frompose->active_group;
 
        for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
-               pchanp = get_pose_channel(frompose, pchan->name);
+               pchanp = BKE_pose_channel_find_name(frompose, pchan->name);
 
                if (pchan->bone->layer & layer_protected) {
                        ListBase proxylocal_constraints = {NULL, NULL};
@@ -1638,7 +1638,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
                        }
 
                        /* free stuff from current channel */
-                       free_pose_channel(pchan);
+                       BKE_pose_channel_free(pchan);
 
                        /* the final copy */
                        *pchan = pchanw;
@@ -1672,7 +1672,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
 
 static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int counter)
 {
-       bPoseChannel *pchan = verify_pose_channel(pose, bone->name); /* verify checks and/or adds */
+       bPoseChannel *pchan = BKE_pose_channel_verify(pose, bone->name); /* verify checks and/or adds */
 
        pchan->bone = bone;
        pchan->parent = parchan;
@@ -1683,7 +1683,7 @@ static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int
                counter = rebuild_pose_bone(pose, bone, pchan, counter);
                /* for quick detecting of next bone in chain, only b-bone uses it now */
                if (bone->flag & BONE_CONNECTED)
-                       pchan->child = get_pose_channel(pose, bone->name);
+                       pchan->child = BKE_pose_channel_find_name(pose, bone->name);
        }
 
        return counter;
@@ -1691,7 +1691,7 @@ static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int
 
 /* only after leave editmode, duplicating, validating older files, library syncing */
 /* NOTE: pose->flag is set for it */
-void armature_rebuild_pose(Object *ob, bArmature *arm)
+void BKE_pose_rebuild(Object *ob, bArmature *arm)
 {
        Bone *bone;
        bPose *pose;
@@ -1723,8 +1723,8 @@ void armature_rebuild_pose(Object *ob, bArmature *arm)
        for (pchan = pose->chanbase.first; pchan; pchan = next) {
                next = pchan->next;
                if (pchan->bone == NULL) {
-                       free_pose_channel(pchan);
-                       free_pose_channels_hash(pose);
+                       BKE_pose_channel_free(pchan);
+                       BKE_pose_channels_hash_free(pose);
                        BLI_freelinkN(&pose->chanbase, pchan);
                }
        }
@@ -1736,7 +1736,7 @@ void armature_rebuild_pose(Object *ob, bArmature *arm)
                pose_proxy_synchronize(ob, ob->proxy, arm->layer_protected);
        }
 
-       update_pose_constraint_flags(ob->pose); /* for IK detection for example */
+       BKE_pose_update_constraint_flags(ob->pose); /* for IK detection for example */
 
        /* the sorting */
        if (counter>1)
@@ -1745,7 +1745,7 @@ void armature_rebuild_pose(Object *ob, bArmature *arm)
        ob->pose->flag &= ~POSE_RECALC;
        ob->pose->flag |= POSE_WAS_REBUILT;
 
-       make_pose_channels_hash(ob->pose);
+       BKE_pose_channels_hash_make(ob->pose);
 }
 
 
@@ -1959,7 +1959,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
        float splineVec[3], scaleFac, radius =1.0f;
 
        /* firstly, calculate the bone matrix the standard way, since this is needed for roll control */
-       where_is_pose_bone(scene, ob, pchan, ctime, 1);
+       BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
 
        copy_v3_v3(poseHead, pchan->pose_head);
        copy_v3_v3(poseTail, pchan->pose_tail);
@@ -2145,7 +2145,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
        copy_v3_v3(pchan->pose_head, poseHead);
 
        /* recalculate tail, as it's now outdated after the head gets adjusted above! */
-       where_is_pose_bone_tail(pchan);
+       BKE_pose_where_is_bone_tail(pchan);
 
        /* done! */
        pchan->flag |= POSE_DONE;
@@ -2183,7 +2183,7 @@ static void splineik_execute_tree(Scene *scene, Object *ob, bPoseChannel *pchan_
 /* ********************** THE POSE SOLVER ******************* */
 
 /* loc/rot/size to given mat4 */
-void pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
+void BKE_pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
 {
        float smat[3][3];
        float rmat[3][3];
@@ -2226,12 +2226,12 @@ void pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
 
 /* loc/rot/size to mat4 */
 /* used in constraint.c too */
-void pchan_calc_mat(bPoseChannel *pchan)
+void BKE_pchan_calc_mat(bPoseChannel *pchan)
 {
        /* this is just a wrapper around the copy of this function which calculates the matrix
         * and stores the result in any given channel
         */
-       pchan_to_mat4(pchan, pchan->chan_mat);
+       BKE_pchan_to_mat4(pchan, pchan->chan_mat);
 }
 
 #if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */
@@ -2361,7 +2361,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
 #endif
 
 /* calculate tail of posechannel */
-void where_is_pose_bone_tail(bPoseChannel *pchan)
+void BKE_pose_where_is_bone_tail(bPoseChannel *pchan)
 {
        float vec[3];
 
@@ -2374,17 +2374,17 @@ void where_is_pose_bone_tail(bPoseChannel *pchan)
 /* pchan is validated, as having bone and parent pointer
  * 'do_extra': when zero skips loc/size/rot, constraints and strip modifiers.
  */
-void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, int do_extra)
+void BKE_pose_where_is_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, int do_extra)
 {
        /* This gives a chan_mat with actions (ipos) results. */
        if (do_extra)
-               pchan_calc_mat(pchan);
+               BKE_pchan_calc_mat(pchan);
        else
                unit_m4(pchan->chan_mat);
 
        /* Construct the posemat based on PoseChannels, that we do before applying constraints. */
        /* pose_mat(b) = pose_mat(b-1) * yoffs(b-1) * d_root(b) * bone_mat(b) * chan_mat(b) */
-       armature_mat_bone_to_pose(pchan, pchan->chan_mat, pchan->pose_mat);
+       BKE_armature_mat_bone_to_pose(pchan, pchan->chan_mat, pchan->pose_mat);
 
        /* Only rootbones get the cyclic offset (unless user doesn't want that). */
        /* XXX That could be a problem for snapping and other "reverse transform" features... */
@@ -2430,12 +2430,12 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti
        /* calculate head */
        copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]);
        /* calculate tail */
-       where_is_pose_bone_tail(pchan);
+       BKE_pose_where_is_bone_tail(pchan);
 }
 
 /* This only reads anim data from channels, and writes to channels */
 /* This is the only function adding poses */
-void where_is_pose(Scene *scene, Object *ob)
+void BKE_pose_where_is(Scene *scene, Object *ob)
 {
        bArmature *arm;
        Bone *bone;
@@ -2450,7 +2450,7 @@ void where_is_pose(Scene *scene, Object *ob)
        if (ELEM(NULL, arm, scene))
                return;
        if ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC))
-               armature_rebuild_pose(ob, arm);
+               BKE_pose_rebuild(ob, arm);
 
        ctime = BKE_scene_frame_get(scene); /* not accurate... */
 
@@ -2494,7 +2494,7 @@ void where_is_pose(Scene *scene, Object *ob)
                        }
                        /* 5. otherwise just call the normal solver */
                        else if (!(pchan->flag & POSE_DONE)) {
-                               where_is_pose_bone(scene, ob, pchan, ctime, 1);
+                               BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
                        }
                }
                /* 6. release the IK tree */
@@ -2523,7 +2523,7 @@ int get_selected_defgroups(Object *ob, char *dg_selection, int defbase_tot)
        if (armob) {
                bPose *pose = armob->pose;
                for (i = 0, defgroup = ob->defbase.first; i < defbase_tot && defgroup; defgroup = defgroup->next, i++) {
-                       bPoseChannel *pchan = get_pose_channel(pose, defgroup->name);
+                       bPoseChannel *pchan = BKE_pose_channel_find_name(pose, defgroup->name);
                        if (pchan && (pchan->bone->flag & BONE_SELECTED)) {
                                dg_selection[i] = TRUE;
                                dg_flags_sel_tot++;
@@ -2545,7 +2545,7 @@ int minmax_armature(Object *ob, float min[3], float max[3])
 {
        bPoseChannel *pchan;
 
-       /* For now, we assume where_is_pose has already been called (hence we have valid data in pachan). */
+       /* For now, we assume BKE_pose_where_is has already been called (hence we have valid data in pachan). */
        for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
                DO_MINMAX(pchan->pose_head, min, max);
                DO_MINMAX(pchan->pose_tail, min, max);
@@ -2584,7 +2584,7 @@ void boundbox_armature(Object *ob, float *loc, float *size)
        BKE_boundbox_init_from_minmax(bb, min, max);
 }
 
-BoundBox *BKE_armature_get_bb(Object *ob)
+BoundBox *BKE_armature_boundbox_get(Object *ob)
 {
        boundbox_armature(ob, NULL, NULL);
 
index 7c225eb..9727932 100644 (file)
@@ -78,7 +78,7 @@ MakeCSGMeshFromBlenderBase(
        Mesh *me;
        if (output == NULL || base == NULL) return 0;
 
-       me = get_mesh(base->object);
+       me = BKE_mesh_from_object(base->object);
                
        output->m_descriptor.user_face_vertex_data_size = 0;
        output->m_descriptor.user_data_size = sizeof(FaceData);
@@ -105,7 +105,7 @@ CSG_LoadBlenderMesh(
        Mesh *me;
        if (output == NULL || obj == NULL) return 0;
 
-       me = get_mesh(obj);
+       me = BKE_mesh_from_object(obj);
                
        output->m_descriptor.user_face_vertex_data_size = 0;
        output->m_descriptor.user_data_size = sizeof(FaceData);
index a244fa9..66209e8 100644 (file)
@@ -308,7 +308,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
                                /* pose to local */
                                else if (to == CONSTRAINT_SPACE_LOCAL) {
                                        if (pchan->bone) {
-                                               armature_mat_pose_to_bone(pchan, mat, mat);
+                                               BKE_armature_mat_pose_to_bone(pchan, mat, mat);
 #if 0  /* XXX Old code, will remove it later. */
                                                constraint_pchan_diff_mat(pchan, diff_mat);
 
@@ -317,7 +317,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
 
                                                /* override with local location */
                                                if ((pchan->parent) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) {
-                                                       armature_mat_pose_to_bone_ex(ob, pchan, pchan->pose_mat, tempmat);
+                                                       BKE_armature_mat_pose_to_bone_ex(ob, pchan, pchan->pose_mat, tempmat);
                                                        copy_v3_v3(mat[3], tempmat[3]);
                                                }
 #endif
@@ -337,7 +337,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
                                /* local to pose - do inverse procedure that was done for pose to local */
                                if (pchan->bone) {
                                        /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */
-                                       armature_mat_bone_to_pose(pchan, mat, mat);
+                                       BKE_armature_mat_bone_to_pose(pchan, mat, mat);
 #if 0
                                        constraint_pchan_diff_mat(pchan, diff_mat);
 
@@ -593,7 +593,7 @@ static void constraint_target_to_mat4 (Object *ob, const char *substring, float
        else {
                bPoseChannel *pchan;
                
-               pchan = get_pose_channel(ob->pose, substring);
+               pchan = BKE_pose_channel_find_name(ob->pose, substring);
                if (pchan) {
                        /* Multiply the PoseSpace accumulation/final matrix for this
                         * PoseChannel by the Armature Object's Matrix to get a worldspace
@@ -687,7 +687,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC
                 \
                if (ct->tar) { \
                        if ((ct->tar->type==OB_ARMATURE) && (ct->subtarget[0])) { \
-                               bPoseChannel *pchan= get_pose_channel(ct->tar->pose, ct->subtarget); \
+                               bPoseChannel *pchan= BKE_pose_channel_find_name(ct->tar->pose, ct->subtarget); \
                                ct->type = CONSTRAINT_OBTYPE_BONE; \
                                ct->rotOrder= (pchan) ? (pchan->rotmode) : EULER_ORDER_DEFAULT; \
                        }\
@@ -2199,18 +2199,18 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
                         */
                        pchan = cob->pchan;
                        
-                       tchan= verify_pose_channel(pose, pchan->name);
+                       tchan= BKE_pose_channel_verify(pose, pchan->name);
                        tchan->rotmode= pchan->rotmode;
                        
                        /* evaluate action using workob (it will only set the PoseChannel in question) */
                        what_does_obaction(cob->ob, &workob, pose, data->act, pchan->name, t);
                        
                        /* convert animation to matrices for use here */
-                       pchan_calc_mat(tchan);
+                       BKE_pchan_calc_mat(tchan);
                        copy_m4_m4(ct->matrix, tchan->chan_mat);
                        
                        /* Clean up */
-                       free_pose(pose);
+                       BKE_pose_free(pose);
                }
                else if (cob->type == CONSTRAINT_OBTYPE_OBJECT) {
                        Object workob;
@@ -4542,7 +4542,7 @@ static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(is
 }
 
 /* helper for copy_constraints(), to be used for making sure that usercounts of copied ID's are fixed up */
-static void con_fix_copied_refs_cb(bConstraint *con, ID **idpoin, short isReference, void *UNUSED(userData))
+static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData))
 {
        /* increment usercount if this is a reference type */
        if ((*idpoin) && (isReference))
index d828764..54655cf 100644 (file)
@@ -2840,7 +2840,7 @@ void DAG_pose_sort(Object *ob)
                                
                                for (ct= targets.first; ct; ct= ct->next) {
                                        if (ct->tar==ob && ct->subtarget[0]) {
-                                               bPoseChannel *target= get_pose_channel(ob->pose, ct->subtarget);
+                                               bPoseChannel *target= BKE_pose_channel_find_name(ob->pose, ct->subtarget);
                                                if (target) {
                                                        node2= dag_get_node(dag, target);
                                                        dag_add_relation(dag, node2, node, 0, "Pose Constraint");
index 71c6c8d..f1942b2 100644 (file)
@@ -1085,7 +1085,7 @@ static bPoseChannel *dtar_get_pchan_ptr (ChannelDriver *driver, DriverTarget *dt
                Object *ob= (Object *)id;
                
                /* get pose, and subsequently, posechannel */
-               return get_pose_channel(ob->pose, dtar->pchan_name);
+               return BKE_pose_channel_find_name(ob->pose, dtar->pchan_name);
        }
        else {
                /* cannot find a posechannel this way */
@@ -1164,7 +1164,7 @@ static float dvar_eval_locDiff (ChannelDriver *driver, DriverVar *dvar)
                }
                
                /* try to get posechannel */
-               pchan= get_pose_channel(ob->pose, dtar->pchan_name);
+               pchan= BKE_pose_channel_find_name(ob->pose, dtar->pchan_name);
                
                /* check if object or bone */
                if (pchan) {
@@ -1251,7 +1251,7 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar)
        }
        
        /* try to get posechannel */
-       pchan= get_pose_channel(ob->pose, dtar->pchan_name);
+       pchan= BKE_pose_channel_find_name(ob->pose, dtar->pchan_name);
        
        /* check if object or bone, and get transform matrix accordingly 
         *      - "useEulers" code is used to prevent the problems associated with non-uniqueness
@@ -1278,7 +1278,7 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar)
                                 * since it stores delta transform of pose_mat so that deforms work
                                 * so it cannot be used here for "transform" space
                                 */
-                               pchan_to_mat4(pchan, mat);
+                               BKE_pchan_to_mat4(pchan, mat);
                        }
                }
                else {
index 1690ad9..88cfa63 100644 (file)
@@ -157,7 +157,7 @@ static void de_interlace_st(struct ImBuf *ibuf)     /* standard fields */
        ibuf->y /= 2;
 }
 
-void image_de_interlace(Image *ima, int odd)
+void BKE_image_de_interlace(Image *ima, int odd)
 {
        ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
        if (ibuf) {
@@ -602,7 +602,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
 }
 
 /* adds new image block, creates ImBuf and initializes color */
-Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
+Image *BKE_image_add_generated(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
 {
        /* on save, type is changed to FILE in editsima.c */
        Image *ima= image_alloc(name, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST);
@@ -626,7 +626,7 @@ Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *n
 }
 
 /* creates an image image owns the imbuf passed */
-Image *BKE_add_image_imbuf(ImBuf *ibuf)
+Image *BKE_image_add_from_imbuf(ImBuf *ibuf)
 {
        /* on save, type is changed to FILE in editsima.c */
        Image *ima;
@@ -678,7 +678,7 @@ void BKE_image_memorypack(Image *ima)
        }
 }
 
-void tag_image_time(Image *ima)
+void BKE_image_tag_time(Image *ima)
 {
        if (ima)
                ima->lastused = (int)PIL_check_seconds_timer();
@@ -1531,7 +1531,7 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
 #undef BUFF_MARGIN_Y
 }
 
-void BKE_stamp_info(Scene *scene, Object *camera, struct ImBuf *ibuf)
+void BKE_imbuf_stamp_info(Scene *scene, Object *camera, struct ImBuf *ibuf)
 {
        struct StampData stamp_data;
 
@@ -1553,7 +1553,7 @@ void BKE_stamp_info(Scene *scene, Object *camera, struct ImBuf *ibuf)
        if (stamp_data.rendertime[0]) IMB_metadata_change_field (ibuf, "RenderTime", stamp_data.rendertime);
 }
 
-int BKE_alphatest_ibuf(ImBuf *ibuf)
+int BKE_imbuf_alpha_test(ImBuf *ibuf)
 {
        int tot;
        if (ibuf->rect_float) {
@@ -1578,7 +1578,7 @@ int BKE_alphatest_ibuf(ImBuf *ibuf)
 
 /* note: imf->planes is ignored here, its assumed the image channels
  * are already set */
-int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
+int BKE_imbuf_write(ImBuf *ibuf, const char *name, ImageFormatData *imf)
 {
        char imtype= imf->imtype;
        char compress= imf->compress;
@@ -1682,9 +1682,9 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
        return(ok);
 }
 
-/* same as BKE_write_ibuf() but crappy workaround not to perminantly modify
+/* same as BKE_imbuf_write() but crappy workaround not to perminantly modify
  * _some_, values in the imbuf */
-int BKE_write_ibuf_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
+int BKE_imbuf_write_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
                       const short save_copy)
 {
        ImBuf ibuf_back= *ibuf;
@@ -1694,7 +1694,7 @@ int BKE_write_ibuf_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
         * this just controls how to save for some formats */
        ibuf->planes= imf->planes;
 
-       ok= BKE_write_ibuf(ibuf, name, imf);
+       ok= BKE_imbuf_write(ibuf, name, imf);
 
        if (save_copy) {
                /* note that we are not restoring _all_ settings */
@@ -1705,12 +1705,12 @@ int BKE_write_ibuf_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
        return ok;
 }
 
-int BKE_write_ibuf_stamp(Scene *scene, struct Object *camera, ImBuf *ibuf, const char *name, struct ImageFormatData *imf)
+int BKE_imbuf_write_stamp(Scene *scene, struct Object *camera, ImBuf *ibuf, const char *name, struct ImageFormatData *imf)
 {
        if (scene && scene->r.stamp & R_STAMP_ALL)
-               BKE_stamp_info(scene, camera, ibuf);
+               BKE_imbuf_stamp_info(scene, camera, ibuf);
 
-       return BKE_write_ibuf(ibuf, name, imf);
+       return BKE_imbuf_write(ibuf, name, imf);
 }
 
 
@@ -2575,7 +2575,7 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r)
                BLI_unlock_thread(LOCK_IMAGE);
        }
 
-       tag_image_time(ima);
+       BKE_image_tag_time(ima);
 
        return ibuf;
 }
@@ -2599,7 +2599,7 @@ ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser)
        return BKE_image_acquire_ibuf(ima, iuser, NULL);
 }
 
-int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
+int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr)
 {
        const int len= (iuser->fie_ima*iuser->frames)/2;
 
@@ -2639,9 +2639,9 @@ int BKE_image_user_get_frame(const ImageUser *iuser, int cfra, int fieldnr)
        }
 }
 
-void BKE_image_user_calc_frame(ImageUser *iuser, int cfra, int fieldnr)
+void BKE_image_user_frame_calc(ImageUser *iuser, int cfra, int fieldnr)
 {
-       const int framenr= BKE_image_user_get_frame(iuser, cfra, fieldnr);
+       const int framenr= BKE_image_user_frame_get(iuser, cfra, fieldnr);
 
        /* allows image users to handle redraws */
        if (iuser->flag & IMA_ANIM_ALWAYS)
index d7af24b..c2cb45d 100644 (file)
@@ -1104,7 +1104,7 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
                /* ... xxx, the other vars don't need to be filled in */
                
                /* get the group to use */
-               agrp= action_groups_find_named(&tmp_act, grpname);
+               agrp= BKE_action_group_find_name(&tmp_act, grpname);
                /* no matching group, so add one */
                if (agrp == NULL) {
                        /* Add a new group, and make it active */
index 927a439..e7206af 100644 (file)
@@ -51,7 +51,7 @@
 #include "BKE_main.h"
 #include "BKE_node.h"
 
-void *add_lamp(const char *name)
+void *BKE_lamp_add(const char *name)
 {
        Lamp *la;
        
@@ -155,7 +155,7 @@ Lamp *localize_lamp(Lamp *la)
        return lan;
 }
 
-void make_local_lamp(Lamp *la)
+void BKE_lamp_make_local(Lamp *la)
 {
        Main *bmain= G.main;
        Object *ob;
index d9ee958..12496e7 100644 (file)
@@ -83,7 +83,7 @@ void calc_lat_fudu(int flag, int res, float *fu, float *du)
        }
 }
 
-void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
+void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
 {
        BPoint *bp;
        int i, u, v, w;
@@ -184,7 +184,7 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
        MEM_freeN(vertexCos);
 }
 
-Lattice *add_lattice(const char *name)
+Lattice *BKE_lattice_add(const char *name)
 {
        Lattice *lt;
        
@@ -195,7 +195,7 @@ Lattice *add_lattice(const char *name)
        lt->typeu= lt->typev= lt->typew= KEY_BSPLINE;
        
        lt->def= MEM_callocN(sizeof(BPoint), "lattvert"); /* temporary */
-       resizelattice(lt, 2, 2, 2, NULL);       /* creates a uniform lattice */
+       BKE_lattice_resize(lt, 2, 2, 2, NULL);  /* creates a uniform lattice */
                
        return lt;
 }
@@ -353,7 +353,7 @@ void calc_latt_deform(Object *ob, float co[3], float weight)
        /* vgroup influence */
        int defgroup_nr= -1;
        float co_prev[3], weight_blend= 0.0f;
-       MDeformVert *dvert= lattice_get_deform_verts(ob);
+       MDeformVert *dvert= BKE_lattice_deform_verts_get(ob);
 
 
        if (lt->editlatt) lt= lt->editlatt->latt;
@@ -928,7 +928,7 @@ void outside_lattice(Lattice *lt)
        }
 }
 
-float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
+float (*BKE_lattice_vertexcos_get(struct Object *ob, int *numVerts_r))[3]
 {
        Lattice *lt = ob->data;
        int i, numVerts;
@@ -946,7 +946,7 @@ float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
        return vertexCos;
 }
 
-void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3])
+void BKE_lattice_vertexcos_apply(struct Object *ob, float (*vertexCos)[3])
 {
        Lattice *lt = ob->data;
        int i, numVerts = lt->pntsu*lt->pntsv*lt->pntsw;
@@ -956,7 +956,7 @@ void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3])
        }
 }
 
-void lattice_calc_modifiers(Scene *scene, Object *ob)
+void BKE_lattice_modifiers_calc(Scene *scene, Object *ob)
 {
        Lattice *lt= ob->data;
        ModifierData *md = modifiers_getVirtualModifierList(ob);
@@ -975,12 +975,12 @@ void lattice_calc_modifiers(Scene *scene, Object *ob)
                if (mti->isDisabled && mti->isDisabled(md, 0)) continue;
                if (mti->type!=eModifierTypeType_OnlyDeform) continue;
 
-               if (!vertexCos) vertexCos = lattice_getVertexCos(ob, &numVerts);
+               if (!vertexCos) vertexCos = BKE_lattice_vertexcos_get(ob, &numVerts);
                mti->deformVerts(md, ob, NULL, vertexCos, numVerts, 0, 0);
        }
 
        /* always displist to make this work like derivedmesh */
-       if (!vertexCos) vertexCos = lattice_getVertexCos(ob, &numVerts);
+       if (!vertexCos) vertexCos = BKE_lattice_vertexcos_get(ob, &numVerts);
        
        {
                DispList *dl = MEM_callocN(sizeof(*dl), "lt_dl");
@@ -993,7 +993,7 @@ void lattice_calc_modifiers(Scene *scene, Object *ob)
        }
 }
 
-struct MDeformVert* lattice_get_deform_verts(struct Object *oblatt)
+struct MDeformVert* BKE_lattice_deform_verts_get(struct Object *oblatt)
 {
        Lattice *lt = (Lattice*)oblatt->data;
        BLI_assert(oblatt->type == OB_LATTICE);
index e952056..8d64334 100644 (file)
@@ -206,10 +206,10 @@ int id_make_local(ID *id, int test)
                        if (!test) BKE_metaball_make_local((MetaBall *)id);
                        return 1;
                case ID_MA:
-                       if (!test) make_local_material((Material *)id);
+                       if (!test) BKE_material_make_local((Material *)id);
                        return 1;
                case ID_TE:
-                       if (!test) make_local_texture((Tex *)id);
+                       if (!test) BKE_texture_make_local((Tex *)id);
                        return 1;
                case ID_IM:
                        if (!test) BKE_image_make_local((Image *)id);
@@ -221,13 +221,13 @@ int id_make_local(ID *id, int test)
                        }
                        return 1;
                case ID_LA:
-                       if (!test) make_local_lamp((Lamp *)id);
+                       if (!test) BKE_lamp_make_local((Lamp *)id);
                        return 1;
                case ID_CA:
                        if (!test) BKE_camera_make_local((Camera *)id);
                        return 1;
                case ID_SPK:
-                       if (!test) make_local_speaker((Speaker *)id);
+                       if (!test) BKE_speaker_make_local((Speaker *)id);
                        return 1;
                case ID_IP:
                        return 0; /* deprecated */
@@ -943,7 +943,7 @@ void free_main(Main *mainvar)
 /* ***************** ID ************************ */
 
 
-ID *find_id(const char *type, const char *name)                /* type: "OB" or "MA" etc */
+ID *BKE_libblock_find_name(const char *type, const char *name)         /* type: "OB" or "MA" etc */
 {
        ListBase *lb= which_libbase(G.main, GS(type));
        return BLI_findstring(lb, name, offsetof(ID, name) + 2);
index 16b3cb6..f4d9bcf 100644 (file)
@@ -199,7 +199,7 @@ void init_material(Material *ma)
        ma->preview = NULL;
 }
 
-Material *add_material(const char *name)
+Material *BKE_material_add(const char *name)
 {
        Material *ma;
 
@@ -280,7 +280,7 @@ static void extern_local_material(Material *ma)
        }
 }
 
-void make_local_material(Material *ma)
+void BKE_material_make_local(Material *ma)
 {
        Main *bmain= G.main;
        Object *ob;
@@ -1674,7 +1674,7 @@ static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag)
        }
        /* create a new material */
        else {
-               ma= add_material(idname+2);
+               ma= BKE_material_add(idname+2);
 
                if (ma) {
                        printf("TexFace Convert: Material \"%s\" created.\n", idname+2);
index da758ea..fd054de 100644 (file)
@@ -484,7 +484,7 @@ static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata)
        memset(&mesh->fdata, 0, sizeof(mesh->fdata));
 }
 
-Mesh *add_mesh(const char *name)
+Mesh *BKE_mesh_add(const char *name)
 {
        Mesh *me;
        
@@ -846,7 +846,7 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
        return nr;
 }
 
-Mesh *get_mesh(Object *ob)
+Mesh *BKE_mesh_from_object(Object *ob)
 {
        
        if (ob==NULL) return NULL;
@@ -1489,7 +1489,7 @@ void nurbs_to_mesh(Object *ob)
                }
 
                /* make mesh */
-               me= add_mesh("Mesh");
+               me= BKE_mesh_add("Mesh");
                me->totvert= totvert;
                me->totedge= totedge;
                me->totloop = totloop;
@@ -1505,7 +1505,7 @@ void nurbs_to_mesh(Object *ob)
                BKE_mesh_calc_edges(me, TRUE);
        }
        else {
-               me= add_mesh("Mesh");
+               me= BKE_mesh_add("Mesh");
                DM_to_mesh(dm, me, ob);
        }
 
index bc7d3af..e432428 100644 (file)
@@ -381,7 +381,7 @@ void multires_force_update(Object *ob)
 
 void multires_force_external_reload(Object *ob)
 {
-       Mesh *me = get_mesh(ob);
+       Mesh *me = BKE_mesh_from_object(ob);
 
        CustomData_external_reload(&me->ldata, &me->id, CD_MASK_MDISPS, me->totloop);
        multires_force_update(ob);
@@ -650,7 +650,7 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl)
 /* direction=1 for delete higher, direction=0 for lower (not implemented yet) */
 void multiresModifier_del_levels(MultiresModifierData *mmd, Object *ob, int direction)
 {
-       Mesh *me = get_mesh(ob);
+       Mesh *me = BKE_mesh_from_object(ob);
        int lvl = multires_get_level(ob, mmd, 0);
        int levels = mmd->totlvl - lvl;
        MDisps *mdisps;
@@ -717,7 +717,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
 
        multires_force_update(ob);
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        totlvl = mmd->totlvl;
 
        /* nothing to do */
index 3cdf45e..14f2303 100644 (file)
@@ -321,7 +321,7 @@ void BKE_object_free(Object *ob)
        if (ob->defbase.first)
                BLI_freelistN(&ob->defbase);
        if (ob->pose)
-               free_pose(ob->pose);
+               BKE_pose_free(ob->pose);
        if (ob->mpath)
                animviz_free_motionpath(ob->mpath);
        free_properties(&ob->prop);
@@ -730,17 +730,17 @@ int BKE_object_exists_check(Object *obtest)
 void *BKE_object_obdata_add_from_type(int type)
 {
        switch (type) {
-       case OB_MESH: return add_mesh("Mesh");
-       case OB_CURVE: return BKE_curve_add("Curve", OB_CURVE);
-       case OB_SURF: return BKE_curve_add("Surf", OB_SURF);
-       case OB_FONT: return BKE_curve_add("Text", OB_FONT);
-       case OB_MBALL: return BKE_metaball_add("Meta");
-       case OB_CAMERA: return BKE_camera_add("Camera");
-       case OB_LAMP: return add_lamp("Lamp");
-       case OB_LATTICE: return add_lattice("Lattice");
-       case OB_ARMATURE: return add_armature("Armature");
-       case OB_SPEAKER: return add_speaker("Speaker");
-       case OB_EMPTY: return NULL;
+       case OB_MESH:      return BKE_mesh_add("Mesh");
+       case OB_CURVE:     return BKE_curve_add("Curve", OB_CURVE);
+       case OB_SURF:      return BKE_curve_add("Surf", OB_SURF);
+       case OB_FONT:      return BKE_curve_add("Text", OB_FONT);
+       case OB_MBALL:     return BKE_metaball_add("Meta");
+       case OB_CAMERA:    return BKE_camera_add("Camera");
+       case OB_LAMP:      return BKE_lamp_add("Lamp");
+       case OB_LATTICE:   return BKE_lattice_add("Lattice");
+       case OB_ARMATURE:  return BKE_armature_add("Armature");
+       case OB_SPEAKER:   return BKE_speaker_add("Speaker");
+       case OB_EMPTY:     return NULL;
        default:
                printf("BKE_object_obdata_add_from_type: Internal error, bad type: %d\n", type);
                return NULL;
@@ -1027,9 +1027,9 @@ static void copy_object_pose(Object *obn, Object *ob)
 {
        bPoseChannel *chan;
        
-       /* note: need to clear obn->pose pointer first, so that copy_pose works (otherwise there's a crash) */
+       /* note: need to clear obn->pose pointer first, so that BKE_pose_copy_data works (otherwise there's a crash) */
        obn->pose= NULL;
-       copy_pose(&obn->pose, ob->pose, 1);     /* 1 = copy constraints */
+       BKE_pose_copy_data(&obn->pose, ob->pose, 1);    /* 1 = copy constraints */
 
        for (chan = obn->pose->chanbase.first; chan; chan=chan->next) {
                bConstraint *con;
@@ -1134,7 +1134,7 @@ Object *BKE_object_copy(Object *ob)
                copy_object_pose(obn, ob);
                /* backwards compat... non-armatures can get poses in older files? */
                if (ob->type==OB_ARMATURE)
-                       armature_rebuild_pose(obn, obn->data);
+                       BKE_pose_rebuild(obn, obn->data);
        }
        defgroup_copy_list(&obn->defbase, &ob->defbase);
        copy_constraints(&obn->constraints, &ob->constraints, TRUE);
@@ -1400,8 +1400,8 @@ void BKE_object_make_proxy(Object *ob, Object *target, Object *gob)
        /* type conversions */
        if (target->type == OB_ARMATURE) {
                copy_object_pose(ob, target);   /* data copy, object pointers in constraints */
-               rest_pose(ob->pose);                    /* clear all transforms in channels */
-               armature_rebuild_pose(ob, ob->data);    /* set all internal links */
+               BKE_pose_rest(ob->pose);                        /* clear all transforms in channels */
+               BKE_pose_rebuild(ob, ob->data); /* set all internal links */
                
                armature_set_id_extern(ob);
        }
@@ -1570,7 +1570,7 @@ void BKE_object_tfm_protected_restore(Object *ob,
        }
 }
 
-/* see pchan_apply_mat4() for the equivalent 'pchan' function */
+/* see BKE_pchan_apply_mat4() for the equivalent 'pchan' function */
 void BKE_object_apply_mat4(Object *ob, float mat[][4], const short use_compat, const short use_parent)
 {
        float rot[3][3];
@@ -1723,7 +1723,7 @@ static void ob_parbone(Object *ob, Object *par, float mat[][4])
        }
        
        /* Make sure the bone is still valid */
-       pchan= get_pose_channel(par->pose, ob->parsubstr);
+       pchan= BKE_pose_channel_find_name(par->pose, ob->parsubstr);
        if (!pchan) {
                printf ("Object %s with Bone parent: bone %s doesn't exist\n", ob->id.name+2, ob->parsubstr);
                unit_m4(mat);
@@ -2295,7 +2295,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
                break;
        case OB_MESH:
                {
-                       Mesh *me= get_mesh(ob);
+                       Mesh *me= BKE_mesh_from_object(ob);
 
                        if (me) {
                                bb = *mesh_get_bb(ob);
@@ -2499,7 +2499,7 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
        if (ob->recalc & OB_RECALC_ALL) {
                /* speed optimization for animation lookups */
                if (ob->pose)
-                       make_pose_channels_hash(ob->pose);
+                       BKE_pose_channels_hash_make(ob->pose);
 
                if (ob->recalc & OB_RECALC_DATA) {
                        if (ob->type==OB_ARMATURE) {
@@ -2508,7 +2508,7 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
                                 * is evaluated on the rebuilt pose, otherwise we get incorrect poses
                                 * on file load */
                                if (ob->pose==NULL || (ob->pose->flag & POSE_RECALC))
-                                       armature_rebuild_pose(ob, ob->data);
+                                       BKE_pose_rebuild(ob, ob->data);
                        }
                }
 
@@ -2585,10 +2585,10 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
                        case OB_ARMATURE:
                                if (ob->id.lib && ob->proxy_from) {
                                        // printf("pose proxy copy, lib ob %s proxy %s\n", ob->id.name, ob->proxy_from->id.name);
-                                       copy_pose_result(ob->pose, ob->proxy_from->pose);
+                                       BKE_pose_copy_result(ob->pose, ob->proxy_from->pose);
                                }
                                else {
-                                       where_is_pose(scene, ob);
+                                       BKE_pose_where_is(scene, ob);
                                }
                                break;
 
@@ -2603,7 +2603,7 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
                                break;
                                
                        case OB_LATTICE:
-                               lattice_calc_modifiers(scene, ob);
+                               BKE_lattice_modifiers_calc(scene, ob);
                                break;
                        }
 
index 4ddcd6f..6242976 100644 (file)
@@ -1251,18 +1251,18 @@ void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v
 
                /* write the images */
                cache_filename(string, och->bakepath, och->relbase, f, CACHE_TYPE_DISPLACE);
-               if (0 == BKE_write_ibuf(ibuf_disp, string, &imf))
+               if (0 == BKE_imbuf_write(ibuf_disp, string, &imf))
                        printf("Cannot save Displacement File Output to %s\n", string);
 
                if (o->_do_jacobian) {
                        cache_filename(string, och->bakepath, och->relbase,  f, CACHE_TYPE_FOAM);
-                       if (0 == BKE_write_ibuf(ibuf_foam, string, &imf))
+                       if (0 == BKE_imbuf_write(ibuf_foam, string, &imf))
                                printf("Cannot save Foam File Output to %s\n", string);
                }
 
                if (o->_do_normals) {
                        cache_filename(string, och->bakepath,  och->relbase, f, CACHE_TYPE_NORMAL);
-                       if (0 == BKE_write_ibuf(ibuf_normal, string, &imf))
+                       if (0 == BKE_imbuf_write(ibuf_normal, string, &imf))
                                printf("Cannot save Normal File Output to %s\n", string);
                }
 
index 9e21538..2673200 100644 (file)
@@ -615,7 +615,7 @@ void BKE_scene_set_background(Main *bmain, Scene *scene)
 /* called from creator.c */
 Scene *BKE_scene_set_name(Main *bmain, const char *name)
 {
-       Scene *sce= (Scene *)find_id("SC", name);
+       Scene *sce= (Scene *)BKE_libblock_find_name("SC", name);
        if (sce) {
                BKE_scene_set_background(bmain, sce);
                printf("Scene switch: '%s' in file: '%s'\n", name, G.main->name);
index d6fea87..fdda1c6 100644 (file)
@@ -492,7 +492,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
                calc.dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
        }
        else if (calc.ob->type == OB_LATTICE) {
-               calc.dvert = lattice_get_deform_verts(calc.ob);
+               calc.dvert = BKE_lattice_deform_verts_get(calc.ob);
        }
 
 
index d3c3822..e94a11b 100644 (file)
@@ -43,7 +43,7 @@
 #include "BKE_main.h"
 #include "BKE_speaker.h"
 
-void *add_speaker(const char *name)
+void *BKE_speaker_add(const char *name)
 {
        Speaker *spk;
 
@@ -76,7 +76,7 @@ Speaker *BKE_speaker_copy(Speaker *spk)
        return spkn;
 }
 
-void make_local_speaker(Speaker *spk)
+void BKE_speaker_make_local(Speaker *spk)
 {
        Main *bmain= G.main;
        Object *ob;
index 5ba3e95..9b3689d 100644 (file)
@@ -901,7 +901,7 @@ static void extern_local_texture(Tex *tex)
        id_lib_extern((ID *)tex->ima);
 }
 
-void make_local_texture(Tex *tex)
+void BKE_texture_make_local(Tex *tex)
 {
        Main *bmain= G.main;
        Material *ma;
index ec7d580..637bb08 100644 (file)
@@ -2574,7 +2574,7 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
                
                /* sync proxy active bone */
                if (pose->proxy_act_bone[0]) {
-                       Bone *bone = get_named_bone(arm, pose->proxy_act_bone);
+                       Bone *bone = BKE_armature_find_bone_name(arm, pose->proxy_act_bone);
                        if (bone)
                                arm->act_bone = bone;
                }
@@ -2584,7 +2584,7 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
                lib_link_constraints(fd, (ID *)ob, &pchan->constraints);
                
                /* hurms... loop in a loop, but yah... later... (ton) */
-               pchan->bone= get_named_bone(arm, pchan->name);
+               pchan->bone= BKE_armature_find_bone_name(arm, pchan->name);
                
                pchan->custom= newlibadr_us(fd, arm->id.lib, pchan->custom);
                if (pchan->bone==NULL)
@@ -4096,7 +4096,7 @@ static void lib_link_object(FileData *fd, Main *main)
                                warn= 1;
 
                                if (ob->pose) {
-                                       free_pose(ob->pose);
+                                       BKE_pose_free(ob->pose);
                                        ob->pose= NULL;
                                        ob->mode &= ~OB_MODE_POSE;
                                }
index 6b03fab..43d32b4 100644 (file)
@@ -1854,7 +1854,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
                
                // armature recode checks 
                for (arm= main->armature.first; arm; arm= arm->id.next) {
-                       where_is_armature(arm);
+                       BKE_armature_where_is(arm);
 
                        for (bone= arm->bonebase.first; bone; bone= bone->next)
                                do_version_bone_head_tail_237(bone);
@@ -1866,7 +1866,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
                                        ob->partype = PARSKEL;
                        }
 
-                       // btw. armature_rebuild_pose is further only called on leave editmode
+                       // btw. BKE_pose_rebuild is further only called on leave editmode
                        if (ob->type==OB_ARMATURE) {
                                if (ob->pose)
                                        ob->pose->flag |= POSE_RECALC;
index c741ebb..11f6b97 100644 (file)
@@ -1271,7 +1271,7 @@ static void write_pose(WriteData *wd, bPose *pose)
 
        /* write IK param */
        if (pose->ikparam) {
-               char *structname = (char *)get_ikparam_name(pose);
+               char *structname = (char *)BKE_pose_ikparam_get_name(pose);
                if (structname)
                        writestruct(wd, DATA, structname, 1, pose->ikparam);
        }
index 3c90c5a..3e40afa 100644 (file)
@@ -371,7 +371,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
        }
 
        if (!(fcu)) return; 
-       bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);
+       bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name);
        if (!pchan)
                return;
 
@@ -379,7 +379,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
 
        if (flag & ARM_RESTPOS) {
                arm->flag &= ~ARM_RESTPOS;
-               where_is_pose(scene, ob_arm);
+               BKE_pose_where_is(scene, ob_arm);
        }
 
        if (fra.size()) {
@@ -388,7 +388,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
 
        if (flag & ARM_RESTPOS) 
                arm->flag = flag;
-       where_is_pose(scene, ob_arm);
+       BKE_pose_where_is(scene, ob_arm);
 }
 
 void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_arm, Bone *bone)
@@ -739,7 +739,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj
        bPoseChannel *pchan = NULL;
        bPose *pose = ob_arm->pose;
 
-       pchan = get_pose_channel(pose, bone->name);
+       pchan = BKE_pose_channel_find_name(pose, bone->name);
 
        if (!pchan)
                return "";
@@ -756,7 +756,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj
                float ctime = BKE_scene_frame_get_from_ctime(scene, *it);
 
                BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
-               where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
+               BKE_pose_where_is_bone(scene, ob_arm, pchan, ctime, 1);
 
                // compute bone local mat
                if (bone->parent) {
@@ -1206,7 +1206,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo
 
        BLI_snprintf(prefix, sizeof(prefix), "pose.bones[\"%s\"]", bone->name);
 
-       bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);
+       bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name);
        if (!pchan)
                return;
        //Fill frame array with key frame values framed at \param:transform_type
@@ -1227,7 +1227,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo
        // exit rest position
        if (flag & ARM_RESTPOS) {
                arm->flag &= ~ARM_RESTPOS;
-               where_is_pose(scene, ob_arm);
+               BKE_pose_where_is(scene, ob_arm);
        }
        //v array will hold all values which will be exported. 
        if (fra.size()) {
@@ -1257,7 +1257,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo
        // restore restpos
        if (flag & ARM_RESTPOS) 
                arm->flag = flag;
-       where_is_pose(scene, ob_arm);
+       BKE_pose_where_is(scene, ob_arm);
 }
 
 void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, int type, Bone *bone, Object *ob_arm, bPoseChannel *pchan)
@@ -1265,7 +1265,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
        bPoseChannel *parchan = NULL;
        bPose *pose = ob_arm->pose;
 
-       pchan = get_pose_channel(pose, bone->name);
+       pchan = BKE_pose_channel_find_name(pose, bone->name);
 
        if (!pchan)
                return;
@@ -1282,7 +1282,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
 
 
                BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
-               where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
+               BKE_pose_where_is_bone(scene, ob_arm, pchan, ctime, 1);
 
                // compute bone local mat
                if (bone->parent) {
index d6b6bfe..1950578 100644 (file)
@@ -206,7 +206,7 @@ void AnimationImporter::add_fcurves_to_object(Object *ob, std::vector<FCurve*>&
                        
                        if (bone_name) {
                                /* try to find group */
-                               grp = action_groups_find_named(act, bone_name);
+                               grp = BKE_action_group_find_name(act, bone_name);
                                
                                /* no matching groups, so add one */
                                if (grp == NULL) {
@@ -361,7 +361,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
                        create_fcurve(3, rna_path)
                };
 
-               bPoseChannel *chan = get_pose_channel(ob->pose, grp->name);
+               bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, grp->name);
 
                float m4[4][4], irest[3][3];
                invert_m4_m4(m4, chan->bone->arm_mat);
@@ -670,7 +670,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>&
                get_joint_rest_mat(irest_dae, root, node);
                invert_m4(irest_dae);
 
-               Bone *bone = get_named_bone((bArmature*)ob->data, bone_name);
+               Bone *bone = BKE_armature_find_bone_name((bArmature*)ob->data, bone_name);
                if (!bone) {
                        fprintf(stderr, "cannot find bone \"%s\"\n", bone_name);
                        return;
@@ -784,7 +784,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>&
        }
 
        if (is_joint) {
-               bPoseChannel *chan = get_pose_channel(ob->pose, bone_name);
+               bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, bone_name);
                chan->rotmode = ROT_MODE_QUAT;
        }
        else {
@@ -1025,7 +1025,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCur
        get_joint_rest_mat(irest_dae, root, node);
        invert_m4(irest_dae);
 
-       Bone *bone = get_named_bone((bArmature*)ob->data, bone_name);
+       Bone *bone = BKE_armature_find_bone_name((bArmature*)ob->data, bone_name);
        if (!bone) {
                fprintf(stderr, "cannot find bone \"%s\"\n", bone_name);
                return;
@@ -1123,7 +1123,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCur
                add_bone_fcurve(ob, node, newcu[i]);
        }
 
-       bPoseChannel *chan = get_pose_channel(ob->pose, bone_name);
+       bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, bone_name);
        chan->rotmode = ROT_MODE_QUAT;
 
 }
@@ -1307,7 +1307,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node,
                get_joint_rest_mat(irest_dae, root, node);
                invert_m4(irest_dae);
 
-               Bone *bone = get_named_bone((bArmature*)ob->data, bone_name);
+               Bone *bone = BKE_armature_find_bone_name((bArmature*)ob->data, bone_name);
                if (!bone) {
                        fprintf(stderr, "cannot find bone \"%s\"\n", bone_name);
                        return NULL;
@@ -1515,7 +1515,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node,
 
        if (is_rotation || is_matrix) {
                if (is_joint) {
-                       bPoseChannel *chan = get_pose_channel(ob->pose, bone_name);
+                       bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, bone_name);
                        chan->rotmode = ROT_MODE_QUAT;
                }
                else {
@@ -1849,7 +1849,7 @@ void AnimationImporter::add_bone_fcurve(Object *ob, COLLADAFW::Node *node, FCurv
        bAction *act = ob->adt->action;
                        
        /* try to find group */
-       bActionGroup *grp = action_groups_find_named(act, bone_name);
+       bActionGroup *grp = BKE_action_group_find_name(act, bone_name);
 
        /* no matching groups, so add one */
        if (grp == NULL) {
index d5a3b4c..38a5e9b 100644 (file)
@@ -251,13 +251,13 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene* sce,
 }*/
 void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node)
 {
-       bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);
+       bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name);
 
        float mat[4][4];
 
        if (bone->parent) {
                // get bone-space matrix from armature-space
-               bPoseChannel *parchan = get_pose_channel(ob_arm->pose, bone->parent->name);
+               bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, bone->parent->name);
 
                float invpar[4][4];
                invert_m4_m4(invpar, parchan->pose_mat);
@@ -481,12 +481,12 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase
        // put armature in rest position
        if (!(arm->flag & ARM_RESTPOS)) {
                arm->flag |= ARM_RESTPOS;
-               where_is_pose(scene, ob_arm);
+               BKE_pose_where_is(scene, ob_arm);
        }
 
        for (bDeformGroup *def = (bDeformGroup*)defbase->first; def; def = def->next) {
                if (is_bone_defgroup(ob_arm, def)) {
-                       bPoseChannel *pchan = get_pose_channel(pose, def->name);
+                       bPoseChannel *pchan = BKE_pose_channel_find_name(pose, def->name);
 
                        float mat[4][4];
                        float world[4][4];
@@ -515,7 +515,7 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase
        // back from rest positon
        if (!(flag & ARM_RESTPOS)) {
                arm->flag = flag;
-               where_is_pose(scene, ob_arm);
+               BKE_pose_where_is(scene, ob_arm);
        }
 
        source.finish();
@@ -525,7 +525,7 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase
 
 Bone *ArmatureExporter::get_bone_from_defgroup(Object *ob_arm, bDeformGroup* def)
 {
-       bPoseChannel *pchan = get_pose_channel(ob_arm->pose, def->name);
+       bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, def->name);
        return pchan ? pchan->bone : NULL;
 }
 
index 4316edf..97de759 100644 (file)
@@ -321,7 +321,7 @@ void ArmatureImporter::set_leaf_bone_shapes(Object *ob_arm)
        for (it = leaf_bones.begin(); it != leaf_bones.end(); it++) {
                LeafBone& leaf = *it;
 
-               bPoseChannel *pchan = get_pose_channel(pose, leaf.name);
+               bPoseChannel *pchan = BKE_pose_channel_find_name(pose, leaf.name);
                if (pchan) {
                        pchan->custom = get_empty_for_leaves();
                }
@@ -499,7 +499,7 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
        std::map<COLLADAFW::UniqueId, SkinInfo>::iterator it;
        for (it = skin_by_data_uid.begin(); it != skin_by_data_uid.end(); it++) {
                SkinInfo *b = &it->second;
-               if (b == a || b->get_armature() == NULL)
+               if (b == a || b->BKE_armature_from_object() == NULL)
                        continue;
 
                skin_root_joints.clear();
@@ -509,7 +509,7 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
                std::vector<COLLADAFW::Node*>::iterator ri;
                for (ri = skin_root_joints.begin(); ri != skin_root_joints.end(); ri++) {
                        if (a->uses_joint_or_descendant(*ri)) {
-                               shared = b->get_armature();
+                               shared = b->BKE_armature_from_object();
                                break;
                        }
                }
@@ -582,13 +582,13 @@ void ArmatureImporter::set_pose(Object * ob_arm,  COLLADAFW::Node * root_node, c
        get_node_mat(obmat, root_node, NULL, NULL);
 
        //if (*edbone)
-       bPoseChannel * pchan  = get_pose_channel(ob_arm -> pose, bone_name);
+       bPoseChannel * pchan  = BKE_pose_channel_find_name(ob_arm -> pose, bone_name);
        //else fprintf ( "",
 
        // get world-space
        if (parentname) {
                mult_m4_m4m4(mat, parent_mat, obmat);
-               bPoseChannel *parchan = get_pose_channel(ob_arm->pose, parentname);
+               bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, parentname);
 
                mult_m4_m4m4(pchan->pose_mat, parchan->pose_mat, mat );
 
@@ -660,7 +660,7 @@ void ArmatureImporter::make_armatures(bContext *C)
                // set armature parent if any
                Object *par = skin.get_parent();
                if (par)
-                       bc_set_parent(skin.get_armature(), par, C, false);
+                       bc_set_parent(skin.BKE_armature_from_object(), par, C, false);
 
                // free memory stolen from SkinControllerData
                skin.free();
@@ -761,7 +761,7 @@ Object *ArmatureImporter::get_armature_for_joint(COLLADAFW::Node *node)
                SkinInfo& skin = it->second;
 
                if (skin.uses_joint_or_descendant(node))
-                       return skin.get_armature();
+                       return skin.BKE_armature_from_object();
        }
 
        std::map<COLLADAFW::UniqueId, Object*>::iterator arm;
index 98a30fb..6dca782 100644 (file)
@@ -572,7 +572,7 @@ bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat )
                return true;
                
        const std::string& str_mat_id = cmat->getName().size() ? cmat->getName() : cmat->getOriginalId();
-       Material *ma = add_material((char*)str_mat_id.c_str());
+       Material *ma = BKE_material_add((char*)str_mat_id.c_str());
        
        this->uid_effect_map[cmat->getInstantiatedEffect()] = ma;
        this->uid_material_map[cmat->getUniqueId()] = ma;
@@ -949,8 +949,8 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
 
        la_id = light->getOriginalId();
        la_name = light->getName();
-       if (la_name.size()) lamp = (Lamp*)add_lamp((char*)la_name.c_str());
-       else lamp = (Lamp*)add_lamp((char*)la_id.c_str());
+       if (la_name.size()) lamp = (Lamp*)BKE_lamp_add((char*)la_name.c_str());
+       else lamp = (Lamp*)BKE_lamp_add((char*)la_id.c_str());
 
        if (!lamp) {
                fprintf(stderr, "Cannot create lamp.\n");
index c209751..ca1f2d2 100644 (file)
@@ -962,7 +962,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom)
        }
        
        const std::string& str_geom_id = mesh->getName().size() ? mesh->getName() : mesh->getOriginalId();
-       Mesh *me = add_mesh((char*)str_geom_id.c_str());
+       Mesh *me = BKE_mesh_add((char*)str_geom_id.c_str());
        me->id.us--; // is already 1 here, but will be set later in set_mesh
 
        // store the Mesh pointer to link it later with an Object
index d807b04..f7cb7dc 100644 (file)
@@ -178,7 +178,7 @@ bool SkinInfo::get_joint_inv_bind_matrix(float inv_bind_mat[][4], COLLADAFW::Nod
        return false;
 }
 
-Object *SkinInfo::get_armature()
+Object *SkinInfo::BKE_armature_from_object()
 {
        return ob_arm;
 }
@@ -288,7 +288,7 @@ void SkinInfo::link_armature(bContext *C, Object *ob, std::map<COLLADAFW::Unique
 
 bPoseChannel *SkinInfo::get_pose_channel_from_node(COLLADAFW::Node *node)
 {
-       return get_pose_channel(ob_arm->pose, bc_get_joint_name(node));
+       return BKE_pose_channel_find_name(ob_arm->pose, bc_get_joint_name(node));
 }
 
 void SkinInfo::set_parent(Object *_parent)
index 7befe71..894f53f 100644 (file)
@@ -105,7 +105,7 @@ public:
 
        bool get_joint_inv_bind_matrix(float inv_bind_mat[][4], COLLADAFW::Node *node);
 
-       Object *get_armature();
+       Object *BKE_armature_from_object();
 
        const COLLADAFW::UniqueId& get_controller_uid();
 
index b449c11..5b8e696 100644 (file)
@@ -144,7 +144,7 @@ static void animchan_sync_group (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                 * NOTE: this feature will only really work if groups by default contain the F-Curves for a single bone
                 */
                if (ob->pose) {
-                       bPoseChannel *pchan= get_pose_channel(ob->pose, agrp->name);
+                       bPoseChannel *pchan= BKE_pose_channel_find_name(ob->pose, agrp->name);
                        
                        /* if one matches, sync the selection status */
                        if (pchan) {
@@ -179,7 +179,7 @@ static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                        
                        /* get bone-name, and check if this bone is selected */
                        bone_name= BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
-                       pchan= get_pose_channel(ob->pose, bone_name);
+                       pchan= BKE_pose_channel_find_name(ob->pose, bone_name);
                        if (bone_name) MEM_freeN(bone_name);
                        
                        /* F-Curve selection depends on whether the bone is selected */
index cc3401d..180953e 100644 (file)
@@ -842,7 +842,7 @@ static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_
                        
                        /* get bone-name, and check if this bone is selected */
                        bone_name= BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
-                       pchan= get_pose_channel(ob->pose, bone_name);
+                       pchan= BKE_pose_channel_find_name(ob->pose, bone_name);
                        if (bone_name) MEM_freeN(bone_name);
                        
                        /* check whether to continue or skip */
index 9d51b42..281a3e1 100644 (file)
@@ -183,7 +183,7 @@ FCurve *verify_fcurve (bAction *act, const char group[], const char rna_path[],
                /* if a group name has been provided, try to add or find a group, then add F-Curve to it */
                if (group) {
                        /* try to find group */
-                       grp= action_groups_find_named(act, group);
+                       grp= BKE_action_group_find_name(act, group);
                        
                        /* no matching groups, so add one */
                        if (grp == NULL)
index 925cffc..8f2a228 100644 (file)
@@ -531,7 +531,7 @@ ListBase builtin_keyingsets = {NULL, NULL};
 /* --------------- */
 
 /* Find KeyingSet type info given a name */
-KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[])
+KeyingSetInfo *ANIM_keyingset_info_find_name (const char name[])
 {
        /* sanity checks */
        if ((name == NULL) || (name[0] == 0))
@@ -786,7 +786,7 @@ EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(p
 short ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *ks)
 {
        if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) {
-               KeyingSetInfo *ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
+               KeyingSetInfo *ksi = ANIM_keyingset_info_find_name(ks->typeinfo);
                
                /* get the associated 'type info' for this KeyingSet */
                if (ksi == NULL)
@@ -868,7 +868,7 @@ short ANIM_validate_keyingset(bContext *C, ListBase *dsources, KeyingSet *ks)
        
        /* if relative Keying Sets, poll and build up the paths */
        if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) {
-               KeyingSetInfo *ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
+               KeyingSetInfo *ksi = ANIM_keyingset_info_find_name(ks->typeinfo);
                
                /* clear all existing paths 
                 * NOTE: BKE_keyingset_free() frees all of the paths for the KeyingSet, but not the set itself
index 5c43ba6..44dfcaa 100644 (file)
@@ -340,7 +340,7 @@ static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist)
        
        for (curBone=bonelist->first; curBone; curBone=curBone->next) {
                /* sets local matrix and arm_mat (restpos) */
-               where_is_armature_bone(curBone, curBone->parent);
+               BKE_armature_where_is_bone(curBone, curBone->parent);
                
                /* Find the associated editbone */
                for (ebone = editbonelist->first; ebone; ebone=ebone->next)
@@ -367,7 +367,7 @@ static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist)
                        curBone->roll = (float)-atan2(difmat[2][0], difmat[2][2]);
                        
                        /* and set restposition again */
-                       where_is_armature_bone(curBone, curBone->parent);
+                       BKE_armature_where_is_bone(curBone, curBone->parent);
                }
                fix_bonelist_roll(&curBone->childbase, editbonelist);
        }
@@ -382,7 +382,7 @@ void ED_armature_from_edit(Object *obedit)
        Object *obt;
        
        /* armature bones */
-       free_bonelist(&arm->bonebase);
+       BKE_armature_bonelist_free(&arm->bonebase);
        
        /* remove zero sized bones, this gives instable restposes */
        for (eBone=arm->edbo->first; eBone; eBone= neBone) {
@@ -476,13 +476,13 @@ void ED_armature_from_edit(Object *obedit)
        }
        
        /* Make a pass through the new armature to fix rolling */
-       /* also builds restposition again (like where_is_armature) */
+       /* also builds restposition again (like BKE_armature_where_is) */
        fix_bonelist_roll(&arm->bonebase, arm->edbo);
        
        /* so all users of this armature should get rebuilt */
        for (obt= G.main->object.first; obt; obt= obt->id.next) {
                if (obt->data==arm)
-                       armature_rebuild_pose(obt, arm);
+                       BKE_pose_rebuild(obt, arm);
        }
        
        DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
@@ -645,7 +645,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
 {
        Scene *scene= CTX_data_scene(C);
        Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object
-       bArmature *arm= get_armature(ob);
+       bArmature *arm= BKE_armature_from_object(ob);
        bPose *pose;
        bPoseChannel *pchan;
        EditBone *curbone;
@@ -716,7 +716,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
        ED_armature_edit_free(ob);
        
        /* flush positions of posebones */
-       where_is_pose(scene, ob);
+       BKE_pose_where_is(scene, ob);
        
        /* fix parenting of objects which are bone-parented */
        applyarmature_fix_boneparents(scene, ob);
@@ -766,7 +766,7 @@ static int pose_visual_transform_apply_exec (bContext *C, wmOperator *UNUSED(op)
                 * change, thus changing the result we may be trying to record.
                 */
                copy_m4_m4(delta_mat, pchan->chan_mat);
-               pchan_apply_mat4(pchan, delta_mat, TRUE);
+               BKE_pchan_apply_mat4(pchan, delta_mat, TRUE);
        }
        CTX_DATA_END;
        
@@ -991,8 +991,8 @@ int join_armature_exec(bContext *C, wmOperator *UNUSED(op))
                                
                                BLI_remlink(&opose->chanbase, pchan);
                                BLI_addtail(&pose->chanbase, pchan);
-                               free_pose_channels_hash(opose);
-                               free_pose_channels_hash(pose);
+                               BKE_pose_channels_hash_free(opose);
+                               BKE_pose_channels_hash_free(pose);
                        }
                        
                        ED_base_object_free_and_unlink(bmain, scene, base);
@@ -1155,8 +1155,8 @@ static void separate_armature_bones(Object *ob, short sel)
                        }
                        
                        /* free any of the extra-data this pchan might have */
-                       free_pose_channel(pchan);
-                       free_pose_channels_hash(ob->pose);
+                       BKE_pose_channel_free(pchan);
+                       BKE_pose_channels_hash_free(ob->pose);
                        
                        /* get rid of unneeded bone */
                        bone_free(arm, curbone);
@@ -1694,8 +1694,8 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
                        curBone = editbone_name_exists(arm->edbo, pchan->name);
                        
                        if (curBone && (curBone->flag & BONE_SELECTED) && (arm->layer & curBone->layer)) {
-                               free_pose_channel(pchan);
-                               free_pose_channels_hash(obedit->pose);
+                               BKE_pose_channel_free(pchan);
+                               BKE_pose_channels_hash_free(obedit->pose);
                                BLI_freelinkN (&obedit->pose->chanbase, pchan);
                        }
                        else {
@@ -2481,7 +2481,7 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
        bConstraint  *curcon;
        ListBase     *conlist;
        
-       if ( (pchan = verify_pose_channel(dst_ob->pose, dupBone->name)) ) {
+       if ( (pchan = BKE_pose_channel_verify(dst_ob->pose, dupBone->name)) ) {
                if ( (conlist = &pchan->constraints) ) {
                        for (curcon = conlist->first; curcon; curcon=curcon->next) {
                                /* does this constraint have a subtarget in
@@ -2552,15 +2552,15 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
        if (src_ob->pose) {
                bPoseChannel *chanold, *channew;
                
-               chanold = verify_pose_channel(src_ob->pose, curBone->name);
+               chanold = BKE_pose_channel_verify(src_ob->pose, curBone->name);
                if (chanold) {
                        /* WARNING: this creates a new posechannel, but there will not be an attached bone
                         *              yet as the new bones created here are still 'EditBones' not 'Bones'.
                         */
-                       channew= verify_pose_channel(dst_ob->pose, eBone->name);
+                       channew= BKE_pose_channel_verify(dst_ob->pose, eBone->name);
 
                        if (channew) {
-                               duplicate_pose_channel_data(channew, chanold);
+                               BKE_pose_channel_copy_data(channew, chanold);
                        }
                }
        }
@@ -4611,7 +4611,7 @@ static int bone_skinnable_cb(Object *ob, Bone *bone, void *datap)
 
        if (!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
                if (!(bone->flag & BONE_NO_DEFORM)) {
-                       if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
+                       if (data->heat && data->armob->pose && BKE_pose_channel_find_name(data->armob->pose, bone->name))
                                segments = bone->segments;
                        else
                                segments = 1;
@@ -4678,7 +4678,7 @@ static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap)
 
        if (!wpmode || !(bone->flag & BONE_HIDDEN_P)) {
           if (!(bone->flag & BONE_NO_DEFORM)) {
-                       if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
+                       if (data->heat && data->armob->pose && BKE_pose_channel_find_name(data->armob->pose, bone->name))
                                segments = bone->segments;
                        else
                                segments = 1;
@@ -4821,7 +4821,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
                                segments = 1;
                                bbone = NULL;
                                
-                               if ((par->pose) && (pchan=get_pose_channel(par->pose, bone->name))) {
+                               if ((par->pose) && (pchan=BKE_pose_channel_find_name(par->pose, bone->name))) {
                                        if (bone->segments > 1) {
                                                segments = bone->segments;
                                                bbone = b_bone_spline_setup(pchan, 1);
@@ -5447,7 +5447,7 @@ void POSE_OT_reveal(wmOperatorType *ot)
 
 static int bone_unique_check(void *arg, const char *name)
 {
-       return get_named_bone((bArmature *)arg, name) != NULL;
+       return BKE_armature_find_bone_name((bArmature *)arg, name) != NULL;
 }
 
 static void unique_bone_name(bArmature *arm, char *name)
@@ -5509,7 +5509,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
                        else return;
                }
                else {
-                       Bone *bone= get_named_bone(arm, oldname);
+                       Bone *bone= BKE_armature_find_bone_name(arm, oldname);
                        
                        if (bone) {
                                unique_bone_name(arm, newname);
@@ -5528,7 +5528,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
                                
                                /* Rename the pose channel, if it exists */
                                if (ob->pose) {
-                                       bPoseChannel *pchan = get_pose_channel(ob->pose, oldname);
+                                       bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, oldname);
                                        if (pchan) {
                                                BLI_strncpy(pchan->name, newname, MAXBONENAME);
                                                
index 3c855ff..3b613a6 100644 (file)
@@ -189,7 +189,7 @@ void poseAnim_mapping_refresh(bContext *C, Scene *scene, Object *ob)
        if ((arm->flag & ARM_DELAYDEFORM)==0)
                DAG_id_tag_update(&ob->id, OB_RECALC_DATA);  /* sets recalc flags */
        else
-               where_is_pose(scene, ob);
+               BKE_pose_where_is(scene, ob);
        
        /* note, notifier might evolve */
        WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
index 3b01ba2..f180f73 100644 (file)
@@ -786,7 +786,7 @@ static void poselib_backup_posecopy (tPoseLib_PreviewData *pld)
        /* for each posechannel that has an actionchannel in */
        for (agrp= pld->act->groups.first; agrp; agrp= agrp->next) {
                /* try to find posechannel */
-               pchan= get_pose_channel(pld->pose, agrp->name);
+               pchan= BKE_pose_channel_find_name(pld->pose, agrp->name);
                
                /* backup data if available */
                if (pchan) {
@@ -885,7 +885,7 @@ static void poselib_apply_pose (tPoseLib_PreviewData *pld)
                /* check if group has any keyframes */
                if (ANIM_animchanneldata_keyframes_loop(&ked, NULL, agrp, ALE_GROUP, NULL, group_ok_cb, NULL)) {
                        /* has keyframe on this frame, so try to get a PoseChannel with this name */
-                       pchan= get_pose_channel(pose, agrp->name);
+                       pchan= BKE_pose_channel_find_name(pose, agrp->name);
                        
                        if (pchan) {    
                                short ok= 0;
@@ -927,7 +927,7 @@ static void poselib_keytag_pose (bContext *C, Scene *scene, tPoseLib_PreviewData
        /* start tagging/keying */
        for (agrp= act->groups.first; agrp; agrp= agrp->next) {
                /* only for selected bones unless there aren't any selected, in which case all are included  */
-               pchan= get_pose_channel(pose, agrp->name);
+               pchan= BKE_pose_channel_find_name(pose, agrp->name);
                
                if (pchan) {
                        if ( (pld->selcount == 0) || ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) ) {
@@ -987,7 +987,7 @@ static void poselib_preview_apply (bContext *C, wmOperator *op)
                if ((pld->arm->flag & ARM_DELAYDEFORM)==0)
                        DAG_id_tag_update(&pld->ob->id, OB_RECALC_DATA);  /* sets recalc flags */
                else
-                       where_is_pose(pld->scene, pld->ob);
+                       BKE_pose_where_is(pld->scene, pld->ob);
        }
        
        /* do header print - if interactively previewing */
@@ -1495,7 +1495,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op)
                if ((arm->flag & ARM_DELAYDEFORM)==0)
                        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);  /* sets recalc flags */
                else
-                       where_is_pose(scene, ob);
+                       BKE_pose_where_is(scene, ob);
                
        }
        else if (pld->state == PL_PREVIEW_CONFIRM) {
@@ -1514,7 +1514,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op)
                        //remake_action_ipos(ob->action);
                }
                else
-                       where_is_pose(scene, ob);
+                       BKE_pose_where_is(scene, ob);
        }
        
        /* free memory used for backups and searching */
index 95e7a84..15d2d32 100644 (file)
@@ -164,7 +164,7 @@ static int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan, int level)
                }
        }
        for (bone= pchan->bone->childbase.first; bone; bone= bone->next) {
-               pchan= get_pose_channel(ob->pose, bone->name);
+               pchan= BKE_pose_channel_find_name(ob->pose, bone->name);
                if (pchan && pose_channel_in_IK_chain(ob, pchan, level + 1))
                        return 1;
        }
@@ -371,7 +371,7 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
                                        
                                        for (ct= targets.first; ct; ct= ct->next) {
                                                if ((ct->tar == ob) && (ct->subtarget[0])) {
-                                                       bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget);
+                                                       bPoseChannel *pchanc= BKE_pose_channel_find_name(ob->pose, ct->subtarget);
                                                        if ((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) {
                                                                pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
                                                                found= 1;
@@ -650,7 +650,7 @@ static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
                                char *boneName = BLI_getQuotedStr(ksp->rna_path, "bones[");
                                
                                if (boneName) {
-                                       bPoseChannel *pchan = get_pose_channel(pose, boneName);
+                                       bPoseChannel *pchan = BKE_pose_channel_find_name(pose, boneName);
                                        
                                        if (pchan) {
                                                /* select if bone is visible and can be affected */
@@ -751,7 +751,7 @@ static int pose_bone_flip_active_exec (bContext *C, wmOperator *UNUSED(op))
                        char name[MAXBONENAME];
                        flip_side_name(name, arm->act_bone->name, TRUE);
 
-                       pchanf= get_pose_channel(ob->pose, name);
+                       pchanf= BKE_pose_channel_find_name(ob->pose, name);
                        if (pchanf && pchanf->bone != arm->act_bone) {
                                arm->act_bone->flag &= ~BONE_SELECTED;
                                pchanf->bone->flag |= BONE_SELECTED;
@@ -805,7 +805,7 @@ static void pose_copy_menu(Scene *scene)
        if (ELEM(NULL, ob, ob->pose)) return;
        if ((ob==obedit) || (ob->mode & OB_MODE_POSE)==0) return;
        
-       pchan= get_active_posechannel(ob);
+       pchan= BKE_pose_channel_active(ob);
        
        if (pchan==NULL) return;
        pchanact= pchan;
@@ -891,13 +891,13 @@ static void pose_copy_menu(Scene *scene)
                                                pchan->custom = pchanact->custom;
                                                break;
                                        case 9: /* Visual Location */
-                                               armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc);
+                                               BKE_armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc);
                                                break;
                                        case 10: /* Visual Rotation */
                                        {
                                                float delta_mat[4][4];
                                                
-                                               armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
+                                               BKE_armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
                                                
                                                if (pchan->rotmode == ROT_MODE_AXISANGLE) {
                                                        float tmp_quat[4];
@@ -916,7 +916,7 @@ static void pose_copy_menu(Scene *scene)
                                        {
                                                float delta_mat[4][4], size[4];
                                                
-                                               armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
+                                               BKE_armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
                                                mat4_to_size(size, delta_mat);
                                                copy_v3_v3(pchan->size, size);
                                        }
@@ -978,7 +978,7 @@ static void pose_copy_menu(Scene *scene)
                        }
                }
                BLI_freelistN(&const_copy);
-               update_pose_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */
+               BKE_pose_update_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */
                
                if (ob->pose)
                        ob->pose->flag |= POSE_RECALC;
@@ -1059,7 +1059,7 @@ static bPoseChannel *pose_bone_do_paste (Object *ob, bPoseChannel *chan, short s
         *      1) channel exists - poses are not meant to add random channels to anymore
         *      2) if selection-masking is on, channel is selected - only selected bones get pasted on, allowing making both sides symmetrical
         */
-       pchan= get_pose_channel(ob->pose, name);
+       pchan= BKE_pose_channel_find_name(ob->pose, name);
        
        if (selOnly)
                paste_ok= ((pchan) && (pchan->bone->flag & BONE_SELECTED));
@@ -1176,7 +1176,7 @@ static int pose_copy_exec (bContext *C, wmOperator *op)
        
        /* sets chan->flag to POSE_KEY if bone selected, then copy those bones to the buffer */
        set_pose_keys(ob);  
-       copy_pose(&g_posebuf, ob->pose, 0);
+       BKE_pose_copy_data(&g_posebuf, ob->pose, 0);
        
        
        return OPERATOR_FINISHED;
@@ -1291,7 +1291,7 @@ static int pose_group_add_exec (bContext *C, wmOperator *UNUSED(op))
                return OPERATOR_CANCELLED;
        
        /* for now, just call the API function for this */
-       pose_add_group(ob);
+       BKE_pose_add_group(ob);
        
        /* notifiers for updates */
        WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
@@ -1331,7 +1331,7 @@ static int pose_group_remove_exec (bContext *C, wmOperator *UNUSED(op))
                return OPERATOR_CANCELLED;
        
        /* for now, just call the API function for this */
-       pose_remove_group(ob);
+       BKE_pose_remove_group(ob);
        
        /* notifiers for updates */
        WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
@@ -1434,7 +1434,7 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
         */
        pose->active_group= RNA_int_get(op->ptr, "type");
        if (pose->active_group == 0)
-               pose_add_group(ob);
+               BKE_pose_add_group(ob);
        
        /* add selected bones to group then */
        CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
@@ -2281,7 +2281,7 @@ static int pose_clear_user_transforms_exec (bContext *C, wmOperator *UNUSED(op))
                bPoseChannel *pchan;
                
                /* execute animation step for current frame using a dummy copy of the pose */           
-               copy_pose(&dummyPose, ob->pose, 0);
+               BKE_pose_copy_data(&dummyPose, ob->pose, 0);
                
                BLI_strncpy(workob.id.name, "OB<ClearTfmWorkOb>", sizeof(workob.id.name));
                workob.type = OB_ARMATURE;
@@ -2314,7 +2314,7 @@ static int pose_clear_user_transforms_exec (bContext *C, wmOperator *UNUSED(op))
                /* no animation, so just reset whole pose to rest pose 
                 * (cannot just restore for selected though)
                 */
-               rest_pose(ob->pose);
+               BKE_pose_rest(ob->pose);
        }
        
        /* notifiers and updates */
index 3795de7..490a883 100644 (file)
@@ -190,7 +190,7 @@ int ANIM_apply_keyingset(struct bContext *C, ListBase *dsources, struct bAction
 struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, const char name[]);
 
 /* Find KeyingSet type info given a name */
-KeyingSetInfo *ANIM_keyingset_info_find_named(const char name[]);
+KeyingSetInfo *ANIM_keyingset_info_find_name(const char name[]);
 
 /* for RNA type registrations... */
 void ANIM_keyingset_info_register(KeyingSetInfo *ksi);
index 149921c..1c0a98e 100644 (file)
@@ -953,7 +953,7 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event)
        // if there are problems because of this, then rna needs changed update functions.
        // 
        // object_test_constraints(ob);
-       // if (ob->pose) update_pose_constraint_flags(ob->pose);
+       // if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
        
        if (ob->type == OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
        else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
@@ -969,7 +969,7 @@ static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v)
 /* draw panel showing settings for a constraint */
 static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
 {
-       bPoseChannel *pchan = get_active_posechannel(ob);
+       bPoseChannel *pchan = BKE_pose_channel_active(ob);
        bConstraintTypeInfo *cti;
        uiBlock *block;
        uiLayout *result = NULL, *col, *box, *row;
index cfc9e11..5f6384d 100644 (file)
@@ -67,7 +67,7 @@
  * use in object mode when selecting faces (while painting) */
 void paintface_flush_flags(Object *ob)
 {
-       Mesh *me = get_mesh(ob);
+       Mesh *me = BKE_mesh_from_object(ob);
        DerivedMesh *dm = ob->derivedFinal;
        MPoly *polys, *mp_orig;
        MFace *faces;
@@ -166,7 +166,7 @@ void paintface_hide(Object *ob, const int unselected)
        MPoly *mpoly;
        int a;
        
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL || me->totpoly == 0) return;
 
        mpoly = me->mpoly;
@@ -195,7 +195,7 @@ void paintface_reveal(Object *ob)
        MPoly *mpoly;
        int a;
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL || me->totpoly == 0) return;
 
        mpoly = me->mpoly;
@@ -325,7 +325,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
        Mesh *me;
        unsigned int index = 0;
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL || me->totpoly == 0) return;
 
        if (mode == 0 || mode == 1) {
@@ -347,7 +347,7 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
        MPoly *mpoly;
        int a;
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL) return;
        
        if (action == SEL_INVERT) {
@@ -410,7 +410,7 @@ int paintface_minmax(Object *ob, float r_min[3], float r_max[3])
        int a, b, ok = FALSE;
        float vec[3], bmat[3][3];
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (!me || !me->mtpoly) return ok;
        
        copy_m3_m4(bmat, ob->obmat);
@@ -459,7 +459,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
        MEdge *med;
        int a, b;
        
-       me = get_mesh(OBACT);
+       me = BKE_mesh_from_object(OBACT);
        if (me == 0 ||  me->totpoly == 0) return;
 
        if (mode == 0)
@@ -516,7 +516,7 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
        unsigned int a, index;
        
        /* Get the face under the cursor */
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
 
        if (!facesel_face_pick(C, me, ob, mval, &index, 1))
                return 0;
@@ -567,7 +567,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
        int sx = rect->xmax - rect->xmin + 1;
        int sy = rect->ymax - rect->ymin + 1;
        
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
 
        if (me == NULL || me->totpoly == 0 || sx * sy <= 0)
                return OPERATOR_CANCELLED;
@@ -629,7 +629,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
  * use in object mode when selecting vertices (while painting) */
 void paintvert_flush_flags(Object *ob)
 {
-       Mesh *me = get_mesh(ob);
+       Mesh *me = BKE_mesh_from_object(ob);
        DerivedMesh *dm = ob->derivedFinal;
        MVert *dm_mvert, *dm_mv;
        int *index_array = NULL;
@@ -668,7 +668,7 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
        MVert *mvert;
        int a;
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL) return;
        
        if (action == SEL_INVERT) {
index 042deb3..49e472f 100644 (file)
@@ -560,7 +560,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
        }
        else {
                RNA_string_get(op->ptr, "name", name);
-               ima = (Image *)find_id("IM", name);
+               ima = (Image *)BKE_libblock_find_name("IM", name);
        }
        
        if (!ima) {
index 3c19871..40bca55 100644 (file)
@@ -1499,7 +1499,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                mb = newob->data;
                                mb->id.us--;
 
-                               newob->data = add_mesh("Mesh");
+                               newob->data = BKE_mesh_add("Mesh");
                                newob->type = OB_MESH;
 
                                me = newob->data;
@@ -1761,7 +1761,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                        ID_NEW_US2(obn->data)
                                        else {
                                                obn->data = BKE_armature_copy(obn->data);
-                                               armature_rebuild_pose(obn, obn->data);
+                                               BKE_pose_rebuild(obn, obn->data);
                                                didit = 1;
                                        }
                                        id->us--;
@@ -1954,7 +1954,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
 
        /* find object, create fake base */
        RNA_string_get(op->ptr, "name", name);
-       ob = (Object *)find_id("OB", name);
+       ob = (Object *)BKE_libblock_find_name("OB", name);
        if (ob == NULL)
                return OPERATOR_CANCELLED;
 
index 60ca674..ec3360f 100644 (file)
@@ -89,7 +89,7 @@ ListBase *get_active_constraints(Object *ob)
        if (ob->mode & OB_MODE_POSE) {
                bPoseChannel *pchan;
                
-               pchan = get_active_posechannel(ob);
+               pchan = BKE_pose_channel_active(ob);
                if (pchan)
                        return &pchan->constraints;
        }
@@ -314,7 +314,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                        curcon->flag |= CONSTRAINT_DISABLE;
                                }
                                else if (data->tar == owner) {
-                                       if (!get_named_bone(get_armature(owner), data->subtarget)) {
+                                       if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), data->subtarget)) {
                                                curcon->flag |= CONSTRAINT_DISABLE;
                                        }
                                }
@@ -325,7 +325,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                                curcon->flag |= CONSTRAINT_DISABLE;
                                        }
                                        else if (data->poletar == owner) {
-                                               if (!get_named_bone(get_armature(owner), data->polesubtarget)) {
+                                               if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), data->polesubtarget)) {
                                                        curcon->flag |= CONSTRAINT_DISABLE;
                                                }
                                        }
@@ -344,7 +344,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                        curcon->flag |= CONSTRAINT_DISABLE;
                                }
                                else if (data->tar == owner) {
-                                       if (!get_named_bone(get_armature(owner), data->subtarget)) {
+                                       if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), data->subtarget)) {
                                                curcon->flag |= CONSTRAINT_DISABLE;
                                        }
                                }
@@ -453,7 +453,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                        }
                                        else if (ct->tar == owner) {
                                                if (type == CONSTRAINT_OBTYPE_BONE) {
-                                                       if (!get_named_bone(get_armature(owner), ct->subtarget)) {
+                                                       if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), ct->subtarget)) {
                                                                /* bone must exist in armature... */
                                                                // TODO: clear subtarget?
                                                                curcon->flag |= CONSTRAINT_DISABLE;
@@ -585,7 +585,7 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int
                list = &ob->constraints;
        } 
        else if (owner == EDIT_CONSTRAINT_OWNER_BONE) {
-               bPoseChannel *pchan = get_active_posechannel(ob);
+               bPoseChannel *pchan = BKE_pose_channel_active(ob);
                if (pchan)
                        list = &pchan->constraints;
                else {
@@ -713,7 +713,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
        /* try to find a pose channel - assume that this is the constraint owner */
        // TODO: get from context instead?
        if (ob && ob->pose)
-               pchan = get_active_posechannel(ob);
+               pchan = BKE_pose_channel_active(ob);
        
        /* calculate/set inverse matrix:
         *  We just calculate all transform-stack eval up to but not including this constraint.
@@ -729,7 +729,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
                 * to use as baseline ("pmat") to derive delta from. This extra calc saves users 
                 * from having pressing "Clear Inverse" first
                 */
-               where_is_pose(scene, ob);
+               BKE_pose_where_is(scene, ob);
                copy_m4_m4(pmat, pchan->pose_mat);
                
                /* 2. knock out constraints starting from this one */
@@ -746,7 +746,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
                }
                
                /* 3. solve pose without disabled constraints */
-               where_is_pose(scene, ob);
+               BKE_pose_where_is(scene, ob);
                
                /* 4. determine effect of constraint by removing the newly calculated 
                 * pchan->pose_mat from the original pchan->pose_mat, thus determining 
@@ -769,7 +769,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
                }
                
                /* 6. recalculate pose with new inv-mat applied */
-               where_is_pose(scene, ob);
+               BKE_pose_where_is(scene, ob);
        }
        else if (ob) {
                Object workob;
@@ -977,7 +977,7 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con)
 void ED_object_constraint_update(Object *ob)
 {
 
-       if (ob->pose) update_pose_constraint_flags(ob->pose);
+       if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
 
        object_test_constraints(ob);
 
@@ -1312,7 +1312,7 @@ void OBJECT_OT_constraints_copy(wmOperatorType *ot)
 static short get_new_constraint_target(bContext *C, int con_type, Object **tar_ob, bPoseChannel **tar_pchan, short add)
 {
        Object *obact = ED_object_active_context(C);
-       bPoseChannel *pchanact = get_active_posechannel(obact);
+       bPoseChannel *pchanact = BKE_pose_channel_active(obact);
        short only_curve = 0, only_mesh = 0, only_ob = 0;
        short found = 0;
        
@@ -1459,7 +1459,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
                pchan = NULL;
        }
        else {
-               pchan = get_active_posechannel(ob);
+               pchan = BKE_pose_channel_active(ob);
                
                /* ensure not to confuse object/pose adding */
                if (pchan == NULL) {
@@ -1541,7 +1541,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
        object_test_constraints(ob);
 
        if (pchan)
-               update_pose_constraint_flags(ob->pose);
+               BKE_pose_update_constraint_flags(ob->pose);
 
 
        /* force depsgraph to get recalculated since new relationships added */
@@ -1690,7 +1690,7 @@ void POSE_OT_constraint_add_with_targets(wmOperatorType *ot)
 static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
 {
        Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
-       bPoseChannel *pchan = get_active_posechannel(ob);
+       bPoseChannel *pchan = BKE_pose_channel_active(ob);
        bConstraint *con = NULL;
        
        uiPopupMenu *pup;
index 6ec844e..e9341d9 100644 (file)
@@ -648,7 +648,7 @@ static int object_hook_reset_exec(bContext *C, wmOperator *op)
        
        /* reset functionality */
        if (hmd->object) {
-               bPoseChannel *pchan = get_pose_channel(hmd->object->pose, hmd->subtarget);
+               bPoseChannel *pchan = BKE_pose_channel_find_name(hmd->object->pose, hmd->subtarget);
                
                if (hmd->subtarget[0] && pchan) {
                        float imat[4][4], mat[4][4];
index 648f530..7b37ca8 100644 (file)
@@ -271,12 +271,12 @@ static int make_regular_exec(bContext *C, wmOperator *UNUSED(op))
        
        if (ob) {
                lt = ob->data;
-               resizelattice(lt->editlatt->latt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
+               BKE_lattice_resize(lt->editlatt->latt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
        }
        else {
                ob = CTX_data_active_object(C);
                lt = ob->data;
-               resizelattice(lt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
+               BKE_lattice_resize(lt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
        }
        
        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
index b4207ef..f6bf9ba 100644 (file)
@@ -1369,7 +1369,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
                        dm->release(dm);
                }
                else if (ob->type == OB_LATTICE) {
-                       lattice_calc_modifiers(scene, ob);
+                       BKE_lattice_modifiers_calc(scene, ob);
                }
                else if (ob->type == OB_MBALL) {
                        makeDispListMBall(scene, ob);
index 666bcca..8cb7c1f 100644 (file)
@@ -554,7 +554,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
                }               
        }
        else if (partype == PAR_BONE) {
-               pchan = get_active_posechannel(par);
+               pchan = BKE_pose_channel_active(par);
                
                if (pchan == NULL) {
                        BKE_report(reports, RPT_ERROR, "No active Bone");
@@ -1510,7 +1510,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
                                        case OB_ARMATURE:
                                                ob->recalc |= OB_RECALC_DATA;
                                                ob->data = BKE_armature_copy(ob->data);
-                                               armature_rebuild_pose(ob, ob->data);
+                                               BKE_pose_rebuild(ob, ob->data);
                                                break;
                                        case OB_SPEAKER:
                                                ob->data = BKE_speaker_copy(ob->data);
@@ -1911,7 +1911,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *even
        char name[MAX_ID_NAME - 2];
        
        RNA_string_get(op->ptr, "name", name);
-       ma = (Material *)find_id("MA", name);
+       ma = (Material *)BKE_libblock_find_name("MA", name);
        if (base == NULL || ma == NULL)
                return OPERATOR_CANCELLED;
        
index 0ef4bb5..3e06db4 100644 (file)
@@ -884,7 +884,7 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op)
                flip_side_name(tmpname, primbase->object->id.name + 2, TRUE);
                
                if (strcmp(tmpname, primbase->object->id.name + 2) != 0) { /* names differ */
-                       Object *ob = (Object *)find_id("OB", tmpname);
+                       Object *ob = (Object *)BKE_libblock_find_name("OB", tmpname);
                        if (ob) {
                                Base *secbase = BKE_scene_base_find(scene, ob);
 
index 92dc9b9..785b9c0 100644 (file)
@@ -548,7 +548,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
 
                BKE_object_where_is_calc(scene, ob);
                if (ob->type == OB_ARMATURE) {
-                       where_is_pose(scene, ob); /* needed for bone parents */
+                       BKE_pose_where_is(scene, ob); /* needed for bone parents */
                }
 
                ignore_parent_tx(bmain, scene, ob);
@@ -855,7 +855,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
                                        /* do_inverse_offset= TRUE; */ /* docenter_armature() handles this */
 
                                        BKE_object_where_is_calc(scene, ob);
-                                       where_is_pose(scene, ob); /* needed for bone parents */
+                                       BKE_pose_where_is(scene, ob); /* needed for bone parents */
 
                                        ignore_parent_tx(bmain, scene, ob);
 
@@ -895,7 +895,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 
                                BKE_object_where_is_calc(scene, ob);
                                if (ob->type == OB_ARMATURE) {
-                                       where_is_pose(scene, ob); /* needed for bone parents */
+                                       BKE_pose_where_is(scene, ob); /* needed for bone parents */
                                }
 
                                ignore_parent_tx(bmain, scene, ob);
@@ -917,7 +917,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 
                                                BKE_object_where_is_calc(scene, ob_other);
                                                if (ob_other->type == OB_ARMATURE) {
-                                                       where_is_pose(scene, ob_other); /* needed for bone parents */
+                                                       BKE_pose_where_is(scene, ob_other); /* needed for bone parents */
                                                }
                                                ignore_parent_tx(bmain, scene, ob_other);
                                        }
index 57588c0..b106bd8 100644 (file)
@@ -271,7 +271,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
                        }
 
                        BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, FALSE);
-                       ok = BKE_write_ibuf_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */
+                       ok = BKE_imbuf_write_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */
                        if (ok) printf("OpenGL Render written to '%s'\n", name);
                        else printf("OpenGL Render failed to write '%s'\n", name);
                }
@@ -546,7 +546,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
                }
                else {
                        BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, TRUE);
-                       ok = BKE_write_ibuf_stamp(scene, camera, ibuf, name, &scene->r.im_format);
+                       ok = BKE_imbuf_write_stamp(scene, camera, ibuf, name, &scene->r.im_format);
 
                        if (ok == 0) {
                                printf("Write error: cannot save %s\n", name);
index c8fd8d0..ca4683b 100644 (file)
@@ -375,7 +375,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
                ma = BKE_material_copy(ma);
        }
        else {
-               ma = add_material("Material");
+               ma = BKE_material_add("Material");
 
                if (BKE_scene_use_new_shading_nodes(scene)) {
                        ED_node_shader_default(scene, &ma->id);
index 69ea428..6c59914 100644 (file)
@@ -295,7 +295,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
                bPoseChannel *pchan;
                Object *obpose= BKE_object_pose_armature_get(obact);
                
-               pchan= get_active_posechannel(obpose);
+               pchan= BKE_pose_channel_active(obpose);
                if (pchan) {
                        CTX_data_pointer_set(result, &obpose->id, &RNA_PoseBone, pchan);
                        return 1;
index 22a1770..4f24339 100644 (file)
@@ -190,7 +190,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
                                /* bw screenshot? - users will notice if it fails! */
                                IMB_color_to_bw(ibuf);
                        }
-                       BKE_write_ibuf(ibuf, path, &scd->im_format);
+                       BKE_imbuf_write(ibuf, path, &scd->im_format);
 
                        IMB_freeImBuf(ibuf);
                }
@@ -357,7 +357,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
                                BKE_makepicstring(name, rd.pic, sj->bmain->name, rd.cfra, rd.im_format.imtype, rd.scemode & R_EXTENSION, TRUE);
                                
                                ibuf->rect= sj->dumprect;
-                               ok= BKE_write_ibuf(ibuf, name, &rd.im_format);
+                               ok= BKE_imbuf_write(ibuf, name, &rd.im_format);
                                
                                if (ok==0) {
                                        printf("Write error: cannot save %s\n", name);
index 8bac74e..397bfad 100644 (file)
@@ -4858,7 +4858,7 @@ static int texture_paint_init(bContext *C, wmOperator *op)
 
        if (pop->mode != PAINT_MODE_2D) {
                Object *ob = OBACT;
-               Mesh *me = get_mesh(ob);
+               Mesh *me = BKE_mesh_from_object(ob);
 
                if (!me) {
                        return 0;
@@ -5451,7 +5451,7 @@ static int image_paint_sample_color_poll(bContext *C)
                if (CTX_wm_view3d(C)) {
                        Object *obact = CTX_data_active_object(C);
                        if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
-                               Mesh *me = get_mesh(obact);
+                               Mesh *me = BKE_mesh_from_object(obact);
                                if (me) {
                                        return !(me->editflag & ME_EDIT_PAINT_MASK);
                                }
@@ -5559,7 +5559,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
 
        if (!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) {
                BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects");
@@ -5794,7 +5794,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       image = BKE_add_image_imbuf(ibuf);
+       image = BKE_image_add_from_imbuf(ibuf);
 
        if (image) {
                /* now for the trickyness. store the view projection here!
index 8f8c4ae..bfd8f86 100644 (file)
@@ -93,7 +93,7 @@ static int vertex_paint_use_fast_update_check(Object *ob)
        DerivedMesh *dm = ob->derivedFinal;
 
        if (dm) {
-               Mesh *me = get_mesh(ob);
+               Mesh *me = BKE_mesh_from_object(ob);
                if (me && me->mcol) {
                        return (me->mcol == CustomData_get_layer(&dm->faceData, CD_MCOL));
                }
@@ -110,7 +110,7 @@ static int vertex_paint_use_tessface_check(Object *ob)
        DerivedMesh *dm = ob->derivedFinal;
 
        if (dm) {
-               Mesh *me = get_mesh(ob);
+               Mesh *me = BKE_mesh_from_object(ob);
                return (me->mpoly == CustomData_get_layer(&dm->faceData, CD_MPOLY));
        }
 
@@ -317,7 +317,7 @@ static void make_vertexcol(Object *ob)  /* single ob */
 {
        Mesh *me;
        if (!ob || ob->id.lib) return;
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL) return;
        if (me->edit_btmesh) return;
 
@@ -433,7 +433,7 @@ void vpaint_fill(Object *ob, unsigned int paintcol)
        MLoopCol *lcol;
        int i, j, selected;
 
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL || me->totpoly == 0) return;
 
        if (!me->mloopcol) make_vertexcol(ob);
@@ -551,7 +551,7 @@ void vpaint_dogamma(Scene *scene)
        unsigned char *cp, gamtab[256];
 
        ob = OBACT;
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
 
        if (!(ob->mode & OB_MODE_VERTEX_PAINT)) return;
        if (me == 0 || me->mcol == 0 || me->totface == 0) return;
@@ -1007,7 +1007,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
        short change = FALSE;
 
        view3d_set_viewcontext(C, &vc);
-       me = get_mesh(vc.obact);
+       me = BKE_mesh_from_object(vc.obact);
 
        if (me && me->dvert && vc.v3d && vc.rv3d) {
                int index;
@@ -1094,7 +1094,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA
                        Mesh *me;
 
                        view3d_set_viewcontext(C, &vc);
-                       me = get_mesh(vc.obact);
+                       me = BKE_mesh_from_object(vc.obact);
 
                        if (me && me->dvert && vc.v3d && vc.rv3d) {
                                int index;
@@ -1975,7 +1975,7 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op))  /* toggle */
        VPaint *wp = scene->toolsettings->wpaint;
        Mesh *me;
        
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (ob->id.lib || me == NULL) return OPERATOR_PASS_THROUGH;
        
        if (ob->mode & OB_MODE_WEIGHT_PAINT) ob->mode &= ~OB_MODE_WEIGHT_PAINT;
@@ -2139,7 +2139,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
                return FALSE;
        }
        
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL || me->totpoly == 0) return OPERATOR_PASS_THROUGH;
        
        /* if nothing was added yet, we make dverts and a vertex deform group */
@@ -2154,7 +2154,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
                if ((modob = modifiers_isDeformedByArmature(ob))) {
                        Bone *actbone = ((bArmature *)modob->data)->act_bone;
                        if (actbone) {
-                               bPoseChannel *pchan = get_pose_channel(modob->pose, actbone->name);
+                               bPoseChannel *pchan = BKE_pose_channel_find_name(modob->pose, actbone->name);
 
                                if (pchan) {
                                        bDeformGroup *dg = defgroup_find_name(ob, pchan->name);
@@ -2541,7 +2541,7 @@ static int set_vpaint(bContext *C, wmOperator *op)  /* toggle */
        VPaint *vp = scene->toolsettings->vpaint;
        Mesh *me;
        
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        
        if (me == NULL || BKE_object_obdata_is_libdata(ob)) {
                ob->mode &= ~OB_MODE_VERTEX_PAINT;
@@ -2678,7 +2678,7 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent
        float mat[4][4], imat[4][4];
 
        /* context checks could be a poll() */
-       me = get_mesh(ob);
+       me = BKE_mesh_from_object(ob);
        if (me == NULL || me->totpoly == 0)
                return OPERATOR_PASS_THROUGH;
        
@@ -2726,7 +2726,7 @@ static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob,
 {
        ViewContext *vc = &vpd->vc;
        Brush *brush = paint_brush(&vp->paint);
-       Mesh *me = get_mesh(ob);
+       Mesh *me = BKE_mesh_from_object(ob);
        MFace *mface = &me->mface[index];
        unsigned int *mcol = ((unsigned int *)me->mcol) + 4 * index;
        unsigned int *mcolorig = ((unsigned int *)vp->vpaint_prev) + 4 * index;
@@ -2771,7 +2771,7 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob,
 {
        ViewContext *vc = &vpd->vc;
        Brush *brush = paint_brush(&vp->paint);
-       Mesh *me = get_mesh(ob);
+       Mesh *me = BKE_mesh_from_object(ob);
        MPoly *mpoly = &me->mpoly[index];
        MFace *mf;
        MCol *mc;
index fa560dc..a49a9f0 100644 (file)
@@ -2756,7 +2756,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_
                ss->face_normals = NULL;
        }
        else {
-               Mesh *me = get_mesh(ob);
+               Mesh *me = BKE_mesh_from_object(ob);
                ss->totvert = me->totvert;
                ss->totpoly = me->totpoly;
                ss->mvert = me->mvert;
@@ -2945,7 +2945,7 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
                
                BLI_strncpy(cache->saved_active_brush_name, brush->id.name + 2, sizeof(cache->saved_active_brush_name));
 
-               br = (Brush *)find_id("BR", "Smooth");
+               br = (Brush *)BKE_libblock_find_name("BR", "Smooth");
                if (br) {
                        paint_brush_set(p, br);
                        brush = br;
@@ -3508,7 +3508,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
                /* Alt-Smooth */
                if (ss->cache->alt_smooth) {
                        Paint *p = &sd->paint;
-                       brush = (Brush *)find_id("BR", ss->cache->saved_active_brush_name);
+                       brush = (Brush *)BKE_libblock_find_name("BR", ss->cache->saved_active_brush_name);
                        if (brush) {
                                paint_brush_set(p, brush);
                        }
index 20d5257..ff466c2 100644 (file)
@@ -294,7 +294,7 @@ static int buttons_context_path_pose_bone(ButsContextPath *path)
                }
                else {
                        if (arm->act_bone) {
-                               bPoseChannel *pchan= get_pose_channel(ob->pose, arm->act_bone->name);
+                               bPoseChannel *pchan= BKE_pose_channel_find_name(ob->pose, arm->act_bone->name);
                                if (pchan) {
                                        RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &path->ptr[path->len]);
                                        path->len++;
index ecbd9a4..de171bc 100644 (file)
@@ -146,7 +146,7 @@ static void image_info(Scene *scene, ImageUser *iuser, Image *ima, ImBuf *ibuf,
        /* the frame number, even if we cant */
        if (ima->source == IMA_SRC_SEQUENCE) {
                /* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
-               const int framenr = BKE_image_user_get_frame(iuser, CFRA, 0);
+               const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0);
                ofs += sprintf(str + ofs, ", Frame: %d", framenr);
        }
 
@@ -430,7 +430,7 @@ static void set_frames_cb(bContext *C, void *ima_v, void *iuser_v)
        
        if (ima->anim) {
                iuser->frames = IMB_anim_get_duration(ima->anim, IMB_TC_RECORD_RUN);
-               BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
+               BKE_image_user_frame_calc(iuser, scene->r.cfra, 0);
        }
 }
 
index 66070bf..51741b8 100644 (file)
@@ -1150,7 +1150,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
                        /* TODO, better solution, if a 24bit image is painted onto it may contain alpha */
                        if (ibuf->userflags & IB_BITMAPDIRTY) { /* it has been painted onto */
                                /* checks each pixel, not ideal */
-                               ibuf->planes = BKE_alphatest_ibuf(ibuf) ? 32 : 24;
+                               ibuf->planes = BKE_imbuf_alpha_test(ibuf) ? 32 : 24;
                        }
                }
                
@@ -1167,7 +1167,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
                        BKE_image_release_renderresult(scene, ima);
                }
                else {
-                       if (BKE_write_ibuf_as(ibuf, simopts->filepath, &simopts->im_format, save_copy)) {
+                       if (BKE_imbuf_write_as(ibuf, simopts->filepath, &simopts->im_format, save_copy)) {
                                ok = TRUE;
                        }
                }
@@ -1528,7 +1528,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
        if (!alpha)
                color[3] = 1.0f;
 
-       ima = BKE_add_image_size(width, height, name, alpha ? 32 : 24, floatbuf, uvtestgrid, color);
+       ima = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, floatbuf, uvtestgrid, color);
 
        if (!ima)
                return OPERATOR_CANCELLED;
@@ -2408,7 +2408,7 @@ void ED_image_update_frame(const Main *mainp, int cfra)
                if (tex->type == TEX_IMAGE && tex->ima) {
                        if (ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
                                if (tex->iuser.flag & IMA_ANIM_ALWAYS)
-                                       BKE_image_user_calc_frame(&tex->iuser, cfra, 0);
+                                       BKE_image_user_frame_calc(&tex->iuser, cfra, 0);
                        }
                }
        }
@@ -2423,12 +2423,12 @@ void ED_image_update_frame(const Main *mainp, int cfra)
                                        BGpic *bgpic;
                                        for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next)
                                                if (bgpic->iuser.flag & IMA_ANIM_ALWAYS)
-                                                       BKE_image_user_calc_frame(&bgpic->iuser, cfra, 0);
+                                                       BKE_image_user_frame_calc(&bgpic->iuser, cfra, 0);
                                }
                                else if (sa->spacetype == SPACE_IMAGE) {
                                        SpaceImage *sima = sa->spacedata.first;
                                        if (sima->iuser.flag & IMA_ANIM_ALWAYS)
-                                               BKE_image_user_calc_frame(&sima->iuser, cfra, 0);
+                                               BKE_image_user_frame_calc(&sima->iuser, cfra, 0);
                                }
                                else if (sa->spacetype == SPACE_NODE) {
                                        SpaceNode *snode = sa->spacedata.first;
@@ -2440,7 +2440,7 @@ void ED_image_update_frame(const Main *mainp, int cfra)
                                                                ImageUser *iuser = node->storage;
                                                                if (ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
                                                                        if (iuser->flag & IMA_ANIM_ALWAYS)
-                                                                               BKE_image_user_calc_frame(iuser, cfra, 0);
+                                                                               BKE_image_user_frame_calc(iuser, cfra, 0);
                                                        }
                                                }
                                        }
index 426cc32..9e0f538 100644 (file)
@@ -590,7 +590,7 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
        ima = ED_space_image(sima);
 
        if (sima->iuser.flag & IMA_ANIM_ALWAYS)
-               BKE_image_user_calc_frame(&sima->iuser, scene->r.cfra, 0);
+               BKE_image_user_frame_calc(&sima->iuser, scene->r.cfra, 0);
        
        /* check if we have to set the image from the editmesh */
        if (ima && (ima->source == IMA_SRC_VIEWER || sima->pin)) ;
index 891236d..97b6c32 100644 (file)
@@ -1084,7 +1084,7 @@ static void get_armature_bone_constraint(Object *ob, const char *posechannel, co
 {
        /* check that bone exist in the active object */
        if (ob->type == OB_ARMATURE && ob->pose) {
-               bPoseChannel *pchan= get_pose_channel(ob->pose, posechannel);
+               bPoseChannel *pchan= BKE_pose_channel_find_name(ob->pose, posechannel);
                if (pchan) {
                        bConstraint *con= BLI_findstring(&pchan->constraints, constraint_name, offsetof(bConstraint, name));
                        if (con) {
index bfa8111..c2b7a1d 100644 (file)
@@ -1247,7 +1247,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
                Scene *scene= CTX_data_scene(C);
                ImageUser *iuser= node->storage;
                char numstr[32];
-               const int framenr= BKE_image_user_get_frame(iuser, CFRA, 0);
+               const int framenr= BKE_image_user_frame_get(iuser, CFRA, 0);
                BLI_snprintf(numstr, sizeof(numstr), "Frame: %d", framenr);
                uiItemL(layout, numstr, ICON_NONE);
        }
index d47a1d5..be9b495 100644 (file)
@@ -3418,7 +3418,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
        else if (RNA_struct_property_is_set(op->ptr, "name")) {
                char name[MAX_ID_NAME-2];
                RNA_string_get(op->ptr, "name", name);
-               ima= (Image *)find_id("IM", name);
+               ima= (Image *)BKE_libblock_find_name("IM", name);
 
                if (!ima) {
                        BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found", name);
index 9bc87a2..47eecbc 100644 (file)
@@ -674,7 +674,7 @@ static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops)
 }
 
 /* find next element that has this name */
-static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
+static TreeElement *outliner_find_name(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
 {
        TreeElement *te, *tes;
        
@@ -694,7 +694,7 @@ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *na
                                return te;
                }
                
-               tes= outliner_find_named(soops, &te->subtree, name, flags, prev, prevFound);
+               tes= outliner_find_name(soops, &te->subtree, name, flags, prev, prevFound);
                if (tes) return tes;
        }
 
@@ -721,18 +721,18 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
                flags= soops->search_flags;
                
                /* try to find matching element */
-               te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound);
+               te= outliner_find_name(soops, &soops->tree, name, flags, last_find, &prevFound);
                if (te==NULL) {
                        /* no more matches after previous, start from beginning again */
                        prevFound= 1;
-                       te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound);
+                       te= outliner_find_name(soops, &soops->tree, name, flags, last_find, &prevFound);
                }
        }
        else {
                /* pop up panel - no previous, or user didn't want search after previous */
                name[0]= '\0';
 // XXX         if (sbutton(name, 0, sizeof(name)-1, "Find: ") && name[0]) {
-//                     te= outliner_find_named(soops, &soops->tree, name, flags, NULL, &prevFound);
+//                     te= outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
 //             }
 //             else return; /* XXX RETURN! XXX */
        }
@@ -1402,9 +1402,9 @@ static int parent_drop_exec(bContext *C, wmOperator *op)
 
        partype= RNA_enum_get(op->ptr, "type");
        RNA_string_get(op->ptr, "parent", parname);
-       par= (Object *)find_id("OB", parname);
+       par= (Object *)BKE_libblock_find_name("OB", parname);
        RNA_string_get(op->ptr, "child", childname);
-       ob= (Object *)find_id("OB", childname);
+       ob= (Object *)BKE_libblock_find_name("OB", childname);
 
        ED_object_parent_set(op->reports, bmain, scene, ob, par, partype);
 
@@ -1473,9 +1473,9 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
                RNA_string_set(op->ptr, "parent", te_found->name);
                /* Identify parent and child */
                RNA_string_get(op->ptr, "child", childname);
-               ob= (Object *)find_id("OB", childname);
+               ob= (Object *)BKE_libblock_find_name("OB", childname);
                RNA_string_get(op->ptr, "parent", parname);
-               par= (Object *)find_id("OB", parname);
+               par= (Object *)BKE_libblock_find_name("OB", parname);
                
                if (ELEM(NULL, ob, par)) {
                        if (par == NULL) printf("par==NULL\n");
@@ -1659,7 +1659,7 @@ static int parent_clear_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
        char obname[MAX_ID_NAME];
 
        RNA_string_get(op->ptr, "dragged_obj", obname);
-       ob= (Object *)find_id("OB", obname);
+       ob= (Object *)BKE_libblock_find_name("OB", obname);
 
        /* check dragged object (child) is active */
        if (ob != CTX_data_active_object(C))
index ca5b210..a980101 100644 (file)
@@ -258,7 +258,7 @@ void draw_motion_path_instance(Scene *scene,
                         * unless an option is set to always use the whole action
                         */
                        if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT) == 0) {
-                               bActionGroup *agrp = action_groups_find_named(adt->action, pchan->name);
+                               bActionGroup *agrp = BKE_action_group_find_name(adt->action, pchan->name);
                                
                                if (agrp) {
                                        agroup_to_keylist(adt, agrp, &keys, NULL);
index 15e6994..2211b1d 100644 (file)
@@ -2338,9 +2338,9 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
        
        /* copy the pose */
        poseo = ob->pose;
-       copy_pose(&posen, ob->pose, 1);
+       BKE_pose_copy_data(&posen, ob->pose, 1);
        ob->pose = posen;
-       armature_rebuild_pose(ob, ob->data);    /* child pointers for IK */
+       BKE_pose_rebuild(ob, ob->data);    /* child pointers for IK */
        ghost_poses_tag_unselected(ob, 0);      /* hide unselected bones if need be */
        
        glEnable(GL_BLEND);
@@ -2352,20 +2352,20 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
                UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128 - (int)(120.0 * sqrt(colfac)));
                
                BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
-               where_is_pose(scene, ob);
+               BKE_pose_where_is(scene, ob);
                draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
        }
        glDisable(GL_BLEND);
        if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
 
        ghost_poses_tag_unselected(ob, 1);      /* unhide unselected bones if need be */
-       free_pose(posen);
+       BKE_pose_free(posen);
        
        /* restore */
        CFRA = cfrao;
        ob->pose = poseo;
        arm->flag = flago;
-       armature_rebuild_pose(ob, ob->data);
+       BKE_pose_rebuild(ob, ob->data);
        ob->mode |= OB_MODE_POSE;
        ob->ipoflag = ipoflago;
 }
@@ -2415,9 +2415,9 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
        
        /* copy the pose */
        poseo = ob->pose;
-       copy_pose(&posen, ob->pose, 1);
+       BKE_pose_copy_data(&posen, ob->pose, 1);
        ob->pose = posen;
-       armature_rebuild_pose(ob, ob->data);  /* child pointers for IK */
+       BKE_pose_rebuild(ob, ob->data);  /* child pointers for IK */
        ghost_poses_tag_unselected(ob, 0);    /* hide unselected bones if need be */
        
        glEnable(GL_BLEND);
@@ -2431,7 +2431,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
                CFRA = (int)ak->cfra;
                
                BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
-               where_is_pose(scene, ob);
+               BKE_pose_where_is(scene, ob);
                draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
        }
        glDisable(GL_BLEND);
@@ -2439,13 +2439,13 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
 
        ghost_poses_tag_unselected(ob, 1);  /* unhide unselected bones if need be */
        BLI_dlrbTree_free(&keys);
-       free_pose(posen);
+       BKE_pose_free(posen);
        
        /* restore */
        CFRA = cfrao;
        ob->pose = poseo;
        arm->flag = flago;
-       armature_rebuild_pose(ob, ob->data);
+       BKE_pose_rebuild(ob, ob->data);
        ob->mode |= OB_MODE_POSE;
 }
 
@@ -2481,9 +2481,9 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
        
        /* copy the pose */
        poseo = ob->pose;
-       copy_pose(&posen, ob->pose, 1);
+       BKE_pose_copy_data(&posen, ob->pose, 1);
        ob->pose = posen;
-       armature_rebuild_pose(ob, ob->data);    /* child pointers for IK */
+       BKE_pose_rebuild(ob, ob->data);    /* child pointers for IK */
        ghost_poses_tag_unselected(ob, 0);      /* hide unselected bones if need be */
        
        glEnable(GL_BLEND);
@@ -2501,7 +2501,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
                        
                        if (CFRA != cfrao) {
                                BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
-                               where_is_pose(scene, ob);
+                               BKE_pose_where_is(scene, ob);
                                draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
                        }
                }
@@ -2516,7 +2516,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
                        
                        if (CFRA != cfrao) {
                                BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
-                               where_is_pose(scene, ob);
+                               BKE_pose_where_is(scene, ob);
                                draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
                        }
                }
@@ -2525,13 +2525,13 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
        if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
 
        ghost_poses_tag_unselected(ob, 1);      /* unhide unselected bones if need be */
-       free_pose(posen);
+       BKE_pose_free(posen);
        
        /* restore */
        CFRA = cfrao;
        ob->pose = poseo;
        arm->flag = flago;
-       armature_rebuild_pose(ob, ob->data);
+       BKE_pose_rebuild(ob, ob->data);
        ob->mode |= OB_MODE_POSE;
 }
 
index 79dce3e..6c94176 100644 (file)
@@ -1971,7 +1971,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob)
 
        /* now we default make displist, this will modifiers work for non animated case */
        if (ob->disp.first == NULL)
-               lattice_calc_modifiers(scene, ob);
+               BKE_lattice_modifiers_calc(scene, ob);
        dl = find_displist(&ob->disp, DL_VERTS);
        
        if (is_edit) {
@@ -6168,7 +6168,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type)
                }
        }
        else if (ob->type == OB_ARMATURE) {
-               bb = BKE_armature_get_bb(ob);
+               bb = BKE_armature_boundbox_get(ob);
        }
        else {
                drawcube();
index f9b8f92..28fd2c8 100644 (file)
@@ -1016,7 +1016,7 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
                        break;
        }
 
-       // removed since BKE_image_user_calc_frame is now called in draw_bgpic because screen_ops doesnt call the notifier.
+       // removed since BKE_image_user_frame_calc is now called in draw_bgpic because screen_ops doesnt call the notifier.
 #if 0
        if (wmn->category == NC_SCENE && wmn->data == ND_FRAME) {
                View3D *v3d = area->spacedata.first;
@@ -1025,7 +1025,7 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
                for (; bgpic; bgpic = bgpic->next) {
                        if (bgpic->ima) {
                                Scene *scene = wmn->reference;
-                               BKE_image_user_calc_frame(&bgpic->iuser, scene->r.cfra, 0);
+                               BKE_image_user_frame_calc(&bgpic->iuser, scene->r.cfra, 0);
                        }
                }
        }
index 1312961..723dc9d 100644 (file)
@@ -939,7 +939,7 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
        PointerRNA pchanptr;
        uiLayout *col;
 
-       pchan = get_active_posechannel(ob);
+       pchan = BKE_pose_channel_active(ob);
 
        if (!pchan) {
                uiItemL(layout, IFACE_("No Bone Active"), ICON_NONE);
index fe7511c..dd90ef5 100644 (file)
@@ -1544,7 +1544,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, int foreground)
                                ima = bgpic->ima;
                                if (ima == NULL)
                                        continue;
-                               BKE_image_user_calc_frame(&bgpic->iuser, CFRA, 0);
+                               BKE_image_user_frame_calc(&bgpic->iuser, CFRA, 0);
                                ibuf = BKE_image_get_ibuf(ima, &bgpic->iuser);
                        }
                        else {
index de17f0a..b593331 100644 (file)
@@ -3098,7 +3098,7 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
        }
        else if (RNA_struct_property_is_set(op->ptr, "name")) {
                RNA_string_get(op->ptr, "name", name);
-               ima = (Image *)find_id("IM", name);
+               ima = (Image *)BKE_libblock_find_name("IM", name);
        }
        
        bgpic = background_image_add(C);
index 2fe0a30..367b36d 100644 (file)
@@ -582,7 +582,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
                                                                mul_m4_v3(ob->imat, vec);
                                                                
                                                                /* Get location of grid point in pose space. */
-                                                               armature_loc_pose_to_bone(pchan, vec, vec);
+                                                               BKE_armature_loc_pose_to_bone(pchan, vec, vec);
                                                                
                                                                /* adjust location */
                                                                if ((pchan->protectflag & OB_LOCK_LOCX) == 0)
@@ -707,7 +707,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
                                                if (pchan->bone->layer & arm->layer) {
                                                        if ((pchan->bone->flag & BONE_CONNECTED) == 0) {
                                                                /* Get position in pchan (pose) space. */
-                                                               armature_loc_pose_to_bone(pchan, vec, vec);
+                                                               BKE_armature_loc_pose_to_bone(pchan, vec, vec);
 
                                                                /* copy new position */
                                                                if ((pchan->protectflag & OB_LOCK_LOCX) == 0)
index 1509242..e1be274 100644 (file)
@@ -1176,7 +1176,7 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
                        
                        copy_v3_v3(vec, ob->obmat[3]);
                        if (ob->type == OB_ARMATURE && v3d->ob_centre_bone[0]) {
-                               bPoseChannel *pchan = get_pose_channel(ob->pose, v3d->ob_centre_bone);
+                               bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, v3d->ob_centre_bone);
                                if (pchan) {
                                        copy_v3_v3(vec, pchan->pose_mat[3]);
                                        mul_m4_v3(ob->obmat, vec);
index d7ad0c0..3cd41ed 100644 (file)
@@ -424,7 +424,7 @@ static short apply_targetless_ik(Object *ob)
                                bone= parchan->bone;
                                bone->flag |= BONE_TRANSFORM;   /* ensures it gets an auto key inserted */
 
-                               armature_mat_pose_to_bone(parchan, parchan->pose_mat, rmat);
+                               BKE_armature_mat_pose_to_bone(parchan, parchan->pose_mat, rmat);
 
                                /* apply and decompose, doesn't work for constraints or non-uniform scale well */
                                {
@@ -535,11 +535,11 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
        /* proper way to get parent transform + own transform + constraints transform */
        copy_m3_m4(omat, ob->obmat);
 
-       /* New code, using "generic" pchan_to_pose_mat(). */
+       /* New code, using "generic" BKE_pchan_to_pose_mat(). */
        {
                float rotscale_mat[4][4], loc_mat[4][4];
 
-               pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
+               BKE_pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
                if (t->mode == TFM_TRANSLATION)
                        copy_m3_m4(pmat, loc_mat);
                else
@@ -884,7 +884,7 @@ static short pose_grab_with_ik_children(bPose *pose, Bone *bone)
                }
        }
        if (wentdeeper==0) {
-               bPoseChannel *pchan= get_pose_channel(pose, bone->name);
+               bPoseChannel *pchan= BKE_pose_channel_find_name(pose, bone->name);
                if (pchan)
                        added+= pose_grab_with_ik_add(pchan);
        }
@@ -953,7 +953,7 @@ static void createTransPose(TransInfo *t, Object *ob)
        t->total= 0;
 
        /* check validity of state */
-       arm= get_armature(ob);
+       arm= BKE_armature_from_object(ob);
        if ((arm==NULL) || (ob->pose==NULL)) return;
 
        if (arm->flag & ARM_RESTPOS) {
@@ -5046,7 +5046,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
                         * we need to update the pose otherwise no updates get called during
                         * transform and the auto-ik is not applied. see [#26164] */
                        struct Object *pose_ob=t->poseobj;
-                       where_is_pose(t->scene, pose_ob);
+                       BKE_pose_where_is(t->scene, pose_ob);
                }
 
                /* set BONE_TRANSFORM flags for autokey, manipulator draw might have changed them */
index bea1002..b986bda 100644 (file)
@@ -833,7 +833,7 @@ static void recalcData_view3d(TransInfo *t)
                        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);  /* sets recalc flags */
                }
                else
-                       where_is_pose(t->scene, ob);
+                       BKE_pose_where_is(t->scene, ob);
        }
        else if (base && (base->object->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, base->object)) {
                if (t->state != TRANS_CANCEL) {
index 093c81c..94f6640 100644 (file)
@@ -203,7 +203,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
 {
        if (ob) {
                if (ob->mode & OB_MODE_POSE) {
-                       bPoseChannel *pchan= get_active_posechannel(ob);
+                       bPoseChannel *pchan= BKE_pose_channel_active(ob);
 
                        if (pchan) {
                                float mat[3][3], tmat[3][3], obmat[3][3];
index 6add8cd..ebfedea 100644 (file)
@@ -714,7 +714,7 @@ int GPU_set_tpage(MTFace *tface, int mipmap, int alphablend)
        gpu_verify_repeat(ima);
        
        /* Did this get lost in the image recode? */
-       /* tag_image_time(ima);*/
+       /* BKE_image_tag_time(ima);*/
 
        return 1;
 }
index 08c5e24..c726102 100644 (file)
@@ -229,7 +229,7 @@ static void where_is_ik_bone(bPoseChannel *pchan, float ik_mat[][3])   // nr = t
 }
 
 
-/* called from within the core where_is_pose loop, all animsystems and constraints
+/* called from within the core BKE_pose_where_is loop, all animsystems and constraints
  * were executed & assigned. Now as last we do an IK pass */
 static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
 {
@@ -535,8 +535,8 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob,  struct bPose
                /* 4. walk over the tree for regular solving */
                for (a=0; a<tree->totchannel; a++) {
                        if (!(tree->pchan[a]->flag & POSE_DONE))        // successive trees can set the flag
-                               where_is_pose_bone(scene, ob, tree->pchan[a], ctime, 1);
-                       // tell blender that this channel was controlled by IK, it's cleared on each where_is_pose()
+                               BKE_pose_where_is_bone(scene, ob, tree->pchan[a], ctime, 1);
+                       // tell blender that this channel was controlled by IK, it's cleared on each BKE_pose_where_is()
                        tree->pchan[a]->flag |= POSE_CHAIN;
                }
                /* 5. execute the IK solver */
index 2e437c6..d94529b 100644 (file)
@@ -418,7 +418,7 @@ static IK_Data* get_ikdata(bPose *pose)
        // here init ikdata if needed
        // now that we have scene, make sure the default param are initialized
        if (!DefIKParam.iksolver)
-               init_pose_itasc(&DefIKParam);
+               BKE_pose_itasc_init(&DefIKParam);
 
        return (IK_Data*)pose->ikdata;
 }
@@ -1023,7 +1023,7 @@ static void convert_pose(IK_Scene *ikscene)
 }
 
 // compute array of joint value corresponding to current pose
-static void rest_pose(IK_Scene *ikscene)
+static void BKE_pose_rest(IK_Scene *ikscene)
 {
        bPoseChannel *pchan;
        IK_Channel *ikchan;
@@ -1133,7 +1133,7 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
        }
        else {
                // in Blender, the rest pose is always 0 for joints
-               rest_pose(ikscene);
+               BKE_pose_rest(ikscene);
        }
        rot = &ikscene->jointArray(0);
        for (a=0, ikchan = ikscene->channels; a<tree->totchannel; ++a, ++ikchan) {
@@ -1545,7 +1545,7 @@ static void execute_scene(Scene* blscene, IK_Scene* ikscene, bItasc* ikparam, fl
        if (ikparam->flag & ITASC_SIMULATION) {
                for (i=0, ikchan=ikscene->channels; i<ikscene->numchan; i++, ++ikchan) {
                        // In simulation mode we don't allow external contraint to change our bones, mark the channel done
-                       // also tell Blender that this channel is part of IK tree (cleared on each where_is_pose()
+                       // also tell Blender that this channel is part of IK tree (cleared on each BKE_pose_where_is()
                        ikchan->pchan->flag |= (POSE_DONE|POSE_CHAIN);
                        ikchan->jointValid = 0;
                }
@@ -1554,8 +1554,8 @@ static void execute_scene(Scene* blscene, IK_Scene* ikscene, bItasc* ikparam, fl
                // in animation mode, we must get the bone position from action and constraints
                for (i=0, ikchan=ikscene->channels; i<ikscene->numchan; i++, ++ikchan) {
                        if (!(ikchan->pchan->flag & POSE_DONE))
-                               where_is_pose_bone(blscene, ikscene->blArmature, ikchan->pchan, ctime, 1);
-                       // tell blender that this channel was controlled by IK, it's cleared on each where_is_pose()
+                               BKE_pose_where_is_bone(blscene, ikscene->blArmature, ikchan->pchan, ctime, 1);
+                       // tell blender that this channel was controlled by IK, it's cleared on each BKE_pose_where_is()
                        ikchan->pchan->flag |= (POSE_DONE|POSE_CHAIN);
                        ikchan->jointValid = 0;
                }
index 43474d7..30b3e75 100644 (file)
@@ -335,7 +335,7 @@ typedef struct bPose {
        
        float ctime;                            /* local action time of this pose */
        float stride_offset[3];         /* applied to object */
-       float cyclic_offset[3];         /* result of match and cycles, applied in where_is_pose() */
+       float cyclic_offset[3];         /* result of match and cycles, applied in BKE_pose_where_is() */
        
        
        ListBase agroups;                       /* list of bActionGroups */
@@ -352,7 +352,7 @@ typedef struct bPose {
 
 /* Pose->flag */
 typedef enum ePose_Flags {
-               /* results in armature_rebuild_pose being called */
+               /* results in BKE_pose_rebuild being called */
        POSE_RECALC = (1<<0),
                /* prevents any channel from getting overridden by anim from IPO */
        POSE_LOCKED     = (1<<1),
@@ -362,7 +362,7 @@ typedef enum ePose_Flags {
        POSE_CONSTRAINTS_TIMEDEPEND = (1<<3),
                /* recalculate bone paths */
        POSE_RECALCPATHS = (1<<4),
-               /* set by armature_rebuild_pose to give a chance to the IK solver to rebuild IK tree */
+               /* set by BKE_pose_rebuild to give a chance to the IK solver to rebuild IK tree */
        POSE_WAS_REBUILT = (1<<5),
                /* set by game_copy_pose to indicate that this pose is used in the game engine */
        POSE_GAME_ENGINE = (1<<6)
index 06352fd..7f52456 100644 (file)
@@ -201,7 +201,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
        }
        
        /* check if we have registered this info before, and remove it */
-       ksi = ANIM_keyingset_info_find_named(dummyksi.idname);
+       ksi = ANIM_keyingset_info_find_name(dummyksi.idname);
        if (ksi && ksi->ext.srna)
                rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna);
        
@@ -337,7 +337,7 @@ static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr)
        
        /* keying set info is only for builtin Keying Sets */
        if ((ks->flag & KEYINGSET_ABSOLUTE) == 0)
-               ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
+               ksi = ANIM_keyingset_info_find_name(ks->typeinfo);
        return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetInfo, ksi);
 }
 
index f7e7435..7052bfa 100644 (file)
@@ -134,7 +134,7 @@ static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *
 {
        ImageUser *iuser = ptr->data;
 
-       BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
+       BKE_image_user_frame_calc(iuser, scene->r.cfra, 0);
 }
 
 
index ff71763..8432180 100644 (file)
@@ -85,7 +85,7 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
                        const float dither_back = ibuf->dither;
                        ibuf->planes = scene->r.im_format.planes;
                        ibuf->dither = scene->r.dither_intensity;
-                       if (!BKE_write_ibuf(ibuf, path, &scene->r.im_format)) {
+                       if (!BKE_imbuf_write(ibuf, path, &scene->r.im_format)) {
                                BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path);
                        }
                        ibuf->planes = imb_planes_back;
index 5d8d8c7..d919406 100644 (file)
@@ -109,21 +109,21 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
        newv = (lt->opntsv > 0)? lt->opntsv: lt->pntsv;
        neww = (lt->opntsw > 0)? lt->opntsw: lt->pntsw;
 
-       /* resizelattice needs an object, any object will have the same result */
+       /* BKE_lattice_resize needs an object, any object will have the same result */
        for (ob = bmain->object.first; ob; ob = ob->id.next) {
                if (ob->data == lt) {
-                       resizelattice(lt, newu, newv, neww, ob);
+                       BKE_lattice_resize(lt, newu, newv, neww, ob);
                        if (lt->editlatt)
-                               resizelattice(lt->editlatt->latt, newu, newv, neww, ob);
+                               BKE_lattice_resize(lt->editlatt->latt, newu, newv, neww, ob);
                        break;
                }
        }
 
        /* otherwise without, means old points are not repositioned */
        if (!ob) {
-               resizelattice(lt, newu, newv, neww, NULL);
+               BKE_lattice_resize(lt, newu, newv, neww, NULL);
                if (lt->editlatt)
-                       resizelattice(lt->editlatt->latt, newu, newv, neww, NULL);
+                       BKE_lattice_resize(lt->editlatt->latt, newu, newv, neww, NULL);
        }
 
        rna_Lattice_update_data(bmain, scene, ptr);
index 661e4b1..0451d7c 100644 (file)
@@ -198,7 +198,7 @@ void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *ob
 
 struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name)
 {
-       ID *id = (ID *)add_material(name);
+       ID *id = (ID *)BKE_material_add(name);
        id_us_min(id);
        return (Material *)id;
 }
@@ -233,7 +233,7 @@ void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree
 
 Mesh *rna_Main_meshes_new(Main *UNUSED(bmain), const char *name)
 {
-       Mesh *me = add_mesh(name);
+       Mesh *me = BKE_mesh_add(name);
        id_us_min(&me->id);
        return me;
 }
@@ -250,7 +250,7 @@ void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
 
 Lamp *rna_Main_lamps_new(Main *UNUSED(bmain), const char *name, int type)
 {
-       Lamp *lamp = add_lamp(name);
+       Lamp *lamp = BKE_lamp_add(name);
        lamp->type = type;
        id_us_min(&lamp->id);
        return lamp;
@@ -269,7 +269,7 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
 Image *rna_Main_images_new(Main *UNUSED(bmain), const char *name, int width, int height, int alpha, int float_buffer)
 {
        float color[4] = {0.0, 0.0, 0.0, 1.0};
-       Image *image = BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color);
+       Image *image = BKE_image_add_generated(width, height, name, alpha ? 32:24, float_buffer, 0, color);
        id_us_min(&image->id);
        return image;
 }
@@ -299,7 +299,7 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
 
 Lattice *rna_Main_lattices_new(Main *UNUSED(bmain), const char *name)
 {
-       Lattice *lt = add_lattice(name);
+       Lattice *lt = BKE_lattice_add(name);
        id_us_min(&lt->id);
        return lt;
 }
@@ -426,7 +426,7 @@ void rna_Main_groups_remove(Main *bmain, Group *group)
 
 Speaker *rna_Main_speakers_new(Main *UNUSED(bmain), const char *name)
 {
-       Speaker *speaker = add_speaker(name);
+       Speaker *speaker = BKE_speaker_add(name);
        id_us_min(&speaker->id);
        return speaker;
 }
@@ -468,7 +468,7 @@ Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath
 
 bArmature *rna_Main_armatures_new(Main *UNUSED(bmain), const char *name)
 {
-       bArmature *arm = add_armature(name);
+       bArmature *arm = BKE_armature_add(name);
        id_us_min(&arm->id);
        return arm;
 }
index 3e8ee8c..38f0b7e 100644 (file)
@@ -355,7 +355,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value)
                if (GS(id->name) == ID_CU)
                        BKE_curve_type_test(ob);
                else if (ob->type == OB_ARMATURE)
-                       armature_rebuild_pose(ob, ob->data);
+                       BKE_pose_rebuild(ob, ob->data);
        }
 }
 
index 77110f8..e95e49e 100644 (file)
@@ -131,7 +131,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
                if (ob != basis_ob)
                        return NULL; /* only do basis metaball */
 
-               tmpmesh = add_mesh("Mesh");
+               tmpmesh = BKE_mesh_add("Mesh");
                        
                if (render) {
                        ListBase disp = {NULL, NULL};
@@ -164,7 +164,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
                        else
                                dm = mesh_create_derived_view(sce, ob, mask);
                        
-                       tmpmesh = add_mesh("Mesh");
+                       tmpmesh = BKE_mesh_add("Mesh");
                        DM_to_mesh(dm, tmpmesh, ob);
                        dm->release(dm);
                }
index ceace42..c87dabf 100644 (file)
@@ -173,7 +173,7 @@ static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
                        pose->ikparam = NULL;
                }
                pose->iksolver = value;
-               init_pose_ikparam(pose);
+               BKE_pose_ikparam_init(pose);
        }
 }
 
@@ -185,7 +185,7 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr
        pose->flag |= POSE_RECALC;      /* checks & sorts pose channels */
        DAG_scene_sort(bmain, scene);
        
-       update_pose_constraint_flags(pose);
+       BKE_pose_update_constraint_flags(pose);
        
        object_test_constraints(ob);
 
@@ -586,7 +586,7 @@ static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index)
 int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
 {
        bPose *pose = (bPose*)ptr->data;
-       bPoseChannel *pchan = get_pose_channel(pose, key);
+       bPoseChannel *pchan = BKE_pose_channel_find_name(pose, key);
        if (pchan) {
                RNA_pointer_create(ptr->id.data, &RNA_PoseBone, pchan, r_ptr);
                return TRUE;
@@ -599,13 +599,13 @@ int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_
 static void rna_PoseChannel_matrix_basis_get(PointerRNA *ptr, float *values)
 {
        bPoseChannel *pchan = (bPoseChannel*)ptr->data;
-       pchan_to_mat4(pchan, (float (*)[4])values);
+       BKE_pchan_to_mat4(pchan, (float (*)[4])values);
 }
 
 static void rna_PoseChannel_matrix_basis_set(PointerRNA *ptr, const float *values)
 {
        bPoseChannel *pchan = (bPoseChannel*)ptr->data;
-       pchan_apply_mat4(pchan, (float (*)[4])values, FALSE); /* no compat for predictable result */
+   &nb