From 299ff91ea1fe5623bea1c6775cb8250d5e4ec3a0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 5 May 2012 14:33:36 +0000 Subject: code cleanup: BKE_scene api naming. also stop numpy from being found in /usr/include with cmake. --- source/blender/blenkernel/intern/action.c | 2 +- source/blender/blenkernel/intern/anim.c | 4 +- source/blender/blenkernel/intern/armature.c | 2 +- source/blender/blenkernel/intern/blender.c | 2 +- source/blender/blenkernel/intern/dynamicpaint.c | 14 ++-- source/blender/blenkernel/intern/group.c | 6 +- source/blender/blenkernel/intern/image.c | 2 +- source/blender/blenkernel/intern/mball.c | 18 +++--- source/blender/blenkernel/intern/node.c | 2 +- source/blender/blenkernel/intern/object.c | 8 +-- source/blender/blenkernel/intern/particle.c | 4 +- source/blender/blenkernel/intern/particle_system.c | 2 +- source/blender/blenkernel/intern/pointcache.c | 8 +-- source/blender/blenkernel/intern/scene.c | 74 +++++++++++----------- source/blender/blenkernel/intern/sequencer.c | 6 +- source/blender/blenkernel/intern/tracking.c | 2 +- 16 files changed, 78 insertions(+), 78 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 9ed1a2e8956..addbde139d2 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1453,7 +1453,7 @@ 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) { diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 353caece2be..96e962bc3d3 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -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 } @@ -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; diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index e2d90b60ffa..56275f5735b 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2452,7 +2452,7 @@ void where_is_pose(Scene *scene, Object *ob) if ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC)) armature_rebuild_pose(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)) { diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index b0bfd2ee98d..58ada7b0784 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -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); diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index fde5d2d2a2d..2bde31cfd63 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -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 */ diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 6e105c7d0bb..c722522250c 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -52,7 +52,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" -#include "BKE_scene.h" /* object_in_scene */ +#include "BKE_scene.h" /* BKE_scene_base_find */ static void free_group_object(GroupObject *go) { @@ -182,7 +182,7 @@ int add_to_group(Group *group, Object *object, Scene *scene, Base *base) if ((object->flag & OB_FROMGROUP)==0) { if (scene && base==NULL) - base= object_in_scene(object, scene); + base= BKE_scene_base_find(scene, object); object->flag |= OB_FROMGROUP; @@ -223,7 +223,7 @@ int rem_from_group(Group *group, Object *object, Scene *scene, Base *base) /* object can be NULL */ if (object && find_group(object, NULL) == NULL) { if (scene && base==NULL) - base= object_in_scene(object, scene); + base= BKE_scene_base_find(scene, object); object->flag &= ~OB_FROMGROUP; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 77728e4114a..8262e8722c6 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1222,7 +1222,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d } if (scene->r.stamp & R_STAMP_MARKER) { - char *name = scene_find_last_marker_name(scene, CFRA); + char *name = BKE_scene_find_last_marker_name(scene, CFRA); if (name) BLI_strncpy(text, name, sizeof(text)); else BLI_strncpy(text, "", sizeof(text)); diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 9fd8707cc01..a841649e007 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -482,11 +482,11 @@ void BKE_metaball_properties_copy(Scene *scene, Object *active_object) BLI_split_name_num(basisname, &basisnr, active_object->id.name+2, '.'); - /* XXX recursion check, see scene.c, just too simple code this next_object() */ - if (F_ERROR==next_object(&sce_iter, 0, NULL, NULL)) + /* XXX recursion check, see scene.c, just too simple code this BKE_scene_base_iter_next() */ + if (F_ERROR==BKE_scene_base_iter_next(&sce_iter, 0, NULL, NULL)) return; - while (next_object(&sce_iter, 1, &base, &ob)) { + while (BKE_scene_base_iter_next(&sce_iter, 1, &base, &ob)) { if (ob->type==OB_MBALL) { if (ob != active_object) { BLI_split_name_num(obname, &obnr, ob->id.name+2, '.'); @@ -528,11 +528,11 @@ Object *BKE_metaball_basis_find(Scene *scene, Object *basis) BLI_split_name_num(basisname, &basisnr, basis->id.name+2, '.'); totelem= 0; - /* XXX recursion check, see scene.c, just too simple code this next_object() */ - if (F_ERROR==next_object(&sce_iter, 0, NULL, NULL)) + /* XXX recursion check, see scene.c, just too simple code this BKE_scene_base_iter_next() */ + if (F_ERROR==BKE_scene_base_iter_next(&sce_iter, 0, NULL, NULL)) return NULL; - while (next_object(&sce_iter, 1, &base, &ob)) { + while (BKE_scene_base_iter_next(&sce_iter, 1, &base, &ob)) { if (ob->type==OB_MBALL) { if (ob==bob) { @@ -1701,15 +1701,15 @@ static float init_meta(Scene *scene, Object *ob) /* return totsize */ int a, obnr, zero_size=0; char obname[MAX_ID_NAME]; - copy_m4_m4(obmat, ob->obmat); /* to cope with duplicators from next_object */ + copy_m4_m4(obmat, ob->obmat); /* to cope with duplicators from BKE_scene_base_iter_next */ invert_m4_m4(obinv, ob->obmat); a= 0; BLI_split_name_num(obname, &obnr, ob->id.name+2, '.'); /* make main array */ - next_object(&sce_iter, 0, NULL, NULL); - while (next_object(&sce_iter, 1, &base, &bob)) { + BKE_scene_base_iter_next(&sce_iter, 0, NULL, NULL); + while (BKE_scene_base_iter_next(&sce_iter, 1, &base, &bob)) { if (bob->type==OB_MBALL) { zero_size= 0; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 5d76458b157..7832947be73 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2093,7 +2093,7 @@ void free_nodesystem(void) free_typeinfos(&ntreeGetType(NTREE_TEXTURE)->node_types); } -/* called from unlink_scene, when deleting a scene goes over all scenes +/* called from BKE_scene_unlink, when deleting a scene goes over all scenes * other than the input, checks if they have render layer nodes referencing * the to-be-deleted scene, and resets them to NULL. */ diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 37d261c6d29..3cdf45e3569 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -862,9 +862,9 @@ Object *BKE_object_add(struct Scene *scene, int type) ob->lay= scene->lay; - base= scene_add_base(scene, ob); - scene_deselect_all(scene); - scene_select_base(scene, base); + base= BKE_scene_base_add(scene, ob); + BKE_scene_base_deselect_all(scene); + BKE_scene_base_select(scene, base); ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; return ob; @@ -1211,7 +1211,7 @@ void BKE_object_make_local(Object *ob) } else { for (sce= bmain->scene.first; sce && ELEM(0, is_lib, is_local); sce= sce->id.next) { - if (object_in_scene(ob, sce)) { + if (BKE_scene_base_find(sce, ob)) { if (sce->id.lib) is_lib= TRUE; else is_local= TRUE; } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 7b2cb147597..0e56839a6e9 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3475,7 +3475,7 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n psys->totpart=0; psys->flag = PSYS_ENABLED|PSYS_CURRENT; - psys->cfra = BKE_frame_to_ctime(scene, CFRA + 1); + psys->cfra = BKE_scene_frame_get_from_ctime(scene, CFRA + 1); DAG_scene_sort(G.main, scene); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -4266,7 +4266,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta float timestep = psys_get_timestep(sim); /* negative time means "use current time" */ - cfra = state->time > 0 ? state->time : BKE_curframe(sim->scene); + cfra = state->time > 0 ? state->time : BKE_scene_frame_get(sim->scene); if (p>=totpart) { if (!psys->totchild) diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 63db4d5e854..e5c95c116fd 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4465,7 +4465,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys) if (!psys_check_enabled(ob, psys)) return; - cfra= BKE_curframe(scene); + cfra= BKE_scene_frame_get(scene); sim.scene= scene; sim.ob= ob; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index b24007ec491..69808db52b6 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2320,8 +2320,8 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra cache= pid->cache; if (timescale) { - time= BKE_curframe(scene); - nexttime = BKE_frame_to_ctime(scene, CFRA + 1.0f); + time= BKE_scene_frame_get(scene); + nexttime = BKE_scene_frame_get_from_ctime(scene, CFRA + 1.0f); *timescale= MAX2(nexttime - time, 0.0f); } @@ -2743,7 +2743,7 @@ static void *ptcache_bake_thread(void *ptr) efra = data->endframe; for (; (*data->cfra_ptr <= data->endframe) && !data->break_operation; *data->cfra_ptr+=data->step) { - scene_update_for_newframe(data->main, data->scene, data->scene->lay); + BKE_scene_update_for_newframe(data->main, data->scene, data->scene->lay); if (G.background) { printf("bake: frame %d :: %d\n", (int)*data->cfra_ptr, data->endframe); } @@ -2974,7 +2974,7 @@ void BKE_ptcache_bake(PTCacheBaker* baker) CFRA = cfrao; if (bake) /* already on cfra unless baking */ - scene_update_for_newframe(bmain, scene, scene->lay); + BKE_scene_update_for_newframe(bmain, scene, scene->lay); if (thread_data.break_operation) WM_cursor_wait(0); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 6c21b462a7a..9e21538b5ca 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -110,7 +110,7 @@ void free_qtcodecdata(QuicktimeCodecData *qcd) } } -Scene *copy_scene(Scene *sce, int type) +Scene *BKE_scene_copy(Scene *sce, int type) { Scene *scen; ToolSettings *ts; @@ -118,7 +118,7 @@ Scene *copy_scene(Scene *sce, int type) if (type == SCE_COPY_EMPTY) { ListBase lb; - scen= add_scene(sce->id.name+2); + scen= BKE_scene_add(sce->id.name+2); lb= scen->r.layers; scen->r= sce->r; @@ -332,7 +332,7 @@ void BKE_scene_free(Scene *sce) sound_destroy_scene(sce); } -Scene *add_scene(const char *name) +Scene *BKE_scene_add(const char *name) { Main *bmain= G.main; Scene *sce; @@ -490,7 +490,7 @@ Scene *add_scene(const char *name) sce->r.osa= 8; /* note; in header_info.c the scene copy happens..., if you add more to renderdata it has to be checked there */ - scene_add_render_layer(sce, NULL); + BKE_scene_add_render_layer(sce, NULL); /* game data */ sce->gm.stereoflag = STEREO_NOSTEREO; @@ -544,11 +544,11 @@ Scene *add_scene(const char *name) return sce; } -Base *object_in_scene(Object *ob, Scene *sce) +Base *BKE_scene_base_find(Scene *scene, Object *ob) { Base *base; - base= sce->base.first; + base= scene->base.first; while (base) { if (base->object == ob) return base; base= base->next; @@ -556,7 +556,7 @@ Base *object_in_scene(Object *ob, Scene *sce) return NULL; } -void set_scene_bg(Main *bmain, Scene *scene) +void BKE_scene_set_background(Main *bmain, Scene *scene) { Scene *sce; Base *base; @@ -566,7 +566,7 @@ void set_scene_bg(Main *bmain, Scene *scene) int flag; /* check for cyclic sets, for reading old files but also for definite security (py?) */ - scene_check_setscene(bmain, scene); + BKE_scene_validate_setscene(bmain, scene); /* can happen when switching modes in other scenes */ if (scene->obedit && !(scene->obedit->mode & OB_MODE_EDIT)) @@ -613,11 +613,11 @@ void set_scene_bg(Main *bmain, Scene *scene) } /* called from creator.c */ -Scene *set_scene_name(Main *bmain, const char *name) +Scene *BKE_scene_set_name(Main *bmain, const char *name) { Scene *sce= (Scene *)find_id("SC", name); if (sce) { - set_scene_bg(bmain, sce); + BKE_scene_set_background(bmain, sce); printf("Scene switch: '%s' in file: '%s'\n", name, G.main->name); return sce; } @@ -626,7 +626,7 @@ Scene *set_scene_name(Main *bmain, const char *name) return NULL; } -void unlink_scene(Main *bmain, Scene *sce, Scene *newsce) +void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce) { Scene *sce1; bScreen *sc; @@ -653,7 +653,7 @@ void unlink_scene(Main *bmain, Scene *sce, Scene *newsce) /* used by metaballs * doesnt return the original duplicated object, only dupli's */ -int next_object(Scene **scene, int val, Base **base, Object **ob) +int BKE_scene_base_iter_next(Scene **scene, int val, Base **base, Object **ob) { static ListBase *duplilist= NULL; static DupliObject *dupob; @@ -776,7 +776,7 @@ int next_object(Scene **scene, int val, Base **base, Object **ob) return fase; } -Object *scene_find_camera(Scene *sc) +Object *BKE_scene_camera_find(Scene *sc) { Base *base; @@ -788,7 +788,7 @@ Object *scene_find_camera(Scene *sc) } #ifdef DURIAN_CAMERA_SWITCH -Object *scene_camera_switch_find(Scene *scene) +Object *BKE_scene_camera_switch_find(Scene *scene) { TimeMarker *m; int cfra = scene->r.cfra; @@ -809,10 +809,10 @@ Object *scene_camera_switch_find(Scene *scene) } #endif -int scene_camera_switch_update(Scene *scene) +int BKE_scene_camera_switch_update(Scene *scene) { #ifdef DURIAN_CAMERA_SWITCH - Object *camera= scene_camera_switch_find(scene); + Object *camera= BKE_scene_camera_switch_find(scene); if (camera) { scene->camera= camera; return 1; @@ -823,7 +823,7 @@ int scene_camera_switch_update(Scene *scene) return 0; } -char *scene_find_marker_name(Scene *scene, int frame) +char *BKE_scene_find_marker_name(Scene *scene, int frame) { ListBase *markers= &scene->markers; TimeMarker *m1, *m2; @@ -845,7 +845,7 @@ char *scene_find_marker_name(Scene *scene, int frame) /* return the current marker for this frame, * we can have more then 1 marker per frame, this just returns the first :/ */ -char *scene_find_last_marker_name(Scene *scene, int frame) +char *BKE_scene_find_last_marker_name(Scene *scene, int frame) { TimeMarker *marker, *best_marker = NULL; int best_frame = -MAXFRAME*2; @@ -864,9 +864,9 @@ char *scene_find_last_marker_name(Scene *scene, int frame) } -Base *scene_add_base(Scene *sce, Object *ob) +Base *BKE_scene_base_add(Scene *sce, Object *ob) { - Base *b= MEM_callocN(sizeof(*b), "scene_add_base"); + Base *b= MEM_callocN(sizeof(*b), "BKE_scene_base_add"); BLI_addhead(&sce->base, b); b->object= ob; @@ -876,7 +876,7 @@ Base *scene_add_base(Scene *sce, Object *ob) return b; } -void scene_deselect_all(Scene *sce) +void BKE_scene_base_deselect_all(Scene *sce) { Base *b; @@ -886,7 +886,7 @@ void scene_deselect_all(Scene *sce) } } -void scene_select_base(Scene *sce, Base *selbase) +void BKE_scene_base_select(Scene *sce, Base *selbase) { selbase->flag |= SELECT; selbase->object->flag= selbase->flag; @@ -895,7 +895,7 @@ void scene_select_base(Scene *sce, Base *selbase) } /* checks for cycle, returns 1 if it's all OK */ -int scene_check_setscene(Main *bmain, Scene *sce) +int BKE_scene_validate_setscene(Main *bmain, Scene *sce) { Scene *scene; int a, totscene; @@ -921,13 +921,13 @@ int scene_check_setscene(Main *bmain, Scene *sce) /* This function is needed to cope with fractional frames - including two Blender rendering features * mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. */ -float BKE_curframe(Scene *scene) +float BKE_scene_frame_get(Scene *scene) { - return BKE_frame_to_ctime(scene, scene->r.cfra); + return BKE_scene_frame_get_from_ctime(scene, scene->r.cfra); } /* This function is used to obtain arbitrary fractional frames */ -float BKE_frame_to_ctime(Scene *scene, const float frame) +float BKE_scene_frame_get_from_ctime(Scene *scene, const float frame) { float ctime = frame; ctime += scene->r.subframe; @@ -944,7 +944,7 @@ float BKE_frame_to_ctime(Scene *scene, const float frame) */ static void scene_update_drivers(Main *UNUSED(bmain), Scene *scene) { - float ctime = BKE_curframe(scene); + float ctime = BKE_scene_frame_get(scene); /* scene itself */ if (scene->adt && scene->adt->drivers.first) { @@ -1004,7 +1004,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen } /* this is called in main loop, doing tagged updates before redraw */ -void scene_update_tagged(Main *bmain, Scene *scene) +void BKE_scene_update_tagged(Main *bmain, Scene *scene) { /* keep this first */ BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE); @@ -1024,7 +1024,7 @@ void scene_update_tagged(Main *bmain, Scene *scene) /* extra call here to recalc scene animation (for sequencer) */ { AnimData *adt= BKE_animdata_from_id(&scene->id); - float ctime = BKE_curframe(scene); + float ctime = BKE_scene_frame_get(scene); if (adt && (adt->recalc & ADT_RECALC_ANIM)) BKE_animsys_evaluate_animdata(scene, &scene->id, adt, ctime, 0); @@ -1043,9 +1043,9 @@ void scene_update_tagged(Main *bmain, Scene *scene) } /* applies changes right away, does all sets too */ -void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) +void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) { - float ctime = BKE_curframe(sce); + float ctime = BKE_scene_frame_get(sce); Scene *sce_iter; /* keep this first */ @@ -1064,7 +1064,7 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) /* flush recalc flags to dependencies, if we were only changing a frame * this would not be necessary, but if a user or a script has modified - * some datablock before scene_update_tagged was called, we need the flush */ + * some datablock before BKE_scene_update_tagged was called, we need the flush */ DAG_ids_flush_tagged(bmain); /* Following 2 functions are recursive @@ -1094,7 +1094,7 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) } /* return default layer, also used to patch old files */ -SceneRenderLayer *scene_add_render_layer(Scene *sce, const char *name) +SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name) { SceneRenderLayer *srl; @@ -1114,7 +1114,7 @@ SceneRenderLayer *scene_add_render_layer(Scene *sce, const char *name) return srl; } -int scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl) +int BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl) { const int act= BLI_findindex(&scene->r.layers, srl); Scene *sce; @@ -1209,13 +1209,13 @@ Base *_setlooper_base_step(Scene **sce_iter, Base *base) return NULL; } -int scene_use_new_shading_nodes(Scene *scene) +int BKE_scene_use_new_shading_nodes(Scene *scene) { RenderEngineType *type= RE_engines_find(scene->r.engine); return (type && type->flag & RE_USE_SHADING_NODES); } -void copy_baseflags(struct Scene *scene) +void BKE_scene_base_flag_to_objects(struct Scene *scene) { Base *base= scene->base.first; @@ -1225,7 +1225,7 @@ void copy_baseflags(struct Scene *scene) } } -void copy_objectflags(struct Scene *scene) +void BKE_scene_base_flag_from_objects(struct Scene *scene) { Base *base= scene->base.first; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 395214b1609..6e043c74816 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2099,7 +2099,7 @@ static ImBuf *seq_render_scene_strip( if (seq->scene_camera) camera = seq->scene_camera; else { - scene_camera_switch_update(scene); + BKE_scene_camera_switch_update(scene); camera = scene->camera; } @@ -2127,7 +2127,7 @@ static ImBuf *seq_render_scene_strip( context.scene->r.seq_prev_type = 3 /* ==OB_SOLID */; /* opengl offscreen render */ - scene_update_for_newframe(context.bmain, scene, scene->lay); + BKE_scene_update_for_newframe(context.bmain, scene, scene->lay); ibuf = sequencer_view3d_cb(scene, camera, context.rectx, context.recty, IB_rect, context.scene->r.seq_prev_type, TRUE, err_out); if (ibuf == NULL) { @@ -2182,7 +2182,7 @@ static ImBuf *seq_render_scene_strip( scene->r.cfra = oldcfra; if (frame != oldcfra) - scene_update_for_newframe(context.bmain, scene, scene->lay); + BKE_scene_update_for_newframe(context.bmain, scene, scene->lay); #ifdef DURIAN_CAMERA_SWITCH /* stooping to new low's in hackyness :( */ diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 144fd9ddb20..b68102885ea 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -2123,7 +2123,7 @@ void BKE_get_tracking_mat(Scene *scene, Object *ob, float mat[4][4]) if (scene->camera) ob = scene->camera; else - ob = scene_find_camera(scene); + ob = BKE_scene_camera_find(scene); } if (ob) -- cgit v1.2.3