diff options
Diffstat (limited to 'source/blender/blenkernel')
31 files changed, 258 insertions, 258 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index b9d7fb88a22..a326b514f9a 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -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 }; diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 72d452150a1..b8c2c42f8d5 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -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); diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index d9a656a8a40..563f066bda6 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -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); diff --git a/source/blender/blenkernel/BKE_lamp.h b/source/blender/blenkernel/BKE_lamp.h index fd19794085d..f9137e50d74 100644 --- a/source/blender/blenkernel/BKE_lamp.h +++ b/source/blender/blenkernel/BKE_lamp.h @@ -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 diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h index 251f02fecd7..9a952fc6b1e 100644 --- a/source/blender/blenkernel/BKE_lattice.h +++ b/source/blender/blenkernel/BKE_lattice.h @@ -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 diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 8a93366ea9a..e8dff6633bc 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -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, diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 32570311d02..801724d1d4f 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -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 *); diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 34289a2ae4d..256d4b1cae1 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -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, diff --git a/source/blender/blenkernel/BKE_speaker.h b/source/blender/blenkernel/BKE_speaker.h index 5ff881ee085..52c177fce57 100644 --- a/source/blender/blenkernel/BKE_speaker.h +++ b/source/blender/blenkernel/BKE_speaker.h @@ -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 diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index aa6f56c5d8f..ed58620b716 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -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); diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index addbde139d2..90cfb9a1d82 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -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); } diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 66c91c034a9..de70ffcaaef 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -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) */ diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 56275f5735b..814e9d53503 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -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); diff --git a/source/blender/blenkernel/intern/booleanops_mesh.c b/source/blender/blenkernel/intern/booleanops_mesh.c index 7c225eb0fad..972793227a8 100644 --- a/source/blender/blenkernel/intern/booleanops_mesh.c +++ b/source/blender/blenkernel/intern/booleanops_mesh.c @@ -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); diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index a244fa96fda..66209e8a924 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -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)) diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index d8287644abf..54655cf8582 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -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"); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 71c6c8d80aa..f1942b24810 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -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 { diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 1690ad9e3aa..88cfa63e3e7 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -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) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index d7af24b394d..c2cb45d9f9d 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -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 */ diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c index 927a4390999..e7206af3a0f 100644 --- a/source/blender/blenkernel/intern/lamp.c +++ b/source/blender/blenkernel/intern/lamp.c @@ -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; diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index d9ee95857ca..12496e78037 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -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); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index e9520566dd0..8d643349b8c 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -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); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 16b3cb639bc..f4d9bcfd218 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -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); diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index da758ea0f0b..fd054dee44a 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -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); } diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index bc7d3af930b..e432428eae4 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -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 */ diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 3cdf45e3569..14f23032dd9 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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; } diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index 4ddcd6f4b51..6242976d323 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -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); } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 9e21538b5ca..2673200690b 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -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); diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index d6fea87397d..fdda1c6ec0a 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -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); } diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c index d3c38221c00..e94a11b8f89 100644 --- a/source/blender/blenkernel/intern/speaker.c +++ b/source/blender/blenkernel/intern/speaker.c @@ -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; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 5ba3e95154b..9b3689df941 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -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; |