svn merge ^/trunk/blender -r46300:46330
authorOve Murberg Henriksen <sorayasilvermoon@hotmail.com>
Mon, 7 May 2012 01:04:52 +0000 (01:04 +0000)
committerOve Murberg Henriksen <sorayasilvermoon@hotmail.com>
Mon, 7 May 2012 01:04:52 +0000 (01:04 +0000)
312 files changed:
CMakeLists.txt
intern/audaspace/intern/AUD_Reference.h
intern/audaspace/intern/AUD_SequencerHandle.cpp
intern/cycles/blender/blender_mesh.cpp
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/blender/blender_sync.h
intern/cycles/blender/blender_util.h
intern/cycles/bvh/bvh_build.cpp
intern/cycles/bvh/bvh_build.h
intern/cycles/device/device_cpu.cpp
intern/cycles/kernel/kernel_camera.h
intern/cycles/kernel/kernel_montecarlo.h
intern/cycles/render/image.cpp
intern/cycles/render/image.h
intern/cycles/render/mesh.cpp
intern/cycles/render/mesh.h
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_camera.h
source/blender/blenkernel/BKE_constraint.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/blender.c
source/blender/blenkernel/intern/booleanops_mesh.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/editderivedmesh.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/ocean.c
source/blender/blenkernel/intern/paint.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/sequencer.c
source/blender/blenkernel/intern/shrinkwrap.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/blenlib/BLI_bitmap.h
source/blender/blenlib/BLI_boxpack2d.h
source/blender/blenlib/BLI_bpath.h
source/blender/blenlib/BLI_callbacks.h
source/blender/blenlib/BLI_jitter.h
source/blender/blenlib/BLI_scanfill.h
source/blender/blenlib/BLI_uvproject.h
source/blender/blenlib/BLI_voxel.h
source/blender/blenlib/intern/boxpack2d.c
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/callbacks.c
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/jitter.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/uvproject.c
source/blender/blenlib/intern/voxel.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_triangulate.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationImporter.cpp
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/collada/SkinInfo.cpp
source/blender/collada/SkinInfo.h
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada_utils.cpp
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/armature/poseUtils.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editfont.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_undo.c
source/blender/editors/include/ED_keyframing.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/mesh/mesh_ops.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_group.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.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_internal.c
source/blender/editors/render/render_opengl.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/screen/screendump.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_hide.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_texture.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_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_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/drawanimviz.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.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_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_material.c
source/blender/ikplugin/intern/iksolver_plugin.c
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_particle_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_camera.c
source/blender/makesrna/intern/rna_camera_api.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_text_api.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_particlesystem.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/composite/nodes/node_composite_defocus.c
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/nodes/composite/nodes/node_composite_outputFile.c
source/blender/nodes/composite/nodes/node_composite_splitViewer.c
source/blender/nodes/composite/nodes/node_composite_viewer.c
source/blender/nodes/intern/node_common.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/nodes/shader/nodes/node_shader_dynamic.c
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pointdensity.c
source/blender/render/intern/source/render_result.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/voxeldata.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_ArmatureObject.h
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_ShapeDeformer.cpp
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

index 43636740e913d9df99e2e5a8e0634170379752c9..fe9b535d373cc4eb4a26ce1b3f8eb5fb6b2d8202 100644 (file)
@@ -1641,6 +1641,7 @@ if(WITH_PYTHON)
                          PATH_SUFFIXES
                            site-packages
                            dist-packages
+                          NO_DEFAULT_PATH
                        )
 
                        if(NOT EXISTS "${PYTHON_NUMPY_PATH}")
index 0c9f02c0155d86452e99176976f8bd52234a266c..5a1aa9471484f604b39f73960c48187eccee632d 100644 (file)
@@ -174,8 +174,14 @@ public:
                        std::cerr << "-" << typeid(*m_reference).name() << std::endl;
 #endif
                if(AUD_ReferenceHandler::decref(m_original))
+               {
+                       pthread_mutex_unlock(AUD_ReferenceHandler::getMutex());
                        delete m_reference;
-               pthread_mutex_unlock(AUD_ReferenceHandler::getMutex());
+               }
+               else
+               {
+                       pthread_mutex_unlock(AUD_ReferenceHandler::getMutex());
+               }
        }
 
        /**
@@ -194,7 +200,11 @@ public:
                        std::cerr << "-" << typeid(*m_reference).name() << std::endl;
 #endif
                if(AUD_ReferenceHandler::decref(m_original))
+               {
+                       pthread_mutex_unlock(AUD_ReferenceHandler::getMutex());
                        delete m_reference;
+                       pthread_mutex_lock(AUD_ReferenceHandler::getMutex());
+               }
 
                m_original = ref.m_original;
                m_reference = ref.m_reference;
index d13efb9683b6547bfc831a6514524f7c724b16e4..f4bfae6cee75480180cc8aa7a46c202218985e1d 100644 (file)
@@ -154,6 +154,7 @@ void AUD_SequencerHandle::seek(float position)
                if(seekpos < 0)
                        seekpos = 0;
                seekpos += m_entry->m_skip;
+               m_handle->setPitch(1.0f);
                m_handle->seek(seekpos);
                if(position < m_entry->m_begin)
                        m_handle->pause();
index 867cc71bf47ca2bb1b429740a2b319165b5064a5..d7003729c46703e921188b50f93b6b2227e61b24 100644 (file)
@@ -202,7 +202,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated)
 {
        /* test if we can instance or if the object is modified */
        BL::ID b_ob_data = b_ob.data();
-       BL::ID key = (object_is_modified(b_ob))? b_ob: b_ob_data;
+       BL::ID key = (BKE_object_is_modified(b_ob))? b_ob: b_ob_data;
        BL::Material material_override = render_layer.material_override;
 
        /* find shader indices */
@@ -309,7 +309,7 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion)
 
        /* skip objects without deforming modifiers. this is not a totally reliable,
         * would need a more extensive check to see which objects are animated */
-       if(!size || !ccl::object_is_deform_modified(b_ob, b_scene, preview))
+       if(!size || !ccl::BKE_object_is_deform_modified(b_ob, b_scene, preview))
                return;
 
        /* get derived mesh */
index bbf48050222b954437681d830cfbf6567edb626f..641aa88d6effedd7b8de353c645642b52678d911 100644 (file)
@@ -34,10 +34,10 @@ CCL_NAMESPACE_BEGIN
 
 /* Utilities */
 
-bool BlenderSync::object_is_modified(BL::Object b_ob)
+bool BlenderSync::BKE_object_is_modified(BL::Object b_ob)
 {
        /* test if we can instance or if the object is modified */
-       if(ccl::object_is_modified(b_ob, b_scene, preview)) {
+       if(ccl::BKE_object_is_modified(b_ob, b_scene, preview)) {
                /* modifiers */
                return true;
        }
@@ -286,7 +286,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
        BL::Scene::objects_iterator b_ob;
 
        for(b_scene.objects.begin(b_ob); b_ob != b_scene.objects.end(); ++b_ob) {
-               bool hide = (b_v3d)? b_ob->hide(): b_ob->hide_render();
+               bool hide = (render_layer.use_viewport_visibility)? b_ob->hide(): b_ob->hide_render();
                uint ob_layer = get_layer(b_ob->layers());
 
                if(!hide && (ob_layer & scene_layer)) {
index 24cf10bc02879f4d855c110c3bf8c09bbc689f61..c0b6e210bb14395e4b41fe9d7a4e6646640703e4 100644 (file)
@@ -87,7 +87,7 @@ bool BlenderSync::sync_recalc()
 
                if(object_is_mesh(*b_ob)) {
                        if(b_ob->is_updated_data() || b_ob->data().is_updated()) {
-                               BL::ID key = object_is_modified(*b_ob)? *b_ob: b_ob->data();
+                               BL::ID key = BKE_object_is_modified(*b_ob)? *b_ob: b_ob->data();
                                mesh_map.set_recalc(key);
                        }
                }
@@ -215,6 +215,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
                        render_layer.holdout_layer = 0;
                        render_layer.material_override = PointerRNA_NULL;
                        render_layer.use_background = true;
+                       render_layer.use_viewport_visibility = true;
                        render_layer.samples = 0;
                        return;
                }
@@ -234,6 +235,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
                        render_layer.layer |= render_layer.holdout_layer;
                        render_layer.material_override = b_rlay->material_override();
                        render_layer.use_background = b_rlay->use_sky();
+                       render_layer.use_viewport_visibility = false;
                        render_layer.samples = b_rlay->samples();
                }
 
index d6a7218f74f793294aa31e1ef9f56aa23539ab9f..10afd468850cd530c4b8ed18da8795b8b4263cf0 100644 (file)
@@ -88,7 +88,7 @@ private:
 
        /* util */
        void find_shader(BL::ID id, vector<uint>& used_shaders, int default_shader);
-       bool object_is_modified(BL::Object b_ob);
+       bool BKE_object_is_modified(BL::Object b_ob);
        bool object_is_mesh(BL::Object b_ob);
        bool object_is_light(BL::Object b_ob);
 
@@ -113,6 +113,7 @@ private:
                : scene_layer(0), layer(0), holdout_layer(0),
                  material_override(PointerRNA_NULL),
                  use_background(true),
+                 use_viewport_visibility(false),
                  samples(0)
                {}
 
@@ -122,6 +123,7 @@ private:
                uint holdout_layer;
                BL::Material material_override;
                bool use_background;
+               bool use_viewport_visibility;
                int samples;
        } render_layer;
 };
index 9184e14bc7608ece419cbe47a5714d95b7b70884..b01fa81ee40750ab1fbcda4d9608d5acea371498 100644 (file)
@@ -91,12 +91,12 @@ static inline void object_free_duplilist(BL::Object self)
        rna_Object_free_duplilist(self.ptr.data, NULL);
 }
 
-static inline bool object_is_modified(BL::Object self, BL::Scene scene, bool preview)
+static inline bool BKE_object_is_modified(BL::Object self, BL::Scene scene, bool preview)
 {
        return rna_Object_is_modified(self.ptr.data, scene.ptr.data, (preview)? (1<<0): (1<<1))? true: false;
 }
 
-static inline bool object_is_deform_modified(BL::Object self, BL::Scene scene, bool preview)
+static inline bool BKE_object_is_deform_modified(BL::Object self, BL::Scene scene, bool preview)
 {
        return rna_Object_is_deform_modified(self.ptr.data, scene.ptr.data, (preview)? (1<<0): (1<<1))? true: false;
 }
index d865426304abc7d8b56afb5494eac425c2560fb7..28237aea611b0b82ab12263e8e57819a707422d3 100644 (file)
@@ -36,12 +36,12 @@ CCL_NAMESPACE_BEGIN
 
 class BVHBuildTask : public Task {
 public:
-       BVHBuildTask(InnerNode *node_, int child_, BVHObjectBinning& range_, int level_)
-       : node(node_), child(child_), level(level_), range(range_) {}
+       BVHBuildTask(BVHBuild *build, InnerNode *node, int child, BVHObjectBinning& range_, int level)
+       : range(range_)
+       {
+               run = function_bind(&BVHBuild::thread_build_node, build, node, child, &range, level);
+       }
 
-       InnerNode *node;
-       int child;
-       int level;
        BVHObjectBinning range;
 };
 
@@ -55,8 +55,7 @@ BVHBuild::BVHBuild(const vector<Object*>& objects_,
   prim_object(prim_object_),
   params(params_),
   progress(progress_),
-  progress_start_time(0.0),
-  task_pool(function_bind(&BVHBuild::thread_build_node, this, _1, _2))
+  progress_start_time(0.0)
 {
        spatial_min_overlap = 0.0f;
 }
@@ -177,7 +176,7 @@ BVHNode* BVHBuild::run()
                /* multithreaded binning build */
                BVHObjectBinning rootbin(root, (references.size())? &references[0]: NULL);
                rootnode = build_node(rootbin, 0);
-               task_pool.wait();
+               task_pool.wait_work();
        }
 
        /* delete if we cancelled */
@@ -210,25 +209,24 @@ void BVHBuild::progress_update()
        progress_start_time = time_dt(); 
 }
 
-void BVHBuild::thread_build_node(Task *task_, int thread_id)
+void BVHBuild::thread_build_node(InnerNode *inner, int child, BVHObjectBinning *range, int level)
 {
        if(progress.get_cancel())
                return;
 
        /* build nodes */
-       BVHBuildTask *task = (BVHBuildTask*)task_;
-       BVHNode *node = build_node(task->range, task->level);
+       BVHNode *node = build_node(*range, level);
 
        /* set child in inner node */
-       task->node->children[task->child] = node;
+       inner->children[child] = node;
 
        /* update progress */
-       if(task->range.size() < THREAD_TASK_SIZE) {
+       if(range->size() < THREAD_TASK_SIZE) {
                /*rotate(node, INT_MAX, 5);*/
 
                thread_scoped_lock lock(build_mutex);
 
-               progress_count += task->range.size();
+               progress_count += range->size();
                progress_update();
        }
 }
@@ -262,8 +260,8 @@ BVHNode* BVHBuild::build_node(const BVHObjectBinning& range, int level)
                /* threaded build */
                inner = new InnerNode(range.bounds());
 
-               task_pool.push(new BVHBuildTask(inner, 0, left, level + 1), true);
-               task_pool.push(new BVHBuildTask(inner, 1, right, level + 1), true);
+               task_pool.push(new BVHBuildTask(this, inner, 0, left, level + 1), true);
+               task_pool.push(new BVHBuildTask(this, inner, 1, right, level + 1), true);
        }
 
        return inner;
index 84e14632b4b34ce099e499f9e7b82f496ec69e8c..44ef918b3269fe0c187e42caa4f9a9c89a29ff99 100644 (file)
@@ -29,7 +29,9 @@
 
 CCL_NAMESPACE_BEGIN
 
+class BVHBuildTask;
 class BVHParams;
+class InnerNode;
 class Mesh;
 class Object;
 class Progress;
@@ -54,6 +56,7 @@ protected:
        friend class BVHMixedSplit;
        friend class BVHObjectSplit;
        friend class BVHSpatialSplit;
+       friend class BVHBuildTask;
 
        /* adding references */
        void add_reference_mesh(BoundBox& root, BoundBox& center, Mesh *mesh, int i);
@@ -68,7 +71,7 @@ protected:
 
        /* threads */
        enum { THREAD_TASK_SIZE = 4096 };
-       void thread_build_node(Task *task_, int thread_id);
+       void thread_build_node(InnerNode *node, int child, BVHObjectBinning *range, int level);
        thread_mutex build_mutex;
 
        /* progress */
index ec84047c44fe8e9fb88489de27a72f810b85cc91..07988d32aff4a4d83c9c8cac9d80cd63dae8ec1e 100644 (file)
@@ -44,7 +44,6 @@ public:
        KernelGlobals *kg;
        
        CPUDevice(int threads_num)
-       : task_pool(function_bind(&CPUDevice::thread_run, this, _1, _2))
        {
                kg = kernel_globals_create();
 
@@ -113,10 +112,8 @@ public:
 #endif
        }
 
-       void thread_run(Task *task_, int thread_id)
+       void thread_run(DeviceTask *task)
        {
-               DeviceTask *task = (DeviceTask*)task_;
-
                if(task->type == DeviceTask::PATH_TRACE)
                        thread_path_trace(*task);
                else if(task->type == DeviceTask::TONEMAP)
@@ -125,6 +122,15 @@ public:
                        thread_shader(*task);
        }
 
+       class CPUDeviceTask : public DeviceTask {
+       public:
+               CPUDeviceTask(CPUDevice *device, DeviceTask& task)
+               : DeviceTask(task)
+               {
+                       run = function_bind(&CPUDevice::thread_run, device, this);
+               }
+       };
+
        void thread_path_trace(DeviceTask& task)
        {
                if(task_pool.cancelled())
@@ -226,12 +232,12 @@ public:
                task.split(tasks, TaskScheduler::num_threads()*10);
 
                foreach(DeviceTask& task, tasks)
-                       task_pool.push(new DeviceTask(task));
+                       task_pool.push(new CPUDeviceTask(this, task));
        }
 
        void task_wait()
        {
-               task_pool.wait();
+               task_pool.wait_work();
        }
 
        void task_cancel()
index e4b10f6151c51ccda00c30326cf6be28a5c28633..aed26f5e852d8898fcf3608a205782d56cef1a5d 100644 (file)
@@ -134,7 +134,20 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa
 
 /* Environment Camera */
 
-__device void camera_sample_environment(KernelGlobals *kg, float raster_x, float raster_y, Ray *ray)
+__device float3 panorama_to_direction(KernelGlobals *kg, float u, float v)
+{
+       switch(kernel_data.cam.panorama_type) {
+               case PANORAMA_EQUIRECTANGULAR:
+                       return equirectangular_to_direction(u, v);
+               case PANORAMA_FISHEYE_EQUIDISTANT:
+                       return fisheye_to_direction(u, v, kernel_data.cam.fisheye_fov);
+               case PANORAMA_FISHEYE_EQUISOLID:
+               default:
+                       return fisheye_equisolid_to_direction(u, v, kernel_data.cam.fisheye_lens, kernel_data.cam.fisheye_fov, kernel_data.cam.sensorwidth, kernel_data.cam.sensorheight);
+       }
+}
+
+__device void camera_sample_panorama(KernelGlobals *kg, float raster_x, float raster_y, Ray *ray)
 {
        Transform rastertocamera = kernel_data.cam.rastertocamera;
        float3 Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y, 0.0f));
@@ -143,6 +156,21 @@ __device void camera_sample_environment(KernelGlobals *kg, float raster_x, float
        ray->P = make_float3(0.0f, 0.0f, 0.0f);
        ray->D = equirectangular_to_direction(Pcamera.x, Pcamera.y);
 
+#ifdef __CAMERA_CLIPPING__
+       /* clipping */
+       ray->t = kernel_data.cam.cliplength;
+#else
+       ray->t = FLT_MAX;
+#endif
+
+       ray->D = panorama_to_direction(kg, Pcamera.x, Pcamera.y);
+
+       /* indicates ray should not receive any light, outside of the lens */
+       if(len_squared(ray->D) == 0.0f) {
+               ray->t = 0.0f;
+               return;
+       }
+
        /* transform ray from camera to world */
        Transform cameratoworld = kernel_data.cam.cameratoworld;
 
@@ -161,11 +189,10 @@ __device void camera_sample_environment(KernelGlobals *kg, float raster_x, float
        ray->dP.dy = make_float3(0.0f, 0.0f, 0.0f);
 
        Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x + 1.0f, raster_y, 0.0f));
-       ray->dD.dx = normalize(transform_direction(&cameratoworld, equirectangular_to_direction(Pcamera.x, Pcamera.y))) - ray->D;
+       ray->dD.dx = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))) - ray->D;
 
        Pcamera = transform_perspective(&rastertocamera, make_float3(raster_x, raster_y + 1.0f, 0.0f));
-       ray->dD.dy = normalize(transform_direction(&cameratoworld, equirectangular_to_direction(Pcamera.x, Pcamera.y))) - ray->D;
-#endif
+       ray->dD.dy = normalize(transform_direction(&cameratoworld, panorama_to_direction(kg, Pcamera.x, Pcamera.y))) - ray->D;
 
 #ifdef __CAMERA_CLIPPING__
        /* clipping */
index 68f007cfd97a12495499df86d0b5ebd6f1b5a3fb..f51ce263ea2d7bb034a5ffa67af699228dde5856 100644 (file)
@@ -91,8 +91,8 @@ __device_inline void sample_uniform_hemisphere(const float3 N,
                                                                                         float3 *omega_in, float *pdf)
 {
        float z = randu;
-       float r = sqrtf(max(0.f, 1.f - z*z));
-       float phi = 2.f * M_PI_F * randv;
+       float r = sqrtf(max(0.0f, 1.0f - z*z));
+       float phi = 2.0f * M_PI_F * randv;
        float x = r * cosf(phi);
        float y = r * sinf(phi);
 
@@ -224,6 +224,53 @@ __device float3 equirectangular_to_direction(float u, float v)
                cos(theta));
 }
 
+/* Fisheye <- Cartesian direction */
+
+__device float3 fisheye_to_direction(float u, float v, float fov)
+{
+       u = (u - 0.5f) * 2.0f;
+       v = (v - 0.5f) * 2.0f;
+
+       float r = sqrt(u*u + v*v);
+
+       if(r > 1.0f)
+               return make_float3(0.0f, 0.0f, 0.0f);
+
+       float phi = acosf((r != 0.0f)? u/r: 0.0f);
+       float theta = asinf(r) * (fov / M_PI_F);
+
+       if(v < 0.0f) phi = -phi;
+
+       return make_float3(
+                cosf(theta),
+                -cosf(phi)*sinf(theta),
+                sinf(phi)*sinf(theta)
+       );
+}
+
+__device float3 fisheye_equisolid_to_direction(float u, float v, float lens, float fov, float width, float height)
+{
+       u = (u - 0.5f) * width;
+       v = (v - 0.5f) * height;
+
+       float rmax = 2.0f * lens * sinf(fov * 0.25f);
+       float r = sqrt(u*u + v*v);
+
+       if(r > rmax)
+               return make_float3(0.0f, 0.0f, 0.0f);
+
+       float phi = acosf((r != 0.0f)? u/r: 0.0f);
+       float theta = 2.0f * asinf(r/(2.0f * lens));
+
+       if(v < 0.0f) phi = -phi;
+
+       return make_float3(
+                cosf(theta),
+                -cosf(phi)*sinf(theta),
+                sinf(phi)*sinf(theta)
+       );
+}
+
 /* Mirror Ball <-> Cartesion direction */
 
 __device float3 mirrorball_to_direction(float u, float v)
index 78b8f06c7b468cb419eb1ace34053fbea5276a02..3e6052338c0c65d617dae1ab85f99e5ce2ac7721 100644 (file)
@@ -324,8 +324,10 @@ bool ImageManager::file_load_float_image(Image *img, device_vector<float4>& tex_
        return true;
 }
 
-void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int slot)
+void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int slot, Progress *progress)
 {
+       if(progress->get_cancel())
+               return;
        if(osl_texture_system)
                return;
 
@@ -342,6 +344,9 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
        }
 
        if(is_float) {
+               string filename = path_filename(float_images[slot]->filename);
+               progress->set_status("Updating Images", "Loading " + filename);
+
                device_vector<float4>& tex_img = dscene->tex_float_image[slot - TEX_IMAGE_FLOAT_START];
 
                if(tex_img.device_pointer)
@@ -365,6 +370,9 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
                device->tex_alloc(name.c_str(), tex_img, true, true);
        }
        else {
+               string filename = path_filename(images[slot]->filename);
+               progress->set_status("Updating Images", "Loading " + filename);
+
                device_vector<uchar4>& tex_img = dscene->tex_image[slot];
 
                if(tex_img.device_pointer)
@@ -387,6 +395,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
 
                device->tex_alloc(name.c_str(), tex_img, true, true);
        }
+
+       img->need_load = false;
 }
 
 void ImageManager::device_free_image(Device *device, DeviceScene *dscene, int slot)
@@ -431,39 +441,37 @@ void ImageManager::device_update(Device *device, DeviceScene *dscene, Progress&
 {
        if(!need_update)
                return;
+       
+       TaskPool pool;
 
        for(size_t slot = 0; slot < images.size(); slot++) {
-               if(images[slot]) {
-                       if(images[slot]->users == 0) {
-                               device_free_image(device, dscene, slot);
-                       }
-                       else if(images[slot]->need_load) {
-                               string name = path_filename(images[slot]->filename);
-                               progress.set_status("Updating Images", "Loading " + name);
-                               device_load_image(device, dscene, slot);
-                               images[slot]->need_load = false;
-                       }
+               if(!images[slot])
+                       continue;
 
-                       if(progress.get_cancel()) return;
+               if(images[slot]->users == 0) {
+                       device_free_image(device, dscene, slot);
+               }
+               else if(images[slot]->need_load) {
+                       if(!osl_texture_system) 
+                               pool.push(function_bind(&ImageManager::device_load_image, this, device, dscene, slot, &progress));
                }
        }
 
        for(size_t slot = 0; slot < float_images.size(); slot++) {
-               if(float_images[slot]) {
-                       if(float_images[slot]->users == 0) {
-                               device_free_image(device, dscene, slot + TEX_IMAGE_FLOAT_START);
-                       }
-                       else if(float_images[slot]->need_load) {
-                               string name = path_filename(float_images[slot]->filename);
-                               progress.set_status("Updating Images", "Loading " + name);
-                               device_load_image(device, dscene, slot + TEX_IMAGE_FLOAT_START);
-                               float_images[slot]->need_load = false;
-                       }
+               if(!float_images[slot])
+                       continue;
 
-                       if(progress.get_cancel()) return;
+               if(float_images[slot]->users == 0) {
+                       device_free_image(device, dscene, slot + TEX_IMAGE_FLOAT_START);
+               }
+               else if(float_images[slot]->need_load) {
+                       if(!osl_texture_system) 
+                               pool.push(function_bind(&ImageManager::device_load_image, this, device, dscene, slot + TEX_IMAGE_FLOAT_START, &progress));
                }
        }
 
+       pool.wait_work();
+
        need_update = false;
 }
 
index d789e6885e3a6f420c955c53b0fb43af3ea681b5..cc01b4a8e4cbbe9458aabd0d584bf963741f01de 100644 (file)
@@ -65,7 +65,7 @@ private:
        bool file_load_image(Image *img, device_vector<uchar4>& tex_img);
        bool file_load_float_image(Image *img, device_vector<float4>& tex_img);
 
-       void device_load_image(Device *device, DeviceScene *dscene, int slot);
+       void device_load_image(Device *device, DeviceScene *dscene, int slot, Progress *progess);
        void device_free_image(Device *device, DeviceScene *dscene, int slot);
 };
 
index 5d96611ff26a3c7e9918c43468dec49f171dcb2e..0422f97a7066dfd46fe4df303dbfd2c97c979520 100644 (file)
@@ -242,31 +242,47 @@ void Mesh::pack_verts(float4 *tri_verts, float4 *tri_vindex, size_t vert_offset)
        }
 }
 
-void Mesh::compute_bvh(SceneParams *params, Progress& progress)
+void Mesh::compute_bvh(SceneParams *params, Progress *progress, int n, int total)
 {
-       Object object;
-       object.mesh = this;
+       if(progress->get_cancel())
+               return;
 
-       vector<Object*> objects;
-       objects.push_back(&object);
+       compute_bounds();
 
-       if(bvh && !need_update_rebuild) {
-               progress.set_substatus("Refitting BVH");
-               bvh->objects = objects;
-               bvh->refit(progress);
-       }
-       else {
-               progress.set_substatus("Building BVH");
+       if(!transform_applied) {
+               string msg = "Updating Mesh BVH ";
+               if(name == "")
+                       msg += string_printf("%u/%u", (uint)(n+1), (uint)total);
+               else
+                       msg += string_printf("%s %u/%u", name.c_str(), (uint)(n+1), (uint)total);
+
+               Object object;
+               object.mesh = this;
+
+               vector<Object*> objects;
+               objects.push_back(&object);
 
-               BVHParams bparams;
-               bparams.use_cache = params->use_bvh_cache;
-               bparams.use_spatial_split = params->use_bvh_spatial_split;
-               bparams.use_qbvh = params->use_qbvh;
+               if(bvh && !need_update_rebuild) {
+                       progress->set_status(msg, "Refitting BVH");
+                       bvh->objects = objects;
+                       bvh->refit(*progress);
+               }
+               else {
+                       progress->set_status(msg, "Building BVH");
+
+                       BVHParams bparams;
+                       bparams.use_cache = params->use_bvh_cache;
+                       bparams.use_spatial_split = params->use_bvh_spatial_split;
+                       bparams.use_qbvh = params->use_qbvh;
 
-               delete bvh;
-               bvh = BVH::create(bparams, objects);
-               bvh->build(progress);
+                       delete bvh;
+                       bvh = BVH::create(bparams, objects);
+                       bvh->build(*progress);
+               }
        }
+
+       need_update = false;
+       need_update_rebuild = false;
 }
 
 void Mesh::tag_update(Scene *scene, bool rebuild)
@@ -686,35 +702,22 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
        }
 
        /* update bvh */
-       size_t i = 0, num_instance_bvh = 0;
+       size_t i = 0, num_bvh = 0;
 
        foreach(Mesh *mesh, scene->meshes)
                if(mesh->need_update && !mesh->transform_applied)
-                       num_instance_bvh++;
+                       num_bvh++;
+
+       TaskPool pool;
 
        foreach(Mesh *mesh, scene->meshes) {
                if(mesh->need_update) {
-                       mesh->compute_bounds();
-
-                       if(!mesh->transform_applied) {
-                               string msg = "Updating Mesh BVH ";
-                               if(mesh->name == "")
-                                       msg += string_printf("%u/%u", (uint)(i+1), (uint)num_instance_bvh);
-                               else
-                                       msg += string_printf("%s %u/%u", mesh->name.c_str(), (uint)(i+1), (uint)num_instance_bvh);
-                               progress.set_status(msg, "Building BVH");
-
-                               mesh->compute_bvh(&scene->params, progress);
-
-                               i++;
-                       }
-
-                       if(progress.get_cancel()) return;
-
-                       mesh->need_update = false;
-                       mesh->need_update_rebuild = false;
+                       pool.push(function_bind(&Mesh::compute_bvh, mesh, &scene->params, &progress, i, num_bvh));
+                       i++;
                }
        }
+
+       pool.wait_work();
        
        foreach(Shader *shader, scene->shaders)
                shader->need_update_attributes = false;
index 047a2d2624d420a22f9bc3b1696b98dc785230e4..637143f5adf41916f8e67723d3d7a9a0c69a96a9 100644 (file)
@@ -96,7 +96,7 @@ public:
 
        void pack_normals(Scene *scene, float4 *normal, float4 *vnormal);
        void pack_verts(float4 *tri_verts, float4 *tri_vindex, size_t vert_offset);
-       void compute_bvh(SceneParams *params, Progress& progress);
+       void compute_bvh(SceneParams *params, Progress *progress, int n, int total);
 
        bool need_attribute(Scene *scene, AttributeStandard std);
        bool need_attribute(Scene *scene, ustring name);
index ca6da539884bd34124e5ddde9cefb2de5f00ea6c..8070b60126a88eb416af6e4e89301c79a3543eb1 100644 (file)
@@ -377,6 +377,11 @@ class VIEW3D_MT_view_align(Menu):
         layout.operator("view3d.view_selected")
         layout.operator("view3d.view_center_cursor")
 
+        layout.separator()
+
+        layout.operator("view3d.view_lock_to_active")
+        layout.operator("view3d.view_lock_clear")
+
 
 class VIEW3D_MT_view_align_selected(Menu):
     bl_label = "Align View to Selected"
@@ -1152,7 +1157,7 @@ class VIEW3D_MT_vertex_group(Menu):
         if ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex):
             if ob.vertex_groups.active:
                 layout.separator()
-                layout.operator("object.vertex_group_assign", text="Assign to Active Group")
+                layout.operator("object.vertex_group_assign", text="Assign to Active Group").new = False
                 layout.operator("object.vertex_group_remove_from", text="Remove from Active Group").all = False
                 layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
                 layout.separator()
index 564cd235869679c0038b2884cb413898788c69e9..a326b514f9ac7949bb664b9900cf40dd32ba9541 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 ----------------- */
@@ -122,7 +122,7 @@ void action_groups_add_channel(struct bAction *act, struct bActionGroup *agrp, s
 void action_groups_remove_channel(struct bAction *act, struct FCurve *fcu);
 
 /* Find a group with the given name */
-struct bActionGroup *action_groups_find_named(struct bAction *act, const char name[]);
+struct bActionGroup *BKE_action_group_find_name(struct bAction *act, const char name[]);
 
 /* Clear all 'temp' flags on all groups */
 void action_groups_clear_tempflags(struct bAction *act);
@@ -133,71 +133,71 @@ void action_groups_clear_tempflags(struct bAction *act);
  * Deallocates a pose channel.
  * Does not free the pose channel itself.
  */
-void free_pose_channel(struct bPoseChannel *pchan);
+void BKE_pose_channel_free(struct bPoseChannel *pchan);
 
 /**
  * Removes and deallocates all channels from a pose.
  * Does not free the pose itself.
  */
-void free_pose_channels(struct bPose *pose);
+void BKE_pose_channels_free(struct bPose *pose);
 
 /**
  * Removes the hash for quick lookup of channels, must
  * be done when adding/removing channels.
  */
-void make_pose_channels_hash(struct bPose *pose);
-void free_pose_channels_hash(struct bPose *pose);
+void BKE_pose_channels_hash_make(struct bPose *pose);
+void BKE_pose_channels_hash_free(struct bPose *pose);
 
 /** 
  * Removes and deallocates all data from a pose, and also frees the pose.
  */
-void free_pose(struct bPose *pose);
+void BKE_pose_free(struct bPose *pose);
 
 /**
  * Allocate a new pose on the heap, and copy the src pose and it's channels
  * into the new pose. *dst is set to the newly allocated structure, and assumed to be NULL.
  */ 
-void copy_pose(struct bPose **dst, struct bPose *src, int copyconstraints);
+void BKE_pose_copy_data(struct bPose **dst, struct bPose *src, int copyconstraints);
 
 /**
  * Copy the internal members of each pose channel including constraints
  * and ID-Props, used when duplicating bones in editmode.
  */
-void duplicate_pose_channel_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
+void BKE_pose_channel_copy_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
 
 /**
  * Return a pointer to the pose channel of the given name
  * from this pose.
  */
-struct bPoseChannel *get_pose_channel(const struct bPose *pose, const char *name);
+struct bPoseChannel *BKE_pose_channel_find_name(const struct bPose *pose, const char *name);
 
 /**
  * Return a pointer to the active pose channel from this Object.
  * (Note: Object, not bPose is used here, as we need layer info from Armature)
  */
-struct bPoseChannel *get_active_posechannel(struct Object *ob);
+struct bPoseChannel *BKE_pose_channel_active(struct Object *ob);
 
 /** 
  * Looks to see if the channel with the given name
  * already exists in this pose - if not a new one is
  * allocated and initialized.
  */
-struct bPoseChannel *verify_pose_channel(struct bPose* pose, const char* name);
+struct bPoseChannel *BKE_pose_channel_verify(struct bPose* pose, const char* name);
 
 /* Copy the data from the action-pose (src) into the pose */
 void extract_pose_from_pose(struct bPose *pose, const struct bPose *src);
 
 /* sets constraint flags */
-void update_pose_constraint_flags(struct bPose *pose);
+void BKE_pose_update_constraint_flags(struct bPose *pose);
 
 /* return the name of structure pointed by pose->ikparam */
-const char *get_ikparam_name(struct bPose *pose);
+const char *BKE_pose_ikparam_get_name(struct bPose *pose);
 
 /* allocate and initialize pose->ikparam according to pose->iksolver */
-void init_pose_ikparam(struct bPose *pose);
+void BKE_pose_ikparam_init(struct bPose *pose);
 
 /* initialize a bItasc structure with default value */
-void init_pose_itasc(struct bItasc *itasc);
+void BKE_pose_itasc_init(struct bItasc *itasc);
 
 /* clears BONE_UNKEYED flags for frame changing */
 // XXX to be depreceated for a more general solution in animsys...
@@ -206,10 +206,10 @@ void framechange_poses_clear_unkeyed(void);
 /* Bone Groups API --------------------- */    
 
 /* Adds a new bone-group */
-void pose_add_group(struct Object *ob);
+void BKE_pose_add_group(struct Object *ob);
 
 /* Remove the active bone-group */
-void pose_remove_group(struct Object *ob);
+void BKE_pose_remove_group(struct Object *ob);
 
 /* Assorted Evaluation ----------------- */    
 
@@ -217,9 +217,9 @@ void pose_remove_group(struct Object *ob);
 void what_does_obaction(struct Object *ob, struct Object *workob, struct bPose *pose, struct bAction *act, char groupname[], float cframe);
 
 /* for proxy */
-void copy_pose_result(struct bPose *to, struct bPose *from);
+void BKE_pose_copy_result(struct bPose *to, struct bPose *from);
 /* clear all transforms */
-void rest_pose(struct bPose *pose);
+void BKE_pose_rest(struct bPose *pose);
 
 #ifdef __cplusplus
 };
index dfe3fde17eb0a12653bcd2d2fced31c37909ba3e..b8c2c42f8d537d756d4d12134ef361a8638c997d 100644 (file)
@@ -75,28 +75,28 @@ typedef struct PoseTree
 extern "C" {
 #endif
 
-struct bArmature *add_armature(const char *name);
-struct bArmature *get_armature(struct Object *ob);
-void free_bonelist (struct ListBase *lb);
-void free_armature(struct bArmature *arm);
-void make_local_armature(struct bArmature *arm);
-struct bArmature *copy_armature(struct bArmature *arm);
+struct bArmature *BKE_armature_add(const char *name);
+struct bArmature *BKE_armature_from_object(struct Object *ob);
+void BKE_armature_bonelist_free (struct ListBase *lb);
+void BKE_armature_free(struct bArmature *arm);
+void BKE_armature_make_local(struct bArmature *arm);
+struct bArmature *BKE_armature_copy(struct bArmature *arm);
 
 /* Bounding box. */
-struct BoundBox *BKE_armature_get_bb(struct Object *ob);
+struct BoundBox *BKE_armature_boundbox_get(struct Object *ob);
 
 int bone_autoside_name (char name[64], int strip_number, short axis, float head, float tail);
 
-struct Bone *get_named_bone (struct bArmature *arm, const char *name);
+struct Bone *BKE_armature_find_bone_name (struct bArmature *arm, const char *name);
 
 float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float r1, float r2, float rdist);
 
-void where_is_armature (struct bArmature *arm);
-void where_is_armature_bone(struct Bone *bone, struct Bone *prevbone);
-void armature_rebuild_pose(struct Object *ob, struct bArmature *arm);
-void where_is_pose (struct Scene *scene, struct Object *ob);
-void where_is_pose_bone(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime, int do_extra);
-void where_is_pose_bone_tail(struct bPoseChannel *pchan);
+void BKE_armature_where_is(struct bArmature *arm);
+void BKE_armature_where_is_bone(struct Bone *bone, struct Bone *prevbone);
+void BKE_pose_rebuild(struct Object *ob, struct bArmature *arm);
+void BKE_pose_where_is(struct Scene *scene, struct Object *ob);
+void BKE_pose_where_is_bone(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime, int do_extra);
+void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan);
 
 /* get_objectspace_bone_matrix has to be removed still */
 void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int root, int posed);
@@ -106,23 +106,23 @@ void mat3_to_vec_roll(float mat[][3], float *vec, float *roll);
 int get_selected_defgroups(struct Object *ob, char *defbase_sel, int defbase_len);
 
 /* Common Conversions Between Co-ordinate Spaces */
-void armature_mat_world_to_pose(struct Object *ob, float inmat[][4], float outmat[][4]);
-void armature_loc_world_to_pose(struct Object *ob, const float inloc[3], float outloc[3]);
-void armature_mat_pose_to_bone(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
-void armature_loc_pose_to_bone(struct bPoseChannel *pchan, const float inloc[3], float outloc[3]);
-void armature_mat_bone_to_pose(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
-void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4]);
+void BKE_armature_mat_world_to_pose(struct Object *ob, float inmat[][4], float outmat[][4]);
+void BKE_armature_loc_world_to_pose(struct Object *ob, const float inloc[3], float outloc[3]);
+void BKE_armature_mat_pose_to_bone(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
+void BKE_armature_loc_pose_to_bone(struct bPoseChannel *pchan, const float inloc[3], float outloc[3]);
+void BKE_armature_mat_bone_to_pose(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
+void BKE_armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4]);
 
-void armature_mat_pose_to_bone_ex(struct Object *ob, struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
+void BKE_armature_mat_pose_to_bone_ex(struct Object *ob, struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
 
-void pchan_mat3_to_rot(struct bPoseChannel *pchan, float mat[][3], short use_compat);
-void pchan_apply_mat4(struct bPoseChannel *pchan, float mat[][4], short use_comat);
-void pchan_to_mat4(struct bPoseChannel *pchan, float chan_mat[4][4]);
-void pchan_calc_mat(struct bPoseChannel *pchan);
+void BKE_pchan_mat3_to_rot(struct bPoseChannel *pchan, float mat[][3], short use_compat);
+void BKE_pchan_apply_mat4(struct bPoseChannel *pchan, float mat[][4], short use_comat);
+void BKE_pchan_to_mat4(struct bPoseChannel *pchan, float chan_mat[4][4]);
+void BKE_pchan_calc_mat(struct bPoseChannel *pchan);
 
 /* Get the "pchan to pose" transform matrix. These matrices apply the effects of
  * HINGE/NO_SCALE/NO_LOCAL_LOCATION options over the pchan loc/rot/scale transformations. */
-void pchan_to_pose_mat(struct bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4]);
+void BKE_pchan_to_pose_mat(struct bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4]);
 
 /* Rotation Mode Conversions - Used for PoseChannels + Objects... */
 void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode);
index 52666ca1538d08d6e93c8430d48481be00d6e58a..b5edc8f3e50c0e0788875d681c3cbf2c3f80ed61 100644 (file)
@@ -41,34 +41,34 @@ struct wmOperator;
 // enum CurveMappingPreset;
 
 /* datablock functions */
-struct Brush *add_brush(const char *name);
-struct Brush *copy_brush(struct Brush *brush);
-void make_local_brush(struct Brush *brush);
-void free_brush(struct Brush *brush);
+struct Brush *BKE_brush_add(const char *name);
+struct Brush *BKE_brush_copy(struct Brush *brush);
+void BKE_brush_make_local(struct Brush *brush);
+void BKE_brush_free(struct Brush *brush);
 
-void brush_reset_sculpt(struct Brush *brush);
+void BKE_brush_sculpt_reset(struct Brush *brush);
 
 /* image icon function */
 struct ImBuf *get_brush_icon(struct Brush *brush);
 
 /* brush library operations used by different paint panels */
-int brush_texture_set_nr(struct Brush *brush, int nr);
-int brush_texture_delete(struct Brush *brush);
-int brush_clone_image_set_nr(struct Brush *brush, int nr);
-int brush_clone_image_delete(struct Brush *brush);
+int BKE_brush_texture_set_nr(struct Brush *brush, int nr);
+int BKE_brush_texture_delete(struct Brush *brush);
+int BKE_brush_clone_image_set_nr(struct Brush *brush, int nr);
+int BKE_brush_clone_image_delete(struct Brush *brush);
 
 /* jitter */
-void brush_jitter_pos(const struct Scene *scene, struct Brush *brush,
+void BKE_brush_jitter_pos(const struct Scene *scene, struct Brush *brush,
                       const float pos[2], float jitterpos[2]);
 
 /* brush curve */
-void brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset);
-float brush_curve_strength_clamp(struct Brush *br, float p, const float len);
-float brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
+void BKE_brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset);
+float BKE_brush_curve_strength_clamp(struct Brush *br, float p, const float len);
+float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
 
 /* sampling */
-void brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread);
-void brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
+void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread);
+void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
        struct ImBuf **imbuf, int use_color_correction);
 
 /* painting */
@@ -76,48 +76,48 @@ struct BrushPainter;
 typedef struct BrushPainter BrushPainter;
 typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, const float lastpos[2], const float pos[2]);
 
-BrushPainter *brush_painter_new(struct Scene *scene, struct Brush *brush);
-void brush_painter_require_imbuf(BrushPainter *painter, short flt,
+BrushPainter *BKE_brush_painter_new(struct Scene *scene, struct Brush *brush);
+void BKE_brush_painter_require_imbuf(BrushPainter *painter, short flt,
                                  short texonly, int size);
-int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2],
+int BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2],
                         double time, float pressure, void *user, int use_color_correction);
-void brush_painter_break_stroke(BrushPainter *painter);
-void brush_painter_free(BrushPainter *painter);
+void BKE_brush_painter_break_stroke(BrushPainter *painter);
+void BKE_brush_painter_free(BrushPainter *painter);
 
 /* texture */
-unsigned int *brush_gen_texture_cache(struct Brush *br, int half_side);
+unsigned int *BKE_brush_gen_texture_cache(struct Brush *br, int half_side);
 
 /* radial control */
-struct ImBuf *brush_gen_radial_control_imbuf(struct Brush *br);
+struct ImBuf *BKE_brush_gen_radial_control_imbuf(struct Brush *br);
 
 /* unified strength and size */
 
-int  brush_size(const struct Scene *scene, struct Brush *brush);
-void brush_set_size(struct Scene *scene, struct Brush *brush, int value);
+int  BKE_brush_size_get(const struct Scene *scene, struct Brush *brush);
+void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int value);
 
-float brush_unprojected_radius(const struct Scene *scene, struct Brush *brush);
-void  brush_set_unprojected_radius(struct Scene *scene, struct Brush *brush, float value);
+float BKE_brush_unprojected_radius_get(const struct Scene *scene, struct Brush *brush);
+void  BKE_brush_unprojected_radius_set(struct Scene *scene, struct Brush *brush, float value);
 
-float brush_alpha(const struct Scene *scene, struct Brush *brush);
-float brush_weight(const Scene *scene, struct Brush *brush);
-void brush_set_weight(const Scene *scene, struct Brush *brush, float value);
+float BKE_brush_alpha_get(const struct Scene *scene, struct Brush *brush);
+float BKE_brush_weight_get(const Scene *scene, struct Brush *brush);
+void BKE_brush_weight_set(const Scene *scene, struct Brush *brush, float value);
 
-int  brush_use_locked_size(const struct Scene *scene, struct Brush *brush);
-int  brush_use_alpha_pressure(const struct Scene *scene, struct Brush *brush);
-int  brush_use_size_pressure(const struct Scene *scene, struct Brush *brush);
+int  BKE_brush_use_locked_size(const struct Scene *scene, struct Brush *brush);
+int  BKE_brush_use_alpha_pressure(const struct Scene *scene, struct Brush *brush);
+int  BKE_brush_use_size_pressure(const struct Scene *scene, struct Brush *brush);
 
 /* scale unprojected radius to reflect a change in the brush's 2D size */
-void brush_scale_unprojected_radius(float *unprojected_radius,
+void BKE_brush_scale_unprojected_radius(float *unprojected_radius,
                                                                        int new_brush_size,
                                                                        int old_brush_size);
 
 /* scale brush size to reflect a change in the brush's unprojected radius */
-void brush_scale_size(int *brush_size,
+void BKE_brush_scale_size(int *BKE_brush_size_get,
                                          float new_unprojected_radius,
                                          float old_unprojected_radius);
 
 /* debugging only */
-void brush_debug_print_state(struct Brush *br);
+void BKE_brush_debug_print_state(struct Brush *br);
 
 #endif
 
index 6d10219e74c5daa378e8b1b9770123089be3cd86..8f68d7abcacb8883fa722921dac4b7e8d0e4109a 100644 (file)
@@ -48,18 +48,18 @@ struct View3D;
 
 /* Camera Datablock */
 
-void *add_camera(const char *name);
-struct Camera *copy_camera(struct Camera *cam);
-void make_local_camera(struct Camera *cam);
-void free_camera(struct Camera *ca);
+void *BKE_camera_add(const char *name);
+struct Camera *BKE_camera_copy(struct Camera *cam);
+void BKE_camera_make_local(struct Camera *cam);
+void BKE_camera_free(struct Camera *ca);
 
 /* Camera Usage */
 
-float object_camera_dof_distance(struct Object *ob);
-void object_camera_mode(struct RenderData *rd, struct Object *ob);
+float BKE_camera_object_dof_distance(struct Object *ob);
+void BKE_camera_object_mode(struct RenderData *rd, struct Object *ob);
 
-int camera_sensor_fit(int sensor_fit, float sizex, float sizey);
-float camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y);
+int BKE_camera_sensor_fit(int sensor_fit, float sizex, float sizey);
+float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y);
 
 /* Camera Parameters:
  *
@@ -102,21 +102,21 @@ typedef struct CameraParams {
        float winmat[4][4];
 } CameraParams;
 
-void camera_params_init(CameraParams *params);
-void camera_params_from_object(CameraParams *params, struct Object *camera);
-void camera_params_from_view3d(CameraParams *params, struct View3D *v3d, struct RegionView3D *rv3d);
+void BKE_camera_params_init(CameraParams *params);
+void BKE_camera_params_from_object(CameraParams *params, struct Object *camera);
+void BKE_camera_params_from_view3d(CameraParams *params, struct View3D *v3d, struct RegionView3D *rv3d);
 
-void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy);
-void camera_params_compute_matrix(CameraParams *params);
+void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy);
+void BKE_camera_params_compute_matrix(CameraParams *params);
 
 /* Camera View Frame */
 
-void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3],
+void BKE_camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3],
                           float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]);
 
-void camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]);
+void BKE_camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]);
 
-int camera_view_frame_fit_to_scene(
+int BKE_camera_view_frame_fit_to_scene(
         struct Scene *scene, struct View3D *v3d, struct Object *camera_ob,
         float r_co[3]);
 
index f834ad5e77409a3024ca39d891a35a0515b9c932..b12ab5381848175bdab1887d9e0133cf903f34b0 100644 (file)
@@ -62,7 +62,7 @@ typedef struct bConstraintOb {
 /* ---------------------------------------------------------------------------- */
 
 /* Callback format for performing operations on ID-pointers for Constraints */
-typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, void *userdata);
+typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, short isReference, void *userdata);
 
 /* ....... */
 
index 16e98f25e0cb04082ea0e6efdf5ec193d94d0b80..6636a70e94d5de8299a1ecc2ab698be465986a3f 100644 (file)
@@ -71,17 +71,17 @@ typedef struct EditFont {
 } EditFont;
 
 
-void BKE_font_register_builtin(void *mem, int size);
+void BKE_vfont_builtin_register(void *mem, int size);
 
-void free_vfont(struct VFont *sc); 
-void free_ttfont(void);
-struct VFont *get_builtin_font(void);
-struct VFont *load_vfont(struct Main *bmain, const char *name);
-struct TmpFont *vfont_find_tmpfont(struct VFont *vfont);
+void BKE_vfont_free(struct VFont *sc); 
+void BKE_vfont_free_global_ttf(void);
+struct VFont *BKE_vfont_builtin_get(void);
+struct VFont *BKE_vfont_load(struct Main *bmain, const char *name);
+struct TmpFont *BKE_vfont_find_tmpfont(struct VFont *vfont);
 
-struct chartrans *BKE_text_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode);
+struct chartrans *BKE_vfont_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode);
 
-int BKE_font_getselection(struct Object *ob, int *start, int *end);
+int BKE_vfont_select_get(struct Object *ob, int *start, int *end);
 
 #ifdef __cplusplus
 }
index bb0216fe11c253fc1ac19c91d9be060fb4fb1b43..134ec1acd8e997e7bc47e454a67c271855860a22 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 6629f0bdf7f6e5f0c01fd00427abbabc118925ad..ccf9e0cef5b1b10180dedeb0a2358b270a37ef62 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 c2112d1e1695258fc02bddbfe7cb511c01e74fa5..563f066bda64084cfc0913f5febed5af1bc3a384 100644 (file)
@@ -46,14 +46,14 @@ 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_imbuf_stamp_info(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf);
 void   BKE_stamp_buf(struct Scene *scene, struct Object *camera, unsigned char *rect, float *rectf, int width, int height, int channels);
-int            BKE_alphatest_ibuf(struct ImBuf *ibuf);
-int            BKE_write_ibuf_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
-int            BKE_write_ibuf(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
-int     BKE_write_ibuf_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy);
+int            BKE_imbuf_alpha_test(struct ImBuf *ibuf);
+int            BKE_imbuf_write_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
+int            BKE_imbuf_write(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
+int     BKE_imbuf_write_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy);
 void   BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames);
 int            BKE_add_image_extension(char *string, const char imtype);
 char   BKE_ftype_to_imtype(const int ftype);
@@ -72,11 +72,11 @@ void    BKE_imformat_defaults(struct ImageFormatData *im_format);
 
 struct anim *openanim(const char *name, int flags, int streamindex);
 
-void   image_de_interlace(struct Image *ima, int odd);
+void   BKE_image_de_interlace(struct Image *ima, int odd);
 
-void   make_local_image(struct Image *ima);
+void   BKE_image_make_local(struct Image *ima);
 
-void   tag_image_time(struct Image *ima);
+void   BKE_image_tag_time(struct Image *ima);
 void   free_old_images(void);
 
 /* ********************************** NEW IMAGE API *********************** */
@@ -130,13 +130,15 @@ struct ImBuf *BKE_image_get_ibuf(struct Image *ima, struct ImageUser *iuser);
 struct ImBuf *BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **lock_r);
 void BKE_image_release_ibuf(struct Image *ima, void *lock);
 
+/* returns a new image or NULL if it can't load */
+struct Image *BKE_image_load(const char *filepath);
 /* returns existing Image when filename/type is same (frame optional) */
-struct Image *BKE_add_image_file(const char *name);
+struct Image *BKE_image_load_exists(const char *filepath);
 
 /* adds image, adds ibuf, generates color or pattern */
-struct Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
+struct Image *BKE_image_add_generated(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
 /* adds image from imbuf, owns imbuf */
-struct Image *BKE_add_image_imbuf(struct ImBuf *ibuf);
+struct Image *BKE_image_add_from_imbuf(struct ImBuf *ibuf);
 
 /* for reload, refresh, pack */
 void BKE_image_signal(struct Image *ima, struct ImageUser *iuser, int signal);
@@ -148,8 +150,8 @@ struct Image *BKE_image_verify_viewer(int type, const char *name);
 void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf);
 
 /* called on frame change or before render */
-void BKE_image_user_calc_frame(struct ImageUser *iuser, int cfra, int fieldnr);
-int BKE_image_user_get_frame(const struct ImageUser *iuser, int cfra, int fieldnr);
+void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
+int  BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr);
 
 /* sets index offset for multilayer files */
 struct RenderPass *BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser);
@@ -176,7 +178,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 547e7de7634ac2b287c15a6437be3229a76ec8be..ca86e90f192cafebf33c2a703273614d02b24cd3 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 63d9d73109760a6d7e3521729b7d048c764e65bf..757952515e5a3cd9d68f4b893c26c4bac18d414c 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 50e2557632061819533f3e3b227e5b33e5295e29..f9137e50d74a1f382df70042b24d2d900e34c393 100644 (file)
@@ -38,11 +38,11 @@ extern "C" {
 
 struct Lamp;
 
-void *add_lamp(const char *name);
-struct Lamp *copy_lamp(struct Lamp *la);
+void *BKE_lamp_add(const char *name);
+struct Lamp *BKE_lamp_copy(struct Lamp *la);
 struct Lamp *localize_lamp(struct Lamp *la);
-void make_local_lamp(struct Lamp *la);
-void free_lamp(struct Lamp *la);
+void BKE_lamp_make_local(struct Lamp *la);
+void BKE_lamp_free(struct Lamp *la);
 
 #ifdef __cplusplus
 }
index a0075c4d6beb123fad441583200c50283ec15474..9a952fc6b1e40d314b6ec00e19dfcee111669d0f 100644 (file)
@@ -41,11 +41,11 @@ struct DerivedMesh;
 struct BPoint;
 struct MDeformVert;
 
-void resizelattice(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
-struct Lattice *add_lattice(const char *name);
-struct Lattice *copy_lattice(struct Lattice *lt);
-void free_lattice(struct Lattice *lt);
-void make_local_lattice(struct Lattice *lt);
+void BKE_lattice_resize(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
+struct Lattice *BKE_lattice_add(const char *name);
+struct Lattice *BKE_lattice_copy(struct Lattice *lt);
+void BKE_lattice_free(struct Lattice *lt);
+void BKE_lattice_make_local(struct Lattice *lt);
 void calc_lat_fudu(int flag, int res, float *fu, float *du);
 
 void init_latt_deform(struct Object *oblatt, struct Object *ob);
@@ -69,11 +69,11 @@ void armature_deform_verts(struct Object *armOb, struct Object *target,
                            float (*defMats)[3][3], int numVerts, int deformflag,
                            float (*prevCos)[3], const char *defgrp_name);
 
-float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3];
-void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3]);
-void lattice_calc_modifiers(struct Scene *scene, struct Object *ob);
+float (*BKE_lattice_vertexcos_get(struct Object *ob, int *numVerts_r))[3];
+void    BKE_lattice_vertexcos_apply(struct Object *ob, float (*vertexCos)[3]);
+void    BKE_lattice_modifiers_calc(struct Scene *scene, struct Object *ob);
 
-struct MDeformVert* lattice_get_deform_verts(struct Object *lattice);
+struct MDeformVert* BKE_lattice_deform_verts_get(struct Object *lattice);
 
 #endif
 
index be21996428addc1bf28772fa71d735dd4469a0fa..2804eb407db2bcc633344d42a8d836cb6b092133 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);
@@ -81,7 +82,7 @@ void name_uiprefix_id(char *name, struct ID *id);
 void test_idbutton(char *name);
 void text_idbutton(struct ID *id, char *text);
 void BKE_library_make_local(struct Main *bmain, struct Library *lib, int untagged_only);
-struct ID *find_id(const char *type, const char *name);
+struct ID *BKE_libblock_find_name(const short type, const char *name);
 void clear_id_newpoins(void);
 
 void IDnames_to_pupstring(const char **str, const char *title, const char *extraops,
index 99561a687b9955cb19ef3bf5011a805bde9359c1..801724d1d4f83825e7d32f541cd2502edc87854e 100644 (file)
@@ -46,15 +46,15 @@ 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_add(const char *name);
+struct Material *BKE_material_copy(struct Material *ma);
 struct Material *localize_material(struct Material *ma);
 struct Material *give_node_material(struct Material *ma); /* returns node material or self */
-void make_local_material(struct Material *ma);
+void BKE_material_make_local(struct Material *ma);
 void extern_local_matarar(struct Material **matar, short totcol);
 
 void automatname(struct Material *);
index 14cb5d19ddfada47215ef0dd3f526dee27ae8faa..256d4b1cae124c07970f4663bef53d7862f6f272 100644 (file)
@@ -119,18 +119,18 @@ 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);
-struct Mesh *add_mesh(const char *name);
-struct Mesh *copy_mesh(struct Mesh *me);
+void BKE_mesh_free(struct Mesh *me, int unlink);
+struct Mesh *BKE_mesh_add(const char *name);
+struct Mesh *BKE_mesh_copy(struct Mesh *me);
 void mesh_update_customdata_pointers(struct Mesh *me, const short do_ensure_tess_cd);
 
-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);
 void transform_mesh_orco_verts(struct Mesh *me, float (*orco)[3], int totvert, int invert);
 int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr);
-struct Mesh *get_mesh(struct Object *ob);
+struct Mesh *BKE_mesh_from_object(struct Object *ob);
 void set_mesh(struct Object *ob, struct Mesh *me);
 void mball_to_mesh(struct ListBase *lb, struct Mesh *me);
 int nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *totvert,
index 4fced71d7f2bf0c5d3019a679ab7ea103f4a0673..92a447f93510c64e6ffb2bfaa5464acf8348c45e 100644 (file)
@@ -50,64 +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);
-
-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(
@@ -121,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];
@@ -135,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 67dba6fd7a7713883bfec9028800b1a5fe7da2b9..f776295b912bf52d87debf11d62936031495d145 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 e46d99ed873c396780d4f9432a6b9d6165553dc3..3a93562707d904be40fe9ddacceb0f640a783466 100644 (file)
@@ -61,40 +61,44 @@ 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);
-struct Scene *add_scene(const char *name);
-struct Base *object_in_scene(struct Object *ob, struct Scene *sce);
+void BKE_scene_free(struct Scene *sce);
+struct Scene *BKE_scene_add(const char *name);
 
-void set_scene_bg(struct Main *bmain, struct Scene *sce);
-struct Scene *set_scene_name(struct Main *bmain, const char *name);
+/* base functions */
+struct Base *BKE_scene_base_find(struct Scene *scene, struct Object *ob);
+struct Base *BKE_scene_base_add(struct Scene *sce, struct Object *ob);
+void         BKE_scene_base_deselect_all(struct Scene *sce);
+void         BKE_scene_base_select(struct Scene *sce, struct Base *selbase);
+int          BKE_scene_base_iter_next(struct Scene **scene, int val, struct Base **base, struct Object **ob);
 
-struct Scene *copy_scene(struct Scene *sce, int type);
-void unlink_scene(struct Main *bmain, struct Scene *sce, struct Scene *newsce);
+void BKE_scene_base_flag_to_objects(struct Scene *scene);
+void BKE_scene_base_flag_from_objects(struct Scene *scene);
 
-int next_object(struct Scene **scene, int val, struct Base **base, struct Object **ob);
-struct Object *scene_find_camera(struct Scene *sc);
-struct Object *scene_camera_switch_find(struct Scene *scene); // DURIAN_CAMERA_SWITCH
-int scene_camera_switch_update(struct Scene *scene);
+void BKE_scene_set_background(struct Main *bmain, struct Scene *sce);
+struct Scene *BKE_scene_set_name(struct Main *bmain, const char *name);
 
-char *scene_find_marker_name(struct Scene *scene, int frame);
-char *scene_find_last_marker_name(struct Scene *scene, int frame);
+struct Scene *BKE_scene_copy(struct Scene *sce, int type);
+void BKE_scene_unlink(struct Main *bmain, struct Scene *sce, struct Scene *newsce);
 
-struct Base *scene_add_base(struct Scene *sce, struct Object *ob);
-void scene_deselect_all(struct Scene *sce);
-void scene_select_base(struct Scene *sce, struct Base *selbase);
+struct Object *BKE_scene_camera_find(struct Scene *sc);
+struct Object *BKE_scene_camera_switch_find(struct Scene *scene); // DURIAN_CAMERA_SWITCH
+int BKE_scene_camera_switch_update(struct Scene *scene);
+
+char *BKE_scene_find_marker_name(struct Scene *scene, int frame);
+char *BKE_scene_find_last_marker_name(struct Scene *scene, int frame);
 
 /* checks for cycle, returns 1 if it's all OK */
-int scene_check_setscene(struct Main *bmain, struct Scene *sce);
+int BKE_scene_validate_setscene(struct Main *bmain, struct Scene *sce);
 
-float BKE_curframe(struct Scene *scene);
-float BKE_frame_to_ctime(struct Scene *scene, const float frame);
+float BKE_scene_frame_get(struct Scene *scene);
+float BKE_scene_frame_get_from_ctime(struct Scene *scene, const float frame);
 
-void scene_update_tagged(struct Main *bmain, struct Scene *sce);
+void BKE_scene_update_tagged(struct Main *bmain, struct Scene *sce);
 
-void scene_update_for_newframe(struct Main *bmain, struct Scene *sce, unsigned int lay);
+void BKE_scene_update_for_newframe(struct Main *bmain, struct Scene *sce, unsigned int lay);
 
-struct SceneRenderLayer *scene_add_render_layer(struct Scene *sce, const char *name);
-int scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl);
+struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const char *name);
+int BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl);
 
 /* render profile */
 int get_render_subsurf_level(struct RenderData *r, int level);
@@ -102,7 +106,7 @@ int get_render_child_particle_number(struct RenderData *r, int num);
 int get_render_shadow_samples(struct RenderData *r, int samples);
 float get_render_aosss_error(struct RenderData *r, float error);
 
-int scene_use_new_shading_nodes(struct Scene *scene);
+int BKE_scene_use_new_shading_nodes(struct Scene *scene);
 
 #ifdef __cplusplus
 }
index fbb93c761c2b2f4ec41c8a202340ef14fed39517..af6e793cf2f4f26c53935afba27f176945f0fc86 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 8b01dbde531bd6ef856ca77cb91a381e7daa3650..5234f10ddb3b6427fb84e6b5c61dad70aa37ab3a 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 fddcfb2c7f318a19619838ca99f361e84f8819dd..52c177fce57c3e0b560ac3fb5def203688e9dbaf 100644 (file)
@@ -33,9 +33,9 @@
  *  \brief General operations for speakers.
  */
 
-void *add_speaker(const char *name);
-struct Speaker *copy_speaker(struct Speaker *spk);
-void make_local_speaker(struct Speaker *spk);
-void free_speaker(struct Speaker *spk);
+void *BKE_speaker_add(const char *name);
+struct Speaker *BKE_speaker_copy(struct Speaker *spk);
+void BKE_speaker_make_local(struct Speaker *spk);
+void BKE_speaker_free(struct Speaker *spk);
 
 #endif
index b1902c75afbb45c202177bd0fd067ecef6afdb60..592b3d1d2e0f5f8f55e181a69fc9784d36fc17c5 100644 (file)
@@ -42,17 +42,17 @@ 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);
+struct Text*   BKE_text_add    (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);
-void                   clear_text(struct Text *text);
-void                   write_text(struct Text *text, const char *str);
+int                            BKE_text_reload         (struct Text *text);
+struct Text*   BKE_text_load           (const char *file, const char *relpath);
+struct Text*   BKE_text_copy           (struct Text *ta);
+void                   BKE_text_unlink         (struct Main *bmain, struct Text *text);
+void                   BKE_text_clear      (struct Text *text);
+void                   BKE_text_write      (struct Text *text, const char *str);
 
 char*  txt_to_buf                      (struct Text *text);
 void   txt_clean_text          (struct Text *text);
index 2574c45eec2d8588e548429ee1d680b74fbcf528..ed58620b716e5079482790822c049d1f767c70ac 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,9 +79,9 @@ 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 BKE_texture_make_local(struct Tex *tex);
 void autotexname(struct Tex *tex);
 
 struct Tex *give_current_object_texture(struct Object *ob);
index 16ff3acaf7170e21bfd77610fa0a65b1f6e9ac8a..67896fffc4d046623f256a68d58f6ef31368362e 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 74373d28c1443e002065d1606d14ff08a891ca28..34dee93d95ab6ef1beb3c738258647f2c861cf45 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 5a2407ca56bbbb14d2e8ca407b9d1a51312457f9..90cfb9a1d8251c95cc617ef22713fabe2696ec4d 100644 (file)
@@ -69,7 +69,7 @@
  * - Pose is the local (object level) component of armature. The current
  *   object pose is saved in files, and (will be) is presorted for dependency
  * - Actions have fewer (or other) channels, and write data to a Pose
- * - Currently ob->pose data is controlled in where_is_pose only. The (recalc)
+ * - Currently ob->pose data is controlled in BKE_pose_where_is only. The (recalc)
  *   event system takes care of calling that
  * - The NLA system (here too) uses Poses as interpolation format for Actions
  * - Therefore we assume poses to be static, and duplicates of poses have channels in
@@ -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);
@@ -383,7 +383,7 @@ void action_groups_remove_channel(bAction *act, FCurve *fcu)
 }
 
 /* Find a group with the given name */
-bActionGroup *action_groups_find_named (bAction *act, const char name[])
+bActionGroup *BKE_action_group_find_name (bAction *act, const char name[])
 {
        /* sanity checks */
        if (ELEM3(NULL, act, act->groups.first, name) || (name[0] == 0))
@@ -410,7 +410,7 @@ void action_groups_clear_tempflags(bAction *act)
 /* *************** Pose channels *************** */
 
 /* usually used within a loop, so we got a N^2 slowdown */
-bPoseChannel *get_pose_channel(const bPose *pose, const char *name)
+bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name)
 {
        if (ELEM(NULL, pose, name) || (name[0] == 0))
                return NULL;
@@ -423,7 +423,7 @@ bPoseChannel *get_pose_channel(const bPose *pose, const char *name)
 
 /* Use with care, not on Armature poses but for temporal ones */
 /* (currently used for action constraints and in rebuild_pose) */
-bPoseChannel *verify_pose_channel(bPose *pose, const char *name)
+bPoseChannel *BKE_pose_channel_verify(bPose *pose, const char *name)
 {
        bPoseChannel *chan;
        
@@ -454,13 +454,13 @@ bPoseChannel *verify_pose_channel(bPose *pose, const char *name)
        chan->protectflag = OB_LOCK_ROT4D;      /* lock by components by default */
        
        BLI_addtail(&pose->chanbase, chan);
-       free_pose_channels_hash(pose);
+       BKE_pose_channels_hash_free(pose);
        
        return chan;
 }
 
 /* Find the active posechannel for an object (we can't just use pose, as layer info is in armature) */
-bPoseChannel *get_active_posechannel (Object *ob)
+bPoseChannel *BKE_pose_channel_active (Object *ob)
 {
        bArmature *arm= (ob) ? ob->data : NULL;
        bPoseChannel *pchan;
@@ -478,7 +478,7 @@ bPoseChannel *get_active_posechannel (Object *ob)
        return NULL;
 }
 
-const char *get_ikparam_name(bPose *pose)
+const char *BKE_pose_ikparam_get_name(bPose *pose)
 {
        if (pose) {
                switch (pose->iksolver) {
@@ -491,7 +491,7 @@ const char *get_ikparam_name(bPose *pose)
        return NULL;
 }
 /* dst should be freed already, makes entire duplicate */
-void copy_pose(bPose **dst, bPose *src, int copycon)
+void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon)
 {
        bPose *outPose;
        bPoseChannel *pchan;
@@ -503,7 +503,7 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
        }
        
        if (*dst==src) {
-               printf("copy_pose source and target are the same\n");
+               printf("BKE_pose_copy_data source and target are the same\n");
                *dst=NULL;
                return;
        }
@@ -536,7 +536,7 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
        *dst=outPose;
 }
 
-void init_pose_itasc(bItasc *itasc)
+void BKE_pose_itasc_init(bItasc *itasc)
 {
        if (itasc) {
                itasc->iksolver = IKSOLVER_ITASC;
@@ -553,13 +553,13 @@ void init_pose_itasc(bItasc *itasc)
                itasc->dampeps = 0.15;
        }
 }
-void init_pose_ikparam(bPose *pose)
+void BKE_pose_ikparam_init(bPose *pose)
 {
        bItasc *itasc;
        switch (pose->iksolver) {
        case IKSOLVER_ITASC:
                itasc = MEM_callocN(sizeof(bItasc), "itasc");
-               init_pose_itasc(itasc);
+               BKE_pose_itasc_init(itasc);
                pose->ikparam = itasc;
                break;
        case IKSOLVER_LEGACY:
@@ -569,7 +569,7 @@ void init_pose_ikparam(bPose *pose)
        }
 }
 
-void make_pose_channels_hash(bPose *pose) 
+void BKE_pose_channels_hash_make(bPose *pose) 
 {
        if (!pose->chanhash) {
                bPoseChannel *pchan;
@@ -580,7 +580,7 @@ void make_pose_channels_hash(bPose *pose)
        }
 }
 
-void free_pose_channels_hash(bPose *pose) 
+void BKE_pose_channels_hash_free(bPose *pose) 
 {
        if (pose->chanhash) {
                BLI_ghash_free(pose->chanhash, NULL, NULL);
@@ -589,7 +589,7 @@ void free_pose_channels_hash(bPose *pose)
 }
 
 
-void free_pose_channel(bPoseChannel *pchan)
+void BKE_pose_channel_free(bPoseChannel *pchan)
 {
 
        if (pchan->mpath) {
@@ -605,25 +605,25 @@ void free_pose_channel(bPoseChannel *pchan)
        }
 }
 
-void free_pose_channels(bPose *pose) 
+void BKE_pose_channels_free(bPose *pose) 
 {
        bPoseChannel *pchan;
        
        if (pose->chanbase.first) {
                for (pchan = pose->chanbase.first; pchan; pchan=pchan->next)
-                       free_pose_channel(pchan);
+                       BKE_pose_channel_free(pchan);
                
                BLI_freelistN(&pose->chanbase);
        }
 
-       free_pose_channels_hash(pose);
+       BKE_pose_channels_hash_free(pose);
 }
 
-void free_pose(bPose *pose)
+void BKE_pose_free(bPose *pose)
 {
        if (pose) {
                /* free pose-channels */
-               free_pose_channels(pose);
+               BKE_pose_channels_free(pose);
                
                /* free pose-groups */
                if (pose->agroups.first)
@@ -665,8 +665,8 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan
 
 /* makes copies of internal data, unlike copy_pose_channel_data which only
  * copies the pose state.
- * hint: use when copying bones in editmode (on returned value from verify_pose_channel) */
-void duplicate_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
+ * hint: use when copying bones in editmode (on returned value from BKE_pose_channel_verify) */
+void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
 {
        /* copy transform locks */
        pchan->protectflag = pchan_from->protectflag;
@@ -709,7 +709,7 @@ void duplicate_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *pchan_
  * can do more constraints flags later 
  */
 /* pose should be entirely OK */
-void update_pose_constraint_flags(bPose *pose)
+void BKE_pose_update_constraint_flags(bPose *pose)
 {
        bPoseChannel *pchan, *parchan;
        bConstraint *con;
@@ -792,7 +792,7 @@ void framechange_poses_clear_unkeyed(void)
 /* ************************** Bone Groups ************************** */
 
 /* Adds a new bone-group */
-void pose_add_group(Object *ob)
+void BKE_pose_add_group(Object *ob)
 {
        bPose *pose= (ob) ? ob->pose : NULL;
        bActionGroup *grp;
@@ -809,7 +809,7 @@ void pose_add_group(Object *ob)
 }
 
 /* Remove the active bone-group */
-void pose_remove_group(Object *ob)
+void BKE_pose_remove_group(Object *ob)
 {
        bPose *pose= (ob) ? ob->pose : NULL;
        bActionGroup *grp = NULL;
@@ -1072,7 +1072,7 @@ void extract_pose_from_pose(bPose *pose, const bPose *src)
 }
 
 /* for do_all_pose_actions, clears the pose. Now also exported for proxy and tools */
-void rest_pose(bPose *pose)
+void BKE_pose_rest(bPose *pose)
 {
        bPoseChannel *pchan;
        
@@ -1094,7 +1094,7 @@ void rest_pose(bPose *pose)
 }
 
 /* both poses should be in sync */
-void copy_pose_result(bPose *to, bPose *from)
+void BKE_pose_copy_result(bPose *to, bPose *from)
 {
        bPoseChannel *pchanto, *pchanfrom;
        
@@ -1104,13 +1104,13 @@ void copy_pose_result(bPose *to, bPose *from)
        }
 
        if (to==from) {
-               printf("copy_pose_result source and target are the same\n");
+               printf("BKE_pose_copy_result source and target are the same\n");
                return;
        }
 
 
        for (pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) {
-               pchanto= get_pose_channel(to, pchanfrom->name);
+               pchanto= BKE_pose_channel_find_name(to, pchanfrom->name);
                if (pchanto) {
                        copy_m4_m4(pchanto->pose_mat, pchanfrom->pose_mat);
                        copy_m4_m4(pchanto->chan_mat, pchanfrom->chan_mat);
@@ -1136,10 +1136,10 @@ void copy_pose_result(bPose *to, bPose *from)
  */
 void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, char groupname[], float cframe)
 {
-       bActionGroup *agrp= action_groups_find_named(act, groupname);
+       bActionGroup *agrp= BKE_action_group_find_name(act, groupname);
        
        /* clear workob */
-       clear_workob(workob);
+       BKE_object_workob_clear(workob);
        
        /* init workob */
        copy_m4_m4(workob->obmat, ob->obmat);
@@ -1243,9 +1243,9 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src,
        
        /* are we also blending with matching bones? */
        if (strip->prev && strip->start>=strip->prev->start) {
-               bPoseChannel *dpchan= get_pose_channel(dst, strip->offs_bone);
+               bPoseChannel *dpchan= BKE_pose_channel_find_name(dst, strip->offs_bone);
                if (dpchan) {
-                       bPoseChannel *spchan= get_pose_channel(src, strip->offs_bone);
+                       bPoseChannel *spchan= BKE_pose_channel_find_name(src, strip->offs_bone);
                        if (spchan) {
                                float vec[3];
                                
@@ -1397,11 +1397,11 @@ static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float
                        if (foundvert) {
                                /* bring it into armature space */
                                sub_v3_v3v3(min, max, min);
-                               bone= get_named_bone(ob->data, strip->offs_bone);       /* weak */
+                               bone= BKE_armature_find_bone_name(ob->data, strip->offs_bone);  /* weak */
                                if (bone) {
                                        mul_mat3_m4_v3(bone->arm_mat, min);
                                        
-                                       /* dominant motion, cyclic_offset was cleared in rest_pose */
+                                       /* dominant motion, cyclic_offset was cleared in BKE_pose_rest */
                                        if (strip->flag & (ACTSTRIP_CYCLIC_USEX | ACTSTRIP_CYCLIC_USEY | ACTSTRIP_CYCLIC_USEZ)) {
                                                if (strip->flag & ACTSTRIP_CYCLIC_USEX) pose->cyclic_offset[0]= time*min[0];
                                                if (strip->flag & ACTSTRIP_CYCLIC_USEY) pose->cyclic_offset[1]= time*min[1];
@@ -1453,12 +1453,12 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
        bActionStrip *strip, *striplast=NULL, *stripfirst=NULL;
        float striptime, frametime, length, actlength;
        float blendfac, stripframe;
-       float scene_cfra= BKE_curframe(scene);
+       float scene_cfra= BKE_scene_frame_get(scene);
        int     doit, dostride;
        
        if (blocktype==ID_AR) {
-               copy_pose(&tpose, ob->pose, 1);
-               rest_pose(ob->pose);            // potentially destroying current not-keyed pose
+               BKE_pose_copy_data(&tpose, ob->pose, 1);
+               BKE_pose_rest(ob->pose);                // potentially destroying current not-keyed pose
        }
        else {
                key= ob_get_key(ob);
@@ -1504,7 +1504,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
                        if (striptime>=0.0) {
                                
                                if (blocktype==ID_AR) 
-                                       rest_pose(tpose);
+                                       BKE_pose_rest(tpose);
                                
                                /* To handle repeat, we add 0.1 frame extra to make sure the last frame is included */
                                if (striptime < 1.0f + 0.1f/length) {
@@ -1656,7 +1656,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
        
        /* free */
        if (tpose)
-               free_pose(tpose);
+               BKE_pose_free(tpose);
        if (chanbase.first)
                BLI_freelistN(&chanbase);
 }
index afa4723bc6d5bce68a1fd389562fd01ddd305c06..1d05ecca90904b28f912ffd25d67894d8a735099 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)
@@ -353,7 +353,7 @@ static void motionpaths_calc_update_scene(Scene *scene)
         *        that doesn't force complete update, but for now, this is the
         *        most accurate way!
         */
-       scene_update_for_newframe(G.main, scene, scene->lay); // XXX this is the best way we can get anything moving
+       BKE_scene_update_for_newframe(G.main, scene, scene->lay); // XXX this is the best way we can get anything moving
 #endif
 }
 
@@ -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
@@ -1249,7 +1249,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
        if (G.rendering == 0)
                no_draw_flag |= PARS_NO_DISP;
        
-       ctime = BKE_curframe(scene); /* NOTE: in old animsys, used parent object's timeoffset... */
+       ctime = BKE_scene_frame_get(scene); /* NOTE: in old animsys, used parent object's timeoffset... */
 
        totpart = psys->totpart;
        totchild = psys->totchild;
@@ -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];
@@ -1545,7 +1545,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
        
        /* in par the family name is stored, use this to find the other objects */
        
-       chartransdata= BKE_text_to_curve(G.main, scene, par, FO_DUPLI);
+       chartransdata= BKE_vfont_to_curve(G.main, scene, par, FO_DUPLI);
        if (chartransdata==NULL) return;
 
        cu= par->data;
index f3a7ff90373dbee7eaef088ac6fea5957004bcfc..de70ffcaaefe7204732c7a00552bef22dce889ec 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?
@@ -425,7 +425,7 @@ void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const cha
                        /* if grouped... */
                        if (fcu->grp) {
                                /* make sure there will be a matching group on the other side for the migrants */
-                               agrp = action_groups_find_named(dstAct, fcu->grp->name);
+                               agrp = BKE_action_group_find_name(dstAct, fcu->grp->name);
                                
                                if (agrp == NULL) {
                                        /* add a new one with a similar name (usually will be the same though) */
@@ -2035,8 +2035,10 @@ static void animsys_evaluate_nla (ListBase *echannels, PointerRNA *ptr, AnimData
        
        /* add 'active' Action (may be tweaking track) as last strip to evaluate in NLA stack
         *      - only do this if we're not exclusively evaluating the 'solo' NLA-track
+        *      - however, if the 'solo' track houses the current 'tweaking' strip, 
+        *        then we should allow this to play, otherwise nothing happens
         */
-       if ((adt->action) && !(adt->flag & ADT_NLA_SOLO_TRACK)) {
+       if ((adt->action) && ((adt->flag & ADT_NLA_SOLO_TRACK)==0 || (adt->flag & ADT_NLA_EDIT_ON))) {
                /* if there are strips, evaluate action as per NLA rules */
                if ((has_strips) || (adt->actstrip)) {
                        /* make dummy NLA strip, and add that to the stack */
index b0d0ace2a7e57e0ecbacfd5bbfd4f5915d509c9d..814e9d53503fab4fbe229868d4b70f310de83dde 100644 (file)
 
 /* **************** Generic Functions, data level *************** */
 
-bArmature *add_armature(const char *name)
+bArmature *BKE_armature_add(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;
        return arm;
 }
 
-bArmature *get_armature(Object *ob)
+bArmature *BKE_armature_from_object(Object *ob)
 {
        if (ob->type == OB_ARMATURE)
                return (bArmature *)ob->data;
        return NULL;
 }
 
-void free_bonelist(ListBase *lb)
+void BKE_armature_bonelist_free(ListBase *lb)
 {
        Bone *bone;
 
@@ -102,16 +102,16 @@ void free_bonelist(ListBase *lb)
                        IDP_FreeProperty(bone->prop);
                        MEM_freeN(bone->prop);
                }
-               free_bonelist(&bone->childbase);
+               BKE_armature_bonelist_free(&bone->childbase);
        }
 
        BLI_freelistN(lb);
 }
 
-void free_armature(bArmature *arm)
+void BKE_armature_free(bArmature *arm)
 {
        if (arm) {
-               free_bonelist(&arm->bonebase);
+               BKE_armature_bonelist_free(&arm->bonebase);
 
                /* free editmode data */
                if (arm->edbo) {
@@ -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*/
@@ -245,7 +245,7 @@ static Bone *get_named_bone_bonechildren(Bone *bone, const char *name)
 
 
 /* Walk the list until the bone is found */
-Bone *get_named_bone(bArmature *arm, const char *name)
+Bone *BKE_armature_find_bone_name(bArmature *arm, const char *name)
 {
        Bone *bone = NULL, *curBone;
 
@@ -909,7 +909,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
                                defnrToPC = MEM_callocN(sizeof(*defnrToPC) * defbase_tot, "defnrToBone");
                                defnrToPCIndex = MEM_callocN(sizeof(*defnrToPCIndex) * defbase_tot, "defnrToIndex");
                                for (i = 0, dg = target->defbase.first; dg; i++, dg = dg->next) {
-                                       defnrToPC[i] = get_pose_channel(armOb->pose, dg->name);
+                                       defnrToPC[i] = BKE_pose_channel_find_name(armOb->pose, dg->name);
                                        /* exclude non-deforming bones */
                                        if (defnrToPC[i]) {
                                                if (defnrToPC[i]->bone->flag & BONE_NO_DEFORM) {
@@ -1099,7 +1099,7 @@ void get_objectspace_bone_matrix(struct Bone* bone, float M_accumulatedMatrix[][
 /* **************** Space to Space API ****************** */
 
 /* Convert World-Space Matrix to Pose-Space Matrix */
-void armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
 {
        float obmat[4][4];
 
@@ -1117,7 +1117,7 @@ void armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
 /* Convert World-Space Location to Pose-Space Location
  * NOTE: this cannot be used to convert to pose-space location of the supplied
  *       pose-channel into its local space (i.e. 'visual'-keyframing) */
-void armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3])
+void BKE_armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3])
 {
        float xLocMat[4][4] = MAT4_UNITY;
        float nLocMat[4][4];
@@ -1126,7 +1126,7 @@ void armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3
        copy_v3_v3(xLocMat[3], inloc);
 
        /* get bone-space cursor matrix and extract location */
-       armature_mat_world_to_pose(ob, xLocMat, nLocMat);
+       BKE_armature_mat_world_to_pose(ob, xLocMat, nLocMat);
        copy_v3_v3(outloc, nLocMat[3]);
 }
 
@@ -1165,7 +1165,7 @@ static void get_offset_bone_mat(Bone *bone, float offs_bone[][4])
  *       pose-channel into its local space (i.e. 'visual'-keyframing).
  *       (note: I don't understand that, so I keep it :p --mont29).
  */
-void pchan_to_pose_mat(bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4])
+void BKE_pchan_to_pose_mat(bPoseChannel *pchan, float rotscale_mat[][4], float loc_mat[][4])
 {
        Bone *bone, *parbone;
        bPoseChannel *parchan;
@@ -1254,14 +1254,14 @@ void pchan_to_pose_mat(bPoseChannel *pchan, float rotscale_mat[][4], float loc_m
 /* Convert Pose-Space Matrix to Bone-Space Matrix.
  * NOTE: this cannot be used to convert to pose-space transforms of the supplied
  *       pose-channel into its local space (i.e. 'visual'-keyframing) */
-void armature_mat_pose_to_bone(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_pose_to_bone(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
 {
        float rotscale_mat[4][4], loc_mat[4][4], inmat_[4][4];
 
        /* Security, this allows to call with inmat == outmat! */
        copy_m4_m4(inmat_, inmat);
 
-       pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
+       BKE_pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
        invert_m4(rotscale_mat);
        invert_m4(loc_mat);
 
@@ -1270,14 +1270,14 @@ void armature_mat_pose_to_bone(bPoseChannel *pchan, float inmat[][4], float outm
 }
 
 /* Convert Bone-Space Matrix to Pose-Space Matrix. */
-void armature_mat_bone_to_pose(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_bone_to_pose(bPoseChannel *pchan, float inmat[][4], float outmat[][4])
 {
        float rotscale_mat[4][4], loc_mat[4][4], inmat_[4][4];
 
        /* Security, this allows to call with inmat == outmat! */
        copy_m4_m4(inmat_, inmat);
 
-       pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
+       BKE_pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
 
        mult_m4_m4m4(outmat, rotscale_mat, inmat_);
        mul_v3_m4v3(outmat[3], loc_mat, inmat_[3]);
@@ -1286,7 +1286,7 @@ void armature_mat_bone_to_pose(bPoseChannel *pchan, float inmat[][4], float outm
 /* Convert Pose-Space Location to Bone-Space Location
  * NOTE: this cannot be used to convert to pose-space location of the supplied
  *       pose-channel into its local space (i.e. 'visual'-keyframing) */
-void armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float outloc[3])
+void BKE_armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float outloc[3])
 {
        float xLocMat[4][4] = MAT4_UNITY;
        float nLocMat[4][4];
@@ -1295,29 +1295,29 @@ void armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float
        copy_v3_v3(xLocMat[3], inloc);
 
        /* get bone-space cursor matrix and extract location */
-       armature_mat_pose_to_bone(pchan, xLocMat, nLocMat);
+       BKE_armature_mat_pose_to_bone(pchan, xLocMat, nLocMat);
        copy_v3_v3(outloc, nLocMat[3]);
 }
 
-void armature_mat_pose_to_bone_ex(Object *ob, bPoseChannel *pchan, float inmat[][4], float outmat[][4])
+void BKE_armature_mat_pose_to_bone_ex(Object *ob, bPoseChannel *pchan, float inmat[][4], float outmat[][4])
 {
        bPoseChannel work_pchan = *pchan;
 
        /* recalculate pose matrix with only parent transformations,
         * bone loc/sca/rot is ignored, scene and frame are not used. */
-       where_is_pose_bone(NULL, ob, &work_pchan, 0.0f, FALSE);
+       BKE_pose_where_is_bone(NULL, ob, &work_pchan, 0.0f, FALSE);
 
        /* find the matrix, need to remove the bone transforms first so this is
         * calculated as a matrix to set rather then a difference ontop of whats
         * already there. */
        unit_m4(outmat);
-       pchan_apply_mat4(&work_pchan, outmat, FALSE);
+       BKE_pchan_apply_mat4(&work_pchan, outmat, FALSE);
 
-       armature_mat_pose_to_bone(&work_pchan, inmat, outmat);
+       BKE_armature_mat_pose_to_bone(&work_pchan, inmat, outmat);
 }
 
-/* same as object_mat3_to_rot() */
-void pchan_mat3_to_rot(bPoseChannel *pchan, float mat[][3], short use_compat)
+/* same as BKE_object_mat3_to_rot() */
+void BKE_pchan_mat3_to_rot(bPoseChannel *pchan, float mat[][3], short use_compat)
 {
        switch (pchan->rotmode) {
                case ROT_MODE_QUAT:
@@ -1335,18 +1335,18 @@ 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() */
-void pchan_apply_mat4(bPoseChannel *pchan, float mat[][4], short use_compat)
+ * similar to BKE_object_apply_mat4() */
+void BKE_pchan_apply_mat4(bPoseChannel *pchan, float mat[][4], short use_compat)
 {
        float rot[3][3];
        mat4_to_loc_rot_size(pchan->loc, rot, pchan->size, mat);
-       pchan_mat3_to_rot(pchan, rot, use_compat);
+       BKE_pchan_mat3_to_rot(pchan, rot, use_compat);
 }
 
 /* Remove rest-position effects from pose-transform for obtaining
  * 'visual' transformation of pose-channel.
  * (used by the Visual-Keyframing stuff) */
-void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4])
+void BKE_armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4])
 {
        float imat[4][4];
 
@@ -1496,7 +1496,7 @@ void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3])
 
 /* recursive part, calculates restposition of entire tree of children */
 /* used by exiting editmode too */
-void where_is_armature_bone(Bone *bone, Bone *prevbone)
+void BKE_armature_where_is_bone(Bone *bone, Bone *prevbone)
 {
        float vec[3];
 
@@ -1529,19 +1529,19 @@ void where_is_armature_bone(Bone *bone, Bone *prevbone)
        /* and the kiddies */
        prevbone = bone;
        for (bone = bone->childbase.first; bone; bone = bone->next) {
-               where_is_armature_bone(bone, prevbone);
+               BKE_armature_where_is_bone(bone, prevbone);
        }
 }
 
 /* updates vectors and matrices on rest-position level, only needed
  * after editing armature itself, now only on reading file */
-void where_is_armature(bArmature *arm)
+void BKE_armature_where_is(bArmature *arm)
 {
        Bone *bone;
 
        /* hierarchical from root to children */
        for (bone = arm->bonebase.first; bone; bone = bone->next) {
-               where_is_armature_bone(bone, NULL);
+               BKE_armature_where_is_bone(bone, NULL);
        }
 }
 
@@ -1561,7 +1561,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
         * to avoid crashing check for possible errors here */
        for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
                if (pchan->bone->layer & layer_protected) {
-                       if (get_pose_channel(frompose, pchan->name) == NULL) {
+                       if (BKE_pose_channel_find_name(frompose, pchan->name) == NULL) {
                                printf("failed to sync proxy armature because '%s' is missing pose channel '%s'\n",
                                       from->id.name, pchan->name);
                                error = 1;
@@ -1573,7 +1573,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
                return;
 
        /* clear all transformation values from library */
-       rest_pose(frompose);
+       BKE_pose_rest(frompose);
 
        /* copy over all of the proxy's bone groups */
                /* TODO for later
@@ -1585,7 +1585,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
        pose->active_group = frompose->active_group;
 
        for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
-               pchanp = get_pose_channel(frompose, pchan->name);
+               pchanp = BKE_pose_channel_find_name(frompose, pchan->name);
 
                if (pchan->bone->layer & layer_protected) {
                        ListBase proxylocal_constraints = {NULL, NULL};
@@ -1638,7 +1638,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
                        }
 
                        /* free stuff from current channel */
-                       free_pose_channel(pchan);
+                       BKE_pose_channel_free(pchan);
 
                        /* the final copy */
                        *pchan = pchanw;
@@ -1672,7 +1672,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
 
 static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int counter)
 {
-       bPoseChannel *pchan = verify_pose_channel(pose, bone->name); /* verify checks and/or adds */
+       bPoseChannel *pchan = BKE_pose_channel_verify(pose, bone->name); /* verify checks and/or adds */
 
        pchan->bone = bone;
        pchan->parent = parchan;
@@ -1683,7 +1683,7 @@ static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int
                counter = rebuild_pose_bone(pose, bone, pchan, counter);
                /* for quick detecting of next bone in chain, only b-bone uses it now */
                if (bone->flag & BONE_CONNECTED)
-                       pchan->child = get_pose_channel(pose, bone->name);
+                       pchan->child = BKE_pose_channel_find_name(pose, bone->name);
        }
 
        return counter;
@@ -1691,7 +1691,7 @@ static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int
 
 /* only after leave editmode, duplicating, validating older files, library syncing */
 /* NOTE: pose->flag is set for it */
-void armature_rebuild_pose(Object *ob, bArmature *arm)
+void BKE_pose_rebuild(Object *ob, bArmature *arm)
 {
        Bone *bone;
        bPose *pose;
@@ -1723,8 +1723,8 @@ void armature_rebuild_pose(Object *ob, bArmature *arm)
        for (pchan = pose->chanbase.first; pchan; pchan = next) {
                next = pchan->next;
                if (pchan->bone == NULL) {
-                       free_pose_channel(pchan);
-                       free_pose_channels_hash(pose);
+                       BKE_pose_channel_free(pchan);
+                       BKE_pose_channels_hash_free(pose);
                        BLI_freelinkN(&pose->chanbase, pchan);
                }
        }
@@ -1732,11 +1732,11 @@ 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);
        }
 
-       update_pose_constraint_flags(ob->pose); /* for IK detection for example */
+       BKE_pose_update_constraint_flags(ob->pose); /* for IK detection for example */
 
        /* the sorting */
        if (counter>1)
@@ -1745,7 +1745,7 @@ void armature_rebuild_pose(Object *ob, bArmature *arm)
        ob->pose->flag &= ~POSE_RECALC;
        ob->pose->flag |= POSE_WAS_REBUILT;
 
-       make_pose_channels_hash(ob->pose);
+       BKE_pose_channels_hash_make(ob->pose);
 }
 
 
@@ -1959,7 +1959,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
        float splineVec[3], scaleFac, radius =1.0f;
 
        /* firstly, calculate the bone matrix the standard way, since this is needed for roll control */
-       where_is_pose_bone(scene, ob, pchan, ctime, 1);
+       BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
 
        copy_v3_v3(poseHead, pchan->pose_head);
        copy_v3_v3(poseTail, pchan->pose_tail);
@@ -2145,7 +2145,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
        copy_v3_v3(pchan->pose_head, poseHead);
 
        /* recalculate tail, as it's now outdated after the head gets adjusted above! */
-       where_is_pose_bone_tail(pchan);
+       BKE_pose_where_is_bone_tail(pchan);
 
        /* done! */
        pchan->flag |= POSE_DONE;
@@ -2183,7 +2183,7 @@ static void splineik_execute_tree(Scene *scene, Object *ob, bPoseChannel *pchan_
 /* ********************** THE POSE SOLVER ******************* */
 
 /* loc/rot/size to given mat4 */
-void pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
+void BKE_pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
 {
        float smat[3][3];
        float rmat[3][3];
@@ -2226,12 +2226,12 @@ void pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
 
 /* loc/rot/size to mat4 */
 /* used in constraint.c too */
-void pchan_calc_mat(bPoseChannel *pchan)
+void BKE_pchan_calc_mat(bPoseChannel *pchan)
 {
        /* this is just a wrapper around the copy of this function which calculates the matrix
         * and stores the result in any given channel
         */
-       pchan_to_mat4(pchan, pchan->chan_mat);
+       BKE_pchan_to_mat4(pchan, pchan->chan_mat);
 }
 
 #if 0 /* XXX OLD ANIMSYS, NLASTRIPS ARE NO LONGER USED */
@@ -2361,7 +2361,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
 #endif
 
 /* calculate tail of posechannel */
-void where_is_pose_bone_tail(bPoseChannel *pchan)
+void BKE_pose_where_is_bone_tail(bPoseChannel *pchan)
 {
        float vec[3];
 
@@ -2374,17 +2374,17 @@ void where_is_pose_bone_tail(bPoseChannel *pchan)
 /* pchan is validated, as having bone and parent pointer
  * 'do_extra': when zero skips loc/size/rot, constraints and strip modifiers.
  */
-void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, int do_extra)
+void BKE_pose_where_is_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, int do_extra)
 {
        /* This gives a chan_mat with actions (ipos) results. */
        if (do_extra)
-               pchan_calc_mat(pchan);
+               BKE_pchan_calc_mat(pchan);
        else
                unit_m4(pchan->chan_mat);
 
        /* Construct the posemat based on PoseChannels, that we do before applying constraints. */
        /* pose_mat(b) = pose_mat(b-1) * yoffs(b-1) * d_root(b) * bone_mat(b) * chan_mat(b) */
-       armature_mat_bone_to_pose(pchan, pchan->chan_mat, pchan->pose_mat);
+       BKE_armature_mat_bone_to_pose(pchan, pchan->chan_mat, pchan->pose_mat);
 
        /* Only rootbones get the cyclic offset (unless user doesn't want that). */
        /* XXX That could be a problem for snapping and other "reverse transform" features... */
@@ -2430,12 +2430,12 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti
        /* calculate head */
        copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]);
        /* calculate tail */
-       where_is_pose_bone_tail(pchan);
+       BKE_pose_where_is_bone_tail(pchan);
 }
 
 /* This only reads anim data from channels, and writes to channels */
 /* This is the only function adding poses */
-void where_is_pose(Scene *scene, Object *ob)
+void BKE_pose_where_is(Scene *scene, Object *ob)
 {
        bArmature *arm;
        Bone *bone;
@@ -2450,9 +2450,9 @@ void where_is_pose(Scene *scene, Object *ob)
        if (ELEM(NULL, arm, scene))
                return;
        if ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC))
-               armature_rebuild_pose(ob, arm);
+               BKE_pose_rebuild(ob, arm);
 
-       ctime = BKE_curframe(scene); /* not accurate... */
+       ctime = BKE_scene_frame_get(scene); /* not accurate... */
 
        /* In editmode or restposition we read the data from the bones */
        if (arm->edbo || (arm->flag & ARM_RESTPOS)) {
@@ -2494,7 +2494,7 @@ void where_is_pose(Scene *scene, Object *ob)
                        }
                        /* 5. otherwise just call the normal solver */
                        else if (!(pchan->flag & POSE_DONE)) {
-                               where_is_pose_bone(scene, ob, pchan, ctime, 1);
+                               BKE_pose_where_is_bone(scene, ob, pchan, ctime, 1);
                        }
                }
                /* 6. release the IK tree */
@@ -2517,13 +2517,13 @@ 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) {
                bPose *pose = armob->pose;
                for (i = 0, defgroup = ob->defbase.first; i < defbase_tot && defgroup; defgroup = defgroup->next, i++) {
-                       bPoseChannel *pchan = get_pose_channel(pose, defgroup->name);
+                       bPoseChannel *pchan = BKE_pose_channel_find_name(pose, defgroup->name);
                        if (pchan && (pchan->bone->flag & BONE_SELECTED)) {
                                dg_selection[i] = TRUE;
                                dg_flags_sel_tot++;
@@ -2545,7 +2545,7 @@ int minmax_armature(Object *ob, float min[3], float max[3])
 {
        bPoseChannel *pchan;
 
-       /* For now, we assume where_is_pose has already been called (hence we have valid data in pachan). */
+       /* For now, we assume BKE_pose_where_is has already been called (hence we have valid data in pachan). */
        for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
                DO_MINMAX(pchan->pose_head, min, max);
                DO_MINMAX(pchan->pose_tail, min, max);
@@ -2581,10 +2581,10 @@ 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)
+BoundBox *BKE_armature_boundbox_get(Object *ob)
 {
        boundbox_armature(ob, NULL, NULL);
 
index 2b741d6d8eb25e361d15dfe9e11c8ba616e721f0..58ada7b07841f1f17d5146f31292275c90e57ae3 100644 (file)
@@ -110,7 +110,7 @@ void free_blender(void)
        
        IMB_exit();
 
-       BLI_cb_finalize();
+       BLI_callback_global_finalize();
 
        seq_stripelem_cache_destruct();
        IMB_moviecache_destruct();
@@ -173,7 +173,7 @@ static void clean_paths(Main *main)
 {
        Scene *scene;
 
-       bpath_traverse_main(main, clean_paths_visit_cb, BPATH_TRAVERSE_SKIP_MULTIFILE, NULL);
+       BLI_bpath_traverse_main(main, clean_paths_visit_cb, BLI_BPATH_TRAVERSE_SKIP_MULTIFILE, NULL);
 
        for (scene= main->scene.first; scene; scene= scene->id.next) {
                BLI_clean(scene->r.pic);
@@ -314,7 +314,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
                BLI_strncpy(G.main->name, filepath, FILE_MAX);
 
        /* baseflags, groups, make depsgraph, etc */
-       set_scene_bg(G.main, CTX_data_scene(C));
+       BKE_scene_set_background(G.main, CTX_data_scene(C));
        
        MEM_freeN(bfd);
 
index 7c225eb0fad1f11a8a0c036b3137c2b222b7fd20..972793227a84a5af7f4387cf5fbe3d6fa372279e 100644 (file)
@@ -78,7 +78,7 @@ MakeCSGMeshFromBlenderBase(
        Mesh *me;
        if (output == NULL || base == NULL) return 0;
 
-       me = get_mesh(base->object);
+       me = BKE_mesh_from_object(base->object);
                
        output->m_descriptor.user_face_vertex_data_size = 0;
        output->m_descriptor.user_data_size = sizeof(FaceData);
@@ -105,7 +105,7 @@ CSG_LoadBlenderMesh(
        Mesh *me;
        if (output == NULL || obj == NULL) return 0;
 
-       me = get_mesh(obj);
+       me = BKE_mesh_from_object(obj);
                
        output->m_descriptor.user_face_vertex_data_size = 0;
        output->m_descriptor.user_data_size = sizeof(FaceData);
index b3d128bf2b47f51a6eed09ee5ef83012a69ea76a..a1e8a11e9ff67a87e6f26c350c3f9446dbe201f3 100644 (file)
@@ -67,7 +67,7 @@
 #include "RE_render_ext.h" /* externtex */
 #include "RE_shader_ext.h"
 
-static void brush_set_defaults(Brush *brush)
+static void brush_defaults(Brush *brush)
 {
        brush->blend = 0;
        brush->flag = 0;
@@ -122,30 +122,30 @@ static void brush_set_defaults(Brush *brush)
 
 /* Datablock add/copy/free/make_local */
 
-Brush *add_brush(const char *name)
+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;
 
-       brush_set_defaults(brush);
+       brush_defaults(brush);
 
        brush->sculpt_tool = SCULPT_TOOL_DRAW; /* sculpting defaults to the draw tool for new brushes */
 
         /* the default alpha falloff curve */
-       brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
+       BKE_brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
 
        return brush;
 }
 
-Brush *copy_brush(Brush *brush)
+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);
@@ -167,7 +167,7 @@ Brush *copy_brush(Brush *brush)
 }
 
 /* not brush itself */
-void free_brush(Brush *brush)
+void BKE_brush_free(Brush *brush)
 {
        if (brush->mtex.tex)
                brush->mtex.tex->id.us--;
@@ -186,7 +186,7 @@ static void extern_local_brush(Brush *brush)
        id_lib_extern((ID *)brush->clone.image);
 }
 
-void make_local_brush(Brush *brush)
+void BKE_brush_make_local(Brush *brush)
 {
 
        /* - only lib users: do nothing
@@ -225,7 +225,7 @@ void make_local_brush(Brush *brush)
                }
        }
        else if (is_local && is_lib) {
-               Brush *brush_new= copy_brush(brush);
+               Brush *brush_new= BKE_brush_copy(brush);
                brush_new->id.us= 1; /* only keep fake user */
                brush_new->id.flag |= LIB_FAKEUSER;
 
@@ -242,11 +242,11 @@ void make_local_brush(Brush *brush)
        }
 }
 
-void brush_debug_print_state(Brush *br)
+void BKE_brush_debug_print_state(Brush *br)
 {
        /* create a fake brush and set it to the defaults */
        Brush def= {{NULL}};
-       brush_set_defaults(&def);
+       brush_defaults(&def);
        
 #define BR_TEST(field, t)                                      \
        if (br->field != def.field)                             \
@@ -329,14 +329,14 @@ void brush_debug_print_state(Brush *br)
 #undef BR_TEST_FLAG
 }
 
-void brush_reset_sculpt(Brush *br)
+void BKE_brush_sculpt_reset(Brush *br)
 {
        /* enable this to see any non-default
         * settings used by a brush: */
-       // brush_debug_print_state(br);
+       // BKE_brush_debug_print_state(br);
 
-       brush_set_defaults(br);
-       brush_curve_preset(br, CURVE_PRESET_SMOOTH);
+       brush_defaults(br);
+       BKE_brush_curve_preset(br, CURVE_PRESET_SMOOTH);
 
        switch (br->sculpt_tool) {
        case SCULPT_TOOL_CLAY:
@@ -409,7 +409,7 @@ void brush_reset_sculpt(Brush *br)
 }
 
 /* Library Operations */
-void brush_curve_preset(Brush *b, /*CurveMappingPreset*/int preset)
+void BKE_brush_curve_preset(Brush *b, /*CurveMappingPreset*/int preset)
 {
        CurveMap *cm = NULL;
 
@@ -424,7 +424,7 @@ void brush_curve_preset(Brush *b, /*CurveMappingPreset*/int preset)
        curvemapping_changed(b->curve, 0);
 }
 
-int brush_texture_set_nr(Brush *brush, int nr)
+int BKE_brush_texture_set_nr(Brush *brush, int nr)
 {
        ID *idtest, *id=NULL;
 
@@ -432,12 +432,12 @@ int 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--;
        }
        if (idtest!=id) {
-               brush_texture_delete(brush);
+               BKE_brush_texture_delete(brush);
 
                brush->mtex.tex= (Tex*)idtest;
                id_us_plus(idtest);
@@ -448,7 +448,7 @@ int brush_texture_set_nr(Brush *brush, int nr)
        return 0;
 }
 
-int brush_texture_delete(Brush *brush)
+int BKE_brush_texture_delete(Brush *brush)
 {
        if (brush->mtex.tex)
                brush->mtex.tex->id.us--;
@@ -456,13 +456,13 @@ int brush_texture_delete(Brush *brush)
        return 1;
 }
 
-int brush_clone_image_set_nr(Brush *brush, int nr)
+int BKE_brush_clone_image_set_nr(Brush *brush, int nr)
 {
        if (brush && nr > 0) {
                Image *ima= (Image*)BLI_findlink(&G.main->image, nr-1);
 
                if (ima) {
-                       brush_clone_image_delete(brush);
+                       BKE_brush_clone_image_delete(brush);
                        brush->clone.image= ima;
                        id_us_plus(&ima->id);
                        brush->clone.offset[0]= brush->clone.offset[1]= 0.0f;
@@ -474,7 +474,7 @@ int brush_clone_image_set_nr(Brush *brush, int nr)
        return 0;
 }
 
-int brush_clone_image_delete(Brush *brush)
+int BKE_brush_clone_image_delete(Brush *brush)
 {
        if (brush && brush->clone.image) {
                brush->clone.image->id.us--;
@@ -486,14 +486,14 @@ int brush_clone_image_delete(Brush *brush)
 }
 
 /* Brush Sampling */
-void brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], const int thread)
+void BKE_brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], const int thread)
 {
        MTex *mtex= &brush->mtex;
 
        if (mtex && mtex->tex) {
                float co[3], tin, tr, tg, tb, ta;
                int hasrgb;
-               const int radius= brush_size(scene, brush);
+               const int radius= BKE_brush_size_get(scene, brush);
 
                co[0]= xy[0]/radius;
                co[1]= xy[1]/radius;
@@ -520,14 +520,14 @@ void brush_sample_tex(const Scene *scene, Brush *brush, const float xy[2], float
 }
 
 /* TODO, use define for 'texfall' arg */
-void brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction)
+void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction)
 {
        ImBuf *ibuf;
        float xy[2], rgba[4], *dstf;
        int x, y, rowbytes, xoff, yoff, imbflag;
-       const int radius= brush_size(scene, brush);
+       const int radius= BKE_brush_size_get(scene, brush);
        unsigned char *dst, crgb[3];
-       const float alpha= brush_alpha(scene, brush);
+       const float alpha= BKE_brush_alpha_get(scene, brush);
        float brush_rgb[3];
     
        imbflag= (flt)? IB_rectfloat: IB_rect;
@@ -555,15 +555,15 @@ void brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall,
 
                                if (texfall == 0) {
                                        copy_v3_v3(dstf, brush_rgb);
-                                       dstf[3]= alpha*brush_curve_strength_clamp(brush, len_v2(xy), radius);
+                                       dstf[3]= alpha*BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
                                }
                                else if (texfall == 1) {
-                                       brush_sample_tex(scene, brush, xy, dstf, 0);
+                                       BKE_brush_sample_tex(scene, brush, xy, dstf, 0);
                                }
                                else {
-                                       brush_sample_tex(scene, brush, xy, rgba, 0);
+                                       BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
                                        mul_v3_v3v3(dstf, rgba, brush_rgb);
-                                       dstf[3] = rgba[3]*alpha*brush_curve_strength_clamp(brush, len_v2(xy), radius);
+                                       dstf[3] = rgba[3]*alpha*BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
                                }
                        }
                }
@@ -580,7 +580,7 @@ void brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall,
                                xy[1] = y + yoff;
 
                                if (texfall == 0) {
-                                       alpha_f = alpha * brush_curve_strength(brush, len_v2(xy), radius);
+                                       alpha_f = alpha * BKE_brush_curve_strength(brush, len_v2(xy), radius);
 
                                        dst[0] = crgb[0];
                                        dst[1] = crgb[1];
@@ -588,21 +588,21 @@ void brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall,
                                        dst[3] = FTOCHAR(alpha_f);
                                }
                                else if (texfall == 1) {
-                                       brush_sample_tex(scene, brush, xy, rgba, 0);
+                                       BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
                                        rgba_float_to_uchar(dst, rgba);
                                }
                                else if (texfall == 2) {
-                                       brush_sample_tex(scene, brush, xy, rgba, 0);
+                                       BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
                                        mul_v3_v3(rgba, brush->rgb);
-                                       alpha_f = rgba[3] * alpha * brush_curve_strength_clamp(brush, len_v2(xy), radius);
+                                       alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
 
                                        rgb_float_to_uchar(dst, rgba);
 
                                        dst[3] = FTOCHAR(alpha_f);
                                }
                                else {
-                                       brush_sample_tex(scene, brush, xy, rgba, 0);
-                                       alpha_f = rgba[3] * alpha * brush_curve_strength_clamp(brush, len_v2(xy), radius);
+                                       BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
+                                       alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
 
                                        dst[0] = crgb[0];
                                        dst[1] = crgb[1];
@@ -631,7 +631,7 @@ void brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall,
 // In anycase, a better solution is needed to prevent
 // inconsistency.
 
-void brush_set_size(Scene *scene, Brush *brush, int size)
+void BKE_brush_size_set(Scene *scene, Brush *brush, int size)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
@@ -641,14 +641,14 @@ void brush_set_size(Scene *scene, Brush *brush, int size)
                brush->size= size;
 }
 
-int brush_size(const Scene *scene, Brush *brush)
+int BKE_brush_size_get(const Scene *scene, Brush *brush)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
        return (ups->flag & UNIFIED_PAINT_SIZE) ? ups->size : brush->size;
 }
 
-int brush_use_locked_size(const Scene *scene, Brush *brush)
+int BKE_brush_use_locked_size(const Scene *scene, Brush *brush)
 {
        const short us_flag = scene->toolsettings->unified_paint_settings.flag;
 
@@ -657,7 +657,7 @@ int brush_use_locked_size(const Scene *scene, Brush *brush)
                (brush->flag & BRUSH_LOCK_SIZE);
 }
 
-int brush_use_size_pressure(const Scene *scene, Brush *brush)
+int BKE_brush_use_size_pressure(const Scene *scene, Brush *brush)
 {
        const short us_flag = scene->toolsettings->unified_paint_settings.flag;
 
@@ -666,7 +666,7 @@ int brush_use_size_pressure(const Scene *scene, Brush *brush)
                (brush->flag & BRUSH_SIZE_PRESSURE);
 }
 
-int brush_use_alpha_pressure(const Scene *scene, Brush *brush)
+int BKE_brush_use_alpha_pressure(const Scene *scene, Brush *brush)
 {
        const short us_flag = scene->toolsettings->unified_paint_settings.flag;
 
@@ -675,7 +675,7 @@ int brush_use_alpha_pressure(const Scene *scene, Brush *brush)
                (brush->flag & BRUSH_ALPHA_PRESSURE);
 }
 
-void brush_set_unprojected_radius(Scene *scene, Brush *brush, float unprojected_radius)
+void BKE_brush_unprojected_radius_set(Scene *scene, Brush *brush, float unprojected_radius)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
@@ -685,7 +685,7 @@ void brush_set_unprojected_radius(Scene *scene, Brush *brush, float unprojected_
                brush->unprojected_radius= unprojected_radius;
 }
 
-float brush_unprojected_radius(const Scene *scene, Brush *brush)
+float BKE_brush_unprojected_radius_get(const Scene *scene, Brush *brush)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
@@ -694,7 +694,7 @@ float brush_unprojected_radius(const Scene *scene, Brush *brush)
                brush->unprojected_radius;
 }
 
-static void brush_set_alpha(Scene *scene, Brush *brush, float alpha)
+static void brush_alpha_set(Scene *scene, Brush *brush, float alpha)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
@@ -704,21 +704,21 @@ static void brush_set_alpha(Scene *scene, Brush *brush, float alpha)
                brush->alpha= alpha;
 }
 
-float brush_alpha(const Scene *scene, Brush *brush)
+float BKE_brush_alpha_get(const Scene *scene, Brush *brush)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
        return (ups->flag & UNIFIED_PAINT_ALPHA) ? ups->alpha : brush->alpha;
 }
 
-float brush_weight(const Scene *scene, Brush *brush)
+float BKE_brush_weight_get(const Scene *scene, Brush *brush)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
        return (ups->flag & UNIFIED_PAINT_WEIGHT) ? ups->weight : brush->weight;
 }
 
-void brush_set_weight(const Scene *scene, Brush *brush, float value)
+void BKE_brush_weight_set(const Scene *scene, Brush *brush, float value)
 {
        UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
 
@@ -729,9 +729,9 @@ void brush_set_weight(const Scene *scene, Brush *brush, float value)
 }
 
 /* scale unprojected radius to reflect a change in the brush's 2D size */
-void brush_scale_unprojected_radius(float *unprojected_radius,
-                                                                       int new_brush_size,
-                                                                       int old_brush_size)
+void BKE_brush_scale_unprojected_radius(float *unprojected_radius,
+                                        int new_brush_size,
+                                        int old_brush_size)
 {
        float scale = new_brush_size;
        /* avoid division by zero */
@@ -741,15 +741,15 @@ void brush_scale_unprojected_radius(float *unprojected_radius,
 }
 
 /* scale brush size to reflect a change in the brush's unprojected radius */
-void brush_scale_size(int *brush_size,
-                                         float new_unprojected_radius,
-                                         float old_unprojected_radius)
+void BKE_brush_scale_size(int *BKE_brush_size_get,
+                          float new_unprojected_radius,
+                          float old_unprojected_radius)
 {
        float scale = new_unprojected_radius;
        /* avoid division by zero */
        if (old_unprojected_radius != 0)
                scale /= new_unprojected_radius;
-       (*brush_size)= (int)((float)(*brush_size) * scale);
+       (*BKE_brush_size_get)= (int)((float)(*BKE_brush_size_get) * scale);
 }
 
 /* Brush Painting */
@@ -757,7 +757,7 @@ void brush_scale_size(int *brush_size,
 typedef struct BrushPainterCache {
        short enabled;
 
-       int size;                       /* size override, if 0 uses 2*brush_size(brush) */
+       int size;                       /* size override, if 0 uses 2*BKE_brush_size_get(brush) */
        short flt;                      /* need float imbuf? */
        short texonly;          /* no alpha, color or fallof, only texture in imbuf */
 
@@ -795,7 +795,7 @@ struct BrushPainter {
        BrushPainterCache cache;
 };
 
-BrushPainter *brush_painter_new(Scene *scene, Brush *brush)
+BrushPainter *BKE_brush_painter_new(Scene *scene, Brush *brush)
 {
        BrushPainter *painter= MEM_callocN(sizeof(BrushPainter), "BrushPainter");
 
@@ -804,15 +804,15 @@ BrushPainter *brush_painter_new(Scene *scene, Brush *brush)
        painter->firsttouch= 1;
        painter->cache.lastsize= -1; /* force ibuf create in refresh */
 
-       painter->startsize = brush_size(scene, brush);
-       painter->startalpha = brush_alpha(scene, brush);
+       painter->startsize = BKE_brush_size_get(scene, brush);
+       painter->startalpha = BKE_brush_alpha_get(scene, brush);
        painter->startjitter = brush->jitter;
        painter->startspacing = brush->spacing;
 
        return painter;
 }
 
-void brush_painter_require_imbuf(BrushPainter *painter, short flt, short texonly, int size)
+void BKE_brush_painter_require_imbuf(BrushPainter *painter, short flt, short texonly, int size)
 {
        if ((painter->cache.flt != flt) || (painter->cache.size != size) ||
                ((painter->cache.texonly != texonly) && texonly)) {
@@ -834,12 +834,12 @@ void brush_painter_require_imbuf(BrushPainter *painter, short flt, short texonly
        painter->cache.enabled= 1;
 }
 
-void brush_painter_free(BrushPainter *painter)
+void BKE_brush_painter_free(BrushPainter *painter)
 {
        Brush *brush = painter->brush;
 
-       brush_set_size(painter->scene, brush, painter->startsize);
-       brush_set_alpha(painter->scene, brush, painter->startalpha);
+       BKE_brush_size_set(painter->scene, brush, painter->startsize);
+       brush_alpha_set(painter->scene, brush, painter->startalpha);
        brush->jitter = painter->startjitter;
        brush->spacing = painter->startspacing;
 
@@ -859,7 +859,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
        float *bf, *mf, *tf, *otf=NULL, xoff, yoff, xy[2], rgba[4];
        unsigned char *b, *m, *t, *ot= NULL;
        int dotexold, origx= x, origy= y;
-       const int radius= brush_size(painter->scene, brush);
+       const int radius= BKE_brush_size_get(painter->scene, brush);
 
        xoff = -radius + 0.5f;
        yoff = -radius + 0.5f;
@@ -897,7 +897,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
                                        xy[0] = x + xoff;
                                        xy[1] = y + yoff;
 
-                                       brush_sample_tex(scene, brush, xy, tf, 0);
+                                       BKE_brush_sample_tex(scene, brush, xy, tf, 0);
                                }
 
                                bf[0] = tf[0]*mf[0];
@@ -928,7 +928,7 @@ static void brush_painter_do_partial(BrushPainter *painter, ImBuf *oldtexibuf,
                                        xy[0] = x + xoff;
                                        xy[1] = y + yoff;
 
-                                       brush_sample_tex(scene, brush, xy, rgba, 0);
+                                       BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
                                        rgba_float_to_uchar(t, rgba);
                                }
 
@@ -948,7 +948,7 @@ static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, const
        BrushPainterCache *cache= &painter->cache;
        ImBuf *oldtexibuf, *ibuf;
        int imbflag, destx, desty, srcx, srcy, w, h, x1, y1, x2, y2;
-       const int diameter= 2*brush_size(scene, brush);
+       const int diameter= 2*BKE_brush_size_get(scene, brush);
 
        imbflag= (cache->flt)? IB_rectfloat: IB_rect;
        if (!cache->ibuf)
@@ -1004,8 +1004,8 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2
        MTex *mtex= &brush->mtex;
        int size;
        short flt;
-       const int diameter= 2*brush_size(scene, brush);
-       const float alpha= brush_alpha(scene, brush);
+       const int diameter= 2*BKE_brush_size_get(scene, brush);
+       const float alpha= BKE_brush_alpha_get(scene, brush);
 
        if (diameter != cache->lastsize ||
                alpha != cache->lastalpha ||
@@ -1024,11 +1024,11 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2
                size= (cache->size)? cache->size: diameter;
 
                if (brush->flag & BRUSH_FIXED_TEX) {
-                       brush_imbuf_new(scene, brush, flt, 3, size, &cache->maskibuf, use_color_correction);
+                       BKE_brush_imbuf_new(scene, brush, flt, 3, size, &cache->maskibuf, use_color_correction);
                        brush_painter_fixed_tex_partial_update(painter, pos);
                }
                else
-                       brush_imbuf_new(scene, brush, flt, 2, size, &cache->ibuf, use_color_correction);
+                       BKE_brush_imbuf_new(scene, brush, flt, 2, size, &cache->ibuf, use_color_correction);
 
                cache->lastsize= diameter;
                cache->lastalpha= alpha;
@@ -1043,24 +1043,24 @@ static void brush_painter_refresh_cache(BrushPainter *painter, const float pos[2
        }
 }
 
-void brush_painter_break_stroke(BrushPainter *painter)
+void BKE_brush_painter_break_stroke(BrushPainter *painter)
 {
        painter->firsttouch= 1;
 }
 
-static void brush_apply_pressure(BrushPainter *painter, Brush *brush, float pressure)
+static void brush_pressure_apply(BrushPainter *painter, Brush *brush, float pressure)
 {
-       if (brush_use_alpha_pressure(painter->scene, brush)) 
-               brush_set_alpha(painter->scene, brush, MAX2(0.0f, painter->startalpha*pressure));
-       if (brush_use_size_pressure(painter->scene, brush))
-               brush_set_size(painter->scene, brush, MAX2(1.0f, painter->startsize*pressure));
+       if (BKE_brush_use_alpha_pressure(painter->scene, brush))
+               brush_alpha_set(painter->scene, brush, MAX2(0.0f, painter->startalpha*pressure));
+       if (BKE_brush_use_size_pressure(painter->scene, brush))
+               BKE_brush_size_set(painter->scene, brush, MAX2(1.0f, painter->startsize*pressure));
        if (brush->flag & BRUSH_JITTER_PRESSURE)
                brush->jitter = MAX2(0.0f, painter->startjitter*pressure);
        if (brush->flag & BRUSH_SPACING_PRESSURE)
                brush->spacing = MAX2(1.0f, painter->startspacing*(1.5f-pressure));
 }
 
-void brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2], float jitterpos[2])
+void BKE_brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2], float jitterpos[2])
 {
        int use_jitter= brush->jitter != 0;
 
@@ -1070,7 +1070,7 @@ void brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2], floa
 
        if (use_jitter) {
                float rand_pos[2];
-               const int radius= brush_size(scene, brush);
+               const int radius= BKE_brush_size_get(scene, brush);
                const int diameter= 2*radius;
 
                // find random position within a circle of diameter 1
@@ -1087,8 +1087,8 @@ void brush_jitter_pos(const Scene *scene, Brush *brush, const float pos[2], floa
        }
 }
 
-int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2], double time, float pressure,
-                        void *user, int use_color_correction)
+int BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2], double time, float pressure,
+                            void *user, int use_color_correction)
 {
        Scene *scene= painter->scene;
        Brush *brush= painter->brush;
@@ -1105,7 +1105,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
                painter->startpaintpos[0]= pos[0];
                painter->startpaintpos[1]= pos[1];
 
-               brush_apply_pressure(painter, brush, pressure);
+               brush_pressure_apply(painter, brush, pressure);
                if (painter->cache.enabled)
                        brush_painter_refresh_cache(painter, pos, use_color_correction);
                totpaintops += func(user, painter->cache.ibuf, pos, pos);
@@ -1152,11 +1152,11 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
        else {
                float startdistance, spacing, step, paintpos[2], dmousepos[2], finalpos[2];
                float t, len, press;
-               const int radius= brush_size(scene, brush);
+               const int radius= BKE_brush_size_get(scene, brush);
 
                /* compute brush spacing adapted to brush radius, spacing may depend
                 * on pressure, so update it */
-               brush_apply_pressure(painter, brush, painter->lastpressure);
+               brush_pressure_apply(painter, brush, painter->lastpressure);
                spacing= MAX2(1.0f, radius)*brush->spacing*0.01f;
 
                /* setup starting distance, direction vector and accumulated distance */
@@ -1174,10 +1174,10 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
 
                                t = step/len;
                                press= (1.0f-t)*painter->lastpressure + t*pressure;
-                               brush_apply_pressure(painter, brush, press);
+                               brush_pressure_apply(painter, brush, press);
                                spacing= MAX2(1.0f, radius)*brush->spacing*0.01f;
 
-                               brush_jitter_pos(scene, brush, paintpos, finalpos);
+                               BKE_brush_jitter_pos(scene, brush, paintpos, finalpos);
 
                                if (painter->cache.enabled)
                                        brush_painter_refresh_cache(painter, finalpos, use_color_correction);
@@ -1192,7 +1192,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
                        }
                }
                else {
-                       brush_jitter_pos(scene, brush, pos, finalpos);
+                       BKE_brush_jitter_pos(scene, brush, pos, finalpos);
 
                        if (painter->cache.enabled)
                                brush_painter_refresh_cache(painter, finalpos, use_color_correction);
@@ -1218,9 +1218,9 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
                                painter->accumtime -= painttime;
 
                        while (painter->accumtime >= (double)brush->rate) {
-                               brush_apply_pressure(painter, brush, pressure);
+                               brush_pressure_apply(painter, brush, pressure);
 
-                               brush_jitter_pos(scene, brush, pos, finalpos);
+                               BKE_brush_jitter_pos(scene, brush, pos, finalpos);
 
                                if (painter->cache.enabled)
                                        brush_painter_refresh_cache(painter, finalpos, use_color_correction);
@@ -1238,8 +1238,8 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
        painter->lastmousepos[1]= pos[1];
        painter->lastpressure= pressure;
 
-       brush_set_alpha(scene, brush, painter->startalpha);
-       brush_set_size(scene, brush, painter->startsize);
+       brush_alpha_set(scene, brush, painter->startalpha);
+       BKE_brush_size_set(scene, brush, painter->startsize);
        brush->jitter = painter->startjitter;
        brush->spacing = painter->startspacing;
 
@@ -1247,7 +1247,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2
 }
 
 /* Uses the brush curve control to find a strength value between 0 and 1 */
-float brush_curve_strength_clamp(Brush *br, float p, const float len)
+float BKE_brush_curve_strength_clamp(Brush *br, float p, const float len)
 {
        if (p >= len)   return 0;
        else                    p= p/len;
@@ -1259,7 +1259,7 @@ float brush_curve_strength_clamp(Brush *br, float p, const float len)
 }
 /* same as above but can return negative values if the curve enables
  * used for sculpt only */
-float brush_curve_strength(Brush *br, float p, const float len)
+float BKE_brush_curve_strength(Brush *br, float p, const float len)
 {
        if (p >= len)
                p= 1.0f;
@@ -1270,7 +1270,7 @@ float brush_curve_strength(Brush *br, float p, const float len)
 }
 
 /* TODO: should probably be unified with BrushPainter stuff? */
-unsigned int *brush_gen_texture_cache(Brush *br, int half_side)
+unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side)
 {
        unsigned int *texcache = NULL;
        MTex *mtex = &br->mtex;
@@ -1316,7 +1316,7 @@ unsigned int *brush_gen_texture_cache(Brush *br, int half_side)
 }
 
 /**** Radial Control ****/
-struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
+struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br)
 {
        ImBuf *im = MEM_callocN(sizeof(ImBuf), "radial control texture");
        unsigned int *texcache;
@@ -1324,14 +1324,14 @@ struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
        int half = side / 2;
        int i, j;
 
-       texcache = brush_gen_texture_cache(br, half);
+       texcache = BKE_brush_gen_texture_cache(br, half);
        im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect");
        im->x = im->y = side;
 
        for (i=0; i<side; ++i) {
                for (j=0; j<side; ++j) {
                        float magn= sqrt(pow(i - half, 2) + pow(j - half, 2));
-                       im->rect_float[i*side + j]= brush_curve_strength_clamp(br, magn, half);
+                       im->rect_float[i*side + j]= BKE_brush_curve_strength_clamp(br, magn, half);
                }
        }
 
index 2be22e0e28b0db29a6ff78d9cc4cf292d2ca3b45..6aff331e1b48e5e837a8e5801d5befdfa1dc044a 100644 (file)
 
 /****************************** Camera Datablock *****************************/
 
-void *add_camera(const char *name)
+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;
@@ -69,18 +69,18 @@ void *add_camera(const char *name)
        return cam;
 }
 
-Camera *copy_camera(Camera *cam)
+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);
 
        return camn;
 }
 
-void make_local_camera(Camera *cam)
+void BKE_camera_make_local(Camera *cam)
 {
        Main *bmain= G.main;
        Object *ob;
@@ -108,7 +108,7 @@ void make_local_camera(Camera *cam)
                id_clear_lib_data(bmain, &cam->id);
        }
        else if (is_local && is_lib) {
-               Camera *cam_new= copy_camera(cam);
+               Camera *cam_new= BKE_camera_copy(cam);
 
                cam_new->id.us= 0;
 
@@ -127,14 +127,14 @@ void make_local_camera(Camera *cam)
        }
 }
 
-void free_camera(Camera *ca)
+void BKE_camera_free(Camera *ca)
 {
        BKE_free_animdata((ID *)ca);
 }
 
 /******************************** Camera Usage *******************************/
 
-void object_camera_mode(RenderData *rd, Object *cam_ob)
+void BKE_camera_object_mode(RenderData *rd, Object *cam_ob)
 {
        rd->mode &= ~(R_ORTHO|R_PANORAMA);
 
@@ -146,7 +146,7 @@ void object_camera_mode(RenderData *rd, Object *cam_ob)
 }
 
 /* get the camera's dof value, takes the dof object into account */
-float object_camera_dof_distance(Object *ob)
+float BKE_camera_object_dof_distance(Object *ob)
 {
        Camera *cam = (Camera *)ob->data; 
        if (ob->type != OB_CAMERA)
@@ -165,7 +165,7 @@ float object_camera_dof_distance(Object *ob)
        return cam->YF_dofdist;
 }
 
-float camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
+float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
 {
        /* sensor size used to fit to. for auto, sensor_x is both x and y. */
        if (sensor_fit == CAMERA_SENSOR_FIT_VERT)
@@ -174,7 +174,7 @@ float camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
        return sensor_x;
 }
 
-int camera_sensor_fit(int sensor_fit, float sizex, float sizey)
+int BKE_camera_sensor_fit(int sensor_fit, float sizex, float sizey)
 {
        if (sensor_fit == CAMERA_SENSOR_FIT_AUTO) {
                if (sizex >= sizey)
@@ -188,7 +188,7 @@ int camera_sensor_fit(int sensor_fit, float sizex, float sizey)
 
 /******************************** Camera Params *******************************/
 
-void camera_params_init(CameraParams *params)
+void BKE_camera_params_init(CameraParams *params)
 {
        memset(params, 0, sizeof(CameraParams));
 
@@ -200,7 +200,7 @@ void camera_params_init(CameraParams *params)
        params->zoom= 1.0f;
 }
 
-void camera_params_from_object(CameraParams *params, Object *ob)
+void BKE_camera_params_from_object(CameraParams *params, Object *ob)
 {
        if (!ob)
                return;
@@ -239,7 +239,7 @@ void camera_params_from_object(CameraParams *params, Object *ob)
        }
 }
 
-void camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *rv3d)
+void BKE_camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *rv3d)
 {
        /* common */
        params->lens= v3d->lens;
@@ -248,7 +248,7 @@ void camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *
 
        if (rv3d->persp==RV3D_CAMOB) {
                /* camera view */
-               camera_params_from_object(params, v3d->camera);
+               BKE_camera_params_from_object(params, v3d->camera);
 
                params->zoom= BKE_screen_view3d_zoom_to_fac((float)rv3d->camzoom);
 
@@ -275,7 +275,7 @@ void camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView3D *
        }
 }
 
-void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float xasp, float yasp)
+void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float xasp, float yasp)
 {
        rctf viewplane;
        float pixsize, viewfac, sensor_size, dx, dy;
@@ -293,12 +293,12 @@ void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, f
        }
        else {
                /* perspective camera */
-               sensor_size= camera_sensor_size(params->sensor_fit, params->sensor_x, params->sensor_y);
+               sensor_size= BKE_camera_sensor_size(params->sensor_fit, params->sensor_x, params->sensor_y);
                pixsize= (sensor_size * params->clipsta)/params->lens;
        }
 
        /* determine sensor fit */
-       sensor_fit = camera_sensor_fit(params->sensor_fit, xasp*winx, yasp*winy);
+       sensor_fit = BKE_camera_sensor_fit(params->sensor_fit, xasp*winx, yasp*winy);
 
        if (sensor_fit==CAMERA_SENSOR_FIT_HOR)
                viewfac= winx;
@@ -351,23 +351,23 @@ void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, f
 }
 
 /* viewplane is assumed to be already computed */
-void camera_params_compute_matrix(CameraParams *params)
+void BKE_camera_params_compute_matrix(CameraParams *params)
 {
-       rctf viewplane= params->viewplane;
+       rctf viewplane = params->viewplane;
 
        /* compute projection matrix */
        if (params->is_ortho)
                orthographic_m4(params->winmat, viewplane.xmin, viewplane.xmax,
-                       viewplane.ymin, viewplane.ymax, params->clipsta, params->clipend);
+                               viewplane.ymin, viewplane.ymax, params->clipsta, params->clipend);
        else
                perspective_m4(params->winmat, viewplane.xmin, viewplane.xmax,
-                       viewplane.ymin, viewplane.ymax, params->clipsta, params->clipend);
+                              viewplane.ymin, viewplane.ymax, params->clipsta, params->clipend);
 }
 
 /***************************** Camera View Frame *****************************/
 
-void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3],
-                          float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3])
+void BKE_camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3],
+                              float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3])
 {
        float facx, facy;
        float depth;
@@ -376,7 +376,7 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
        if (scene) {
                float aspx= (float) scene->r.xsch*scene->r.xasp;
                float aspy= (float) scene->r.ysch*scene->r.yasp;
-               int sensor_fit= camera_sensor_fit(camera->sensor_fit, aspx, aspy);
+               int sensor_fit= BKE_camera_sensor_fit(camera->sensor_fit, aspx, aspy);
 
                if (sensor_fit==CAMERA_SENSOR_FIT_HOR) {
                        r_asp[0]= 1.0;
@@ -431,14 +431,14 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
        r_vec[3][0]= r_shift[0] - facx; r_vec[3][1]= r_shift[1] + facy; r_vec[3][2]= depth;
 }
 
-void camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3])
+void BKE_camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3])
 {
        float dummy_asp[2];
        float dummy_shift[2];
        float dummy_drawsize;
        const float dummy_scale[3]= {1.0f, 1.0f, 1.0f};
 
-       camera_view_frame_ex(scene, camera, FALSE, 1.0, dummy_scale,
+       BKE_camera_view_frame_ex(scene, camera, FALSE, 1.0, dummy_scale,
                             dummy_asp, dummy_shift, &dummy_drawsize, r_vec);
 }
 
@@ -450,7 +450,7 @@ typedef struct CameraViewFrameData {
        unsigned int tot;
 } CameraViewFrameData;
 
-static void camera_to_frame_view_cb(const float co[3], void *user_data)
+static void BKE_camera_to_frame_view_cb(const float co[3], void *user_data)
 {
        CameraViewFrameData *data= (CameraViewFrameData *)user_data;
        unsigned int i;
@@ -467,7 +467,7 @@ static void camera_to_frame_view_cb(const float co[3], void *user_data)
 
 /* don't move the camera, just yield the fit location */
 /* only valid for perspective cameras */
-int camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object *camera_ob, float r_co[3])
+int BKE_camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object *camera_ob, float r_co[3])
 {
        float shift[2];
        float plane_tx[4][3];
@@ -477,7 +477,7 @@ int camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object *cam
 
        unsigned int i;
 
-       camera_view_frame(scene, camera_ob->data, data_cb.frame_tx);
+       BKE_camera_view_frame(scene, camera_ob->data, data_cb.frame_tx);
 
        copy_m3_m4(rot_obmat, camera_ob->obmat);
        normalize_m3(rot_obmat);
@@ -514,7 +514,7 @@ int camera_view_frame_fit_to_scene(Scene *scene, struct View3D *v3d, Object *cam
        data_cb.tot= 0;
        /* run callback on all visible points */
        BKE_scene_foreach_display_point(scene, v3d, BA_SELECT,
-                                       camera_to_frame_view_cb, &data_cb);
+                                       BKE_camera_to_frame_view_cb, &data_cb);
 
        if (data_cb.tot <= 1) {
                return FALSE;
index 47b497188ec5e241bd0a851f276f6591ac773c7d..66209e8a924d1f5ab9a429979e00499e69521580 100644 (file)
@@ -308,7 +308,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
                                /* pose to local */
                                else if (to == CONSTRAINT_SPACE_LOCAL) {
                                        if (pchan->bone) {
-                                               armature_mat_pose_to_bone(pchan, mat, mat);
+                                               BKE_armature_mat_pose_to_bone(pchan, mat, mat);
 #if 0  /* XXX Old code, will remove it later. */
                                                constraint_pchan_diff_mat(pchan, diff_mat);
 
@@ -317,7 +317,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
 
                                                /* override with local location */
                                                if ((pchan->parent) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) {
-                                                       armature_mat_pose_to_bone_ex(ob, pchan, pchan->pose_mat, tempmat);
+                                                       BKE_armature_mat_pose_to_bone_ex(ob, pchan, pchan->pose_mat, tempmat);
                                                        copy_v3_v3(mat[3], tempmat[3]);
                                                }
 #endif
@@ -337,7 +337,7 @@ void constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[][4]
                                /* local to pose - do inverse procedure that was done for pose to local */
                                if (pchan->bone) {
                                        /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */
-                                       armature_mat_bone_to_pose(pchan, mat, mat);
+                                       BKE_armature_mat_bone_to_pose(pchan, mat, mat);
 #if 0
                                        constraint_pchan_diff_mat(pchan, diff_mat);
 
@@ -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]);
                                
@@ -593,7 +593,7 @@ static void constraint_target_to_mat4 (Object *ob, const char *substring, float
        else {
                bPoseChannel *pchan;
                
-               pchan = get_pose_channel(ob->pose, substring);
+               pchan = BKE_pose_channel_find_name(ob->pose, substring);
                if (pchan) {
                        /* Multiply the PoseSpace accumulation/final matrix for this
                         * PoseChannel by the Armature Object's Matrix to get a worldspace
@@ -687,7 +687,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC
                 \
                if (ct->tar) { \
                        if ((ct->tar->type==OB_ARMATURE) && (ct->subtarget[0])) { \
-                               bPoseChannel *pchan= get_pose_channel(ct->tar->pose, ct->subtarget); \
+                               bPoseChannel *pchan= BKE_pose_channel_find_name(ct->tar->pose, ct->subtarget); \
                                ct->type = CONSTRAINT_OBTYPE_BONE; \
                                ct->rotOrder= (pchan) ? (pchan->rotmode) : EULER_ORDER_DEFAULT; \
                        }\
@@ -781,7 +781,7 @@ static void childof_id_looper (bConstraint *con, ConstraintIDFunc func, void *us
        bChildOfConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int childof_get_tars (bConstraint *con, ListBase *list)
@@ -917,7 +917,7 @@ static void trackto_id_looper (bConstraint *con, ConstraintIDFunc func, void *us
        bTrackToConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int trackto_get_tars (bConstraint *con, ListBase *list)
@@ -1098,10 +1098,10 @@ static void kinematic_id_looper (bConstraint *con, ConstraintIDFunc func, void *
        bKinematicConstraint *data= con->data;
        
        /* chain target */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
        
        /* poletarget */
-       func(con, (ID**)&data->poletar, userdata);
+       func(con, (ID**)&data->poletar, FALSE, userdata);
 }
 
 static int kinematic_get_tars (bConstraint *con, ListBase *list)
@@ -1191,7 +1191,7 @@ static void followpath_id_looper (bConstraint *con, ConstraintIDFunc func, void
        bFollowPathConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int followpath_get_tars (bConstraint *con, ListBase *list)
@@ -1541,7 +1541,7 @@ static void loclike_id_looper (bConstraint *con, ConstraintIDFunc func, void *us
        bLocateLikeConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int loclike_get_tars (bConstraint *con, ListBase *list)
@@ -1632,7 +1632,7 @@ static void rotlike_id_looper (bConstraint *con, ConstraintIDFunc func, void *us
        bChildOfConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int rotlike_get_tars (bConstraint *con, ListBase *list)
@@ -1745,7 +1745,7 @@ static void sizelike_id_looper (bConstraint *con, ConstraintIDFunc func, void *u
        bSizeLikeConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int sizelike_get_tars (bConstraint *con, ListBase *list)
@@ -1835,7 +1835,7 @@ static void translike_id_looper (bConstraint *con, ConstraintIDFunc func, void *
        bTransLikeConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int translike_get_tars (bConstraint *con, ListBase *list)
@@ -2007,10 +2007,10 @@ static void pycon_id_looper (bConstraint *con, ConstraintIDFunc func, void *user
        
        /* targets */
        for (ct= data->targets.first; ct; ct= ct->next)
-               func(con, (ID**)&ct->tar, userdata);
+               func(con, (ID**)&ct->tar, FALSE, userdata);
                
        /* script */
-       func(con, (ID**)&data->text, userdata);
+       func(con, (ID**)&data->text, TRUE, userdata);
 }
 
 /* Whether this approach is maintained remains to be seen (aligorith) */
@@ -2107,10 +2107,10 @@ static void actcon_id_looper (bConstraint *con, ConstraintIDFunc func, void *use
        bActionConstraint *data= con->data;
        
        /* target */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
        
        /* action */
-       func(con, (ID**)&data->act, userdata);
+       func(con, (ID**)&data->act, TRUE, userdata);
 }
 
 static int actcon_get_tars (bConstraint *con, ListBase *list)
@@ -2199,18 +2199,18 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
                         */
                        pchan = cob->pchan;
                        
-                       tchan= verify_pose_channel(pose, pchan->name);
+                       tchan= BKE_pose_channel_verify(pose, pchan->name);
                        tchan->rotmode= pchan->rotmode;
                        
                        /* evaluate action using workob (it will only set the PoseChannel in question) */
                        what_does_obaction(cob->ob, &workob, pose, data->act, pchan->name, t);
                        
                        /* convert animation to matrices for use here */
-                       pchan_calc_mat(tchan);
+                       BKE_pchan_calc_mat(tchan);
                        copy_m4_m4(ct->matrix, tchan->chan_mat);
                        
                        /* Clean up */
-                       free_pose(pose);
+                       BKE_pose_free(pose);
                }
                else if (cob->type == CONSTRAINT_OBTYPE_OBJECT) {
                        Object workob;
@@ -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... */
@@ -2273,7 +2273,7 @@ static void locktrack_id_looper (bConstraint *con, ConstraintIDFunc func, void *
        bLockTrackConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int locktrack_get_tars (bConstraint *con, ListBase *list)
@@ -2584,7 +2584,7 @@ static void distlimit_id_looper (bConstraint *con, ConstraintIDFunc func, void *
        bDistLimitConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int distlimit_get_tars (bConstraint *con, ListBase *list)
@@ -2712,7 +2712,7 @@ static void stretchto_id_looper (bConstraint *con, ConstraintIDFunc func, void *
        bStretchToConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int stretchto_get_tars (bConstraint *con, ListBase *list)
@@ -2887,7 +2887,7 @@ static void minmax_id_looper (bConstraint *con, ConstraintIDFunc func, void *use
        bMinMaxConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int minmax_get_tars (bConstraint *con, ListBase *list)
@@ -3030,8 +3030,8 @@ static void rbj_id_looper (bConstraint *con, ConstraintIDFunc func, void *userda
        bRigidBodyJointConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
-       func(con, (ID**)&data->child, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
+       func(con, (ID**)&data->child, FALSE, userdata);
 }
 
 static int rbj_get_tars (bConstraint *con, ListBase *list)
@@ -3083,7 +3083,7 @@ static void clampto_id_looper (bConstraint *con, ConstraintIDFunc func, void *us
        bClampToConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int clampto_get_tars (bConstraint *con, ListBase *list)
@@ -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) {
@@ -3268,7 +3268,7 @@ static void transform_id_looper (bConstraint *con, ConstraintIDFunc func, void *
        bTransformConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int transform_get_tars (bConstraint *con, ListBase *list)
@@ -3403,10 +3403,10 @@ static bConstraintTypeInfo CTI_TRANSFORM = {
 
 static void shrinkwrap_id_looper (bConstraint *con, ConstraintIDFunc func, void *userdata)
 {
-       bShrinkwrapConstraint *data= con->data;
+       bShrinkwrapConstraint *data = con->data;
        
        /* target only */
-       func(con, (ID**)&data->target, userdata);
+       func(con, (ID**)&data->target, FALSE, userdata);
 }
 
 static int shrinkwrap_get_tars (bConstraint *con, ListBase *list)
@@ -3571,7 +3571,7 @@ static void damptrack_id_looper (bConstraint *con, ConstraintIDFunc func, void *
        bDampTrackConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int damptrack_get_tars (bConstraint *con, ListBase *list)
@@ -3717,7 +3717,7 @@ static void splineik_id_looper (bConstraint *con, ConstraintIDFunc func, void *u
        bSplineIKConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int splineik_get_tars (bConstraint *con, ListBase *list)
@@ -3790,7 +3790,7 @@ static void pivotcon_id_looper (bConstraint *con, ConstraintIDFunc func, void *u
        bPivotConstraint *data= con->data;
        
        /* target only */
-       func(con, (ID**)&data->tar, userdata);
+       func(con, (ID**)&data->tar, FALSE, userdata);
 }
 
 static int pivotcon_get_tars (bConstraint *con, ListBase *list)
@@ -3922,9 +3922,9 @@ static void followtrack_id_looper(bConstraint *con, ConstraintIDFunc func, void
 {
        bFollowTrackConstraint *data = con->data;
 
-       func(con, (ID**)&data->clip, userdata);
-       func(con, (ID**)&data->camera, userdata);
-       func(con, (ID**)&data->depth_ob, userdata);
+       func(con, (ID**)&data->clip, TRUE, userdata);
+       func(con, (ID**)&data->camera, FALSE, userdata);
+       func(con, (ID**)&data->depth_ob, FALSE, userdata);
 }
 
 static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
@@ -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;
@@ -4012,8 +4012,8 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
 
                        add_v2_v2v2(pos, marker->pos, track->offset);
 
-                       camera_params_init(&params);
-                       camera_params_from_object(&params, camob);
+                       BKE_camera_params_init(&params);
+                       BKE_camera_params_from_object(&params, camob);
 
                        if (params.is_ortho) {
                                vec[0] = params.ortho_scale * (pos[0] - 0.5f + params.shiftx);
@@ -4116,7 +4116,7 @@ static void camerasolver_id_looper(bConstraint *con, ConstraintIDFunc func, void
 {
        bCameraSolverConstraint *data = con->data;
 
-       func(con, (ID**)&data->clip, userdata);
+       func(con, (ID**)&data->clip, TRUE, userdata);
 }
 
 static void camerasolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
@@ -4172,8 +4172,8 @@ static void objectsolver_id_looper(bConstraint *con, ConstraintIDFunc func, void
 {
        bObjectSolverConstraint *data= con->data;
 
-       func(con, (ID**)&data->clip, userdata);
-       func(con, (ID**)&data->camera, userdata);
+       func(con, (ID**)&data->clip, FALSE, userdata);
+       func(con, (ID**)&data->camera, FALSE, userdata);
 }
 
 static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
@@ -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);
 
@@ -4535,12 +4535,20 @@ void id_loop_constraints(ListBase *conlist, ConstraintIDFunc func, void *userdat
 /* ......... */
 
 /* helper for copy_constraints(), to be used for making sure that ID's are valid */
-static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, void *UNUSED(userData))
+static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *UNUSED(userData))
 {
        if (*idpoin && (*idpoin)->lib)
                id_lib_extern(*idpoin);
 }
 
+/* helper for copy_constraints(), to be used for making sure that usercounts of copied ID's are fixed up */
+static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData))
+{
+       /* increment usercount if this is a reference type */
+       if ((*idpoin) && (isReference))
+               id_us_plus(*idpoin);
+}
+
 /* duplicate all of the constraints in a constraint stack */
 void copy_constraints(ListBase *dst, const ListBase *src, int do_extern)
 {
@@ -4560,6 +4568,10 @@ void copy_constraints(ListBase *dst, const ListBase *src, int do_extern)
                        /* perform custom copying operations if needed */
                        if (cti->copy_data)
                                cti->copy_data(con, srccon);
+                               
+                       /* fix usercounts for all referenced data in referenced data */
+                       if (cti->id_looper)
+                               cti->id_looper(con, con_fix_copied_refs_cb, NULL);
                        
                        /* for proxies we don't want to make extern */
                        if (do_extern) {
index 906757bdd6287201288469f04dc7582aa1d74c48..f4879b8d851527be34f9c9aef362e023216dfde8 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;
@@ -170,10 +170,10 @@ Curve *BKE_curve_add(const char *name, int type)
        cu->twist_mode= CU_TWIST_MINIMUM;       // XXX: this one seems to be the best one in most cases, at least for curve deform...
        cu->type= type;
        
-       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();
+               cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= BKE_vfont_builtin_get();
                cu->vfont->id.us+=4;
                cu->str= MEM_mallocN(12, "str");
                BLI_strncpy(cu->str, "Text", 12);
@@ -192,7 +192,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));
 
@@ -206,7 +206,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;
@@ -383,7 +383,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 d8cdd728c16e71e62eb82f29566ba5628ed540e7..45298aa0b3b594e511f3d546a8e39d6b4be7e67a 100644 (file)
@@ -1895,7 +1895,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;
                }
@@ -2608,7 +2608,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);
@@ -2835,7 +2835,7 @@ void DAG_pose_sort(Object *ob)
                                
                                for (ct= targets.first; ct; ct= ct->next) {
                                        if (ct->tar==ob && ct->subtarget[0]) {
-                                               bPoseChannel *target= get_pose_channel(ob->pose, ct->subtarget);
+                                               bPoseChannel *target= BKE_pose_channel_find_name(ob->pose, ct->subtarget);
                                                if (target) {
                                                        node2= dag_get_node(dag, target);
                                                        dag_add_relation(dag, node2, node, 0, "Pose Constraint");
index 1411c910894eceac9fdebc2c4c3c7e9464935d27..7bd95dfa7dd38f2d7e58bf5a734543c6cc6b28e2 100644 (file)
@@ -432,7 +432,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                totvert= 0;
                nextcol= 0;
                
-               BLI_begin_edgefill(&sf_ctx);
+               BLI_scanfill_begin(&sf_ctx);
                
                dl= dispbase->first;
                while (dl) {
@@ -449,18 +449,18 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                                                while (a--) {
                                                        vlast= eve;
 
-                                                       eve = BLI_addfillvert(&sf_ctx, f1);
+                                                       eve = BLI_scanfill_vert_add(&sf_ctx, f1);
                                                        totvert++;
 
                                                        if (vlast==NULL) v1= eve;
                                                        else {
-                                                               BLI_addfilledge(&sf_ctx, vlast, eve);
+                                                               BLI_scanfill_edge_add(&sf_ctx, vlast, eve);
                                                        }
                                                        f1+=3;
                                                }
 
                                                if (eve!=NULL && v1!=NULL) {
-                                                       BLI_addfilledge(&sf_ctx, eve, v1);
+                                                       BLI_scanfill_edge_add(&sf_ctx, eve, v1);
                                                }
                                        }
                                        else if (colnr<dl->col) {
@@ -473,7 +473,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                        dl= dl->next;
                }
                
-               if (totvert && (tot= BLI_edgefill(&sf_ctx, FALSE))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
+               if (totvert && (tot= BLI_scanfill_calc(&sf_ctx, FALSE))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
                        if (tot) {
                                dlnew= MEM_callocN(sizeof(DispList), "filldisplist");
                                dlnew->type= DL_INDEX3;
@@ -518,7 +518,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                        BLI_addhead(to, dlnew);
                        
                }
-               BLI_end_edgefill(&sf_ctx);
+               BLI_scanfill_end(&sf_ctx);
 
                if (nextcol) {
                        /* stay at current char but fill polys with next material */
@@ -1269,7 +1269,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                if (cu->path) free_path(cu->path);
                cu->path= NULL;
 
-               if (ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0);
+               if (ob->type==OB_FONT) BKE_vfont_to_curve(G.main, scene, ob, 0);
 
                if (!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
 
@@ -1528,7 +1528,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 6c5826c5babc77f45b2c556c77993e38b13cbce6..2bde31cfd632daaafe7287eadd668f1d75334af7 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;
 }
@@ -3066,7 +3066,7 @@ static void dynamicPaint_brushMeshCalculateVelocity(Scene *scene, Object *ob, Dy
        scene->r.cfra = prev_fra;
        scene->r.subframe = prev_sfra;
 
-       subframe_updateObject(scene, ob, UPDATE_EVERYTHING, BKE_curframe(scene));
+       subframe_updateObject(scene, ob, UPDATE_EVERYTHING, BKE_scene_frame_get(scene));
        dm_p = CDDM_copy(brush->dm);
        numOfVerts_p = dm_p->getNumVerts(dm_p);
        mvert_p = dm_p->getVertArray(dm_p);
@@ -3076,7 +3076,7 @@ static void dynamicPaint_brushMeshCalculateVelocity(Scene *scene, Object *ob, Dy
        scene->r.cfra = cur_fra;
        scene->r.subframe = cur_sfra;
 
-       subframe_updateObject(scene, ob, UPDATE_EVERYTHING, BKE_curframe(scene));
+       subframe_updateObject(scene, ob, UPDATE_EVERYTHING, BKE_scene_frame_get(scene));
        dm_c = brush->dm;
        numOfVerts_c = dm_c->getNumVerts(dm_c);
        mvert_c = dm_p->getVertArray(dm_c);
@@ -3126,13 +3126,13 @@ static void dynamicPaint_brushObjectCalculateVelocity(Scene *scene, Object *ob,
        /* previous frame dm */
        scene->r.cfra = prev_fra;
        scene->r.subframe = prev_sfra;
-       subframe_updateObject(scene, ob, UPDATE_PARENTS, BKE_curframe(scene));
+       subframe_updateObject(scene, ob, UPDATE_PARENTS, BKE_scene_frame_get(scene));
        copy_m4_m4(prev_obmat, ob->obmat);
 
        /* current frame dm */
        scene->r.cfra = cur_fra;
        scene->r.subframe = cur_sfra;
-       subframe_updateObject(scene, ob, UPDATE_PARENTS, BKE_curframe(scene));
+       subframe_updateObject(scene, ob, UPDATE_PARENTS, BKE_scene_frame_get(scene));
 
        /* calculate speed */
        mul_m4_v3(prev_obmat, prev_loc);
@@ -4841,7 +4841,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
                                        /* update object data on this subframe */
                                        if (subframe) {
                                                scene_setSubframe(scene, subframe);
-                                               subframe_updateObject(scene, brushObj, UPDATE_EVERYTHING, BKE_curframe(scene));
+                                               subframe_updateObject(scene, brushObj, UPDATE_EVERYTHING, BKE_scene_frame_get(scene));
                                        }
                                        /* Prepare materials if required        */
                                        if (brush_usesMaterial(brush, scene))
@@ -4854,7 +4854,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
                                                        psys_check_enabled(brushObj, brush->psys)) {
 
                                                        /* Paint a particle system */
-                                                       BKE_animsys_evaluate_animdata(scene, &brush->psys->part->id, brush->psys->part->adt, BKE_curframe(scene), ADT_RECALC_ANIM);
+                                                       BKE_animsys_evaluate_animdata(scene, &brush->psys->part->id, brush->psys->part->adt, BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
                                                        dynamicPaint_paintParticles(surface, brush->psys, brush, timescale);
                                                }
                                        }
@@ -4874,7 +4874,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
                                        if (subframe) {
                                                scene->r.cfra = scene_frame;
                                                scene->r.subframe = scene_subframe;
-                                               subframe_updateObject(scene, brushObj, UPDATE_EVERYTHING, BKE_curframe(scene));
+                                               subframe_updateObject(scene, brushObj, UPDATE_EVERYTHING, BKE_scene_frame_get(scene));
                                        }
 
                                        /* process special brush effects, like smudge */
index 5e3f886c7623a439cda6e2c9b92a0596dd40dbae..34794bd5b1f90bd0efac549088b50e1490e75b31 100644 (file)
@@ -197,18 +197,18 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
                        ScanFillFace *efa;
                        int totfilltri;
 
-                       BLI_begin_edgefill(&sf_ctx);
+                       BLI_scanfill_begin(&sf_ctx);
                        /*scanfill time*/
                        l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f);
                        for (j=0; l; l=BM_iter_step(&liter), j++) {
                                /*mark order*/
                                BM_elem_index_set(l, j); /* set_loop */
 
-                               v = BLI_addfillvert(&sf_ctx, l->v->co);
+                               v = BLI_scanfill_vert_add(&sf_ctx, l->v->co);
                                v->tmp.p = l;
 
                                if (lastv) {
-                                       /* e = */ BLI_addfilledge(&sf_ctx, lastv, v);
+                                       /* e = */ BLI_scanfill_edge_add(&sf_ctx, lastv, v);
                                }
 
                                lastv = v;
@@ -216,9 +216,9 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
                        }
 
                        /*complete the loop*/
-                       BLI_addfilledge(&sf_ctx, firstv, v);
+                       BLI_scanfill_edge_add(&sf_ctx, firstv, v);
 
-                       totfilltri = BLI_edgefill_ex(&sf_ctx, FALSE, f->no);
+                       totfilltri = BLI_scanfill_calc_ex(&sf_ctx, FALSE, f->no);
                        BLI_array_grow_items(looptris, totfilltri);
 
                        for (efa = sf_ctx.fillfacebase.first; efa; efa=efa->next) {
@@ -236,7 +236,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
                                i += 1;
                        }
 
-                       BLI_end_edgefill(&sf_ctx);
+                       BLI_scanfill_end(&sf_ctx);
                }
        }