Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-05 18:03:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-05 18:03:12 +0400
commita731e130432a98ab8228112027cd3eaa8ed700b1 (patch)
treee71dad8f907ccd4a73b7bbc1ad166eda2dfba9cf /source/blender/blenkernel
parenta30dec8e5968ae6568184cfdc2e1a69bad0e39d6 (diff)
code cleanup: function naming, use BKE_*type* prefix.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_action.h6
-rw-r--r--source/blender/blenkernel/BKE_armature.h6
-rw-r--r--source/blender/blenkernel/BKE_font.h2
-rw-r--r--source/blender/blenkernel/BKE_gpencil.h2
-rw-r--r--source/blender/blenkernel/BKE_group.h6
-rw-r--r--source/blender/blenkernel/BKE_image.h4
-rw-r--r--source/blender/blenkernel/BKE_ipo.h2
-rw-r--r--source/blender/blenkernel/BKE_key.h6
-rw-r--r--source/blender/blenkernel/BKE_lamp.h4
-rw-r--r--source/blender/blenkernel/BKE_lattice.h6
-rw-r--r--source/blender/blenkernel/BKE_library.h11
-rw-r--r--source/blender/blenkernel/BKE_material.h4
-rw-r--r--source/blender/blenkernel/BKE_mesh.h6
-rw-r--r--source/blender/blenkernel/BKE_object.h135
-rw-r--r--source/blender/blenkernel/BKE_particle.h6
-rw-r--r--source/blender/blenkernel/BKE_scene.h5
-rw-r--r--source/blender/blenkernel/BKE_screen.h2
-rw-r--r--source/blender/blenkernel/BKE_sound.h2
-rw-r--r--source/blender/blenkernel/BKE_speaker.h4
-rw-r--r--source/blender/blenkernel/BKE_text.h6
-rw-r--r--source/blender/blenkernel/BKE_texture.h4
-rw-r--r--source/blender/blenkernel/BKE_world.h6
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c4
-rw-r--r--source/blender/blenkernel/intern/action.c20
-rw-r--r--source/blender/blenkernel/intern/anim.c12
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c18
-rw-r--r--source/blender/blenkernel/intern/armature.c22
-rw-r--r--source/blender/blenkernel/intern/brush.c6
-rw-r--r--source/blender/blenkernel/intern/camera.c4
-rw-r--r--source/blender/blenkernel/intern/constraint.c12
-rw-r--r--source/blender/blenkernel/intern/curve.c10
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c4
-rw-r--r--source/blender/blenkernel/intern/displist.c2
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c4
-rw-r--r--source/blender/blenkernel/intern/effect.c4
-rw-r--r--source/blender/blenkernel/intern/fcurve.c2
-rw-r--r--source/blender/blenkernel/intern/font.c4
-rw-r--r--source/blender/blenkernel/intern/gpencil.c4
-rw-r--r--source/blender/blenkernel/intern/group.c14
-rw-r--r--source/blender/blenkernel/intern/image.c10
-rw-r--r--source/blender/blenkernel/intern/ipo.c2
-rw-r--r--source/blender/blenkernel/intern/key.c10
-rw-r--r--source/blender/blenkernel/intern/lamp.c12
-rw-r--r--source/blender/blenkernel/intern/lattice.c14
-rw-r--r--source/blender/blenkernel/intern/library.c160
-rw-r--r--source/blender/blenkernel/intern/material.c14
-rw-r--r--source/blender/blenkernel/intern/mball.c6
-rw-r--r--source/blender/blenkernel/intern/mesh.c20
-rw-r--r--source/blender/blenkernel/intern/movieclip.c2
-rw-r--r--source/blender/blenkernel/intern/multires.c6
-rw-r--r--source/blender/blenkernel/intern/node.c8
-rw-r--r--source/blender/blenkernel/intern/object.c262
-rw-r--r--source/blender/blenkernel/intern/particle.c12
-rw-r--r--source/blender/blenkernel/intern/particle_system.c4
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/blenkernel/intern/scene.c33
-rw-r--r--source/blender/blenkernel/intern/screen.c2
-rw-r--r--source/blender/blenkernel/intern/sound.c18
-rw-r--r--source/blender/blenkernel/intern/speaker.c10
-rw-r--r--source/blender/blenkernel/intern/text.c12
-rw-r--r--source/blender/blenkernel/intern/texture.c14
-rw-r--r--source/blender/blenkernel/intern/tracking.c2
-rw-r--r--source/blender/blenkernel/intern/world.c16
63 files changed, 517 insertions, 515 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 564cd235869..b9d7fb88a22 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -59,13 +59,13 @@ extern "C" {
struct bAction *add_empty_action(const char name[]);
/* Allocate a copy of the given Action and all its data */
-struct bAction *copy_action(struct bAction *src);
+struct bAction *BKE_action_copy(struct bAction *src);
/* Deallocate all of the Action's data, but not the Action itself */
-void free_action(struct bAction *act);
+void BKE_action_free(struct bAction *act);
// XXX is this needed?
-void make_local_action(struct bAction *act);
+void BKE_action_make_local(struct bAction *act);
/* Action API ----------------- */
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index dfe3fde17eb..72d452150a1 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -78,9 +78,9 @@ extern "C" {
struct bArmature *add_armature(const char *name);
struct bArmature *get_armature(struct Object *ob);
void free_bonelist (struct ListBase *lb);
-void free_armature(struct bArmature *arm);
-void make_local_armature(struct bArmature *arm);
-struct bArmature *copy_armature(struct bArmature *arm);
+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);
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h
index 16e98f25e0c..640a70a8e87 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -73,7 +73,7 @@ typedef struct EditFont {
void BKE_font_register_builtin(void *mem, int size);
-void free_vfont(struct VFont *sc);
+void BKE_vfont_free(struct VFont *sc);
void free_ttfont(void);
struct VFont *get_builtin_font(void);
struct VFont *load_vfont(struct Main *bmain, const char *name);
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index bb0216fe11c..134ec1acd8e 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -41,7 +41,7 @@ struct bGPDframe;
void free_gpencil_strokes(struct bGPDframe *gpf);
void free_gpencil_frames(struct bGPDlayer *gpl);
void free_gpencil_layers(struct ListBase *list);
-void free_gpencil_data(struct bGPdata *gpd);
+void BKE_gpencil_free(struct bGPdata *gpd);
struct bGPDframe *gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe);
struct bGPDlayer *gpencil_layer_addnew(struct bGPdata *gpd);
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h
index 6629f0bdf7f..ccf9e0cef5b 100644
--- a/source/blender/blenkernel/BKE_group.h
+++ b/source/blender/blenkernel/BKE_group.h
@@ -40,10 +40,10 @@ struct Object;
struct bAction;
struct Scene;
-void free_group_objects(struct Group *group);
-void unlink_group(struct Group *group);
+void BKE_group_free(struct Group *group);
+void BKE_group_unlink(struct Group *group);
struct Group *add_group(const char *name);
-struct Group *copy_group(struct Group *group);
+struct Group *BKE_group_copy(struct Group *group);
int add_to_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
int rem_from_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
struct Group *find_group(struct Object *ob, struct Group *group);
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index c2112d1e169..637b57af0bc 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -46,7 +46,7 @@ struct Object;
struct ImageFormatData;
/* call from library */
-void free_image(struct Image *me);
+void BKE_image_free(struct Image *me);
void BKE_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);
@@ -176,7 +176,7 @@ void BKE_image_memorypack(struct Image *ima);
void BKE_image_print_memlist(void);
/* empty image block, of similar type and filename */
-struct Image *copy_image(struct Image *ima);
+struct Image *BKE_image_copy(struct Image *ima);
/* merge source into dest, and free source */
void BKE_image_merge(struct Image *dest, struct Image *source);
diff --git a/source/blender/blenkernel/BKE_ipo.h b/source/blender/blenkernel/BKE_ipo.h
index 547e7de7634..ca86e90f192 100644
--- a/source/blender/blenkernel/BKE_ipo.h
+++ b/source/blender/blenkernel/BKE_ipo.h
@@ -45,7 +45,7 @@ void do_versions_ipos_to_animato(struct Main *main);
/* --------------------- xxx stuff ------------------------ */
-void free_ipo(struct Ipo *ipo);
+void BKE_ipo_free(struct Ipo *ipo);
#ifdef __cplusplus
};
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index 63d9d731097..757952515e5 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -47,12 +47,12 @@ struct Mesh;
extern "C" {
#endif
-void free_key(struct Key *sc);
+void BKE_key_free(struct Key *sc);
void free_key_nolib(struct Key *key);
struct Key *add_key(struct ID *id);
-struct Key *copy_key(struct Key *key);
+struct Key *BKE_key_copy(struct Key *key);
struct Key *copy_key_nolib(struct Key *key);
-void make_local_key(struct Key *key);
+void BKE_key_make_local(struct Key *key);
void sort_keys(struct Key *key);
void key_curve_position_weights(float t, float *data, int type);
diff --git a/source/blender/blenkernel/BKE_lamp.h b/source/blender/blenkernel/BKE_lamp.h
index 50e25576320..fd19794085d 100644
--- a/source/blender/blenkernel/BKE_lamp.h
+++ b/source/blender/blenkernel/BKE_lamp.h
@@ -39,10 +39,10 @@ extern "C" {
struct Lamp;
void *add_lamp(const char *name);
-struct Lamp *copy_lamp(struct Lamp *la);
+struct Lamp *BKE_lamp_copy(struct Lamp *la);
struct Lamp *localize_lamp(struct Lamp *la);
void make_local_lamp(struct Lamp *la);
-void free_lamp(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 a0075c4d6be..251f02fecd7 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -43,9 +43,9 @@ struct MDeformVert;
void resizelattice(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
struct Lattice *add_lattice(const char *name);
-struct Lattice *copy_lattice(struct Lattice *lt);
-void free_lattice(struct Lattice *lt);
-void make_local_lattice(struct Lattice *lt);
+struct Lattice *BKE_lattice_copy(struct Lattice *lt);
+void BKE_lattice_free(struct Lattice *lt);
+void BKE_lattice_make_local(struct Lattice *lt);
void calc_lat_fudu(int flag, int res, float *fu, float *du);
void init_latt_deform(struct Object *oblatt, struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index be21996428a..8a93366ea9a 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -45,15 +45,16 @@ struct bContext;
struct PointerRNA;
struct PropertyRNA;
-void *alloc_libblock(struct ListBase *lb, short type, const char *name);
-void *copy_libblock(struct ID *id);
-void copy_libblock_data(struct ID *id, const struct ID *id_from, const short do_action);
+void *BKE_libblock_alloc(struct ListBase *lb, short type, const char *name);
+void *BKE_libblock_copy(struct ID *id);
+void BKE_libblock_copy_data(struct ID *id, const struct ID *id_from, const short do_action);
void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *id);
void id_lib_extern(struct ID *id);
void BKE_library_filepath_set(struct Library *lib, const char *filepath);
void id_us_plus(struct ID *id);
void id_us_min(struct ID *id);
+
int id_make_local(struct ID *id, int test);
int id_single_user(struct bContext *C, struct ID *id, struct PointerRNA *ptr, struct PropertyRNA *prop);
int id_copy(struct ID *id, struct ID **newid, int test);
@@ -68,8 +69,8 @@ struct ListBase *which_libbase(struct Main *mainlib, short type);
#define MAX_LIBARRAY 40
int set_listbasepointers(struct Main *main, struct ListBase **lb);
-void free_libblock(struct ListBase *lb, void *idv);
-void free_libblock_us(struct ListBase *lb, void *idv);
+void BKE_libblock_free(struct ListBase *lb, void *idv);
+void BKE_libblock_free_us(struct ListBase *lb, void *idv);
void free_main(struct Main *mainvar);
void tag_main_idcode(struct Main *mainvar, const short type, const short tag);
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 99561a687b9..32570311d02 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -46,12 +46,12 @@ struct MTFace;
/* materials */
void init_def_material(void);
-void free_material(struct Material *sc);
+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 *copy_material(struct Material *ma);
+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);
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 14cb5d19ddf..34289a2ae4d 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -119,12 +119,12 @@ void mesh_flush_hidden_from_verts(const struct MVert *mvert,
struct MPoly *mpoly, int totpoly);
void unlink_mesh(struct Mesh *me);
-void free_mesh(struct Mesh *me, int unlink);
+void BKE_mesh_free(struct Mesh *me, int unlink);
struct Mesh *add_mesh(const char *name);
-struct Mesh *copy_mesh(struct Mesh *me);
+struct Mesh *BKE_mesh_copy(struct Mesh *me);
void mesh_update_customdata_pointers(struct Mesh *me, const short do_ensure_tess_cd);
-void make_local_mesh(struct Mesh *me);
+void BKE_mesh_make_local(struct Mesh *me);
void boundbox_mesh(struct Mesh *me, float *loc, float *size);
void tex_space_mesh(struct Mesh *me);
float *get_mesh_orco_verts(struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 2e334c4abc9..92a447f9351 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -50,65 +50,66 @@ struct RenderData;
struct rctf;
struct MovieClip;
-void clear_workob(struct Object *workob);
-void what_does_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
+void BKE_object_workob_clear(struct Object *workob);
+void BKE_object_workob_calc_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
-void copy_baseflags(struct Scene *scene);
-void copy_objectflags(struct Scene *scene);
struct SoftBody *copy_softbody(struct SoftBody *sb);
struct BulletSoftBody *copy_bulletsoftbody(struct BulletSoftBody *sb);
-void copy_object_particlesystems(struct Object *obn, struct Object *ob);
-void copy_object_softbody(struct Object *obn, struct Object *ob);
-void object_free_particlesystems(struct Object *ob);
-void object_free_softbody(struct Object *ob);
-void object_free_bulletsoftbody(struct Object *ob);
-void update_base_layer(struct Scene *scene, struct Object *ob);
+void BKE_object_copy_particlesystems(struct Object *obn, struct Object *ob);
+void BKE_object_copy_softbody(struct Object *obn, struct Object *ob);
+void BKE_object_free_particlesystems(struct Object *ob);
+void BKE_object_free_softbody(struct Object *ob);
+void BKE_object_free_bulletsoftbody(struct Object *ob);
+void BKE_object_update_base_layer(struct Scene *scene, struct Object *ob);
-void free_object(struct Object *ob);
-void object_free_display(struct Object *ob);
+void BKE_object_free(struct Object *ob);
+void BKE_object_free_display(struct Object *ob);
-int object_support_modifier_type(struct Object *ob, int modifier_type);
+int BKE_object_support_modifier_type_check(struct Object *ob, int modifier_type);
-void object_link_modifiers(struct Object *ob, struct Object *from);
-void object_free_modifiers(struct Object *ob);
+void BKE_object_link_modifiers(struct Object *ob, struct Object *from);
+void BKE_object_free_modifiers(struct Object *ob);
-void object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob);
-void object_copy_proxy_drivers(struct Object *ob, struct Object *target);
+void BKE_object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob);
+void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target);
-void unlink_object(struct Object *ob);
-int exist_object(struct Object *obtest);
+void BKE_object_unlink(struct Object *ob);
+int BKE_object_exists_check(struct Object *obtest);
-struct Object *add_only_object(int type, const char *name);
-struct Object *add_object(struct Scene *scene, int type);
-void *add_obdata_from_type(int type);
-
-struct Object *copy_object(struct Object *ob);
-void make_local_object(struct Object *ob);
-int object_is_libdata(struct Object *ob);
-int object_data_is_libdata(struct Object *ob);
-
-void object_scale_to_mat3(struct Object *ob, float mat[][3]);
-void object_rot_to_mat3(struct Object *ob, float mat[][3]);
-void object_mat3_to_rot(struct Object *ob, float mat[][3], short use_compat);
-void object_to_mat3(struct Object *ob, float mat[][3]);
-void object_to_mat4(struct Object *ob, float mat[][4]);
-void object_apply_mat4(struct Object *ob, float mat[][4], const short use_compat, const short use_parent);
-
-struct Object *object_pose_armature_get(struct Object *ob);
-
-void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime);
-void where_is_object(struct Scene *scene, struct Object *ob);
-void where_is_object_simul(struct Scene *scene, struct Object *ob);
-void where_is_object_mat(struct Scene *scene, struct Object *ob, float obmat[4][4]);
-
-struct BoundBox *unit_boundbox(void);
-void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]);
-struct BoundBox *object_get_boundbox(struct Object *ob);
-void object_get_dimensions(struct Object *ob, float vec[3]);
-void object_set_dimensions(struct Object *ob, const float *value);
-void object_boundbox_flag(struct Object *ob, int flag, int set);
-void minmax_object(struct Object *ob, float min[3], float max[3]);
-int minmax_object_duplis(struct Scene *scene, struct Object *ob, float min[3], float max[3]);
+struct Object *BKE_object_add_only_object(int type, const char *name);
+struct Object *BKE_object_add(struct Scene *scene, int type);
+void *BKE_object_obdata_add_from_type(int type);
+
+struct Object *BKE_object_copy(struct Object *ob);
+void BKE_object_make_local(struct Object *ob);
+int BKE_object_is_libdata(struct Object *ob);
+int BKE_object_obdata_is_libdata(struct Object *ob);
+
+void BKE_object_scale_to_mat3(struct Object *ob, float mat[][3]);
+void BKE_object_rot_to_mat3(struct Object *ob, float mat[][3]);
+void BKE_object_mat3_to_rot(struct Object *ob, float mat[][3], short use_compat);
+void BKE_object_to_mat3(struct Object *ob, float mat[][3]);
+void BKE_object_to_mat4(struct Object *ob, float mat[][4]);
+void BKE_object_apply_mat4(struct Object *ob, float mat[][4], const short use_compat, const short use_parent);
+
+struct Object *BKE_object_pose_armature_get(struct Object *ob);
+
+void BKE_object_where_is_calc(struct Scene *scene, struct Object *ob);
+void BKE_object_where_is_calc_time(struct Scene *scene, struct Object *ob, float ctime);
+void BKE_object_where_is_calc_simul(struct Scene *scene, struct Object *ob);
+void BKE_object_where_is_calc_mat4(struct Scene *scene, struct Object *ob, float obmat[4][4]);
+
+/* possibly belong in own moduke? */
+struct BoundBox *BKE_boundbox_alloc_unit(void);
+void BKE_boundbox_init_from_minmax(struct BoundBox *bb, float min[3], float max[3]);
+int BKE_boundbox_ray_hit_check(struct BoundBox *bb, float ray_start[3], float ray_normal[3]);
+
+struct BoundBox *BKE_object_boundbox_get(struct Object *ob);
+void BKE_object_dimensions_get(struct Object *ob, float vec[3]);
+void BKE_object_dimensions_set(struct Object *ob, const float *value);
+void BKE_object_boundbox_flag(struct Object *ob, int flag, int set);
+void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3]);
+int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3]);
/* sometimes min-max isn't enough, we need to loop over each point */
void BKE_object_foreach_display_point(
@@ -122,10 +123,8 @@ void BKE_scene_foreach_display_point(
int BKE_object_parent_loop_check(const struct Object *parent, const struct Object *ob);
-int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]);
-
-void *object_tfm_backup(struct Object *ob);
-void object_tfm_restore(struct Object *ob, void *obtfm_pt);
+void *BKE_object_tfm_backup(struct Object *ob);
+void BKE_object_tfm_restore(struct Object *ob, void *obtfm_pt);
typedef struct ObjectTfmProtectedChannels {
float loc[3], dloc[3];
@@ -136,28 +135,28 @@ typedef struct ObjectTfmProtectedChannels {
float rotAngle, drotAngle;
} ObjectTfmProtectedChannels;
-void object_tfm_protected_backup(const struct Object *ob,
- ObjectTfmProtectedChannels *obtfm);
+void BKE_object_tfm_protected_backup(const struct Object *ob,
+ ObjectTfmProtectedChannels *obtfm);
-void object_tfm_protected_restore(struct Object *ob,
- const ObjectTfmProtectedChannels *obtfm,
- const short protectflag);
+void BKE_object_tfm_protected_restore(struct Object *ob,
+ const ObjectTfmProtectedChannels *obtfm,
+ const short protectflag);
-void object_handle_update(struct Scene *scene, struct Object *ob);
-void object_sculpt_modifiers_changed(struct Object *ob);
+void BKE_object_handle_update(struct Scene *scene, struct Object *ob);
+void BKE_object_sculpt_modifiers_changed(struct Object *ob);
-int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot);
+int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot);
-int object_insert_ptcache(struct Object *ob);
+int BKE_object_insert_ptcache(struct Object *ob);
// void object_delete_ptcache(struct Object *ob, int index);
-struct KeyBlock *object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, int from_mix);
+struct KeyBlock *BKE_object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, int from_mix);
-int object_is_modified(struct Scene *scene, struct Object *ob);
-int object_is_deform_modified(struct Scene *scene, struct Object *ob);
+int BKE_object_is_modified(struct Scene *scene, struct Object *ob);
+int BKE_object_is_deform_modified(struct Scene *scene, struct Object *ob);
-void object_relink(struct Object *ob);
+void BKE_object_relink(struct Object *ob);
-struct MovieClip *object_get_movieclip(struct Scene *scene, struct Object *ob, int use_default);
+struct MovieClip *BKE_object_movieclip_get(struct Scene *scene, struct Object *ob, int use_default);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 67dba6fd7a7..f776295b912 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -246,7 +246,7 @@ void psys_check_group_weights(struct ParticleSettings *part);
int psys_uses_gravity(struct ParticleSimulationData *sim);
/* free */
-void psys_free_settings(struct ParticleSettings *part);
+void BKE_particlesettings_free(struct ParticleSettings *part);
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit);
void psys_free(struct Object * ob, struct ParticleSystem * psys);
@@ -266,8 +266,8 @@ struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct P
struct ModifierData *object_add_particle_system(struct Scene *scene, struct Object *ob, const char *name);
void object_remove_particle_system(struct Scene *scene, struct Object *ob);
struct ParticleSettings *psys_new_settings(const char *name, struct Main *main);
-struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part);
-void make_local_particlesettings(struct ParticleSettings *part);
+struct ParticleSettings *BKE_particlesettings_copy(struct ParticleSettings *part);
+void BKE_particlesettings_make_local(struct ParticleSettings *part);
void psys_reset(struct ParticleSystem *psys, int mode);
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index e46d99ed873..f2c07fb82e0 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -61,7 +61,7 @@ struct Base *_setlooper_base_step(struct Scene **sce_iter, struct Base *base);
void free_avicodecdata(struct AviCodecData *acd);
void free_qtcodecdata(struct QuicktimeCodecData *acd);
-void free_scene(struct Scene *sce);
+void BKE_scene_free(struct Scene *sce);
struct Scene *add_scene(const char *name);
struct Base *object_in_scene(struct Object *ob, struct Scene *sce);
@@ -104,6 +104,9 @@ float get_render_aosss_error(struct RenderData *r, float error);
int scene_use_new_shading_nodes(struct Scene *scene);
+void copy_baseflags(struct Scene *scene);
+void copy_objectflags(struct Scene *scene);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index fbb93c761c2..af6e793cf2f 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -252,7 +252,7 @@ float BKE_screen_view3d_zoom_to_fac(float camzoom);
float BKE_screen_view3d_zoom_from_fac(float zoomfac);
/* screen */
-void free_screen(struct bScreen *sc);
+void BKE_screen_free(struct bScreen *sc);
unsigned int BKE_screen_visible_layers(struct bScreen *screen, struct Scene *scene);
#endif
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index 8b01dbde531..5234f10ddb3 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -77,7 +77,7 @@ void sound_delete_cache(struct bSound* sound);
void sound_load(struct Main *main, struct bSound* sound);
-void sound_free(struct bSound* sound);
+void BKE_sound_free(struct bSound* sound);
#ifdef __AUD_C_API_H__
AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume);
diff --git a/source/blender/blenkernel/BKE_speaker.h b/source/blender/blenkernel/BKE_speaker.h
index fddcfb2c7f3..5ff881ee085 100644
--- a/source/blender/blenkernel/BKE_speaker.h
+++ b/source/blender/blenkernel/BKE_speaker.h
@@ -34,8 +34,8 @@
*/
void *add_speaker(const char *name);
-struct Speaker *copy_speaker(struct Speaker *spk);
+struct Speaker *BKE_speaker_copy(struct Speaker *spk);
void make_local_speaker(struct Speaker *spk);
-void free_speaker(struct Speaker *spk);
+void BKE_speaker_free(struct Speaker *spk);
#endif
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index 115c00d9e73..4b033557026 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -42,15 +42,15 @@ struct Text;
struct TextLine;
struct SpaceText;
-void free_text (struct Text *text);
+void BKE_text_free (struct Text *text);
void txt_set_undostate (int u);
int txt_get_undostate (void);
struct Text* add_empty_text (const char *name);
int txt_extended_ascii_as_utf8(char **str);
int reopen_text (struct Text *text);
struct Text* add_text (const char *file, const char *relpath);
-struct Text* copy_text (struct Text *ta);
-void unlink_text (struct Main *bmain, struct Text *text);
+struct Text* BKE_text_copy (struct Text *ta);
+void BKE_text_unlink (struct Main *bmain, struct Text *text);
void clear_text(struct Text *text);
void write_text(struct Text *text, const char *str);
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index 2574c45eec2..aa6f56c5d8f 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -59,7 +59,7 @@ struct World;
#define MAXCOLORBAND 32
-void free_texture(struct Tex *t);
+void BKE_texture_free(struct Tex *t);
int test_dlerr(const char *name, const char *symbol);
void open_plugin_tex(struct PluginTex *pit);
struct PluginTex *add_plugin_tex(char *str);
@@ -79,7 +79,7 @@ void tex_set_type(struct Tex *tex, int type);
void default_mtex(struct MTex *mtex);
struct MTex *add_mtex(void);
struct MTex *add_mtex_id(struct ID *id, int slot);
-struct Tex *copy_texture(struct Tex *tex);
+struct Tex *BKE_texture_copy(struct Tex *tex);
struct Tex *localize_texture(struct Tex *tex);
void make_local_texture(struct Tex *tex);
void autotexname(struct Tex *tex);
diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h
index 16ff3acaf71..67896fffc4d 100644
--- a/source/blender/blenkernel/BKE_world.h
+++ b/source/blender/blenkernel/BKE_world.h
@@ -35,11 +35,11 @@
struct World;
-void free_world(struct World *sc);
+void BKE_world_free(struct World *sc);
struct World *add_world(const char *name);
-struct World *copy_world(struct World *wrld);
+struct World *BKE_world_copy(struct World *wrld);
struct World *localize_world(struct World *wrld);
-void make_local_world(struct World *wrld);
+void BKE_world_make_local(struct World *wrld);
#endif
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index f648a9e297c..db9df4050b0 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2111,7 +2111,7 @@ static void clear_mesh_caches(Object *ob)
}
if (ob->sculpt) {
- object_sculpt_modifiers_changed(ob);
+ BKE_object_sculpt_modifiers_changed(ob);
}
}
@@ -2884,7 +2884,7 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm)
if (!ob->bb)
ob->bb= MEM_callocN(sizeof(BoundBox), "DM-BoundBox");
- boundbox_set_from_min_max(ob->bb, min, max);
+ BKE_boundbox_init_from_minmax(ob->bb, min, max);
}
/* --- NAVMESH (begin) --- */
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 5a2407ca56b..9ed1a2e8956 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -83,14 +83,14 @@ bAction *add_empty_action(const char name[])
{
bAction *act;
- act= alloc_libblock(&G.main->action, ID_AC, name);
+ act= BKE_libblock_alloc(&G.main->action, ID_AC, name);
return act;
}
/* .................................. */
-/* temp data for make_local_action */
+/* temp data for BKE_action_make_local */
typedef struct tMakeLocalActionContext {
bAction *act; /* original action */
bAction *act_new; /* new action */
@@ -99,7 +99,7 @@ typedef struct tMakeLocalActionContext {
int is_local; /* some action users were not libraries */
} tMakeLocalActionContext;
-/* helper function for make_local_action() - local/lib init step */
+/* helper function for BKE_action_make_local() - local/lib init step */
static void make_localact_init_cb(ID *id, AnimData *adt, void *mlac_ptr)
{
tMakeLocalActionContext *mlac = (tMakeLocalActionContext *)mlac_ptr;
@@ -110,7 +110,7 @@ static void make_localact_init_cb(ID *id, AnimData *adt, void *mlac_ptr)
}
}
-/* helper function for make_local_action() - change references */
+/* helper function for BKE_action_make_local() - change references */
static void make_localact_apply_cb(ID *id, AnimData *adt, void *mlac_ptr)
{
tMakeLocalActionContext *mlac = (tMakeLocalActionContext *)mlac_ptr;
@@ -126,7 +126,7 @@ static void make_localact_apply_cb(ID *id, AnimData *adt, void *mlac_ptr)
}
// does copy_fcurve...
-void make_local_action(bAction *act)
+void BKE_action_make_local(bAction *act)
{
tMakeLocalActionContext mlac = {act, NULL, FALSE, FALSE};
Main *bmain= G.main;
@@ -146,7 +146,7 @@ void make_local_action(bAction *act)
id_clear_lib_data(bmain, &act->id);
}
else if (mlac.is_local && mlac.is_lib) {
- mlac.act_new= copy_action(act);
+ mlac.act_new= BKE_action_copy(act);
mlac.act_new->id.us= 0;
BKE_id_lib_local_paths(bmain, act->id.lib, &mlac.act_new->id);
@@ -157,7 +157,7 @@ void make_local_action(bAction *act)
/* .................................. */
-void free_action(bAction *act)
+void BKE_action_free(bAction *act)
{
/* sanity check */
if (act == NULL)
@@ -177,7 +177,7 @@ void free_action(bAction *act)
/* .................................. */
-bAction *copy_action (bAction *src)
+bAction *BKE_action_copy (bAction *src)
{
bAction *dst = NULL;
bActionGroup *dgrp, *sgrp;
@@ -185,7 +185,7 @@ bAction *copy_action (bAction *src)
if (src == NULL)
return NULL;
- dst= copy_libblock(&src->id);
+ dst= BKE_libblock_copy(&src->id);
/* duplicate the lists of groups and markers */
BLI_duplicatelist(&dst->groups, &src->groups);
@@ -1139,7 +1139,7 @@ void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, c
bActionGroup *agrp= action_groups_find_named(act, groupname);
/* clear workob */
- clear_workob(workob);
+ BKE_object_workob_clear(workob);
/* init workob */
copy_m4_m4(workob->obmat, ob->obmat);
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index afa4723bc6d..353caece2be 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -341,7 +341,7 @@ static void motionpaths_calc_update_scene(Scene *scene)
// is animated but not attached to/updatable from objects
for (base=scene->base.first; base; base=base->next) {
/* update this object */
- object_handle_update(scene, base->object);
+ BKE_object_handle_update(scene, base->object);
/* if this is the last one we need to update, let's stop to save some time */
if (base == last)
@@ -816,7 +816,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level,
* However, this has always been the way that this worked (i.e. pre 2.5), so I guess that it'll be fine!
*/
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, (float)scene->r.cfra, ADT_RECALC_ANIM); /* ob-eval will do drivers, so we don't need to do them */
- where_is_object_time(scene, ob, (float)scene->r.cfra);
+ BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
dob= new_dupli_object(lb, ob, ob->obmat, ob->lay, scene->r.cfra, OB_DUPLIFRAMES, animated);
copy_m4_m4(dob->omat, copyob.obmat);
@@ -831,7 +831,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level,
scene->r.cfra= cfrao;
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, (float)scene->r.cfra, ADT_RECALC_ANIM); /* ob-eval will do drivers, so we don't need to do them */
- where_is_object_time(scene, ob, (float)scene->r.cfra);
+ BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
/* but, to make sure unkeyed object transforms are still sane,
* let's copy object's original data back over
@@ -1309,7 +1309,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
/* we also copy the actual objects to restore afterwards, since
- * where_is_object_time will change the object which breaks transform */
+ * BKE_object_where_is_calc_time will change the object which breaks transform */
oblist = MEM_callocN(totgroup*sizeof(Object *), "dupgroup object list");
obcopylist = MEM_callocN(totgroup*sizeof(Object), "dupgroup copy list");
@@ -1445,7 +1445,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
else {
/* to give ipos in object correct offset */
- where_is_object_time(scene, ob, ctime-pa_time);
+ BKE_object_where_is_calc_time(scene, ob, ctime-pa_time);
copy_v3_v3(vec, obmat[3]);
obmat[3][0] = obmat[3][1] = obmat[3][2] = 0.0f;
@@ -1486,7 +1486,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
}
}
- /* restore objects since they were changed in where_is_object_time */
+ /* restore objects since they were changed in BKE_object_where_is_calc_time */
if (part->ren_as==PART_DRAW_GR) {
for (a=0; a<totgroup; a++)
*(oblist[a])= obcopylist[a];
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 78584333367..66c91c034a9 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -253,8 +253,8 @@ AnimData *BKE_copy_animdata (AnimData *adt, const short do_action)
/* make a copy of action - at worst, user has to delete copies... */
if (do_action) {
- dadt->action= copy_action(adt->action);
- dadt->tmpact= copy_action(adt->tmpact);
+ dadt->action= BKE_action_copy(adt->action);
+ dadt->tmpact= BKE_action_copy(adt->tmpact);
}
else {
id_us_plus((ID *)dadt->action);
@@ -298,11 +298,11 @@ void BKE_copy_animdata_id_action(ID *id)
if (adt) {
if (adt->action) {
id_us_min((ID *)adt->action);
- adt->action= copy_action(adt->action);
+ adt->action= BKE_action_copy(adt->action);
}
if (adt->tmpact) {
id_us_min((ID *)adt->tmpact);
- adt->tmpact= copy_action(adt->tmpact);
+ adt->tmpact= BKE_action_copy(adt->tmpact);
}
}
}
@@ -314,8 +314,8 @@ static void make_local_strips(ListBase *strips)
NlaStrip *strip;
for (strip=strips->first; strip; strip=strip->next) {
- if (strip->act) make_local_action(strip->act);
- if (strip->remap && strip->remap->target) make_local_action(strip->remap->target);
+ if (strip->act) BKE_action_make_local(strip->act);
+ if (strip->remap && strip->remap->target) BKE_action_make_local(strip->remap->target);
make_local_strips(&strip->strips);
}
@@ -327,10 +327,10 @@ void BKE_animdata_make_local(AnimData *adt)
NlaTrack *nlt;
/* Actions - Active and Temp */
- if (adt->action) make_local_action(adt->action);
- if (adt->tmpact) make_local_action(adt->tmpact);
+ if (adt->action) BKE_action_make_local(adt->action);
+ if (adt->tmpact) BKE_action_make_local(adt->tmpact);
/* Remaps */
- if (adt->remap && adt->remap->target) make_local_action(adt->remap->target);
+ if (adt->remap && adt->remap->target) BKE_action_make_local(adt->remap->target);
/* Drivers */
// TODO: need to remap the ID-targets too?
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index b0d0ace2a7e..e2d90b60ffa 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -79,7 +79,7 @@ bArmature *add_armature(const char *name)
{
bArmature *arm;
- arm = alloc_libblock (&G.main->armature, ID_AR, name);
+ arm = BKE_libblock_alloc (&G.main->armature, ID_AR, name);
arm->deformflag = ARM_DEF_VGROUP|ARM_DEF_ENVELOPE;
arm->flag = ARM_COL_CUSTOM; /* custom bone-group colors */
arm->layer = 1;
@@ -108,7 +108,7 @@ void free_bonelist(ListBase *lb)
BLI_freelistN(lb);
}
-void free_armature(bArmature *arm)
+void BKE_armature_free(bArmature *arm)
{
if (arm) {
free_bonelist(&arm->bonebase);
@@ -135,7 +135,7 @@ void free_armature(bArmature *arm)
}
}
-void make_local_armature(bArmature *arm)
+void BKE_armature_make_local(bArmature *arm)
{
Main *bmain = G.main;
int is_local = FALSE, is_lib = FALSE;
@@ -161,7 +161,7 @@ void make_local_armature(bArmature *arm)
id_clear_lib_data(bmain, &arm->id);
}
else if (is_local && is_lib) {
- bArmature *arm_new = copy_armature(arm);
+ bArmature *arm_new = BKE_armature_copy(arm);
arm_new->id.us = 0;
/* Remap paths of new ID using old library as base. */
@@ -201,13 +201,13 @@ static void copy_bonechildren(Bone* newBone, Bone* oldBone, Bone* actBone, Bone
}
}
-bArmature *copy_armature(bArmature *arm)
+bArmature *BKE_armature_copy(bArmature *arm)
{
bArmature *newArm;
Bone *oldBone, *newBone;
Bone *newActBone= NULL;
- newArm = copy_libblock(&arm->id);
+ newArm = BKE_libblock_copy(&arm->id);
BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
/* Duplicate the childrens' lists*/
@@ -1316,7 +1316,7 @@ void armature_mat_pose_to_bone_ex(Object *ob, bPoseChannel *pchan, float inmat[]
armature_mat_pose_to_bone(&work_pchan, inmat, outmat);
}
-/* same as object_mat3_to_rot() */
+/* same as BKE_object_mat3_to_rot() */
void pchan_mat3_to_rot(bPoseChannel *pchan, float mat[][3], short use_compat)
{
switch (pchan->rotmode) {
@@ -1335,7 +1335,7 @@ void pchan_mat3_to_rot(bPoseChannel *pchan, float mat[][3], short use_compat)
}
/* Apply a 4x4 matrix to the pose bone,
- * similar to object_apply_mat4() */
+ * similar to BKE_object_apply_mat4() */
void pchan_apply_mat4(bPoseChannel *pchan, float mat[][4], short use_compat)
{
float rot[3][3];
@@ -1732,7 +1732,7 @@ void armature_rebuild_pose(Object *ob, bArmature *arm)
/* synchronize protected layers with proxy */
if (ob->proxy) {
- object_copy_proxy_drivers(ob, ob->proxy);
+ BKE_object_copy_proxy_drivers(ob, ob->proxy);
pose_proxy_synchronize(ob, ob->proxy, arm->layer_protected);
}
@@ -2517,7 +2517,7 @@ int get_selected_defgroups(Object *ob, char *dg_selection, int defbase_tot)
{
bDeformGroup *defgroup;
unsigned int i;
- Object *armob = object_pose_armature_get(ob);
+ Object *armob = BKE_object_pose_armature_get(ob);
int dg_flags_sel_tot = 0;
if (armob) {
@@ -2581,7 +2581,7 @@ void boundbox_armature(Object *ob, float *loc, float *size)
size[1] = (max[1] - min[1]) / 2.0f;
size[2] = (max[2] - min[2]) / 2.0f;
- boundbox_set_from_min_max(bb, min, max);
+ BKE_boundbox_init_from_minmax(bb, min, max);
}
BoundBox *BKE_armature_get_bb(Object *ob)
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 51258b13f68..a1e8a11e9ff 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -126,7 +126,7 @@ Brush *BKE_brush_add(const char *name)
{
Brush *brush;
- brush= alloc_libblock(&G.main->brush, ID_BR, name);
+ brush= BKE_libblock_alloc(&G.main->brush, ID_BR, name);
/* enable fake user by default */
brush->id.flag |= LIB_FAKEUSER;
@@ -145,7 +145,7 @@ Brush *BKE_brush_copy(Brush *brush)
{
Brush *brushn;
- brushn= copy_libblock(&brush->id);
+ brushn= BKE_libblock_copy(&brush->id);
if (brush->mtex.tex)
id_us_plus((ID*)brush->mtex.tex);
@@ -432,7 +432,7 @@ int BKE_brush_texture_set_nr(Brush *brush, int nr)
idtest= (ID*)BLI_findlink(&G.main->tex, nr-1);
if (idtest==NULL) { /* new tex */
- if (id) idtest= (ID *)copy_texture((Tex *)id);
+ if (id) idtest= (ID *)BKE_texture_copy((Tex *)id);
else idtest= (ID *)add_texture("Tex");
idtest->us--;
}
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 11c628e7848..efede6bbae7 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -54,7 +54,7 @@ void *BKE_camera_add(const char *name)
{
Camera *cam;
- cam= alloc_libblock(&G.main->camera, ID_CA, name);
+ cam= BKE_libblock_alloc(&G.main->camera, ID_CA, name);
cam->lens= 35.0f;
cam->sensor_x= 32.0f;
@@ -73,7 +73,7 @@ Camera *BKE_camera_copy(Camera *cam)
{
Camera *camn;
- camn= copy_libblock(&cam->id);
+ camn= BKE_libblock_copy(&cam->id);
id_lib_extern((ID *)camn->dof_ob);
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 424ded0397e..399aedc914f 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -383,7 +383,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
/* Local space in this case will have to be defined as local to the owner's
* transform-property-rotated axes. So subtract this rotation component.
*/
- object_to_mat4(ob, diff_mat);
+ BKE_object_to_mat4(ob, diff_mat);
normalize_m4(diff_mat);
zero_v3(diff_mat[3]);
@@ -402,7 +402,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
/* Local space in this case will have to be defined as local to the owner's
* transform-property-rotated axes. So add back this rotation component.
*/
- object_to_mat4(ob, diff_mat);
+ BKE_object_to_mat4(ob, diff_mat);
normalize_m4(diff_mat);
zero_v3(diff_mat[3]);
@@ -2218,7 +2218,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
/* evaluate using workob */
// FIXME: we don't have any consistent standards on limiting effects on object...
what_does_obaction(cob->ob, &workob, NULL, data->act, NULL, t);
- object_to_mat4(&workob, ct->matrix);
+ BKE_object_to_mat4(&workob, ct->matrix);
}
else {
/* behavior undefined... */
@@ -3149,7 +3149,7 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
copy_v3_v3(ownLoc, obmat[3]);
INIT_MINMAX(curveMin, curveMax)
- minmax_object(ct->tar, curveMin, curveMax);
+ BKE_object_minmax(ct->tar, curveMin, curveMax);
/* get targetmatrix */
if (cu->path && cu->path->data) {
@@ -3989,7 +3989,7 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
float aspect= (scene->r.xsch * scene->r.xasp) / (scene->r.ysch * scene->r.yasp);
float len, d;
- where_is_object_mat(scene, camob, mat);
+ BKE_object_where_is_calc_mat4(scene, camob, mat);
/* camera axis */
vec[0] = 0.0f;
@@ -4198,7 +4198,7 @@ static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
if (object) {
float mat[4][4], obmat[4][4], imat[4][4], cammat[4][4], camimat[4][4], parmat[4][4];
- where_is_object_mat(scene, camob, cammat);
+ BKE_object_where_is_calc_mat4(scene, camob, cammat);
BKE_tracking_get_interpolated_camera(tracking, object, scene->r.cfra, mat);
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 85e3d85dfc4..04a2eef5615 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -155,7 +155,7 @@ Curve *BKE_curve_add(const char *name, int type)
{
Curve *cu;
- cu = alloc_libblock(&G.main->curve, ID_CU, name);
+ cu = BKE_libblock_alloc(&G.main->curve, ID_CU, name);
copy_v3_fl(cu->size, 1.0f);
cu->flag= CU_FRONT|CU_BACK|CU_DEFORM_BOUNDS_OFF|CU_PATH_RADIUS;
cu->pathlen= 100;
@@ -172,7 +172,7 @@ Curve *BKE_curve_add(const char *name, int type)
cu->bevfac1= 0.0f;
cu->bevfac2= 1.0f;
- cu->bb= unit_boundbox();
+ cu->bb= BKE_boundbox_alloc_unit();
if (type==OB_FONT) {
cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= get_builtin_font();
@@ -194,7 +194,7 @@ Curve *BKE_curve_copy(Curve *cu)
Curve *cun;
int a;
- cun= copy_libblock(&cu->id);
+ cun= BKE_libblock_copy(&cu->id);
cun->nurb.first= cun->nurb.last= NULL;
BKE_nurbList_duplicate(&(cun->nurb), &(cu->nurb));
@@ -208,7 +208,7 @@ Curve *BKE_curve_copy(Curve *cu)
cun->tb= MEM_dupallocN(cu->tb);
cun->bb= MEM_dupallocN(cu->bb);
- cun->key= copy_key(cu->key);
+ cun->key= BKE_key_copy(cu->key);
if (cun->key) cun->key->from= (ID *)cun;
cun->disp.first= cun->disp.last= NULL;
@@ -385,7 +385,7 @@ void BKE_curve_tex_space_calc(Curve *cu)
max[0] = max[1] = max[2] = 1.0f;
}
- boundbox_set_from_min_max(bb, min, max);
+ BKE_boundbox_init_from_minmax(bb, min, max);
if (cu->texflag & CU_AUTOSPACE) {
mid_v3_v3v3(cu->loc, min, max);
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 75e22195c6a..d8287644abf 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -1896,7 +1896,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
if ((all_layer & layer)==0) { // XXX && (ob != obedit)) {
/* but existing displaylists or derivedmesh should be freed */
if (ob->recalc & OB_RECALC_DATA)
- object_free_display(ob);
+ BKE_object_free_display(ob);
ob->recalc &= ~OB_RECALC_ALL;
}
@@ -2613,7 +2613,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
* so it should happen tracking-related constraints recalculation
* when camera is changing (sergey) */
if (sce->camera && &sce->camera->id == id) {
- MovieClip *clip = object_get_movieclip(sce, sce->camera, 1);
+ MovieClip *clip = BKE_object_movieclip_get(sce, sce->camera, 1);
if (clip)
dag_id_flush_update(sce, &clip->id);
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index cf7750520a3..60f060d154e 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1569,7 +1569,7 @@ static void boundbox_displist(Object *ob)
}
if (bb) {
- boundbox_set_from_min_max(bb, min, max);
+ BKE_boundbox_init_from_minmax(bb, min, max);
}
}
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 6c5826c5bab..fde5d2d2a2d 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -540,11 +540,11 @@ static int subframe_updateObject(Scene *scene, Object *ob, int flags, float fram
/* ignore cache clear during subframe updates
* to not mess up cache validity */
object_cacheIgnoreClear(ob, 1);
- object_handle_update(scene, ob);
+ BKE_object_handle_update(scene, ob);
object_cacheIgnoreClear(ob, 0);
}
else
- where_is_object_time(scene, ob, frame);
+ BKE_object_where_is_calc_time(scene, ob, frame);
return 0;
}
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 7fb0cf9f0fa..4024deee1e8 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -202,9 +202,9 @@ static void precalculate_effector(EffectorCache *eff)
if (eff->ob) {
float old_vel[3];
- where_is_object_time(eff->scene, eff->ob, cfra - 1.0f);
+ BKE_object_where_is_calc_time(eff->scene, eff->ob, cfra - 1.0f);
copy_v3_v3(old_vel, eff->ob->obmat[3]);
- where_is_object_time(eff->scene, eff->ob, cfra);
+ BKE_object_where_is_calc_time(eff->scene, eff->ob, cfra);
sub_v3_v3v3(eff->velocity, eff->ob->obmat[3], old_vel);
}
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 0414d69785f..71c6c8d80aa 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1302,7 +1302,7 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar)
}
else {
/* transforms to matrix */
- object_to_mat4(ob, mat);
+ BKE_object_to_mat4(ob, mat);
}
}
else {
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index a7f01393a02..03a1298a053 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -63,7 +63,7 @@
static ListBase ttfdata= {NULL, NULL};
/* The vfont code */
-void free_vfont(struct VFont *vf)
+void BKE_vfont_free(struct VFont *vf)
{
if (vf == NULL) return;
@@ -242,7 +242,7 @@ VFont *load_vfont(Main *bmain, const char *name)
vfd= BLI_vfontdata_from_freetypefont(pf);
if (vfd) {
- vfont = alloc_libblock(&bmain->vfont, ID_VF, filename);
+ vfont = BKE_libblock_alloc(&bmain->vfont, ID_VF, filename);
vfont->data = vfd;
/* if there's a font name, use it for the ID name */
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 9ea4eafdd73..da3acce9228 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -108,7 +108,7 @@ void free_gpencil_layers(ListBase *list)
}
/* Free all of GPencil datablock's related data, but not the block itself */
-void free_gpencil_data(bGPdata *gpd)
+void BKE_gpencil_free(bGPdata *gpd)
{
/* free layers */
free_gpencil_layers(&gpd->layers);
@@ -198,7 +198,7 @@ bGPdata *gpencil_data_addnew (const char name[])
bGPdata *gpd;
/* allocate memory for a new block */
- gpd= alloc_libblock(&G.main->gpencil, ID_GD, name);
+ gpd= BKE_libblock_alloc(&G.main->gpencil, ID_GD, name);
/* initial settings */
gpd->flag = (GP_DATA_DISPINFO|GP_DATA_EXPAND);
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index d46ceebdfee..6e105c7d0bb 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -60,7 +60,7 @@ static void free_group_object(GroupObject *go)
}
-void free_group_objects(Group *group)
+void BKE_group_free(Group *group)
{
/* don't free group itself */
GroupObject *go;
@@ -72,7 +72,7 @@ void free_group_objects(Group *group)
}
}
-void unlink_group(Group *group)
+void BKE_group_unlink(Group *group)
{
Main *bmain= G.main;
Material *ma;
@@ -133,7 +133,7 @@ void unlink_group(Group *group)
}
/* group stays in library, but no members */
- free_group_objects(group);
+ BKE_group_free(group);
group->id.us= 0;
}
@@ -141,12 +141,12 @@ Group *add_group(const char *name)
{
Group *group;
- group = alloc_libblock(&G.main->group, ID_GR, name);
+ group = BKE_libblock_alloc(&G.main->group, ID_GR, name);
group->layer= (1<<20)-1;
return group;
}
-Group *copy_group(Group *group)
+Group *BKE_group_copy(Group *group)
{
Group *groupn;
@@ -361,7 +361,7 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group
go->ob->recalc= go->recalc;
group_replaces_nla(parent, go->ob, 's');
- object_handle_update(scene, go->ob);
+ BKE_object_handle_update(scene, go->ob);
group_replaces_nla(parent, go->ob, 'e');
/* leave recalc tags in case group members are in normal scene */
@@ -379,7 +379,7 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group
for (go= group->gobject.first; go; go= go->next) {
if (go->ob) {
if (go->ob->recalc) {
- object_handle_update(scene, go->ob);
+ BKE_object_handle_update(scene, go->ob);
}
}
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 9c5c99592ed..77728e4114a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -198,7 +198,7 @@ static void image_free_buffers(Image *ima)
}
/* called by library too, do not free ima itself */
-void free_image(Image *ima)
+void BKE_image_free(Image *ima)
{
int a;
@@ -225,7 +225,7 @@ static Image *image_alloc(const char *name, short source, short type)
{
Image *ima;
- ima= alloc_libblock(&G.main->image, ID_IM, name);
+ ima= BKE_libblock_alloc(&G.main->image, ID_IM, name);
if (ima) {
ima->ok= IMA_OK;
@@ -300,7 +300,7 @@ static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int frame)
}
/* empty image block, of similar type and filename */
-Image *copy_image(Image *ima)
+Image *BKE_image_copy(Image *ima)
{
Image *nima= image_alloc(ima->id.name+2, ima->source, ima->type);
@@ -408,7 +408,7 @@ void make_local_image(struct Image *ima)
extern_local_image(ima);
}
else if (is_local && is_lib) {
- Image *ima_new= copy_image(ima);
+ Image *ima_new= BKE_image_copy(ima);
ima_new->id.us= 0;
@@ -501,7 +501,7 @@ void BKE_image_merge(Image *dest, Image *source)
image_assign_ibuf(dest, ibuf, IMA_INDEX_PASS(ibuf->index), IMA_INDEX_FRAME(ibuf->index));
}
- free_libblock(&G.main->image, source);
+ BKE_libblock_free(&G.main->image, source);
}
}
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 48763382f2a..d7af24b394d 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -81,7 +81,7 @@
/* Free data from old IPO-Blocks (those which haven't been converted), but not IPO block itself */
// XXX this shouldn't be necessary anymore, but may occur while not all data is converted yet
-void free_ipo(Ipo *ipo)
+void BKE_ipo_free(Ipo *ipo)
{
IpoCurve *icu, *icn;
int n= 0;
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 54a2613991a..e36e7bf6cf3 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -78,7 +78,7 @@
int slurph_opt = 1;
-void free_key(Key *key)
+void BKE_key_free(Key *key)
{
KeyBlock *kb;
@@ -126,7 +126,7 @@ Key *add_key(ID *id) /* common function */
Key *key;
char *el;
- key = alloc_libblock(&G.main->key, ID_KE, "Key");
+ key = BKE_libblock_alloc(&G.main->key, ID_KE, "Key");
key->type = KEY_NORMAL;
key->from = id;
@@ -170,14 +170,14 @@ Key *add_key(ID *id) /* common function */
return key;
}
-Key *copy_key(Key *key)
+Key *BKE_key_copy(Key *key)
{
Key *keyn;
KeyBlock *kbn, *kb;
if (key == NULL) return NULL;
- keyn = copy_libblock(&key->id);
+ keyn = BKE_libblock_copy(&key->id);
BLI_duplicatelist(&keyn->block, &key->block);
@@ -223,7 +223,7 @@ Key *copy_key_nolib(Key *key)
return keyn;
}
-void make_local_key(Key *key)
+void BKE_key_make_local(Key *key)
{
/* - only lib users: do nothing
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 11c3269ad37..927a4390999 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -55,7 +55,7 @@ void *add_lamp(const char *name)
{
Lamp *la;
- la= alloc_libblock(&G.main->lamp, ID_LA, name);
+ la= BKE_libblock_alloc(&G.main->lamp, ID_LA, name);
la->r= la->g= la->b= la->k= 1.0f;
la->haint= la->energy= 1.0f;
@@ -102,12 +102,12 @@ void *add_lamp(const char *name)
return la;
}
-Lamp *copy_lamp(Lamp *la)
+Lamp *BKE_lamp_copy(Lamp *la)
{
Lamp *lan;
int a;
- lan= copy_libblock(&la->id);
+ lan= BKE_libblock_copy(&la->id);
for (a=0; a<MAX_MTEX; a++) {
if (lan->mtex[a]) {
@@ -133,7 +133,7 @@ Lamp *localize_lamp(Lamp *la)
Lamp *lan;
int a;
- lan= copy_libblock(&la->id);
+ lan= BKE_libblock_copy(&la->id);
BLI_remlink(&G.main->lamp, lan);
for (a=0; a<MAX_MTEX; a++) {
@@ -185,7 +185,7 @@ void make_local_lamp(Lamp *la)
id_clear_lib_data(bmain, &la->id);
}
else if (is_local && is_lib) {
- Lamp *la_new= copy_lamp(la);
+ Lamp *la_new= BKE_lamp_copy(la);
la_new->id.us= 0;
/* Remap paths of new ID using old library as base. */
@@ -206,7 +206,7 @@ void make_local_lamp(Lamp *la)
}
}
-void free_lamp(Lamp *la)
+void BKE_lamp_free(Lamp *la)
{
MTex *mtex;
int a;
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index e78da48d153..d9ee95857ca 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -188,7 +188,7 @@ Lattice *add_lattice(const char *name)
{
Lattice *lt;
- lt= alloc_libblock(&G.main->latt, ID_LT, name);
+ lt= BKE_libblock_alloc(&G.main->latt, ID_LT, name);
lt->flag= LT_GRID;
@@ -200,14 +200,14 @@ Lattice *add_lattice(const char *name)
return lt;
}
-Lattice *copy_lattice(Lattice *lt)
+Lattice *BKE_lattice_copy(Lattice *lt)
{
Lattice *ltn;
- ltn= copy_libblock(&lt->id);
+ ltn= BKE_libblock_copy(&lt->id);
ltn->def= MEM_dupallocN(lt->def);
- ltn->key= copy_key(ltn->key);
+ ltn->key= BKE_key_copy(ltn->key);
if (ltn->key) ltn->key->from= (ID *)ltn;
if (lt->dvert) {
@@ -221,7 +221,7 @@ Lattice *copy_lattice(Lattice *lt)
return ltn;
}
-void free_lattice(Lattice *lt)
+void BKE_lattice_free(Lattice *lt)
{
if (lt->def) MEM_freeN(lt->def);
if (lt->dvert) free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
@@ -243,7 +243,7 @@ void free_lattice(Lattice *lt)
}
-void make_local_lattice(Lattice *lt)
+void BKE_lattice_make_local(Lattice *lt)
{
Main *bmain= G.main;
Object *ob;
@@ -271,7 +271,7 @@ void make_local_lattice(Lattice *lt)
id_clear_lib_data(bmain, &lt->id);
}
else if (is_local && is_lib) {
- Lattice *lt_new= copy_lattice(lt);
+ Lattice *lt_new= BKE_lattice_copy(lt);
lt_new->id.us= 0;
/* Remap paths of new ID using old library as base. */
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 14e2d75bee5..1c13c96d8a3 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -188,54 +188,54 @@ int id_make_local(ID *id, int test)
case ID_LI:
return 0; /* can't be linked */
case ID_OB:
- if (!test) make_local_object((Object*)id);
+ if (!test) BKE_object_make_local((Object *)id);
return 1;
case ID_ME:
if (!test) {
- make_local_mesh((Mesh*)id);
- make_local_key(((Mesh*)id)->key);
+ BKE_mesh_make_local((Mesh *)id);
+ BKE_key_make_local(((Mesh *)id)->key);
}
return 1;
case ID_CU:
if (!test) {
- BKE_curve_make_local((Curve*)id);
- make_local_key(((Curve*)id)->key);
+ BKE_curve_make_local((Curve *)id);
+ BKE_key_make_local(((Curve *)id)->key);
}
return 1;
case ID_MB:
- if (!test) BKE_metaball_make_local((MetaBall*)id);
+ if (!test) BKE_metaball_make_local((MetaBall *)id);
return 1;
case ID_MA:
- if (!test) make_local_material((Material*)id);
+ if (!test) make_local_material((Material *)id);
return 1;
case ID_TE:
- if (!test) make_local_texture((Tex*)id);
+ if (!test) make_local_texture((Tex *)id);
return 1;
case ID_IM:
- if (!test) make_local_image((Image*)id);
+ if (!test) make_local_image((Image *)id);
return 1;
case ID_LT:
if (!test) {
- make_local_lattice((Lattice*)id);
- make_local_key(((Lattice*)id)->key);
+ BKE_lattice_make_local((Lattice *)id);
+ BKE_key_make_local(((Lattice *)id)->key);
}
return 1;
case ID_LA:
- if (!test) make_local_lamp((Lamp*)id);
+ if (!test) make_local_lamp((Lamp *)id);
return 1;
case ID_CA:
- if (!test) BKE_camera_make_local((Camera*)id);
+ if (!test) BKE_camera_make_local((Camera *)id);
return 1;
case ID_SPK:
- if (!test) make_local_speaker((Speaker*)id);
+ if (!test) make_local_speaker((Speaker *)id);
return 1;
case ID_IP:
return 0; /* deprecated */
case ID_KE:
- if (!test) make_local_key((Key*)id);
+ if (!test) BKE_key_make_local((Key *)id);
return 1;
case ID_WO:
- if (!test) make_local_world((World*)id);
+ if (!test) BKE_world_make_local((World *)id);
return 1;
case ID_SCR:
return 0; /* can't be linked */
@@ -250,18 +250,18 @@ int id_make_local(ID *id, int test)
case ID_GR:
return 0; /* not implemented */
case ID_AR:
- if (!test) make_local_armature((bArmature*)id);
+ if (!test) BKE_armature_make_local((bArmature *)id);
return 1;
case ID_AC:
- if (!test) make_local_action((bAction*)id);
+ if (!test) BKE_action_make_local((bAction *)id);
return 1;
case ID_NT:
return 0; /* not implemented */
case ID_BR:
- if (!test) BKE_brush_make_local((Brush*)id);
+ if (!test) BKE_brush_make_local((Brush *)id);
return 1;
case ID_PA:
- if (!test) make_local_particlesettings((ParticleSettings*)id);
+ if (!test) BKE_particlesettings_make_local((ParticleSettings *)id);
return 1;
case ID_WM:
return 0; /* can't be linked */
@@ -285,74 +285,74 @@ int id_copy(ID *id, ID **newid, int test)
case ID_LI:
return 0; /* can't be copied from here */
case ID_OB:
- if (!test) *newid= (ID*)copy_object((Object*)id);
+ if (!test) *newid = (ID *)BKE_object_copy((Object*)id);
return 1;
case ID_ME:
- if (!test) *newid= (ID*)copy_mesh((Mesh*)id);
+ if (!test) *newid = (ID *)BKE_mesh_copy((Mesh*)id);
return 1;
case ID_CU:
- if (!test) *newid= (ID*)BKE_curve_copy((Curve*)id);
+ if (!test) *newid = (ID *)BKE_curve_copy((Curve*)id);
return 1;
case ID_MB:
- if (!test) *newid= (ID*)BKE_metaball_copy((MetaBall*)id);
+ if (!test) *newid = (ID *)BKE_metaball_copy((MetaBall*)id);
return 1;
case ID_MA:
- if (!test) *newid= (ID*)copy_material((Material*)id);
+ if (!test) *newid = (ID *)BKE_material_copy((Material*)id);
return 1;
case ID_TE:
- if (!test) *newid= (ID*)copy_texture((Tex*)id);
+ if (!test) *newid = (ID *)BKE_texture_copy((Tex*)id);
return 1;
case ID_IM:
- if (!test) *newid= (ID*)copy_image((Image*)id);
+ if (!test) *newid = (ID *)BKE_image_copy((Image*)id);
return 1;
case ID_LT:
- if (!test) *newid= (ID*)copy_lattice((Lattice*)id);
+ if (!test) *newid = (ID *)BKE_lattice_copy((Lattice*)id);
return 1;
case ID_LA:
- if (!test) *newid= (ID*)copy_lamp((Lamp*)id);
+ if (!test) *newid = (ID *)BKE_lamp_copy((Lamp*)id);
return 1;
case ID_SPK:
- if (!test) *newid= (ID*)copy_speaker((Speaker*)id);
+ if (!test) *newid = (ID *)BKE_speaker_copy((Speaker*)id);
return 1;
case ID_CA:
- if (!test) *newid= (ID*)BKE_camera_copy((Camera*)id);
+ if (!test) *newid = (ID *)BKE_camera_copy((Camera*)id);
return 1;
case ID_IP:
return 0; /* deprecated */
case ID_KE:
- if (!test) *newid= (ID*)copy_key((Key*)id);
+ if (!test) *newid = (ID *)BKE_key_copy((Key*)id);
return 1;
case ID_WO:
- if (!test) *newid= (ID*)copy_world((World*)id);
+ if (!test) *newid = (ID *)BKE_world_copy((World*)id);
return 1;
case ID_SCR:
return 0; /* can't be copied from here */
case ID_VF:
return 0; /* not implemented */
case ID_TXT:
- if (!test) *newid= (ID*)copy_text((Text*)id);
+ if (!test) *newid = (ID *)BKE_text_copy((Text*)id);
return 1;
case ID_SCRIPT:
return 0; /* deprecated */
case ID_SO:
return 0; /* not implemented */
case ID_GR:
- if (!test) *newid= (ID*)copy_group((Group*)id);
+ if (!test) *newid = (ID *)BKE_group_copy((Group*)id);
return 1;
case ID_AR:
- if (!test) *newid= (ID*)copy_armature((bArmature*)id);
+ if (!test) *newid = (ID *)BKE_armature_copy((bArmature*)id);
return 1;
case ID_AC:
- if (!test) *newid= (ID*)copy_action((bAction*)id);
+ if (!test) *newid = (ID *)BKE_action_copy((bAction*)id);
return 1;
case ID_NT:
- if (!test) *newid= (ID*)ntreeCopyTree((bNodeTree*)id);
+ if (!test) *newid = (ID *)ntreeCopyTree((bNodeTree*)id);
return 1;
case ID_BR:
- if (!test) *newid= (ID*)BKE_brush_copy((Brush*)id);
+ if (!test) *newid = (ID *)BKE_brush_copy((Brush*)id);
return 1;
case ID_PA:
- if (!test) *newid= (ID*)psys_copy_settings((ParticleSettings*)id);
+ if (!test) *newid = (ID *)BKE_particlesettings_copy((ParticleSettings*)id);
return 1;
case ID_WM:
return 0; /* can't be copied from here */
@@ -371,15 +371,15 @@ int id_unlink(ID *id, int test)
switch (GS(id->name)) {
case ID_TXT:
if (test) return 1;
- unlink_text(mainlib, (Text*)id);
+ BKE_text_unlink(mainlib, (Text *)id);
break;
case ID_GR:
if (test) return 1;
- unlink_group((Group*)id);
+ BKE_group_unlink((Group *)id);
break;
case ID_OB:
if (test) return 1;
- unlink_object((Object*)id);
+ BKE_object_unlink((Object *)id);
break;
}
@@ -387,7 +387,7 @@ int id_unlink(ID *id, int test)
if (test) return 1;
lb= which_libbase(mainlib, GS(id->name));
- free_libblock(lb, id);
+ BKE_libblock_free(lb, id);
return 1;
}
@@ -577,10 +577,10 @@ int set_listbasepointers(Main *main, ListBase **lb)
/* *********** ALLOC AND FREE *****************
*
- * free_libblock(ListBase *lb, ID *id )
+ * BKE_libblock_free(ListBase *lb, ID *id )
* provide a list-basis and datablock, but only ID is read
*
- * void *alloc_libblock(ListBase *lb, type, name)
+ * void *BKE_libblock_alloc(ListBase *lb, type, name)
* inserts in list and returns a new ID
*
* **************************** */
@@ -685,7 +685,7 @@ static ID *alloc_libblock_notest(short type)
}
/* used everywhere in blenkernel and text.c */
-void *alloc_libblock(ListBase *lb, short type, const char *name)
+void *BKE_libblock_alloc(ListBase *lb, short type, const char *name)
{
ID *id= NULL;
@@ -714,7 +714,7 @@ static void id_copy_animdata(ID *id, const short do_action)
}
/* material nodes use this since they are not treated as libdata */
-void copy_libblock_data(ID *id, const ID *id_from, const short do_action)
+void BKE_libblock_copy_data(ID *id, const ID *id_from, const short do_action)
{
if (id_from->properties)
id->properties = IDP_CopyProperty(id_from->properties);
@@ -724,14 +724,14 @@ void copy_libblock_data(ID *id, const ID *id_from, const short do_action)
}
/* used everywhere in blenkernel */
-void *copy_libblock(ID *id)
+void *BKE_libblock_copy(ID *id)
{
ID *idn;
ListBase *lb;
size_t idn_len;
lb= which_libbase(G.main, GS(id->name));
- idn= alloc_libblock(lb, GS(id->name), id->name+2);
+ idn= BKE_libblock_alloc(lb, GS(id->name), id->name+2);
assert(idn != NULL);
@@ -746,12 +746,12 @@ void *copy_libblock(ID *id)
id->newid= idn;
idn->flag |= LIB_NEW;
- copy_libblock_data(idn, id, FALSE);
+ BKE_libblock_copy_data(idn, id, FALSE);
return idn;
}
-static void free_library(Library *UNUSED(lib))
+static void BKE_library_free(Library *UNUSED(lib))
{
/* no freeing needed for libraries yet */
}
@@ -788,7 +788,7 @@ static void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata
/* used in headerbuttons.c image.c mesh.c screen.c sound.c and library.c */
-void free_libblock(ListBase *lb, void *idv)
+void BKE_libblock_free(ListBase *lb, void *idv)
{
ID *id= idv;
@@ -798,16 +798,16 @@ void free_libblock(ListBase *lb, void *idv)
switch ( GS(id->name) ) { /* GetShort from util.h */
case ID_SCE:
- free_scene((Scene *)id);
+ BKE_scene_free((Scene *)id);
break;
case ID_LI:
- free_library((Library *)id);
+ BKE_library_free((Library *)id);
break;
case ID_OB:
- free_object((Object *)id);
+ BKE_object_free((Object *)id);
break;
case ID_ME:
- free_mesh((Mesh *)id, 1);
+ BKE_mesh_free((Mesh *)id, 1);
break;
case ID_CU:
BKE_curve_free((Curve *)id);
@@ -816,58 +816,58 @@ void free_libblock(ListBase *lb, void *idv)
BKE_metaball_free((MetaBall *)id);
break;
case ID_MA:
- free_material((Material *)id);
+ BKE_material_free((Material *)id);
break;
case ID_TE:
- free_texture((Tex *)id);
+ BKE_texture_free((Tex *)id);
break;
case ID_IM:
- free_image((Image *)id);
+ BKE_image_free((Image *)id);
break;
case ID_LT:
- free_lattice((Lattice *)id);
+ BKE_lattice_free((Lattice *)id);
break;
case ID_LA:
- free_lamp((Lamp *)id);
+ BKE_lamp_free((Lamp *)id);
break;
case ID_CA:
- BKE_camera_free((Camera*) id);
+ BKE_camera_free((Camera *) id);
break;
case ID_IP:
- free_ipo((Ipo *)id);
+ BKE_ipo_free((Ipo *)id);
break;
case ID_KE:
- free_key((Key *)id);
+ BKE_key_free((Key *)id);
break;
case ID_WO:
- free_world((World *)id);
+ BKE_world_free((World *)id);
break;
case ID_SCR:
- free_screen((bScreen *)id);
+ BKE_screen_free((bScreen *)id);
break;
case ID_VF:
- free_vfont((VFont *)id);
+ BKE_vfont_free((VFont *)id);
break;
case ID_TXT:
- free_text((Text *)id);
+ BKE_text_free((Text *)id);
break;
case ID_SCRIPT:
//XXX free_script((Script *)id);
break;
case ID_SPK:
- free_speaker((Speaker *)id);
+ BKE_speaker_free((Speaker *)id);
break;
case ID_SO:
- sound_free((bSound*)id);
+ BKE_sound_free((bSound *)id);
break;
case ID_GR:
- free_group_objects((Group *)id);
+ BKE_group_free((Group *)id);
break;
case ID_AR:
- free_armature((bArmature *)id);
+ BKE_armature_free((bArmature *)id);
break;
case ID_AC:
- free_action((bAction *)id);
+ BKE_action_free((bAction *)id);
break;
case ID_NT:
ntreeFreeTree((bNodeTree *)id);
@@ -876,14 +876,14 @@ void free_libblock(ListBase *lb, void *idv)
BKE_brush_free((Brush *)id);
break;
case ID_PA:
- psys_free_settings((ParticleSettings *)id);
+ BKE_particlesettings_free((ParticleSettings *)id);
break;
case ID_WM:
if (free_windowmanager_cb)
free_windowmanager_cb(NULL, (wmWindowManager *)id);
break;
case ID_GD:
- free_gpencil_data((bGPdata *)id);
+ BKE_gpencil_free((bGPdata *)id);
break;
case ID_MC:
BKE_movieclip_free((MovieClip *)id);
@@ -903,7 +903,7 @@ void free_libblock(ListBase *lb, void *idv)
MEM_freeN(id);
}
-void free_libblock_us(ListBase *lb, void *idv) /* test users */
+void BKE_libblock_free_us(ListBase *lb, void *idv) /* test users */
{
ID *id= idv;
@@ -914,9 +914,9 @@ void free_libblock_us(ListBase *lb, void *idv) /* test users */
else printf("ERROR block %s users %d\n", id->name, id->us);
}
if (id->us==0) {
- if ( GS(id->name)==ID_OB ) unlink_object((Object *)id);
+ if ( GS(id->name)==ID_OB ) BKE_object_unlink((Object *)id);
- free_libblock(lb, id);
+ BKE_libblock_free(lb, id);
}
}
@@ -933,7 +933,7 @@ void free_main(Main *mainvar)
ID *id;
while ( (id= lb->first) ) {
- free_libblock(lb, id);
+ BKE_libblock_free(lb, id);
}
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index e52a9217673..16b3cb639bc 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -77,7 +77,7 @@ void init_def_material(void)
}
/* not material itself */
-void free_material(Material *ma)
+void BKE_material_free(Material *ma)
{
MTex *mtex;
int a;
@@ -203,7 +203,7 @@ Material *add_material(const char *name)
{
Material *ma;
- ma= alloc_libblock(&G.main->mat, ID_MA, name);
+ ma= BKE_libblock_alloc(&G.main->mat, ID_MA, name);
init_material(ma);
@@ -211,12 +211,12 @@ Material *add_material(const char *name)
}
/* XXX keep synced with next function */
-Material *copy_material(Material *ma)
+Material *BKE_material_copy(Material *ma)
{
Material *man;
int a;
- man= copy_libblock(&ma->id);
+ man= BKE_libblock_copy(&ma->id);
id_lib_extern((ID *)man->group);
@@ -248,7 +248,7 @@ Material *localize_material(Material *ma)
Material *man;
int a;
- man= copy_libblock(&ma->id);
+ man= BKE_libblock_copy(&ma->id);
BLI_remlink(&G.main->mat, man);
/* no increment for texture ID users, in previewrender.c it prevents decrement */
@@ -365,7 +365,7 @@ void make_local_material(Material *ma)
}
/* Both user and local, so copy. */
else if (is_local && is_lib) {
- Material *ma_new= copy_material(ma);
+ Material *ma_new= BKE_material_copy(ma);
ma_new->id.us= 0;
@@ -1743,7 +1743,7 @@ static void convert_tfacematerial(Main *main, Material *ma)
}
/* create a new material */
else {
- mat_new=copy_material(ma);
+ mat_new=BKE_material_copy(ma);
if (mat_new) {
/* rename the material*/
strcpy(mat_new->id.name, idname);
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 8b2e66812c7..9fd8707cc01 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -203,7 +203,7 @@ MetaBall *BKE_metaball_add(const char *name)
{
MetaBall *mb;
- mb= alloc_libblock(&G.main->mball, ID_MB, name);
+ mb= BKE_libblock_alloc(&G.main->mball, ID_MB, name);
mb->size[0]= mb->size[1]= mb->size[2]= 1.0;
mb->texflag= MB_AUTOSPACE;
@@ -220,7 +220,7 @@ MetaBall *BKE_metaball_copy(MetaBall *mb)
MetaBall *mbn;
int a;
- mbn= copy_libblock(&mb->id);
+ mbn= BKE_libblock_copy(&mb->id);
BLI_duplicatelist(&mbn->elems, &mb->elems);
@@ -387,7 +387,7 @@ void BKE_metaball_tex_space_calc(Object *ob)
size[1]= (max[1]-min[1])/2.0f;
size[2]= (max[2]-min[2])/2.0f;
#endif
- boundbox_set_from_min_max(bb, min, max);
+ BKE_boundbox_init_from_minmax(bb, min, max);
}
float *BKE_metaball_make_orco(Object *ob, ListBase *dispbase)
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 4b14c2aec4b..da758ea0f0b 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -412,7 +412,7 @@ void unlink_mesh(Mesh *me)
}
/* do not free mesh itself */
-void free_mesh(Mesh *me, int unlink)
+void BKE_mesh_free(Mesh *me, int unlink)
{
if (unlink)
unlink_mesh(me);
@@ -488,19 +488,19 @@ Mesh *add_mesh(const char *name)
{
Mesh *me;
- me= alloc_libblock(&G.main->mesh, ID_ME, name);
+ me= BKE_libblock_alloc(&G.main->mesh, ID_ME, name);
me->size[0]= me->size[1]= me->size[2]= 1.0;
me->smoothresh= 30;
me->texflag= ME_AUTOSPACE;
me->flag= ME_TWOSIDED;
- me->bb= unit_boundbox();
+ me->bb= BKE_boundbox_alloc_unit();
me->drawflag= ME_DRAWEDGES|ME_DRAWFACES|ME_DRAWCREASES;
return me;
}
-Mesh *copy_mesh(Mesh *me)
+Mesh *BKE_mesh_copy(Mesh *me)
{
Mesh *men;
MTFace *tface;
@@ -508,7 +508,7 @@ Mesh *copy_mesh(Mesh *me)
int a, i;
const int do_tessface = ((me->totface != 0) && (me->totpoly == 0)); /* only do tessface if we have no polys */
- men= copy_libblock(&me->id);
+ men= BKE_libblock_copy(&me->id);
men->mat= MEM_dupallocN(me->mat);
for (a=0; a<men->totcol; a++) {
@@ -555,7 +555,7 @@ Mesh *copy_mesh(Mesh *me)
men->bb= MEM_dupallocN(men->bb);
- men->key= copy_key(me->key);
+ men->key= BKE_key_copy(me->key);
if (men->key) men->key->from= (ID *)men;
return men;
@@ -611,7 +611,7 @@ static void expand_local_mesh(Mesh *me)
}
}
-void make_local_mesh(Mesh *me)
+void BKE_mesh_make_local(Mesh *me)
{
Main *bmain= G.main;
Object *ob;
@@ -641,7 +641,7 @@ void make_local_mesh(Mesh *me)
expand_local_mesh(me);
}
else if (is_local && is_lib) {
- Mesh *me_new= copy_mesh(me);
+ Mesh *me_new= BKE_mesh_copy(me);
me_new->id.us= 0;
@@ -682,7 +682,7 @@ void boundbox_mesh(Mesh *me, float *loc, float *size)
size[1]= (max[1]-min[1])/2.0f;
size[2]= (max[2]-min[2])/2.0f;
- boundbox_set_from_min_max(bb, min, max);
+ BKE_boundbox_init_from_minmax(bb, min, max);
}
void tex_space_mesh(Mesh *me)
@@ -1518,7 +1518,7 @@ void nurbs_to_mesh(Object *ob)
cu->totcol= 0;
if (ob->data) {
- free_libblock(&bmain->curve, ob->data);
+ BKE_libblock_free(&bmain->curve, ob->data);
}
ob->data= me;
ob->type= OB_MESH;
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 7a279572738..849dbd83366 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -430,7 +430,7 @@ static MovieClip *movieclip_alloc(const char *name)
{
MovieClip *clip;
- clip = alloc_libblock(&G.main->movieclip, ID_MC, name);
+ clip = BKE_libblock_alloc(&G.main->movieclip, ID_MC, name);
clip->aspx = clip->aspy = 1.0f;
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index f3901cec506..bc7d3af930b 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -2146,7 +2146,7 @@ void multiresModifier_scale_disp(Scene *scene, Object *ob)
float smat[3][3];
/* object's scale matrix */
- object_scale_to_mat3(ob, smat);
+ BKE_object_scale_to_mat3(ob, smat);
multires_apply_smat(scene, ob, smat);
}
@@ -2157,9 +2157,9 @@ void multiresModifier_prepare_join(Scene *scene, Object *ob, Object *to_ob)
multires_sync_levels(scene, ob, to_ob);
/* construct scale matrix for displacement */
- object_scale_to_mat3(to_ob, tmat);
+ BKE_object_scale_to_mat3(to_ob, tmat);
invert_m3(tmat);
- object_scale_to_mat3(ob, smat);
+ BKE_object_scale_to_mat3(ob, smat);
mul_m3_m3m3(mat, smat, tmat);
multires_apply_smat(scene, ob, mat);
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index b2a85ad0629..5d76458b157 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -643,7 +643,7 @@ bNodeTree *ntreeAddTree(const char *name, int type, int nodetype)
BLI_strncpy(ntree->id.name+2, name, sizeof(ntree->id.name));
}
else
- ntree= alloc_libblock(&G.main->nodetree, ID_NT, name);
+ ntree= BKE_libblock_alloc(&G.main->nodetree, ID_NT, name);
ntree->type= type;
ntree->nodetype = nodetype;
@@ -675,11 +675,11 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
for (newtree=G.main->nodetree.first; newtree; newtree= newtree->id.next)
if (newtree==ntree) break;
if (newtree) {
- newtree= copy_libblock(&ntree->id);
+ newtree= BKE_libblock_copy(&ntree->id);
}
else {
newtree= MEM_dupallocN(ntree);
- copy_libblock_data(&newtree->id, &ntree->id, TRUE); /* copy animdata and ID props */
+ BKE_libblock_copy_data(&newtree->id, &ntree->id, TRUE); /* copy animdata and ID props */
}
id_us_plus((ID *)newtree->gpd);
@@ -931,7 +931,7 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node)
ntree->update |= NTREE_UPDATE_NODES;
}
-/* do not free ntree itself here, free_libblock calls this function too */
+/* do not free ntree itself here, BKE_libblock_free calls this function too */
void ntreeFreeTree(bNodeTree *ntree)
{
bNode *node, *next;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index fde8f8e3f3d..37d261c6d29 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -117,9 +117,9 @@
/* Local function protos */
static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[][4], float slowmat[][4], int simul);
-float originmat[3][3]; /* after where_is_object(), can be used in other functions (bad!) */
+float originmat[3][3]; /* after BKE_object_where_is_calc(), can be used in other functions (bad!) */
-void clear_workob(Object *workob)
+void BKE_object_workob_clear(Object *workob)
{
memset(workob, 0, sizeof(Object));
@@ -128,27 +128,7 @@ void clear_workob(Object *workob)
workob->rotmode= ROT_MODE_EUL;
}
-void copy_baseflags(struct Scene *scene)
-{
- Base *base= scene->base.first;
-
- while (base) {
- base->object->flag= base->flag;
- base= base->next;
- }
-}
-
-void copy_objectflags(struct Scene *scene)
-{
- Base *base= scene->base.first;
-
- while (base) {
- base->flag= base->object->flag;
- base= base->next;
- }
-}
-
-void update_base_layer(struct Scene *scene, Object *ob)
+void BKE_object_update_base_layer(struct Scene *scene, Object *ob)
{
Base *base= scene->base.first;
@@ -158,7 +138,7 @@ void update_base_layer(struct Scene *scene, Object *ob)
}
}
-void object_free_particlesystems(Object *ob)
+void BKE_object_free_particlesystems(Object *ob)
{
while (ob->particlesystem.first) {
ParticleSystem *psys = ob->particlesystem.first;
@@ -169,7 +149,7 @@ void object_free_particlesystems(Object *ob)
}
}
-void object_free_softbody(Object *ob)
+void BKE_object_free_softbody(Object *ob)
{
if (ob->soft) {
sbFree(ob->soft);
@@ -177,7 +157,7 @@ void object_free_softbody(Object *ob)
}
}
-void object_free_bulletsoftbody(Object *ob)
+void BKE_object_free_bulletsoftbody(Object *ob)
{
if (ob->bsoft) {
bsbFree(ob->bsoft);
@@ -185,7 +165,7 @@ void object_free_bulletsoftbody(Object *ob)
}
}
-void object_free_modifiers(Object *ob)
+void BKE_object_free_modifiers(Object *ob)
{
while (ob->modifiers.first) {
ModifierData *md = ob->modifiers.first;
@@ -196,13 +176,13 @@ void object_free_modifiers(Object *ob)
}
/* particle modifiers were freed, so free the particlesystems as well */
- object_free_particlesystems(ob);
+ BKE_object_free_particlesystems(ob);
/* same for softbody */
- object_free_softbody(ob);
+ BKE_object_free_softbody(ob);
}
-int object_support_modifier_type(Object *ob, int modifier_type)
+int BKE_object_support_modifier_type_check(Object *ob, int modifier_type)
{
ModifierTypeInfo *mti;
@@ -217,10 +197,10 @@ int object_support_modifier_type(Object *ob, int modifier_type)
return TRUE;
}
-void object_link_modifiers(struct Object *ob, struct Object *from)
+void BKE_object_link_modifiers(struct Object *ob, struct Object *from)
{
ModifierData *md;
- object_free_modifiers(ob);
+ BKE_object_free_modifiers(ob);
if (!ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
/* only objects listed above can have modifiers and linking them to objects
@@ -233,7 +213,7 @@ void object_link_modifiers(struct Object *ob, struct Object *from)
if (ELEM4(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_ParticleInstance, eModifierType_Collision)) continue;
- if (!object_support_modifier_type(ob, md->type))
+ if (!BKE_object_support_modifier_type_check(ob, md->type))
continue;
nmd = modifier_new(md->type);
@@ -241,15 +221,15 @@ void object_link_modifiers(struct Object *ob, struct Object *from)
BLI_addtail(&ob->modifiers, nmd);
}
- copy_object_particlesystems(ob, from);
- copy_object_softbody(ob, from);
+ BKE_object_copy_particlesystems(ob, from);
+ BKE_object_copy_softbody(ob, from);
// TODO: smoke?, cloth?
}
/* here we will collect all local displist stuff */
/* also (ab)used in depsgraph */
-void object_free_display(Object *ob)
+void BKE_object_free_display(Object *ob)
{
if (ob->derivedDeform) {
ob->derivedDeform->needsFree = 1;
@@ -308,11 +288,11 @@ void free_sculptsession(Object *ob)
/* do not free object itself */
-void free_object(Object *ob)
+void BKE_object_free(Object *ob)
{
int a;
- object_free_display(ob);
+ BKE_object_free_display(ob);
/* disconnect specific data */
if (ob->data) {
@@ -345,7 +325,7 @@ void free_object(Object *ob)
if (ob->mpath)
animviz_free_motionpath(ob->mpath);
free_properties(&ob->prop);
- object_free_modifiers(ob);
+ BKE_object_free_modifiers(ob);
free_sensors(&ob->sensors);
free_controllers(&ob->controllers);
@@ -374,7 +354,7 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec
}
}
-void unlink_object(Object *ob)
+void BKE_object_unlink(Object *ob)
{
Main *bmain= G.main;
Object *obt;
@@ -731,7 +711,7 @@ void unlink_object(Object *ob)
}
}
-int exist_object(Object *obtest)
+int BKE_object_exists_check(Object *obtest)
{
Object *ob;
@@ -747,7 +727,7 @@ int exist_object(Object *obtest)
/* *************************************************** */
-void *add_obdata_from_type(int type)
+void *BKE_object_obdata_add_from_type(int type)
{
switch (type) {
case OB_MESH: return add_mesh("Mesh");
@@ -762,7 +742,7 @@ void *add_obdata_from_type(int type)
case OB_SPEAKER: return add_speaker("Speaker");
case OB_EMPTY: return NULL;
default:
- printf("add_obdata_from_type: Internal error, bad type: %d\n", type);
+ printf("BKE_object_obdata_add_from_type: Internal error, bad type: %d\n", type);
return NULL;
}
}
@@ -788,14 +768,14 @@ static const char *get_obdata_defname(int type)
}
/* more general add: creates minimum required data, but without vertices etc. */
-Object *add_only_object(int type, const char *name)
+Object *BKE_object_add_only_object(int type, const char *name)
{
Object *ob;
if(!name)
name = get_obdata_defname(type);
- ob= alloc_libblock(&G.main->object, ID_OB, name);
+ ob= BKE_libblock_alloc(&G.main->object, ID_OB, name);
/* default object vars */
ob->type= type;
@@ -869,16 +849,16 @@ Object *add_only_object(int type, const char *name)
/* general add: to scene, with layer from area and default name */
/* creates minimum required data, but without vertices etc. */
-Object *add_object(struct Scene *scene, int type)
+Object *BKE_object_add(struct Scene *scene, int type)
{
Object *ob;
Base *base;
char name[MAX_ID_NAME];
BLI_strncpy(name, get_obdata_defname(type), sizeof(name));
- ob = add_only_object(type, name);
+ ob = BKE_object_add_only_object(type, name);
- ob->data= add_obdata_from_type(type);
+ ob->data= BKE_object_obdata_add_from_type(type);
ob->lay= scene->lay;
@@ -992,7 +972,7 @@ static ParticleSystem *copy_particlesystem(ParticleSystem *psys)
return psysn;
}
-void copy_object_particlesystems(Object *obn, Object *ob)
+void BKE_object_copy_particlesystems(Object *obn, Object *ob)
{
ParticleSystem *psys, *npsys;
ModifierData *md;
@@ -1037,7 +1017,7 @@ void copy_object_particlesystems(Object *obn, Object *ob)
}
}
-void copy_object_softbody(Object *obn, Object *ob)
+void BKE_object_copy_softbody(Object *obn, Object *ob)
{
if (ob->soft)
obn->soft= copy_softbody(ob->soft);
@@ -1090,7 +1070,7 @@ static int object_pose_context(Object *ob)
}
}
-Object *object_pose_armature_get(Object *ob)
+Object *BKE_object_pose_armature_get(Object *ob)
{
if (ob==NULL)
return NULL;
@@ -1117,13 +1097,13 @@ static void copy_object_transform(Object *ob_tar, Object *ob_src)
copy_v3_v3(ob_tar->size, ob_src->size);
}
-Object *copy_object(Object *ob)
+Object *BKE_object_copy(Object *ob)
{
Object *obn;
ModifierData *md;
int a;
- obn= copy_libblock(&ob->id);
+ obn= BKE_libblock_copy(&ob->id);
if (ob->totcol) {
obn->mat= MEM_dupallocN(ob->mat);
@@ -1181,7 +1161,7 @@ Object *copy_object(Object *ob)
obn->soft= copy_softbody(ob->soft);
obn->bsoft = copy_bulletsoftbody(ob->bsoft);
- copy_object_particlesystems(obn, ob);
+ BKE_object_copy_particlesystems(obn, ob);
obn->derivedDeform = NULL;
obn->derivedFinal = NULL;
@@ -1209,7 +1189,7 @@ static void extern_local_object(Object *ob)
id_lib_extern((ID *)psys->part);
}
-void make_local_object(Object *ob)
+void BKE_object_make_local(Object *ob)
{
Main *bmain= G.main;
Scene *sce;
@@ -1242,7 +1222,7 @@ void make_local_object(Object *ob)
extern_local_object(ob);
}
else if (is_local && is_lib) {
- Object *ob_new= copy_object(ob);
+ Object *ob_new= BKE_object_copy(ob);
ob_new->id.us= 0;
@@ -1271,7 +1251,7 @@ void make_local_object(Object *ob)
/*
* Returns true if the Object is a from an external blend file (libdata)
*/
-int object_is_libdata(Object *ob)
+int BKE_object_is_libdata(Object *ob)
{
if (!ob) return 0;
if (ob->proxy) return 0;
@@ -1280,7 +1260,7 @@ int object_is_libdata(Object *ob)
}
/* Returns true if the Object data is a from an external blend file (libdata) */
-int object_data_is_libdata(Object *ob)
+int BKE_object_obdata_is_libdata(Object *ob)
{
if (!ob) return 0;
if (ob->proxy && (ob->data==NULL || ((ID *)ob->data)->lib==NULL)) return 0;
@@ -1307,7 +1287,7 @@ static void armature_set_id_extern(Object *ob)
}
-void object_copy_proxy_drivers(Object *ob, Object *target)
+void BKE_object_copy_proxy_drivers(Object *ob, Object *target)
{
if ((target->adt) && (target->adt->drivers.first)) {
FCurve *fcu;
@@ -1349,7 +1329,7 @@ void object_copy_proxy_drivers(Object *ob, Object *target)
/* local_object->proxy == pointer to library object, saved in files and read */
/* local_object->proxy_group == pointer to group dupli-object, saved in files and read */
-void object_make_proxy(Object *ob, Object *target, Object *gob)
+void BKE_object_make_proxy(Object *ob, Object *target, Object *gob)
{
/* paranoia checks */
if (ob->id.lib || target->id.lib==NULL) {
@@ -1378,7 +1358,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
mul_mat3_m4_v3(ob->obmat, tvec);
sub_v3_v3(ob->obmat[3], tvec);
}
- object_apply_mat4(ob, ob->obmat, FALSE, TRUE);
+ BKE_object_apply_mat4(ob, ob->obmat, FALSE, TRUE);
}
else {
copy_object_transform(ob, target);
@@ -1387,7 +1367,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
}
/* copy animdata stuff - drivers only for now... */
- object_copy_proxy_drivers(ob, target);
+ BKE_object_copy_proxy_drivers(ob, target);
/* skip constraints? */
// FIXME: this is considered by many as a bug
@@ -1447,14 +1427,14 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
/* *************** CALC ****************** */
-void object_scale_to_mat3(Object *ob, float mat[][3])
+void BKE_object_scale_to_mat3(Object *ob, float mat[][3])
{
float vec[3];
mul_v3_v3v3(vec, ob->size, ob->dscale);
size_to_mat3(mat, vec);
}
-void object_rot_to_mat3(Object *ob, float mat[][3])
+void BKE_object_rot_to_mat3(Object *ob, float mat[][3])
{
float rmat[3][3], dmat[3][3];
@@ -1488,7 +1468,7 @@ void object_rot_to_mat3(Object *ob, float mat[][3])
mul_m3_m3m3(mat, dmat, rmat);
}
-void object_mat3_to_rot(Object *ob, float mat[][3], short use_compat)
+void BKE_object_mat3_to_rot(Object *ob, float mat[][3], short use_compat)
{
switch (ob->rotmode) {
case ROT_MODE_QUAT:
@@ -1525,7 +1505,7 @@ void object_mat3_to_rot(Object *ob, float mat[][3], short use_compat)
}
}
-void object_tfm_protected_backup(const Object *ob,
+void BKE_object_tfm_protected_backup(const Object *ob,
ObjectTfmProtectedChannels *obtfm)
{
@@ -1552,7 +1532,7 @@ void object_tfm_protected_backup(const Object *ob,
}
-void object_tfm_protected_restore(Object *ob,
+void BKE_object_tfm_protected_restore(Object *ob,
const ObjectTfmProtectedChannels *obtfm,
const short protectflag)
{
@@ -1591,7 +1571,7 @@ void object_tfm_protected_restore(Object *ob,
}
/* see pchan_apply_mat4() for the equivalent 'pchan' function */
-void object_apply_mat4(Object *ob, float mat[][4], const short use_compat, const short use_parent)
+void BKE_object_apply_mat4(Object *ob, float mat[][4], const short use_compat, const short use_parent)
{
float rot[3][3];
@@ -1600,15 +1580,15 @@ void object_apply_mat4(Object *ob, float mat[][4], const short use_compat, const
mult_m4_m4m4(diff_mat, ob->parent->obmat, ob->parentinv);
invert_m4_m4(imat, diff_mat);
mult_m4_m4m4(rmat, imat, mat); /* get the parent relative matrix */
- object_apply_mat4(ob, rmat, use_compat, FALSE);
+ BKE_object_apply_mat4(ob, rmat, use_compat, FALSE);
/* same as below, use rmat rather than mat */
mat4_to_loc_rot_size(ob->loc, rot, ob->size, rmat);
- object_mat3_to_rot(ob, rot, use_compat);
+ BKE_object_mat3_to_rot(ob, rot, use_compat);
}
else {
mat4_to_loc_rot_size(ob->loc, rot, ob->size, mat);
- object_mat3_to_rot(ob, rot, use_compat);
+ BKE_object_mat3_to_rot(ob, rot, use_compat);
}
sub_v3_v3(ob->loc, ob->dloc);
@@ -1617,28 +1597,28 @@ void object_apply_mat4(Object *ob, float mat[][4], const short use_compat, const
if (ob->dscale[1] != 0.0f) ob->size[1] /= ob->dscale[1];
if (ob->dscale[2] != 0.0f) ob->size[2] /= ob->dscale[2];
- /* object_mat3_to_rot handles delta rotations */
+ /* BKE_object_mat3_to_rot handles delta rotations */
}
-void object_to_mat3(Object *ob, float mat[][3]) /* no parent */
+void BKE_object_to_mat3(Object *ob, float mat[][3]) /* no parent */
{
float smat[3][3];
float rmat[3][3];
/*float q1[4];*/
/* size */
- object_scale_to_mat3(ob, smat);
+ BKE_object_scale_to_mat3(ob, smat);
/* rot */
- object_rot_to_mat3(ob, rmat);
+ BKE_object_rot_to_mat3(ob, rmat);
mul_m3_m3m3(mat, rmat, smat);
}
-void object_to_mat4(Object *ob, float mat[][4])
+void BKE_object_to_mat4(Object *ob, float mat[][4])
{
float tmat[3][3];
- object_to_mat3(ob, tmat);
+ BKE_object_to_mat3(ob, tmat);
copy_m4_m3(mat, tmat);
@@ -1937,7 +1917,7 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[
return 1;
}
-void where_is_object_time(Scene *scene, Object *ob, float ctime)
+void BKE_object_where_is_calc_time(Scene *scene, Object *ob, float ctime)
{
float slowmat[4][4] = MAT4_UNITY;
float stime=ctime;
@@ -1961,7 +1941,7 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
Object tmp= *par;
if (par->proxy_from); // was a copied matrix, no where_is! bad...
- else where_is_object_time(scene, par, ctime);
+ else BKE_object_where_is_calc_time(scene, par, ctime);
solve_parenting(scene, ob, par, ob->obmat, slowmat, 0);
@@ -1979,7 +1959,7 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
}
}
else {
- object_to_mat4(ob, ob->obmat);
+ BKE_object_to_mat4(ob, ob->obmat);
}
/* solve constraints */
@@ -1988,7 +1968,7 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
cob= constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
- /* constraints need ctime, not stime. Some call where_is_object_time and bsystem_time */
+ /* constraints need ctime, not stime. Some call BKE_object_where_is_calc_time and bsystem_time */
solve_constraints (&ob->constraints, cob, ctime);
constraints_clear_evalob(cob);
@@ -2003,7 +1983,7 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
* constraints -- assume dependencies are already solved by depsgraph.
* no changes to object and it's parent would be done.
* used for bundles orientation in 3d space relative to parented blender camera */
-void where_is_object_mat(Scene *scene, Object *ob, float obmat[4][4])
+void BKE_object_where_is_calc_mat4(Scene *scene, Object *ob, float obmat[4][4])
{
float slowmat[4][4] = MAT4_UNITY;
@@ -2016,7 +1996,7 @@ void where_is_object_mat(Scene *scene, Object *ob, float obmat[4][4])
where_is_object_parslow(ob, obmat, slowmat);
}
else {
- object_to_mat4(ob, obmat);
+ BKE_object_to_mat4(ob, obmat);
}
}
@@ -2028,7 +2008,7 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
float vec[3];
int ok;
- object_to_mat4(ob, locmat);
+ BKE_object_to_mat4(ob, locmat);
if (ob->partype & PARSLOW) copy_m4_m4(slowmat, obmat);
@@ -2099,13 +2079,13 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
}
-void where_is_object(struct Scene *scene, Object *ob)
+void BKE_object_where_is_calc(struct Scene *scene, Object *ob)
{
- where_is_object_time(scene, ob, (float)scene->r.cfra);
+ BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
}
-void where_is_object_simul(Scene *scene, Object *ob)
+void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
/* was written for the old game engine (until 2.04) */
/* It seems that this function is only called
* for a lamp that is the child of another object */
@@ -2133,7 +2113,7 @@ void where_is_object_simul(Scene *scene, Object *ob)
}
}
else {
- object_to_mat4(ob, ob->obmat);
+ BKE_object_to_mat4(ob, ob->obmat);
}
/* solve constraints */
@@ -2147,9 +2127,9 @@ void where_is_object_simul(Scene *scene, Object *ob)
}
/* for calculation of the inverse parent transform, only used for editor */
-void what_does_parent(Scene *scene, Object *ob, Object *workob)
+void BKE_object_workob_calc_parent(Scene *scene, Object *ob, Object *workob)
{
- clear_workob(workob);
+ BKE_object_workob_clear(workob);
unit_m4(workob->obmat);
unit_m4(workob->parentinv);
@@ -2169,21 +2149,21 @@ void what_does_parent(Scene *scene, Object *ob, Object *workob)
BLI_strncpy(workob->parsubstr, ob->parsubstr, sizeof(workob->parsubstr));
- where_is_object(scene, workob);
+ BKE_object_where_is_calc(scene, workob);
}
-BoundBox *unit_boundbox(void)
+BoundBox *BKE_boundbox_alloc_unit(void)
{
BoundBox *bb;
float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {-1.0f, -1.0f, -1.0f};
bb= MEM_callocN(sizeof(BoundBox), "OB-BoundBox");
- boundbox_set_from_min_max(bb, min, max);
+ BKE_boundbox_init_from_minmax(bb, min, max);
return bb;
}
-void boundbox_set_from_min_max(BoundBox *bb, float min[3], float max[3])
+void BKE_boundbox_init_from_minmax(BoundBox *bb, float min[3], float max[3])
{
bb->vec[0][0]=bb->vec[1][0]=bb->vec[2][0]=bb->vec[3][0]= min[0];
bb->vec[4][0]=bb->vec[5][0]=bb->vec[6][0]=bb->vec[7][0]= max[0];
@@ -2195,7 +2175,7 @@ void boundbox_set_from_min_max(BoundBox *bb, float min[3], float max[3])
bb->vec[1][2]=bb->vec[2][2]=bb->vec[5][2]=bb->vec[6][2]= max[2];
}
-BoundBox *object_get_boundbox(Object *ob)
+BoundBox *BKE_object_boundbox_get(Object *ob)
{
BoundBox *bb= NULL;
@@ -2212,20 +2192,20 @@ BoundBox *object_get_boundbox(Object *ob)
}
/* used to temporally disable/enable boundbox */
-void object_boundbox_flag(Object *ob, int flag, int set)
+void BKE_object_boundbox_flag(Object *ob, int flag, int set)
{
- BoundBox *bb= object_get_boundbox(ob);
+ BoundBox *bb= BKE_object_boundbox_get(ob);
if (bb) {
if (set) bb->flag |= flag;
else bb->flag &= ~flag;
}
}
-void object_get_dimensions(Object *ob, float vec[3])
+void BKE_object_dimensions_get(Object *ob, float vec[3])
{
BoundBox *bb = NULL;
- bb= object_get_boundbox(ob);
+ bb= BKE_object_boundbox_get(ob);
if (bb) {
float scale[3];
@@ -2240,11 +2220,11 @@ void object_get_dimensions(Object *ob, float vec[3])
}
}
-void object_set_dimensions(Object *ob, const float *value)
+void BKE_object_dimensions_set(Object *ob, const float *value)
{
BoundBox *bb = NULL;
- bb= object_get_boundbox(ob);
+ bb= BKE_object_boundbox_get(ob);
if (bb) {
float scale[3], len[3];
@@ -2260,7 +2240,7 @@ void object_set_dimensions(Object *ob, const float *value)
}
}
-void minmax_object(Object *ob, float min[3], float max[3])
+void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
{
BoundBox bb;
float vec[3];
@@ -2279,7 +2259,7 @@ void minmax_object(Object *ob, float min[3], float max[3])
for (a=0; a<8; a++) {
mul_m4_v3(ob->obmat, bb.vec[a]);
- DO_MINMAX(bb.vec[a], min, max);
+ DO_MINMAX(bb.vec[a], min_r, max_r);
}
change= TRUE;
}
@@ -2294,7 +2274,7 @@ void minmax_object(Object *ob, float min[3], float max[3])
for (v=0; v<lt->pntsv; v++) {
for (u=0; u<lt->pntsu; u++, bp++) {
mul_v3_m4v3(vec, ob->obmat, bp->vec);
- DO_MINMAX(vec, min, max);
+ DO_MINMAX(vec, min_r, max_r);
}
}
}
@@ -2306,9 +2286,9 @@ void minmax_object(Object *ob, float min[3], float max[3])
bPoseChannel *pchan;
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
- DO_MINMAX(vec, min, max);
+ DO_MINMAX(vec, min_r, max_r);
mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
- DO_MINMAX(vec, min, max);
+ DO_MINMAX(vec, min_r, max_r);
}
change= TRUE;
}
@@ -2322,7 +2302,7 @@ void minmax_object(Object *ob, float min[3], float max[3])
for (a=0; a<8; a++) {
mul_m4_v3(ob->obmat, bb.vec[a]);
- DO_MINMAX(bb.vec[a], min, max);
+ DO_MINMAX(bb.vec[a], min_r, max_r);
}
change= TRUE;
}
@@ -2331,19 +2311,19 @@ void minmax_object(Object *ob, float min[3], float max[3])
}
if (change == FALSE) {
- DO_MINMAX(ob->obmat[3], min, max);
+ DO_MINMAX(ob->obmat[3], min_r, max_r);
copy_v3_v3(vec, ob->obmat[3]);
add_v3_v3(vec, ob->size);
- DO_MINMAX(vec, min, max);
+ DO_MINMAX(vec, min_r, max_r);
copy_v3_v3(vec, ob->obmat[3]);
sub_v3_v3(vec, ob->size);
- DO_MINMAX(vec, min, max);
+ DO_MINMAX(vec, min_r, max_r);
}
}
-int minmax_object_duplis(Scene *scene, Object *ob, float min[3], float max[3])
+int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_max[3])
{
int ok= 0;
if ((ob->transflag & OB_DUPLI)==0) {
@@ -2356,14 +2336,14 @@ int minmax_object_duplis(Scene *scene, Object *ob, float min[3], float max[3])
lb= object_duplilist(scene, ob);
for (dob= lb->first; dob; dob= dob->next) {
if (dob->no_draw == 0) {
- BoundBox *bb= object_get_boundbox(dob->ob);
+ BoundBox *bb= BKE_object_boundbox_get(dob->ob);
if (bb) {
int i;
for (i=0; i<8; i++) {
float vec[3];
mul_v3_m4v3(vec, dob->mat, bb->vec[i]);
- DO_MINMAX(vec, min, max);
+ DO_MINMAX(vec, r_min, r_max);
}
ok= 1;
@@ -2453,7 +2433,7 @@ typedef struct ObTfmBack {
float imat[4][4]; /* inverse matrix of 'obmat' for during render, old game engine, temporally: ipokeys of transform */
} ObTfmBack;
-void *object_tfm_backup(Object *ob)
+void *BKE_object_tfm_backup(Object *ob)
{
ObTfmBack *obtfm= MEM_mallocN(sizeof(ObTfmBack), "ObTfmBack");
copy_v3_v3(obtfm->loc, ob->loc);
@@ -2477,7 +2457,7 @@ void *object_tfm_backup(Object *ob)
return (void *)obtfm;
}
-void object_tfm_restore(Object *ob, void *obtfm_pt)
+void BKE_object_tfm_restore(Object *ob, void *obtfm_pt)
{
ObTfmBack *obtfm= (ObTfmBack *)obtfm_pt;
copy_v3_v3(ob->loc, obtfm->loc);
@@ -2514,7 +2494,7 @@ int BKE_object_parent_loop_check(const Object *par, const Object *ob)
/* the main object update call, for object matrix, constraints, keys and displist (modifiers) */
/* requires flags to be set! */
-void object_handle_update(Scene *scene, Object *ob)
+void BKE_object_handle_update(Scene *scene, Object *ob)
{
if (ob->recalc & OB_RECALC_ALL) {
/* speed optimization for animation lookups */
@@ -2524,7 +2504,7 @@ void object_handle_update(Scene *scene, Object *ob)
if (ob->recalc & OB_RECALC_DATA) {
if (ob->type==OB_ARMATURE) {
/* this happens for reading old files and to match library armatures
- * with poses we do it ahead of where_is_object to ensure animation
+ * with poses we do it ahead of BKE_object_where_is_calc to ensure animation
* is evaluated on the rebuilt pose, otherwise we get incorrect poses
* on file load */
if (ob->pose==NULL || (ob->pose->flag & POSE_RECALC))
@@ -2533,7 +2513,7 @@ void object_handle_update(Scene *scene, Object *ob)
}
/* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers,
- * which is only in where_is_object now */
+ * which is only in BKE_object_where_is_calc now */
// XXX: should this case be OB_RECALC_OB instead?
if (ob->recalc & OB_RECALC_ALL) {
@@ -2555,7 +2535,7 @@ void object_handle_update(Scene *scene, Object *ob)
copy_m4_m4(ob->obmat, ob->proxy_from->obmat);
}
else
- where_is_object(scene, ob);
+ BKE_object_where_is_calc(scene, ob);
}
if (ob->recalc & OB_RECALC_DATA) {
@@ -2695,7 +2675,7 @@ void object_handle_update(Scene *scene, Object *ob)
/* set pointer in library proxy target, for copying, but restore it */
ob->proxy->proxy_from= ob;
// printf("call update, lib ob %s proxy %s\n", ob->proxy->id.name, ob->id.name);
- object_handle_update(scene, ob->proxy);
+ BKE_object_handle_update(scene, ob->proxy);
}
ob->recalc &= ~OB_RECALC_ALL;
@@ -2708,7 +2688,7 @@ void object_handle_update(Scene *scene, Object *ob)
}
}
-void object_sculpt_modifiers_changed(Object *ob)
+void BKE_object_sculpt_modifiers_changed(Object *ob)
{
SculptSession *ss= ob->sculpt;
@@ -2736,7 +2716,7 @@ void object_sculpt_modifiers_changed(Object *ob)
}
}
-int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot)
+int BKE_object_obdata_texspace_get(Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot)
{
if (ob->data==NULL)
@@ -2746,28 +2726,28 @@ int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size,
case ID_ME:
{
Mesh *me= ob->data;
- if (texflag) *texflag = &me->texflag;
- if (loc) *loc = me->loc;
- if (size) *size = me->size;
- if (rot) *rot = me->rot;
+ if (r_texflag) *r_texflag = &me->texflag;
+ if (r_loc) *r_loc = me->loc;
+ if (r_size) *r_size = me->size;
+ if (r_rot) *r_rot = me->rot;
break;
}
case ID_CU:
{
Curve *cu= ob->data;
- if (texflag) *texflag = &cu->texflag;
- if (loc) *loc = cu->loc;
- if (size) *size = cu->size;
- if (rot) *rot = cu->rot;
+ if (r_texflag) *r_texflag = &cu->texflag;
+ if (r_loc) *r_loc = cu->loc;
+ if (r_size) *r_size = cu->size;
+ if (r_rot) *r_rot = cu->rot;
break;
}
case ID_MB:
{
MetaBall *mb= ob->data;
- if (texflag) *texflag = &mb->texflag;
- if (loc) *loc = mb->loc;
- if (size) *size = mb->size;
- if (rot) *rot = mb->rot;
+ if (r_texflag) *r_texflag = &mb->texflag;
+ if (r_loc) *r_loc = mb->loc;
+ if (r_size) *r_size = mb->size;
+ if (r_rot) *r_rot = mb->rot;
break;
}
default:
@@ -2780,7 +2760,7 @@ int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size,
* Test a bounding box for ray intersection
* assumes the ray is already local to the boundbox space
*/
-int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3])
+int BKE_boundbox_ray_hit_check(struct BoundBox *bb, float ray_start[3], float ray_normal[3])
{
static int triangle_indexes[12][3] = {{0, 1, 2}, {0, 2, 3},
{3, 2, 6}, {3, 6, 7},
@@ -2811,7 +2791,7 @@ static int pc_cmp(void *a, void *b)
else return 0;
}
-int object_insert_ptcache(Object *ob)
+int BKE_object_insert_ptcache(Object *ob)
{
LinkData *link = NULL;
int i = 0;
@@ -2970,7 +2950,7 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int
return kb;
}
-KeyBlock *object_insert_shape_key(Scene *scene, Object *ob, const char *name, int from_mix)
+KeyBlock *BKE_object_insert_shape_key(Scene *scene, Object *ob, const char *name, int from_mix)
{
switch (ob->type) {
case OB_MESH:
@@ -2988,7 +2968,7 @@ KeyBlock *object_insert_shape_key(Scene *scene, Object *ob, const char *name, in
/* most important if this is modified it should _always_ return True, in certain
* cases false positives are hard to avoid (shape keys for example) */
-int object_is_modified(Scene *scene, Object *ob)
+int BKE_object_is_modified(Scene *scene, Object *ob)
{
int flag= 0;
@@ -3016,7 +2996,7 @@ int object_is_modified(Scene *scene, Object *ob)
/* test if object is affected by deforming modifiers (for motion blur). again
* most important is to avoid false positives, this is to skip computations
* and we can still if there was actual deformation afterwards */
-int object_is_deform_modified(Scene *scene, Object *ob)
+int BKE_object_is_deform_modified(Scene *scene, Object *ob)
{
ModifierData *md;
int flag= 0;
@@ -3046,7 +3026,7 @@ static void copy_object__forwardModifierLinks(void *UNUSED(userData), Object *UN
if (*idpoin && (*idpoin)->newid) *idpoin = (*idpoin)->newid;
}
-void object_relink(Object *ob)
+void BKE_object_relink(Object *ob)
{
if (ob->id.lib)
return;
@@ -3069,7 +3049,7 @@ void object_relink(Object *ob)
ID_NEW(ob->proxy_group);
}
-MovieClip *object_get_movieclip(Scene *scene, Object *ob, int use_default)
+MovieClip *BKE_object_movieclip_get(Scene *scene, Object *ob, int use_default)
{
MovieClip *clip= use_default ? scene->clip : NULL;
bConstraint *con= ob->constraints.first, *scon= NULL;
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 1a1ae8e949c..7b2cb147597 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -369,7 +369,7 @@ static void fluid_free_settings(SPHFluidSettings *fluid)
MEM_freeN(fluid);
}
-void psys_free_settings(ParticleSettings *part)
+void BKE_particlesettings_free(ParticleSettings *part)
{
MTex *mtex;
int a;
@@ -3610,19 +3610,19 @@ ParticleSettings *psys_new_settings(const char *name, Main *main)
if (main==NULL)
main = G.main;
- part= alloc_libblock(&main->particle, ID_PA, name);
+ part= BKE_libblock_alloc(&main->particle, ID_PA, name);
default_particle_settings(part);
return part;
}
-ParticleSettings *psys_copy_settings(ParticleSettings *part)
+ParticleSettings *BKE_particlesettings_copy(ParticleSettings *part)
{
ParticleSettings *partn;
int a;
- partn= copy_libblock(&part->id);
+ partn= BKE_libblock_copy(&part->id);
partn->pd= MEM_dupallocN(part->pd);
partn->pd2= MEM_dupallocN(part->pd2);
partn->effector_weights= MEM_dupallocN(part->effector_weights);
@@ -3653,7 +3653,7 @@ static void expand_local_particlesettings(ParticleSettings *part)
}
}
-void make_local_particlesettings(ParticleSettings *part)
+void BKE_particlesettings_make_local(ParticleSettings *part)
{
Main *bmain= G.main;
Object *ob;
@@ -3687,7 +3687,7 @@ void make_local_particlesettings(ParticleSettings *part)
expand_local_particlesettings(part);
}
else if (is_local && is_lib) {
- ParticleSettings *part_new= psys_copy_settings(part);
+ ParticleSettings *part_new= BKE_particlesettings_copy(part);
part_new->id.us= 0;
/* Remap paths of new ID using old library as base. */
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index a4d61cea3fb..63db4d5e854 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -1854,7 +1854,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
ob = ob->parent;
}
ob = sim->ob;
- where_is_object_time(sim->scene, ob, pa->time);
+ BKE_object_where_is_calc_time(sim->scene, ob, pa->time);
psys->flag |= PSYS_OB_ANIM_RESTORE;
}
@@ -4612,7 +4612,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
ob = ob->parent;
}
ob = sim.ob;
- where_is_object_time(scene, ob, cfra);
+ BKE_object_where_is_calc_time(scene, ob, cfra);
psys->flag &= ~PSYS_OB_ANIM_RESTORE;
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 1e80f1e6d1e..b24007ec491 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1122,7 +1122,7 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p
if (do_ext) {
if (pid->cache->index < 0)
- pid->cache->index = pid->stack_index = object_insert_ptcache(pid->ob);
+ pid->cache->index = pid->stack_index = BKE_object_insert_ptcache(pid->ob);
if (pid->cache->flag & PTCACHE_EXTERNAL) {
if (pid->cache->index >= 0)
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index c66aa375a13..6c21b462a7a 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -131,7 +131,7 @@ Scene *copy_scene(Scene *sce, int type)
MEM_freeN(scen->toolsettings);
}
else {
- scen= copy_libblock(&sce->id);
+ scen= BKE_libblock_copy(&sce->id);
BLI_duplicatelist(&(scen->base), &(sce->base));
clear_id_newpoins();
@@ -229,7 +229,7 @@ Scene *copy_scene(Scene *sce, int type)
BKE_copy_animdata_id_action((ID *)scen);
if (scen->world) {
id_us_plus((ID *)scen->world);
- scen->world= copy_world(scen->world);
+ scen->world= BKE_world_copy(scen->world);
BKE_copy_animdata_id_action((ID *)scen->world);
}
@@ -244,7 +244,7 @@ Scene *copy_scene(Scene *sce, int type)
}
/* do not free scene itself */
-void free_scene(Scene *sce)
+void BKE_scene_free(Scene *sce)
{
Base *base;
@@ -339,7 +339,7 @@ Scene *add_scene(const char *name)
ParticleEditSettings *pset;
int a;
- sce= alloc_libblock(&bmain->scene, ID_SCE, name);
+ sce= BKE_libblock_alloc(&bmain->scene, ID_SCE, name);
sce->lay= sce->layact= 1;
sce->r.mode= R_GAMMA|R_OSA|R_SHADOW|R_SSS|R_ENVMAP|R_RAYTRACE;
@@ -647,7 +647,7 @@ void unlink_scene(Main *bmain, Scene *sce, Scene *newsce)
if (sc->scene == sce)
sc->scene= newsce;
- free_libblock(&bmain->scene, sce);
+ BKE_libblock_free(&bmain->scene, sce);
}
/* used by metaballs
@@ -987,7 +987,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
for (base= scene->base.first; base; base= base->next) {
Object *ob= base->object;
- object_handle_update(scene_parent, ob);
+ BKE_object_handle_update(scene_parent, ob);
if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
@@ -1080,7 +1080,7 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
BKE_animsys_evaluate_all_animation(bmain, sce, ctime);
/*...done with recusrive funcs */
- /* object_handle_update() on all objects, groups and sets */
+ /* BKE_object_handle_update() on all objects, groups and sets */
scene_update_tagged_recursive(bmain, sce, sce);
/* notify editors and python about recalc */
@@ -1215,3 +1215,22 @@ int scene_use_new_shading_nodes(Scene *scene)
return (type && type->flag & RE_USE_SHADING_NODES);
}
+void copy_baseflags(struct Scene *scene)
+{
+ Base *base= scene->base.first;
+
+ while (base) {
+ base->object->flag= base->flag;
+ base= base->next;
+ }
+}
+
+void copy_objectflags(struct Scene *scene)
+{
+ Base *base= scene->base.first;
+
+ while (base) {
+ base->flag= base->object->flag;
+ base= base->next;
+ }
+}
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index f69495483ea..8e380c3674f 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -297,7 +297,7 @@ void BKE_screen_area_free(ScrArea *sa)
}
/* don't free screen itself */
-void free_screen(bScreen *sc)
+void BKE_screen_free(bScreen *sc)
{
ScrArea *sa, *san;
ARegion *ar;
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 28ce95ea8d1..da73491eaa3 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -89,21 +89,21 @@ struct bSound* sound_new_file(struct Main *bmain, const char *filename)
while (len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
len--;
- sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
+ sound = BKE_libblock_alloc(&bmain->sound, ID_SO, filename+len);
BLI_strncpy(sound->name, filename, FILE_MAX);
// XXX unused currently sound->type = SOUND_TYPE_FILE;
sound_load(bmain, sound);
if (!sound->playback_handle) {
- free_libblock(&bmain->sound, sound);
+ BKE_libblock_free(&bmain->sound, sound);
sound = NULL;
}
return sound;
}
-void sound_free(struct bSound* sound)
+void BKE_sound_free(struct bSound* sound)
{
if (sound->packedfile) {
freePackedFile(sound->packedfile);
@@ -231,7 +231,7 @@ struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source)
strcpy(name, "buf_");
strcpy(name + 4, source->id.name);
- sound = alloc_libblock(&bmain->sound, ID_SO, name);
+ sound = BKE_libblock_alloc(&bmain->sound, ID_SO, name);
sound->child_sound = source;
sound->type = SOUND_TYPE_BUFFER;
@@ -240,7 +240,7 @@ struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source)
if (!sound->playback_handle)
{
- free_libblock(&bmain->sound, sound);
+ BKE_libblock_free(&bmain->sound, sound);
sound = NULL;
}
@@ -255,7 +255,7 @@ struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, floa
strcpy(name, "lim_");
strcpy(name + 4, source->id.name);
- sound = alloc_libblock(&bmain->sound, ID_SO, name);
+ sound = BKE_libblock_alloc(&bmain->sound, ID_SO, name);
sound->child_sound = source;
sound->start = start;
@@ -266,7 +266,7 @@ struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, floa
if (!sound->playback_handle)
{
- free_libblock(&bmain->sound, sound);
+ BKE_libblock_free(&bmain->sound, sound);
sound = NULL;
}
@@ -277,9 +277,9 @@ struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, floa
void sound_delete(struct Main *bmain, struct bSound* sound)
{
if (sound) {
- sound_free(sound);
+ BKE_sound_free(sound);
- free_libblock(&bmain->sound, sound);
+ BKE_libblock_free(&bmain->sound, sound);
}
}
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index 5466630f621..d3c38221c00 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -47,7 +47,7 @@ void *add_speaker(const char *name)
{
Speaker *spk;
- spk= alloc_libblock(&G.main->speaker, ID_SPK, name);
+ spk= BKE_libblock_alloc(&G.main->speaker, ID_SPK, name);
spk->attenuation = 1.0f;
spk->cone_angle_inner = 360.0f;
@@ -65,11 +65,11 @@ void *add_speaker(const char *name)
return spk;
}
-Speaker *copy_speaker(Speaker *spk)
+Speaker *BKE_speaker_copy(Speaker *spk)
{
Speaker *spkn;
- spkn= copy_libblock(&spk->id);
+ spkn= BKE_libblock_copy(&spk->id);
if (spkn->sound)
spkn->sound->id.us++;
@@ -106,7 +106,7 @@ void make_local_speaker(Speaker *spk)
id_clear_lib_data(bmain, &spk->id);
}
else if (is_local && is_lib) {
- Speaker *spk_new= copy_speaker(spk);
+ Speaker *spk_new= BKE_speaker_copy(spk);
spk_new->id.us= 0;
/* Remap paths of new ID using old library as base. */
@@ -127,7 +127,7 @@ void make_local_speaker(Speaker *spk)
}
}
-void free_speaker(Speaker *spk)
+void BKE_speaker_free(Speaker *spk)
{
if (spk->sound)
spk->sound->id.us--;
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index d67c5fb3698..bd925faf847 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -160,7 +160,7 @@ static void init_undo_text(Text *text)
text->undo_buf= MEM_mallocN(text->undo_len, "undo buf");
}
-void free_text(Text *text)
+void BKE_text_free(Text *text)
{
TextLine *tmp;
@@ -186,7 +186,7 @@ Text *add_empty_text(const char *name)
Text *ta;
TextLine *tmp;
- ta= alloc_libblock(&bmain->text, ID_TXT, name);
+ ta= BKE_libblock_alloc(&bmain->text, ID_TXT, name);
ta->id.us= 1;
ta->name= NULL;
@@ -391,7 +391,7 @@ Text *add_text(const char *file, const char *relpath)
fp= BLI_fopen(str, "r");
if (fp==NULL) return NULL;
- ta= alloc_libblock(&bmain->text, ID_TXT, BLI_path_basename(str));
+ ta= BKE_libblock_alloc(&bmain->text, ID_TXT, BLI_path_basename(str));
ta->id.us= 1;
ta->lines.first= ta->lines.last= NULL;
@@ -473,12 +473,12 @@ Text *add_text(const char *file, const char *relpath)
return ta;
}
-Text *copy_text(Text *ta)
+Text *BKE_text_copy(Text *ta)
{
Text *tan;
TextLine *line, *tmp;
- tan= copy_libblock(&ta->id);
+ tan= BKE_libblock_copy(&ta->id);
/* file name can be NULL */
if (ta->name) {
@@ -521,7 +521,7 @@ Text *copy_text(Text *ta)
return tan;
}
-void unlink_text(Main *bmain, Text *text)
+void BKE_text_unlink(Main *bmain, Text *text)
{
bScreen *scr;
ScrArea *area;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 9200b1dca18..5ba3e95154b 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -547,7 +547,7 @@ int colorband_element_remove(struct ColorBand *coba, int index)
/* ******************* TEX ************************ */
-void free_texture(Tex *tex)
+void BKE_texture_free(Tex *tex)
{
free_plugin_tex(tex->plugin);
@@ -693,7 +693,7 @@ Tex *add_texture(const char *name)
Main *bmain= G.main;
Tex *tex;
- tex= alloc_libblock(&bmain->tex, ID_TE, name);
+ tex= BKE_libblock_alloc(&bmain->tex, ID_TE, name);
default_tex(tex);
@@ -824,11 +824,11 @@ MTex *add_mtex_id(ID *id, int slot)
/* ------------------------------------------------------------------------- */
-Tex *copy_texture(Tex *tex)
+Tex *BKE_texture_copy(Tex *tex)
{
Tex *texn;
- texn= copy_libblock(&tex->id);
+ texn= BKE_libblock_copy(&tex->id);
if (texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima);
else texn->ima= NULL;
@@ -859,10 +859,10 @@ Tex *localize_texture(Tex *tex)
{
Tex *texn;
- texn= copy_libblock(&tex->id);
+ texn= BKE_libblock_copy(&tex->id);
BLI_remlink(&G.main->tex, texn);
- /* image texture: free_texture also doesn't decrease */
+ /* image texture: BKE_texture_free also doesn't decrease */
if (texn->plugin) {
texn->plugin= MEM_dupallocN(texn->plugin);
@@ -978,7 +978,7 @@ void make_local_texture(Tex *tex)
extern_local_texture(tex);
}
else if (is_local && is_lib) {
- Tex *tex_new= copy_texture(tex);
+ Tex *tex_new= BKE_texture_copy(tex);
tex_new->id.us= 0;
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index f4335862629..144fd9ddb20 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -2127,7 +2127,7 @@ void BKE_get_tracking_mat(Scene *scene, Object *ob, float mat[4][4])
}
if (ob)
- where_is_object_mat(scene, ob, mat);
+ BKE_object_where_is_calc_mat4(scene, ob, mat);
else
unit_m4(mat);
}
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 07a83da3d8c..f50a655236f 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -51,7 +51,7 @@
#include "BKE_node.h"
#include "BKE_world.h"
-void free_world(World *wrld)
+void BKE_world_free(World *wrld)
{
MTex *mtex;
int a;
@@ -81,7 +81,7 @@ World *add_world(const char *name)
Main *bmain= G.main;
World *wrld;
- wrld= alloc_libblock(&bmain->world, ID_WO, name);
+ wrld= BKE_libblock_alloc(&bmain->world, ID_WO, name);
wrld->horr= 0.05f;
wrld->horg= 0.05f;
@@ -113,16 +113,16 @@ World *add_world(const char *name)
return wrld;
}
-World *copy_world(World *wrld)
+World *BKE_world_copy(World *wrld)
{
World *wrldn;
int a;
- wrldn= copy_libblock(&wrld->id);
+ wrldn= BKE_libblock_copy(&wrld->id);
for (a=0; a<MAX_MTEX; a++) {
if (wrld->mtex[a]) {
- wrldn->mtex[a]= MEM_mallocN(sizeof(MTex), "copy_world");
+ wrldn->mtex[a]= MEM_mallocN(sizeof(MTex), "BKE_world_copy");
memcpy(wrldn->mtex[a], wrld->mtex[a], sizeof(MTex));
id_us_plus((ID *)wrldn->mtex[a]->tex);
}
@@ -142,7 +142,7 @@ World *localize_world(World *wrld)
World *wrldn;
int a;
- wrldn= copy_libblock(&wrld->id);
+ wrldn= BKE_libblock_copy(&wrld->id);
BLI_remlink(&G.main->world, wrldn);
for (a=0; a<MAX_MTEX; a++) {
@@ -162,7 +162,7 @@ World *localize_world(World *wrld)
return wrldn;
}
-void make_local_world(World *wrld)
+void BKE_world_make_local(World *wrld)
{
Main *bmain= G.main;
Scene *sce;
@@ -190,7 +190,7 @@ void make_local_world(World *wrld)
id_clear_lib_data(bmain, &wrld->id);
}
else if (is_local && is_lib) {
- World *wrld_new= copy_world(wrld);
+ World *wrld_new= BKE_world_copy(wrld);
wrld_new->id.us= 0;
/* Remap paths of new ID using old library as base. */