code cleanup: function naming, use BKE_*type* prefix.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2012 14:03:12 +0000 (14:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2012 14:03:12 +0000 (14:03 +0000)
138 files changed:
source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_font.h
source/blender/blenkernel/BKE_gpencil.h
source/blender/blenkernel/BKE_group.h
source/blender/blenkernel/BKE_image.h
source/blender/blenkernel/BKE_ipo.h
source/blender/blenkernel/BKE_key.h
source/blender/blenkernel/BKE_lamp.h
source/blender/blenkernel/BKE_lattice.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/BKE_speaker.h
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/BKE_world.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lamp.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/speaker.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenkernel/intern/world.c
source/blender/blenloader/intern/readfile.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/collada/AnimationImporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/collada/SkinInfo.cpp
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada_utils.cpp
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/editfont.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_undo.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/screen_context.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/gpu/intern/gpu_draw.c
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_particle_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_particlesystem.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/intern/node_common.c
source/blender/nodes/shader/nodes/node_shader_dynamic.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/render_texture.c
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_window.c
source/gameengine/Converter/BL_ShapeDeformer.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp

index 564cd23..b9d7fb8 100644 (file)
@@ -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 ----------------- */
index dfe3fde..72d4521 100644 (file)
@@ -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);
index 16e98f2..640a70a 100644 (file)
@@ -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);
index bb0216f..134ec1a 100644 (file)
@@ -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);
index 6629f0b..ccf9e0c 100644 (file)
@@ -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);
index c2112d1..637b57a 100644 (file)
@@ -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);
index 547e7de..ca86e90 100644 (file)
@@ -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
 };
index 63d9d73..7579525 100644 (file)
@@ -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);
index 50e2557..fd19794 100644 (file)
@@ -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
 }
index a0075c4..251f02f 100644 (file)
@@ -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);
index be21996..8a93366 100644 (file)
@@ -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);
index 99561a6..3257031 100644 (file)
@@ -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);
index 14cb5d1..34289a2 100644 (file)
@@ -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);
index 2e334c4..92a447f 100644 (file)
@@ -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
 }
index 67dba6f..f776295 100644 (file)
@@ -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);
 
index e46d99e..f2c07fb 100644 (file)
@@ -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
index fbb93c7..af6e793 100644 (file)
@@ -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
index 8b01dbd..5234f10 100644 (file)
@@ -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);
index fddcfb2..5ff881e 100644 (file)
@@ -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
index 115c00d..4b03355 100644 (file)
@@ -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);
 
index 2574c45..aa6f56c 100644 (file)
@@ -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);
index 16ff3ac..67896ff 100644 (file)
 
 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
 
index f648a9e..db9df40 100644 (file)
@@ -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) --- */
index 5a2407c..9ed1a2e 100644 (file)
@@ -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);
index afa4723..353caec 100644 (file)
@@ -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];
index 7858433..66c91c0 100644 (file)
@@ -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?
index b0d0ace..e2d90b6 100644 (file)
@@ -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)
index 51258b1..a1e8a11 100644 (file)
@@ -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--;
        }
index 11c628e..efede6b 100644 (file)
@@ -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);
 
index 424ded0..399aedc 100644 (file)
@@ -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);
 
index 85e3d85..04a2eef 100644 (file)
@@ -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);
index 75e2219..d828764 100644 (file)
@@ -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);
index cf77505..60f060d 100644 (file)
@@ -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);
        }
 }
 
index 6c5826c..fde5d2d 100644 (file)
@@ -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;
 }
index 7fb0cf9..4024dee 100644 (file)
@@ -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);
        }
 }
index 0414d69..71c6c8d 100644 (file)
@@ -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 {
index a7f0139..03a1298 100644 (file)
@@ -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 */
index 9ea4eaf..da3acce 100644 (file)
@@ -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);
index d46ceeb..6e105c7 100644 (file)
@@ -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);
                                }
                        }
                }
index 9c5c995..77728e4 100644 (file)
@@ -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);
        }
 }
 
index 4876338..d7af24b 100644 (file)
@@ -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;
index 54a2613..e36e7bf 100644 (file)
@@ -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
index 11c3269..927a439 100644 (file)
@@ -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;
index e78da48..d9ee958 100644 (file)
@@ -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. */
index 14e2d75..1c13c96 100644 (file)
@@ -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);
                }
        }
 
index e52a921..16b3cb6 100644 (file)
@@ -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);
index 8b2e668..9fd8707 100644 (file)
@@ -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)
index 4b14c2a..da758ea 100644 (file)
@@ -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;
index 7a27957..849dbd8 100644 (file)
@@ -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;
 
index f3901ce..bc7d3af 100644 (file)
@@ -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);
index b2a85ad..5d76458 100644 (file)
@@ -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;
index fde8f8e..37d261c 100644 (file)
 /* 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;
index 1a1ae8e..7b2cb14 100644 (file)
@@ -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. */
index a4d61ce..63db4d5 100644 (file)
@@ -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;
        }
index 1e80f1e..b24007e 100644 (file)
@@ -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)
index c66aa37..6c21b46 100644 (file)
@@ -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;
+       }
+}
index f694954..8e380c3 100644 (file)
@@ -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;
index 28ce95e..da73491 100644 (file)
@@ -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);
        }
 }
 
index 5466630..d3c3822 100644 (file)
@@ -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--;
index d67c5fb..bd925fa 100644 (file)
@@ -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;
index 9200b1d..5ba3e95 100644 (file)
@@ -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;
 
index f433586..144fd9d 100644 (file)
@@ -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);
 }
index 07a83da..f50a655 100644 (file)
@@ -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. */
index c0ae641..475a053 100644 (file)
@@ -558,7 +558,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
        m= MEM_callocN(sizeof(Main), "find_main");
        BLI_addtail(mainlist, m);
 
-       lib= alloc_libblock(&m->library, ID_LI, "lib");
+       lib= BKE_libblock_alloc(&m->library, ID_LI, "lib");
        BLI_strncpy(lib->name, filepath, sizeof(lib->name));
        BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));
        
@@ -8605,8 +8605,8 @@ static void give_base_to_groups(Main *mainvar, Scene *scene)
                if (((group->id.flag & LIB_INDIRECT)==0 && (group->id.flag & LIB_PRE_EXISTING)==0)) {
                        Base *base;
 
-                       /* add_object(...) messes with the selection */
-                       Object *ob= add_only_object(OB_EMPTY, group->id.name+2);
+                       /* BKE_object_add(...) messes with the selection */
+                       Object *ob= BKE_object_add_only_object(OB_EMPTY, group->id.name+2);
                        ob->type= OB_EMPTY;
                        ob->lay= scene->lay;
 
index 0659a42..212ec33 100644 (file)
@@ -181,7 +181,7 @@ static BMFace *copy_face(BMOperator *op, BMesh *source_mesh,
  * Internal Copy function.
  */
 
-static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target)
+static void BKE_mesh_copy(BMOperator *op, BMesh *source, BMesh *target)
 {
 
        BMVert *v = NULL, *v2;
@@ -326,7 +326,7 @@ void bmo_dupe_exec(BMesh *bm, BMOperator *op)
        BMO_slot_buffer_flag_enable(bm, dupeop, "geom", BM_ALL, DUPE_INPUT);
 
        /* use the internal copy function */
-       copy_mesh(dupeop, bm, bm2);
+       BKE_mesh_copy(dupeop, bm, bm2);
        
        /* Output */
        /* First copy the input buffers to output buffers - original data */
index a72d517..34f7efa 100644 (file)
@@ -324,7 +324,7 @@ void AnimationImporter::read_node_transform(COLLADAFW::Node *node, Object *ob)
        TransformReader::get_node_mat(mat, node, &uid_animated_map, ob);
        if (ob) {
                copy_m4_m4(ob->obmat, mat);
-               object_apply_mat4(ob, ob->obmat, 0, 0);
+               BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
        }
 }
 
@@ -1800,7 +1800,7 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root, COLLADAFW::No
                        job->parsubstr[0] = 0;
                }
 
-               where_is_object(scene, job);
+               BKE_object_where_is_calc(scene, job);
 
                // after parenting and layer change
                DAG_scene_sort(CTX_data_main(C), scene);
index 1d315b6..9216d7f 100644 (file)
@@ -230,7 +230,7 @@ void DocumentImporter::finish()
                        Base *base = object_in_scene(ob, sce);
                        if (base) {
                                BLI_remlink(&sce->base, base);
-                               free_libblock_us(&G.main->object, base->object);
+                               BKE_libblock_free_us(&G.main->object, base->object);
                                if (sce->basact==base)
                                        sce->basact= NULL;
                                MEM_freeN(base);
@@ -312,7 +312,7 @@ Object* DocumentImporter::create_camera_object(COLLADAFW::InstanceCamera *camera
        ob->data = cam;
        old_cam->id.us--;
        if (old_cam->id.us == 0)
-               free_libblock(&G.main->camera, old_cam);
+               BKE_libblock_free(&G.main->camera, old_cam);
        return ob;
 }
 
@@ -330,7 +330,7 @@ Object* DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce
        ob->data = la;
        old_lamp->id.us--;
        if (old_lamp->id.us == 0)
-               free_libblock(&G.main->lamp, old_lamp);
+               BKE_libblock_free(&G.main->lamp, old_lamp);
        return ob;
 }
 
@@ -338,7 +338,7 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
 {
        fprintf(stderr, "create <instance_node> under node id=%s from node id=%s\n", instance_node ? instance_node->getOriginalId().c_str() : NULL, source_node ? source_node->getOriginalId().c_str() : NULL);
 
-       Object *obn = copy_object(source_ob);
+       Object *obn = BKE_object_copy(source_ob);
        obn->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
        scene_add_base(sce, obn);
 
@@ -359,7 +359,7 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
                        }
                        // calc new matrix and apply
                        mult_m4_m4m4(obn->obmat, obn->obmat, mat);
-                       object_apply_mat4(obn, obn->obmat, 0, 0);
+                       BKE_object_apply_mat4(obn, obn->obmat, 0, 0);
                }
        }
        else {
index ba6be75..c209751 100644 (file)
@@ -914,7 +914,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
 
        set_mesh(ob, uid_mesh_map[*geom_uid]);
        
-       if (old_mesh->id.us == 0) free_libblock(&G.main->mesh, old_mesh);
+       if (old_mesh->id.us == 0) BKE_libblock_free(&G.main->mesh, old_mesh);
        
        char layername[100];
        layername[0] = '\0';
index 0727ec2..d807b04 100644 (file)
@@ -221,7 +221,7 @@ void SkinInfo::link_armature(bContext *C, Object *ob, std::map<COLLADAFW::Unique
        ((ArmatureModifierData *)md)->object = ob_arm;
 
        copy_m4_m4(ob->obmat, bind_shape_matrix);
-       object_apply_mat4(ob, ob->obmat, 0, 0);
+       BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
 #if 1
        bc_set_parent(ob, ob_arm, C);
 #else
@@ -229,7 +229,7 @@ void SkinInfo::link_armature(bContext *C, Object *ob, std::map<COLLADAFW::Unique
        ob->parent = ob_arm;
        ob->partype = PAROBJECT;
 
-       what_does_parent(scene, ob, &workob);
+       BKE_object_workob_calc_parent(scene, ob, &workob);
        invert_m4_m4(ob->parentinv, workob.obmat);
 
        ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA;
index 4974566..fbd36cd 100644 (file)
@@ -70,7 +70,7 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
                copy_v3_v3(scale, ob->size);
 
                ob->size[0] = ob->size[1] = ob->size[2] = 1.0f;
-               object_to_mat4(ob, C);
+               BKE_object_to_mat4(ob, C);
                copy_v3_v3(ob->size, scale);
 
                mul_serie_m4(tmat, ob->parent->obmat, ob->parentinv, C, NULL, NULL, NULL, NULL, NULL);
index bd0f82f..d7ea74b 100644 (file)
@@ -88,7 +88,7 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
        if (is_parent_space) {
                float mat[4][4];
                // calc par->obmat
-               where_is_object(sce, par);
+               BKE_object_where_is_calc(sce, par);
 
                // move child obmat into world space
                mult_m4_m4m4(mat, par->obmat, ob->obmat);
@@ -96,10 +96,10 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
        }
        
        // apply child obmat (i.e. decompose it into rot/loc/size)
-       object_apply_mat4(ob, ob->obmat, 0, 0);
+       BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
 
        // compute parentinv
-       what_does_parent(sce, ob, &workob);
+       BKE_object_workob_calc_parent(sce, ob, &workob);
        invert_m4_m4(ob->parentinv, workob.obmat);
 
        ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA;
@@ -114,9 +114,9 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
 
 Object *bc_add_object(Scene *scene, int type, const char *name)
 {
-       Object *ob = add_only_object(type, name);
+       Object *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;
        ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
 
index a2e9562..5c43ba6 100644 (file)
@@ -632,9 +632,9 @@ static void applyarmature_fix_boneparents (Scene *scene, Object *armob)
                        /* apply current transform from parent (not yet destroyed), 
                         * then calculate new parent inverse matrix
                         */
-                       object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
+                       BKE_object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
                        
-                       what_does_parent(scene, ob, &workob);
+                       BKE_object_workob_calc_parent(scene, ob, &workob);
                        invert_m4_m4(ob->parentinv, workob.obmat);
                }
        }
@@ -644,7 +644,7 @@ static void applyarmature_fix_boneparents (Scene *scene, Object *armob)
 static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
 {
        Scene *scene= CTX_data_scene(C);
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object
        bArmature *arm= get_armature(ob);
        bPose *pose;
        bPoseChannel *pchan;
@@ -653,7 +653,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
        /* don't check if editmode (should be done by caller) */
        if (ob->type!=OB_ARMATURE)
                return OPERATOR_CANCELLED;
-       if (object_data_is_libdata(ob)) {
+       if (BKE_object_obdata_is_libdata(ob)) {
                BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature"); //error_libdata();
                return OPERATOR_CANCELLED;
        }
@@ -746,7 +746,7 @@ void POSE_OT_armature_apply(wmOperatorType *ot)
 /* set the current pose as the restpose */
 static int pose_visual_transform_apply_exec (bContext *C, wmOperator *UNUSED(op))
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object
 
        /* don't check if editmode (should be done by caller) */
        if (ob->type!=OB_ARMATURE)
@@ -5088,7 +5088,7 @@ static int pose_clear_transform_generic_exec(bContext *C, wmOperator *op,
                void (*clear_func)(bPoseChannel*), const char default_ksName[])
 {
        Scene *scene= CTX_data_scene(C);
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        short autokey = 0;
        
        /* sanity checks */
@@ -5292,7 +5292,7 @@ void POSE_OT_select_all(wmOperatorType *ot)
 
 static int pose_select_parent_exec(bContext *C, wmOperator *UNUSED(op))
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bPoseChannel *pchan, *parent;
 
        /*      Determine if there is an active bone */
@@ -5368,7 +5368,7 @@ static int hide_unselected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr
 /* active object is armature in posemode, poll checked */
 static int pose_hide_exec(bContext *C, wmOperator *op) 
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm= ob->data;
 
        if (RNA_boolean_get(op->ptr, "unselected"))
@@ -5417,7 +5417,7 @@ static int show_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
 /* active object is armature in posemode, poll checked */
 static int pose_reveal_exec(bContext *C, wmOperator *UNUSED(op)) 
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm= ob->data;
        
        bone_looper(ob, arm->bonebase.first, NULL, show_pose_bone_cb);
@@ -5932,7 +5932,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
                ED_armature_edit_free(obedit);
        }
        
-       dst = add_object(scene, OB_ARMATURE);
+       dst = BKE_object_add(scene, OB_ARMATURE);
        ED_object_base_init_transform(NULL, scene->basact, NULL, NULL);         // XXX NULL is C, loc, rot
        obedit= scene->basact->object;
        
@@ -5941,7 +5941,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
        mat4_to_eul(dst->rot, src->obmat);
        mat4_to_size(dst->size, src->obmat);
        
-       where_is_object(scene, obedit);
+       BKE_object_where_is_calc(scene, obedit);
        
        ED_armature_to_edit(obedit);
 
index 40dc0a7..f33dce0 100644 (file)
@@ -130,7 +130,7 @@ static int pose_slide_init (bContext *C, wmOperator *op, short mode)
        
        /* get info from context */
        pso->scene= CTX_data_scene(C);
-       pso->ob= object_pose_armature_get(CTX_data_active_object(C));
+       pso->ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        pso->arm= (pso->ob)? pso->ob->data : NULL;
        pso->sa= CTX_wm_area(C); /* only really needed when doing modal() */
        pso->ar= CTX_wm_region(C); /* only really needed when doing modal() */
@@ -1165,7 +1165,7 @@ static void pose_propagate_fcurve (wmOperator *op, Object *ob, FCurve *fcu,
 static int pose_propagate_exec (bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bAction *act= (ob && ob->adt)? ob->adt->action : NULL;
        
        ListBase pflinks = {NULL, NULL};
index 8791a34..3b01ba2 100644 (file)
@@ -174,7 +174,7 @@ static Object *get_poselib_object (bContext *C)
        if (sa && (sa->spacetype == SPACE_BUTS)) 
                return ED_object_context(C);
        else
-               return object_pose_armature_get(CTX_data_active_object(C));
+               return BKE_object_pose_armature_get(CTX_data_active_object(C));
 }
 
 /* Poll callback for operators that require existing PoseLib data (with poses) to work */
@@ -650,7 +650,7 @@ static int poselib_rename_invoke (bContext *C, wmOperator *op, wmEvent *evt)
 
 static int poselib_rename_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bAction *act= (ob) ? ob->poselib : NULL;
        TimeMarker *marker;
        char newname[64];
index 8a2af14..95e7a84 100644 (file)
@@ -200,7 +200,7 @@ void ED_pose_recalculate_paths(Scene *scene, Object *ob)
 /* show popup to determine settings */
 static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {      
-       Object *ob = object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        if (ELEM(NULL, ob, ob->pose))
                return OPERATOR_CANCELLED;
@@ -227,7 +227,7 @@ static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNU
  */
 static int pose_calculate_paths_exec(bContext *C, wmOperator *op)
 {
-       Object *ob = object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        Scene *scene= CTX_data_scene(C);
        
        if (ELEM(NULL, ob, ob->pose))
@@ -320,7 +320,7 @@ static void ED_pose_clear_paths(Object *ob)
 /* operator callback for this */
 static int pose_clear_paths_exec (bContext *C, wmOperator *UNUSED(op))
 {
-       Object *ob = object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
                
        /* only continue if there's an object */
        if (ELEM(NULL, ob, ob->pose))
@@ -354,7 +354,7 @@ void POSE_OT_paths_clear(wmOperatorType *ot)
 
 static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op))
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bConstraint *con;
        int found= 0;
        
@@ -414,7 +414,7 @@ void POSE_OT_select_constraint_target(wmOperatorType *ot)
 
 static int pose_select_hierarchy_exec(bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm= ob->data;
        Bone *curbone, *pabone, *chbone;
        int direction = RNA_enum_get(op->ptr, "direction");
@@ -674,7 +674,7 @@ static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
 
 static int pose_select_grouped_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        short extend= RNA_boolean_get(op->ptr, "extend");
        short changed = 0;
        
@@ -741,7 +741,7 @@ void POSE_OT_select_grouped(wmOperatorType *ot)
 static int pose_bone_flip_active_exec (bContext *C, wmOperator *UNUSED(op))
 {
        Object *ob_act= CTX_data_active_object(C);
-       Object *ob= object_pose_armature_get(ob_act);
+       Object *ob= BKE_object_pose_armature_get(ob_act);
 
        if (ob && (ob->mode & OB_MODE_POSE)) {
                bArmature *arm= ob->data;
@@ -1163,7 +1163,7 @@ static bPoseChannel *pose_bone_do_paste (Object *ob, bPoseChannel *chan, short s
 
 static int pose_copy_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* sanity checking */
        if (ELEM(NULL, ob, ob->pose)) {
@@ -1201,7 +1201,7 @@ void POSE_OT_copy(wmOperatorType *ot)
 
 static int pose_paste_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        Scene *scene= CTX_data_scene(C);
        bPoseChannel *chan;
        int flip= RNA_boolean_get(op->ptr, "flipped");
@@ -1284,7 +1284,7 @@ static int pose_group_add_exec (bContext *C, wmOperator *UNUSED(op))
        if (sa->spacetype == SPACE_BUTS) 
                ob= ED_object_context(C);
        else
-               ob= object_pose_armature_get(CTX_data_active_object(C));
+               ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
                
        /* only continue if there's an object */
        if (ob == NULL)
@@ -1324,7 +1324,7 @@ static int pose_group_remove_exec (bContext *C, wmOperator *UNUSED(op))
        if (sa->spacetype == SPACE_BUTS) 
                ob= ED_object_context(C);
        else
-               ob= object_pose_armature_get(CTX_data_active_object(C));
+               ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* only continue if there's an object */
        if (ob == NULL)
@@ -1372,7 +1372,7 @@ static int pose_groups_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED
        if (sa->spacetype == SPACE_BUTS) 
                ob= ED_object_context(C);
        else
-               ob= object_pose_armature_get(CTX_data_active_object(C));
+               ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* only continue if there's an object, and a pose there too */
        if (ELEM(NULL, ob, ob->pose)) 
@@ -1421,7 +1421,7 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
        if (sa->spacetype == SPACE_BUTS) 
                ob= ED_object_context(C);
        else
-               ob= object_pose_armature_get(CTX_data_active_object(C));
+               ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* only continue if there's an object, and a pose there too */
        if (ELEM(NULL, ob, ob->pose))
@@ -1484,7 +1484,7 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op))
        if (sa->spacetype == SPACE_BUTS) 
                ob= ED_object_context(C);
        else
-               ob= object_pose_armature_get(CTX_data_active_object(C));
+               ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* only continue if there's an object, and a pose there too */
        if (ELEM(NULL, ob, ob->pose))
@@ -1719,7 +1719,7 @@ static int pose_group_select_exec (bContext *C, wmOperator *UNUSED(op))
        if (sa->spacetype == SPACE_BUTS) 
                ob= ED_object_context(C);
        else
-               ob= object_pose_armature_get(CTX_data_active_object(C));
+               ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* only continue if there's an object, and a pose there too */
        if (ELEM(NULL, ob, ob->pose))
@@ -1757,7 +1757,7 @@ static int pose_group_deselect_exec (bContext *C, wmOperator *UNUSED(op))
        if (sa->spacetype == SPACE_BUTS) 
                ob= ED_object_context(C);
        else
-               ob= object_pose_armature_get(CTX_data_active_object(C));
+               ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* only continue if there's an object, and a pose there too */
        if (ELEM(NULL, ob, ob->pose))
@@ -1790,7 +1790,7 @@ void POSE_OT_group_deselect(wmOperatorType *ot)
 
 static int pose_flip_names_exec (bContext *C, wmOperator *UNUSED(op))
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm;
        
        /* paranoia checks */
@@ -1835,7 +1835,7 @@ void POSE_OT_flip_names(wmOperatorType *ot)
 
 static int pose_autoside_names_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm;
        char newname[MAXBONENAME];
        short axis= RNA_enum_get(op->ptr, "axis");
@@ -1939,7 +1939,7 @@ static int pose_armature_layers_showall_poll (bContext *C)
 
 static int pose_armature_layers_showall_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm = (ob)? ob->data : NULL;
        PointerRNA ptr;
        int maxLayers = (RNA_boolean_get(op->ptr, "all"))? 32 : 16;
@@ -1991,7 +1991,7 @@ void ARMATURE_OT_layers_show_all(wmOperatorType *ot)
 /* Present a popup to get the layers that should be used */
 static int pose_armature_layers_invoke (bContext *C, wmOperator *op, wmEvent *evt)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm= (ob)? ob->data : NULL;
        PointerRNA ptr;
        int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
@@ -2012,7 +2012,7 @@ static int pose_armature_layers_invoke (bContext *C, wmOperator *op, wmEvent *ev
 /* Set the visible layers for the active armature (edit and pose modes) */
 static int pose_armature_layers_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        PointerRNA ptr;
        int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
 
@@ -2102,7 +2102,7 @@ static int pose_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *evt)
 /* Set the visible layers for the active armature (edit and pose modes) */
 static int pose_bone_layers_exec (bContext *C, wmOperator *op)
 {
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        PointerRNA ptr;
        int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
 
@@ -2225,7 +2225,7 @@ void ARMATURE_OT_bone_layers(wmOperatorType *ot)
 static int pose_flip_quats_exec (bContext *C, wmOperator *UNUSED(op))
 {
        Scene *scene= CTX_data_scene(C);
-       Object *ob= object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C));
        KeyingSet *ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOC_ROT_SCALE_ID);
        
        /* loop through all selected pchans, flipping and keying (as needed) */
index 0a976e6..22f1cd5 100644 (file)
@@ -437,12 +437,12 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, float
        int nchars = 0, a;
        float rot[3] = {0.f, 0.f, 0.f};
        
-       obedit= add_object(scene, OB_FONT);
+       obedit= BKE_object_add(scene, OB_FONT);
        base= scene->basact;
 
        
        ED_object_base_init_transform(C, base, NULL, rot); /* seems to assume view align ? TODO - look into this, could be an operator option */
-       where_is_object(scene, obedit);
+       BKE_object_where_is_calc(scene, obedit);
 
        obedit->loc[0] += offset[0];
        obedit->loc[1] += offset[1];
index 34a95cd..990b1ac 100644 (file)
@@ -568,7 +568,7 @@ static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short
        /* init the curve object (remove rotation and get curve data from it)
         *      - must clear transforms set on object, as those skew our results
         */
-       ob= add_object(scene, OB_CURVE);
+       ob= BKE_object_add(scene, OB_CURVE);
        zero_v3(ob->loc);
        zero_v3(ob->rot);
        cu= ob->data;
index 36624b8..916b4ff 100644 (file)
@@ -131,7 +131,7 @@ void gpencil_undo_push(bGPdata *gpd)
                while (undo_node) {
                        bGPundonode *next_node= undo_node->next;
 
-                       free_gpencil_data(undo_node->gpd);
+                       BKE_gpencil_free(undo_node->gpd);
                        MEM_freeN(undo_node->gpd);
 
                        BLI_freelinkN(&undo_nodes, undo_node);
@@ -154,7 +154,7 @@ void gpencil_undo_finish(void)
        bGPundonode *undo_node= undo_nodes.first;
 
        while (undo_node) {
-               free_gpencil_data(undo_node->gpd);
+               BKE_gpencil_free(undo_node->gpd);
                MEM_freeN(undo_node->gpd);
 
                undo_node= undo_node->next;
index bc6753b..ee61b2a 100644 (file)
@@ -835,7 +835,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
                
                if (!ELEM(md->type, eModifierType_Collision, eModifierType_Surface)) {
                        /* only here obdata, the rest of modifiers is ob level */
-                       uiBlockSetButLock(block, object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+                       uiBlockSetButLock(block, BKE_object_obdata_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
                        
                        if (md->type == eModifierType_ParticleSystem) {
                                ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys;
index 96cfd95..0f300cc 100644 (file)
@@ -485,7 +485,7 @@ static int edbm_extrude_mesh(Scene *scene, Object *obedit, BMEditMesh *em, wmOpe
                 * automatically building this data if invalid. Or something.
                 */
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
-               object_handle_update(scene, obedit);
+               BKE_object_handle_update(scene, obedit);
 
                /* individual faces? */
 //             BIF_TransformSetUndo("Extrude");
index a17f335..faf5bbc 100644 (file)
@@ -545,11 +545,11 @@ static void free_undo(void *me_v)
 {
        Mesh *me = me_v;
        if (me->key) {
-               free_key(me->key);
+               BKE_key_free(me->key);
                MEM_freeN(me->key);
        }
 
-       free_mesh(me, FALSE);
+       BKE_mesh_free(me, FALSE);
        MEM_freeN(me);
 }
 
index e418077..aa89eaa 100644 (file)
@@ -182,7 +182,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
         */
        if (key) {
                /* make a duplicate copy that will only be used here... (must remember to free it!) */
-               nkey = copy_key(key);
+               nkey = BKE_key_copy(key);
                
                /* for all keys in old block, clear data-arrays */
                for (kb = key->block.first; kb; kb = kb->next) {
@@ -524,13 +524,13 @@ int join_mesh_exec(bContext *C, wmOperator *op)
 #if 0
                /* free it's ipo too - both are not actually freed from memory yet as ID-blocks */
                if (nkey->ipo) {
-                       free_ipo(nkey->ipo);
+                       BKE_ipo_free(nkey->ipo);
                        BLI_remlink(&bmain->ipo, nkey->ipo);
                        MEM_freeN(nkey->ipo);
                }
 #endif
                
-               free_key(nkey);
+               BKE_key_free(nkey);
                BLI_remlink(&bmain->key, nkey);
                MEM_freeN(nkey);
        }
index d030e61..d58b71f 100644 (file)
@@ -147,7 +147,7 @@ void ED_object_base_init_transform(bContext *C, Base *base, float *loc, float *r
        if (rot)
                copy_v3_v3(ob->rot, rot);
        
-       where_is_object(scene, ob);
+       BKE_object_where_is_calc(scene, ob);
 }
 
 /* uses context to figure out transform for primitive */
@@ -325,7 +325,7 @@ Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot,
                ED_object_exit_editmode(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO);  /* freedata, and undo */
        
        /* deselects all, sets scene->basact */
-       ob = add_object(scene, type);
+       ob = BKE_object_add(scene, type);
        BASACT->lay = ob->lay = layer;
        /* editor level activate, notifiers */
        ED_base_object_activate(C, BASACT);
@@ -891,7 +891,7 @@ void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base)
 {
        DAG_id_type_tag(bmain, ID_OB);
        BLI_remlink(&scene->base, base);
-       free_libblock_us(&bmain->object, base->object);
+       BKE_libblock_free_us(&bmain->object, base->object);
        if (scene->basact == base) scene->basact = NULL;
        MEM_freeN(base);
 }
@@ -975,7 +975,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
        /* XXX check object pointers */
        CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
        {
-               object_relink(ob);
+               BKE_object_relink(ob);
        }
        CTX_DATA_END;
        
@@ -993,7 +993,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
                                                        id = (ID *)ma->mtex[a]->tex;
                                                        if (id) {
                                                                ID_NEW_US(ma->mtex[a]->tex)
-                                                               else ma->mtex[a]->tex = copy_texture(ma->mtex[a]->tex);
+                                                               else ma->mtex[a]->tex = BKE_texture_copy(ma->mtex[a]->tex);
                                                                id->us--;
                                                        }
                                                }
@@ -1073,7 +1073,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
        
        for (dob = lb->first; dob; dob = dob->next) {
                Base *basen;
-               Object *ob = copy_object(dob->ob);
+               Object *ob = BKE_object_copy(dob->ob);
                /* font duplis can have a totcol without material, we get them from parent
                 * should be implemented better...
                 */
@@ -1097,7 +1097,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
                ob->lay = base->lay;
                
                copy_m4_m4(ob->obmat, dob->mat);
-               object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
+               BKE_object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
 
                if (dupli_gh)
                        BLI_ghash_insert(dupli_gh, dob, ob);
@@ -1143,7 +1143,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
 
                                /* note, this may be the parent of other objects, but it should
                                 * still work out ok */
-                               object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
+                               BKE_object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
 
                                /* to set ob_dst->orig and in case theres any other discrepicies */
                                DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB);
@@ -1162,7 +1162,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
 
                        /* similer to the code above, see comments */
                        invert_m4_m4(ob_dst->parentinv, dob->mat);
-                       object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
+                       BKE_object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
                        DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB);
 
 
@@ -1244,7 +1244,7 @@ static void curvetomesh(Scene *scene, Object *ob)
        nurbs_to_mesh(ob); /* also does users */
 
        if (ob->type == OB_MESH)
-               object_free_modifiers(ob);
+               BKE_object_free_modifiers(ob);
 }
 
 static int convert_poll(bContext *C)
@@ -1265,7 +1265,7 @@ static Base *duplibase_for_convert(Scene *scene, Base *base, Object *ob)
                ob = base->object;
        }
 
-       obn = copy_object(ob);
+       obn = BKE_object_copy(ob);
        obn->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
 
        basen = MEM_mallocN(sizeof(Base), "duplibase");
@@ -1325,7 +1325,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                /* When 2 objects with linked data are selected, converting both
                                 * would keep modifiers on all but the converted object [#26003] */
                                if (ob->type == OB_MESH) {
-                                       object_free_modifiers(ob);  /* after derivedmesh calls! */
+                                       BKE_object_free_modifiers(ob);  /* after derivedmesh calls! */
                                }
                        }
                }
@@ -1341,7 +1341,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                me->id.us--;
 
                                /* make a new copy of the mesh */
-                               newob->data = copy_mesh(me);
+                               newob->data = BKE_mesh_copy(me);
                        }
                        else {
                                newob = ob;
@@ -1350,7 +1350,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                        mesh_to_curve(scene, newob);
 
                        if (newob->type == OB_CURVE)
-                               object_free_modifiers(newob);   /* after derivedmesh calls! */
+                               BKE_object_free_modifiers(newob);   /* after derivedmesh calls! */
                }
                else if (ob->type == OB_MESH && ob->modifiers.first) { /* converting a mesh with no modifiers causes a segfault */
                        ob->flag |= OB_DONE;
@@ -1364,7 +1364,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                me->id.us--;
 
                                /* make a new copy of the mesh */
-                               newob->data = copy_mesh(me);
+                               newob->data = BKE_mesh_copy(me);
                        }
                        else {
                                newob = ob;
@@ -1383,7 +1383,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                        /* re-tessellation is called by DM_to_mesh */
 
                        dm->release(dm);
-                       object_free_modifiers(newob);   /* after derivedmesh calls! */
+                       BKE_object_free_modifiers(newob);   /* after derivedmesh calls! */
                }
                else if (ob->type == OB_FONT) {
                        ob->flag |= OB_DONE;
@@ -1631,7 +1631,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                ; /* nothing? */
        }
        else {
-               obn = copy_object(ob);
+               obn = BKE_object_copy(ob);
                obn->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
                
                basen = MEM_mallocN(sizeof(Base), "duplibase");
@@ -1657,7 +1657,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                id = (ID *)obn->mat[a];
                                if (id) {
                                        ID_NEW_US(obn->mat[a])
-                                       else obn->mat[a] = copy_material(obn->mat[a]);
+                                       else obn->mat[a] = BKE_material_copy(obn->mat[a]);
                                        id->us--;
                                        
                                        if (dupflag & USER_DUP_ACT) {
@@ -1672,7 +1672,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                id = (ID *) psys->part;
                                if (id) {
                                        ID_NEW_US(psys->part)
-                                       else psys->part = psys_copy_settings(psys->part);
+                                       else psys->part = BKE_particlesettings_copy(psys->part);
                                        
                                        if (dupflag & USER_DUP_ACT) {
                                                BKE_copy_animdata_id_action(&psys->part->id);
@@ -1691,7 +1691,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                if (dupflag & USER_DUP_MESH) {
                                        ID_NEW_US2(obn->data)
                                        else {
-                                               obn->data = copy_mesh(obn->data);
+                                               obn->data = BKE_mesh_copy(obn->data);
                                                
                                                if (obn->fluidsimSettings) {
                                                        obn->fluidsimSettings->orgMesh = (Mesh *)obn->data;
@@ -1746,7 +1746,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                if (dupflag & USER_DUP_LAMP) {
                                        ID_NEW_US2(obn->data)
                                        else {
-                                               obn->data = copy_lamp(obn->data);
+                                               obn->data = BKE_lamp_copy(obn->data);
                                                didit = 1;
                                        }
                                        id->us--;
@@ -1760,7 +1760,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                if (dupflag & USER_DUP_ARM) {
                                        ID_NEW_US2(obn->data)
                                        else {
-                                               obn->data = copy_armature(obn->data);
+                                               obn->data = BKE_armature_copy(obn->data);
                                                armature_rebuild_pose(obn, obn->data);
                                                didit = 1;
                                        }
@@ -1773,7 +1773,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                if (dupflag != 0) {
                                        ID_NEW_US2(obn->data)
                                        else {
-                                               obn->data = copy_lattice(obn->data);
+                                               obn->data = BKE_lattice_copy(obn->data);
                                                didit = 1;
                                        }
                                        id->us--;
@@ -1793,7 +1793,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                if (dupflag != 0) {
                                        ID_NEW_US2(obn->data)
                                        else {
-                                               obn->data = copy_speaker(obn->data);
+                                               obn->data = BKE_speaker_copy(obn->data);
                                                didit = 1;
                                        }
                                        id->us--;
@@ -1832,7 +1832,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                                                id = (ID *)(*matarar)[a];
                                                if (id) {
                                                        ID_NEW_US((*matarar)[a])
-                                                       else (*matarar)[a] = copy_material((*matarar)[a]);
+                                                       else (*matarar)[a] = BKE_material_copy((*matarar)[a]);
                                                        
                                                        id->us--;
                                                }
@@ -1863,7 +1863,7 @@ Base *ED_object_add_duplicate(Main *bmain, Scene *scene, Base *base, int dupflag
        ob = basen->object;
 
        /* link own references to the newly duplicated data [#26816] */
-       object_relink(ob);
+       BKE_object_relink(ob);
        set_sca_new_poins_ob(ob);
 
        DAG_scene_sort(bmain, scene);
@@ -2033,7 +2033,7 @@ static int join_exec(bContext *C, wmOperator *op)
                BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode");
                return OPERATOR_CANCELLED;
        }
-       else if (object_data_is_libdata(ob)) {
+       else if (BKE_object_obdata_is_libdata(ob)) {
                BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
                return OPERATOR_CANCELLED;
        }
@@ -2086,7 +2086,7 @@ static int join_shapes_exec(bContext *C, wmOperator *op)
                BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode");
                return OPERATOR_CANCELLED;
        }
-       else if (object_data_is_libdata(ob)) {
+       else if (BKE_object_obdata_is_libdata(ob)) {
                BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
                return OPERATOR_CANCELLED;
        }
index e63e0e3..60ca674 100644 (file)
@@ -309,7 +309,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                 *              the constraint is deemed invalid
                                 */
                                /* default IK check ... */
-                               if (exist_object(data->tar) == 0) {
+                               if (BKE_object_exists_check(data->tar) == 0) {
                                        data->tar = NULL;
                                        curcon->flag |= CONSTRAINT_DISABLE;
                                }
@@ -320,7 +320,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                }
                                
                                if (data->poletar) {
-                                       if (exist_object(data->poletar) == 0) {
+                                       if (BKE_object_exists_check(data->poletar) == 0) {
                                                data->poletar = NULL;
                                                curcon->flag |= CONSTRAINT_DISABLE;
                                        }
@@ -339,7 +339,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                bPivotConstraint *data = curcon->data;
                                
                                /* target doesn't have to exist, but if it is non-null, it must exist! */
-                               if (data->tar && exist_object(data->tar) == 0) {
+                               if (data->tar && BKE_object_exists_check(data->tar) == 0) {
                                        data->tar = NULL;
                                        curcon->flag |= CONSTRAINT_DISABLE;
                                }
@@ -446,7 +446,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
                                /* disable and clear constraints targets that are incorrect */
                                for (ct = targets.first; ct; ct = ct->next) {
                                        /* general validity checks (for those constraints that need this) */
-                                       if (exist_object(ct->tar) == 0) {
+                                       if (BKE_object_exists_check(ct->tar) == 0) {
                                                /* object doesn't exist, but constraint requires target */
                                                ct->tar = NULL;
                                                curcon->flag |= CONSTRAINT_DISABLE;
@@ -774,8 +774,8 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
        else if (ob) {
                Object workob;
                
-               /* use what_does_parent to find inverse - just like for normal parenting */
-               what_does_parent(scene, ob, &workob);
+               /* use BKE_object_workob_calc_parent to find inverse - just like for normal parenting */
+               BKE_object_workob_calc_parent(scene, ob, &workob);
                invert_m4_m4(invmat, workob.obmat);
        }
 }
@@ -1147,7 +1147,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op))
 {
        Main *bmain = CTX_data_main(C);
        Scene *scene = CTX_data_scene(C);
-       Object *ob = object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* free constraints for all selected bones */
        CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
@@ -1413,7 +1413,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o
                Object *obt;
                
                /* add new target object */
-               obt = add_object(scene, OB_EMPTY);
+               obt = BKE_object_add(scene, OB_EMPTY);
                
                /* set layers OK */
                newbase = BASACT;
@@ -1434,7 +1434,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o
                        copy_v3_v3(obt->loc, obact->obmat[3]);
                }
 
-               /* restore, add_object sets active */
+               /* restore, BKE_object_add sets active */
                BASACT = base;
                base->flag |= SELECT;
                
@@ -1586,7 +1586,7 @@ static int object_constraint_add_exec(bContext *C, wmOperator *op)
 /* dummy operator callback */
 static int pose_constraint_add_exec(bContext *C, wmOperator *op)
 {
-       Object *ob = object_pose_armature_get(ED_object_active_context(C));
+       Object *ob = BKE_object_pose_armature_get(ED_object_active_context(C));
        int type = RNA_enum_get(op->ptr, "type");
        short with_targets = 0;
        
@@ -1689,7 +1689,7 @@ void POSE_OT_constraint_add_with_targets(wmOperatorType *ot)
 /* present menu with options + validation for targets to use */
 static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
 {
-       Object *ob = object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        bPoseChannel *pchan = get_active_posechannel(ob);
        bConstraint *con = NULL;
        
@@ -1773,7 +1773,7 @@ void POSE_OT_ik_add(wmOperatorType *ot)
 /* remove IK constraints from selected bones */
 static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op))
 {
-       Object *ob = object_pose_armature_get(CTX_data_active_object(C));
+       Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        
        /* only remove IK Constraints */
        CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
index c669bbf..a683b1c 100644 (file)
@@ -427,7 +427,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
 
        ob = base->object;
        
-       if (object_data_is_libdata(ob)) {
+       if (BKE_object_obdata_is_libdata(ob)) {
                error_libdata();
                return;
        }
@@ -465,11 +465,11 @@ void ED_object_enter_editmode(bContext *C, int flag)
                bArmature *arm = base->object->data;
                if (!arm) return;
                /*
-                * The function object_data_is_libdata make a problem here, the
+                * The function BKE_object_obdata_is_libdata make a problem here, the
                 * check for ob->proxy return 0 and let blender enter to edit mode
                 * this causes a crash when you try leave the edit mode.
                 * The problem is that i can't remove the ob->proxy check from
-                * object_data_is_libdata that prevent the bugfix #6614, so
+                * BKE_object_obdata_is_libdata that prevent the bugfix #6614, so
                 * i add this little hack here.
                 */
                if (arm->id.lib) {
@@ -783,7 +783,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
                return;
        }
        else if (event == 24) {
-               /* moved to object_link_modifiers */
+               /* moved to BKE_object_link_modifiers */
                /* copymenu_modifiers(bmain, scene, v3d, ob); */
                return;
        }
index 2cfefa6..6a41cb9 100644 (file)
@@ -417,13 +417,13 @@ static Object *add_hook_object_new(Scene *scene, Object *obedit)
        Base *base, *basedit;
        Object *ob;
 
-       ob = add_object(scene, OB_EMPTY);
+       ob = BKE_object_add(scene, OB_EMPTY);
        
        basedit = object_in_scene(obedit, scene);
        base = object_in_scene(ob, scene);
        base->lay = ob->lay = obedit->lay;
        
-       /* icky, add_object sets new base as active.
+       /* icky, BKE_object_add sets new base as active.
         * so set it back to the original edit object */
        scene->basact = basedit;
 
@@ -469,7 +469,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o
        /* matrix calculus */
        /* vert x (obmat x hook->imat) x hook->obmat x ob->imat */
        /*        (parentinv         )                          */
-       where_is_object(scene, ob);
+       BKE_object_where_is_calc(scene, ob);
        
        invert_m4_m4(ob->imat, ob->obmat);
        /* apparently this call goes from right to left... */
index 281ca7e..b4207ef 100644 (file)
@@ -368,7 +368,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
        if (totvert == 0) return 0;
 
        /* add new mesh */
-       obn = add_object(scene, OB_MESH);
+       obn = BKE_object_add(scene, OB_MESH);
        me = obn->data;
        
        me->totvert = totvert;
@@ -661,7 +661,7 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr)
                        if (mti->flags & eModifierTypeFlag_NoUserAdd)
                                continue;
 
-                       if (!object_support_modifier_type(ob, md_item->value))
+                       if (!BKE_object_support_modifier_type_check(ob, md_item->value))
                                continue;
                }
                else {
index 4678416..95c9773 100644 (file)
@@ -235,7 +235,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
                                        ob->par3 = v3 - 1;
 
                                        /* inverse parent matrix */
-                                       what_does_parent(scene, ob, &workob);
+                                       BKE_object_workob_calc_parent(scene, ob, &workob);
                                        invert_m4_m4(ob->parentinv, workob.obmat);
                                }
                                else {
@@ -243,7 +243,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
                                        ob->par1 = v1 - 1;
 
                                        /* inverse parent matrix */
-                                       what_does_parent(scene, ob, &workob);
+                                       BKE_object_workob_calc_parent(scene, ob, &workob);
                                        invert_m4_m4(ob->parentinv, workob.obmat);
                                }
                        }
@@ -335,24 +335,24 @@ static int make_proxy_exec(bContext *C, wmOperator *op)
                char name[MAX_ID_NAME + 4];
                
                /* Add new object for the proxy */
-               newob = add_object(scene, OB_EMPTY);
+               newob = BKE_object_add(scene, OB_EMPTY);
 
                BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name + 2);
 
                rename_id(&newob->id, name);
                
                /* set layers OK */
-               newbase = BASACT;    /* add_object sets active... */
+               newbase = BASACT;    /* BKE_object_add sets active... */
                newbase->lay = oldbase->lay;
                newob->lay = newbase->lay;
                
-               /* remove base, leave user count of object, it gets linked in object_make_proxy */
+               /* remove base, leave user count of object, it gets linked in BKE_object_make_proxy */
                if (gob == NULL) {
                        BLI_remlink(&scene->base, oldbase);
                        MEM_freeN(oldbase);
                }
                
-               object_make_proxy(newob, ob, gob);
+               BKE_object_make_proxy(newob, ob, gob);
                
                /* depsgraph flushes are needed for the new data */
                DAG_scene_sort(bmain, scene);
@@ -439,7 +439,7 @@ void ED_object_parent_clear(bContext *C, int type)
                }
                else if (type == 1) {
                        ob->parent = NULL;
-                       object_apply_mat4(ob, ob->obmat, TRUE, FALSE);
+                       BKE_object_apply_mat4(ob, ob->obmat, TRUE, FALSE);
                }
                else if (type == 2)
                        unit_m4(ob->parentinv);
@@ -571,7 +571,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
                        Object workob;
                        
                        /* apply transformation of previous parenting */
-                       /* object_apply_mat4(ob, ob->obmat); */ /* removed because of bug [#23577] */
+                       /* BKE_object_apply_mat4(ob, ob->obmat); */ /* removed because of bug [#23577] */
                        
                        /* set the parent (except for follow-path constraint option) */
                        if (partype != PAR_PATH_CONST) {
@@ -650,13 +650,13 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
                                }
                                /* get corrected inverse */
                                ob->partype = PAROBJECT;
-                               what_does_parent(scene, ob, &workob);
+                               BKE_object_workob_calc_parent(scene, ob, &workob);
                                
                                invert_m4_m4(ob->parentinv, workob.obmat);
                        }
                        else {
                                /* calculate inverse parent matrix */
-                               what_does_parent(scene, ob, &workob);
+                               BKE_object_workob_calc_parent(scene, ob, &workob);
                                invert_m4_m4(ob->parentinv, workob.obmat);
                        }
                        
@@ -814,7 +814,7 @@ static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op))
                if (ob->parent) {
                        if (ob->partype & PARSLOW) {
                                ob->partype -= PARSLOW;
-                               where_is_object(scene, ob);
+                               BKE_object_where_is_calc(scene, ob);
                                ob->partype |= PARSLOW;
                                ob->recalc |= OB_RECALC_OB;
                        }
@@ -920,7 +920,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
                }
                
                if (type == 1)
-                       object_apply_mat4(ob, ob->obmat, TRUE, TRUE);
+                       BKE_object_apply_mat4(ob, ob->obmat, TRUE, TRUE);
        }
        CTX_DATA_END;
 
@@ -1313,7 +1313,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
                                                }
                                                break;
                                        case MAKE_LINKS_MODIFIERS:
-                                               object_link_modifiers(obt, ob);
+                                               BKE_object_link_modifiers(obt, ob);
                                                obt->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
                                                break;
                                }
@@ -1401,7 +1401,7 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag)
                if ( (base->flag & flag) == flag) {
                        if (ob->id.lib == NULL && ob->id.us > 1) {
                                /* base gets copy of object */
-                               obn = copy_object(ob);
+                               obn = BKE_object_copy(ob);
                                base->object = obn;
                                ob->id.us--;
                        }
@@ -1413,7 +1413,7 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag)
        
        /* object pointers */
        for (base = FIRSTBASE; base; base = base->next) {
-               object_relink(base->object);
+               BKE_object_relink(base->object);
        }
 
        set_sca_new_poins();
@@ -1447,7 +1447,7 @@ static void new_id_matar(Material **matar, int totcol)
                                id->us--;
                        }
                        else if (id->us > 1) {
-                               matar[a] = copy_material(matar[a]);
+                               matar[a] = BKE_material_copy(matar[a]);
                                id->us--;
                                id->newid = (ID *)matar[a];
                        }
@@ -1478,7 +1478,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
                                
                                switch (ob->type) {
                                        case OB_LAMP:
-                                               ob->data = la = copy_lamp(ob->data);
+                                               ob->data = la = BKE_lamp_copy(ob->data);
                                                for (a = 0; a < MAX_MTEX; a++) {
                                                        if (la->mtex[a]) {
                                                                ID_NEW(la->mtex[a]->object);
@@ -1489,7 +1489,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
                                                ob->data = BKE_camera_copy(ob->data);
                                                break;
                                        case OB_MESH:
-                                               ob->data = copy_mesh(ob->data);
+                                               ob->data = BKE_mesh_copy(ob->data);
                                                //me= ob->data;
                                                //if (me && me->key)
                                                //      ipo_idnew(me->key->ipo);        /* drivers */
@@ -1505,15 +1505,15 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
                                                ID_NEW(cu->taperobj);
                                                break;
                                        case OB_LATTICE:
-                                               ob->data = copy_lattice(ob->data);
+                                               ob->data = BKE_lattice_copy(ob->data);
                                                break;
                                        case OB_ARMATURE:
                                                ob->recalc |= OB_RECALC_DATA;
-                                               ob->data = copy_armature(ob->data);
+                                               ob->data = BKE_armature_copy(ob->data);
                                                armature_rebuild_pose(ob, ob->data);
                                                break;
                                        case OB_SPEAKER:
-                                               ob->data = copy_speaker(ob->data);
+                                               ob->data = BKE_speaker_copy(ob->data);
                                                break;
                                        default:
                                                if (G.debug & G_DEBUG)
@@ -1568,7 +1568,7 @@ static void single_mat_users(Scene *scene, int flag, int do_textures)
                                        /* do not test for LIB_NEW: this functions guaranteed delivers single_users! */
                                        
                                        if (ma->id.us > 1) {
-                                               man = copy_material(ma);
+                                               man = BKE_material_copy(ma);
                                                BKE_copy_animdata_id_action(&man->id);
                                                
                                                man->id.us = 0;
@@ -1579,7 +1579,7 @@ static void single_mat_users(Scene *scene, int flag, int do_textures)
                                                                if (ma->mtex[b] && (tex = ma->mtex[b]->tex)) {
                                                                        if (tex->id.us > 1) {
                                                                                tex->id.us--;
-                                                                               tex = copy_texture(tex);
+                                                                               tex = BKE_texture_copy(tex);
                                                                                BKE_copy_animdata_id_action(&tex->id);
                                                                                man->mtex[b]->tex = tex;
                                                                        }
@@ -1606,7 +1606,7 @@ static void do_single_tex_user(Tex **from)
                tex->id.us--;
        }
        else if (tex->id.us > 1) {
-               texn = copy_texture(tex);
+               texn = BKE_texture_copy(tex);
                BKE_copy_animdata_id_action(&texn->id);
                tex->id.newid = (ID *)texn;
                tex->id.us--;
index 5d31bff..df73e43 100644 (file)
@@ -77,7 +77,7 @@
 static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, int from_mix)
 {
        KeyBlock *kb;
- &