code cleanup: BKE_scene api naming.
also stop numpy from being found in /usr/include with cmake.
This commit is contained in:
@@ -1641,6 +1641,7 @@ if(WITH_PYTHON)
|
||||
PATH_SUFFIXES
|
||||
site-packages
|
||||
dist-packages
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(NOT EXISTS "${PYTHON_NUMPY_PATH}")
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -62,39 +62,43 @@ void free_avicodecdata(struct AviCodecData *acd);
|
||||
void free_qtcodecdata(struct QuicktimeCodecData *acd);
|
||||
|
||||
void BKE_scene_free(struct Scene *sce);
|
||||
struct Scene *add_scene(const char *name);
|
||||
struct Base *object_in_scene(struct Object *ob, struct Scene *sce);
|
||||
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,10 +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);
|
||||
|
||||
void copy_baseflags(struct Scene *scene);
|
||||
void copy_objectflags(struct Scene *scene);
|
||||
int BKE_scene_use_new_shading_nodes(struct Scene *scene);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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, "<none>", sizeof(text));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 :( */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -8529,7 +8529,7 @@ static int object_in_any_scene(Main *mainvar, Object *ob)
|
||||
Scene *sce;
|
||||
|
||||
for (sce= mainvar->scene.first; sce; sce= sce->id.next)
|
||||
if (object_in_scene(ob, sce))
|
||||
if (BKE_scene_base_find(sce, ob))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -8611,7 +8611,7 @@ static void give_base_to_groups(Main *mainvar, Scene *scene)
|
||||
ob->lay= scene->lay;
|
||||
|
||||
/* assign the base */
|
||||
base= scene_add_base(scene, ob);
|
||||
base= BKE_scene_base_add(scene, ob);
|
||||
base->flag |= SELECT;
|
||||
base->object->flag= base->flag;
|
||||
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
|
||||
|
||||
@@ -2144,7 +2144,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
|
||||
if (sce->r.yparts<2) sce->r.yparts= 4;
|
||||
/* adds default layer */
|
||||
if (sce->r.layers.first==NULL)
|
||||
scene_add_render_layer(sce, NULL);
|
||||
BKE_scene_add_render_layer(sce, NULL);
|
||||
else {
|
||||
SceneRenderLayer *srl;
|
||||
/* new layer flag for sky, was default for solid */
|
||||
|
||||
@@ -753,7 +753,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj
|
||||
for (it = frames.begin(); it != frames.end(); it++) {
|
||||
float mat[4][4], ipar[4][4];
|
||||
|
||||
float ctime = BKE_frame_to_ctime(scene, *it);
|
||||
float ctime = BKE_scene_frame_get_from_ctime(scene, *it);
|
||||
|
||||
BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
|
||||
where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
|
||||
@@ -1278,7 +1278,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
|
||||
for (it = frames.begin(); it != frames.end(); it++) {
|
||||
float mat[4][4], ipar[4][4];
|
||||
|
||||
float ctime = BKE_frame_to_ctime(scene, *it);
|
||||
float ctime = BKE_scene_frame_get_from_ctime(scene, *it);
|
||||
|
||||
|
||||
BKE_animsys_evaluate_animdata(scene, &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
|
||||
|
||||
@@ -1772,7 +1772,7 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root, COLLADAFW::No
|
||||
if (joint_objects.find(node->getUniqueId()) == joint_objects.end()) {
|
||||
Object *job = bc_add_object(scene, OB_EMPTY, (char*)get_joint_name(node));
|
||||
|
||||
job->lay = object_in_scene(job, scene)->lay = 2;
|
||||
job->lay = BKE_scene_base_find(scene, job)->lay = 2;
|
||||
|
||||
mul_v3_fl(job->size, 0.5f);
|
||||
job->recalc |= OB_RECALC_OB;
|
||||
|
||||
@@ -122,7 +122,7 @@ bool DocumentImporter::import()
|
||||
loader.registerExtraDataCallbackHandler(ehandler);
|
||||
|
||||
// deselect all to select new objects
|
||||
scene_deselect_all(CTX_data_scene(mContext));
|
||||
BKE_scene_base_deselect_all(CTX_data_scene(mContext));
|
||||
|
||||
if (!root.loadDocument(mFilename)) {
|
||||
fprintf(stderr, "COLLADAFW::Root::loadDocument() returned false on 1st pass\n");
|
||||
@@ -227,7 +227,7 @@ void DocumentImporter::finish()
|
||||
for (it = libnode_ob.begin(); it != libnode_ob.end(); it++) {
|
||||
Object *ob = *it;
|
||||
|
||||
Base *base = object_in_scene(ob, sce);
|
||||
Base *base = BKE_scene_base_find(sce, ob);
|
||||
if (base) {
|
||||
BLI_remlink(&sce->base, base);
|
||||
BKE_libblock_free_us(&G.main->object, base->object);
|
||||
@@ -340,7 +340,7 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
|
||||
|
||||
Object *obn = BKE_object_copy(source_ob);
|
||||
obn->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
|
||||
scene_add_base(sce, obn);
|
||||
BKE_scene_base_add(sce, obn);
|
||||
|
||||
if (instance_node) {
|
||||
anim_importer.read_node_transform(instance_node, obn);
|
||||
|
||||
@@ -120,7 +120,7 @@ Object *bc_add_object(Scene *scene, int type, const char *name)
|
||||
ob->lay= scene->lay;
|
||||
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
|
||||
|
||||
scene_select_base(scene, scene_add_base(scene, ob));
|
||||
BKE_scene_base_select(scene, BKE_scene_base_add(scene, ob));
|
||||
|
||||
return ob;
|
||||
}
|
||||
|
||||
@@ -1048,7 +1048,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
|
||||
int sel= 0;
|
||||
|
||||
if (!extend)
|
||||
scene_deselect_all(scene);
|
||||
BKE_scene_base_deselect_all(scene);
|
||||
|
||||
for (marker= markers->first; marker; marker= marker->next) {
|
||||
if (marker->frame==cfra) {
|
||||
@@ -1060,7 +1060,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
|
||||
for (marker= markers->first; marker; marker= marker->next) {
|
||||
if (marker->camera) {
|
||||
if (marker->frame==cfra) {
|
||||
base= object_in_scene(marker->camera, scene);
|
||||
base= BKE_scene_base_find(scene, marker->camera);
|
||||
if (base) {
|
||||
ED_base_object_select(base, sel);
|
||||
if (sel)
|
||||
@@ -1437,7 +1437,7 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
marker->camera= ob;
|
||||
|
||||
/* camera may have changes */
|
||||
scene_camera_switch_update(scene);
|
||||
BKE_scene_camera_switch_update(scene);
|
||||
BKE_screen_view3d_scene_sync(sc);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
|
||||
|
||||
@@ -292,7 +292,7 @@ short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter);
|
||||
* Checks whether a keyframe exists for the given ID-block one the given frame.
|
||||
* - It is recommended to call this method over the other keyframe-checkers directly,
|
||||
* in case some detail of the implementation changes...
|
||||
* - frame: the value of this is quite often result of BKE_curframe()
|
||||
* - frame: the value of this is quite often result of BKE_scene_frame_get()
|
||||
*/
|
||||
short id_frame_has_keyframe(struct ID *id, float frame, short filter);
|
||||
|
||||
|
||||
@@ -2150,7 +2150,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
|
||||
uiItemL(sub, name, icon);
|
||||
|
||||
ma = give_current_material(ob, index + 1);
|
||||
if (ma && !scene_use_new_shading_nodes(scene)) {
|
||||
if (ma && !BKE_scene_use_new_shading_nodes(scene)) {
|
||||
manode = give_node_material(ma);
|
||||
if (manode) {
|
||||
char str[MAX_ID_NAME + 12];
|
||||
|
||||
@@ -316,8 +316,8 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
|
||||
}
|
||||
else {
|
||||
obedit = base->object;
|
||||
scene_deselect_all(scene);
|
||||
scene_select_base(scene, base);
|
||||
BKE_scene_base_deselect_all(scene);
|
||||
BKE_scene_base_select(scene, base);
|
||||
copy_v3_v3(obedit->loc, co);
|
||||
copy_v3_v3(obedit->rot, rot);
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
|
||||
rename_id(&ob->id, get_lamp_defname(type));
|
||||
rename_id(&la->id, get_lamp_defname(type));
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
ED_node_shader_default(scene, &la->id);
|
||||
la->use_nodes = 1;
|
||||
}
|
||||
@@ -923,7 +923,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
|
||||
|
||||
for (scene_iter = bmain->scene.first; scene_iter; scene_iter = scene_iter->id.next) {
|
||||
if (scene_iter != scene && !(scene_iter->id.lib)) {
|
||||
base_other = object_in_scene(base->object, scene_iter);
|
||||
base_other = BKE_scene_base_find(scene_iter, base->object);
|
||||
if (base_other) {
|
||||
ED_base_object_free_and_unlink(bmain, scene_iter, base_other);
|
||||
}
|
||||
|
||||
@@ -419,8 +419,8 @@ static Object *add_hook_object_new(Scene *scene, Object *obedit)
|
||||
|
||||
ob = BKE_object_add(scene, OB_EMPTY);
|
||||
|
||||
basedit = object_in_scene(obedit, scene);
|
||||
base = object_in_scene(ob, scene);
|
||||
basedit = BKE_scene_base_find(scene, obedit);
|
||||
base = BKE_scene_base_find(scene, ob);
|
||||
base->lay = ob->lay = obedit->lay;
|
||||
|
||||
/* icky, BKE_object_add sets new base as active.
|
||||
|
||||
@@ -1217,7 +1217,7 @@ static int make_links_scene_exec(bContext *C, wmOperator *op)
|
||||
|
||||
CTX_DATA_BEGIN (C, Base *, base, selected_bases)
|
||||
{
|
||||
if (!object_in_scene(base->object, scene_to)) {
|
||||
if (!BKE_scene_base_find(scene_to, base->object)) {
|
||||
Base *nbase = MEM_mallocN(sizeof(Base), "newbase");
|
||||
*nbase = *base;
|
||||
BLI_addhead(&(scene_to->base), nbase);
|
||||
|
||||
@@ -416,7 +416,7 @@ static short select_grouped_parent(bContext *C) /* Makes parent active and de-se
|
||||
|
||||
if (!basact || !(basact->object->parent)) return 0; /* we know OBACT is valid */
|
||||
|
||||
baspar = object_in_scene(basact->object->parent, scene);
|
||||
baspar = BKE_scene_base_find(scene, basact->object->parent);
|
||||
|
||||
/* can be NULL if parent in other scene */
|
||||
if (baspar && BASE_SELECTABLE(v3d, baspar)) {
|
||||
@@ -487,7 +487,7 @@ static short select_grouped_object_hooks(bContext *C, Object *ob)
|
||||
if (md->type == eModifierType_Hook) {
|
||||
hmd = (HookModifierData *) md;
|
||||
if (hmd->object && !(hmd->object->flag & SELECT)) {
|
||||
base = object_in_scene(hmd->object, scene);
|
||||
base = BKE_scene_base_find(scene, hmd->object);
|
||||
if (base && (BASE_SELECTABLE(v3d, base))) {
|
||||
ED_base_object_select(base, BA_SELECT);
|
||||
changed = 1;
|
||||
@@ -886,7 +886,7 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op)
|
||||
if (strcmp(tmpname, primbase->object->id.name + 2) != 0) { /* names differ */
|
||||
Object *ob = (Object *)find_id("OB", tmpname);
|
||||
if (ob) {
|
||||
Base *secbase = object_in_scene(ob, scene);
|
||||
Base *secbase = BKE_scene_base_find(scene, ob);
|
||||
|
||||
if (secbase) {
|
||||
ED_base_object_select(secbase, BA_SELECT);
|
||||
|
||||
@@ -170,7 +170,7 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s
|
||||
if (scn) {
|
||||
/* camera switch wont have updated */
|
||||
scn->r.cfra = (*scene)->r.cfra;
|
||||
scene_camera_switch_update(scn);
|
||||
BKE_scene_camera_switch_update(scn);
|
||||
|
||||
*scene = scn;
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender)
|
||||
|
||||
if (oglrender->timer) { /* exec will not have a timer */
|
||||
scene->r.cfra = oglrender->cfrao;
|
||||
scene_update_for_newframe(bmain, scene, screen_opengl_layers(oglrender));
|
||||
BKE_scene_update_for_newframe(bmain, scene, screen_opengl_layers(oglrender));
|
||||
|
||||
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), oglrender->timer);
|
||||
}
|
||||
@@ -478,7 +478,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
|
||||
Object *camera = NULL;
|
||||
|
||||
/* update animated image textures for gpu, etc,
|
||||
* call before scene_update_for_newframe so modifiers with textures don't lag 1 frame */
|
||||
* call before BKE_scene_update_for_newframe so modifiers with textures don't lag 1 frame */
|
||||
ED_image_update_frame(bmain, scene->r.cfra);
|
||||
|
||||
/* go to next frame */
|
||||
@@ -488,17 +488,17 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
|
||||
if (lay & 0xFF000000)
|
||||
lay &= 0xFF000000;
|
||||
|
||||
scene_update_for_newframe(bmain, scene, lay);
|
||||
BKE_scene_update_for_newframe(bmain, scene, lay);
|
||||
CFRA++;
|
||||
}
|
||||
|
||||
scene_update_for_newframe(bmain, scene, screen_opengl_layers(oglrender));
|
||||
BKE_scene_update_for_newframe(bmain, scene, screen_opengl_layers(oglrender));
|
||||
|
||||
if (view_context) {
|
||||
if (oglrender->rv3d->persp == RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) {
|
||||
/* since scene_update_for_newframe() is used rather
|
||||
/* since BKE_scene_update_for_newframe() is used rather
|
||||
* then ED_update_for_newframe() the camera needs to be set */
|
||||
if (scene_camera_switch_update(scene)) {
|
||||
if (BKE_scene_camera_switch_update(scene)) {
|
||||
oglrender->v3d->camera = scene->camera;
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
else {
|
||||
scene_camera_switch_update(scene);
|
||||
BKE_scene_camera_switch_update(scene);
|
||||
|
||||
camera = scene->camera;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
else {
|
||||
ma = add_material("Material");
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
ED_node_shader_default(scene, &ma->id);
|
||||
ma->use_nodes = 1;
|
||||
}
|
||||
@@ -477,7 +477,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
else {
|
||||
wo = add_world("World");
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
ED_node_shader_default(scene, &wo->id);
|
||||
wo->use_nodes = 1;
|
||||
}
|
||||
@@ -521,7 +521,7 @@ static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
scene_add_render_layer(scene, NULL);
|
||||
BKE_scene_add_render_layer(scene, NULL);
|
||||
scene->r.actlay = BLI_countlist(&scene->r.layers) - 1;
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||
@@ -548,7 +548,7 @@ static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
SceneRenderLayer *rl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
||||
|
||||
if (!scene_remove_render_layer(CTX_data_main(C), scene, rl))
|
||||
if (!BKE_scene_remove_render_layer(CTX_data_main(C), scene, rl))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||
|
||||
@@ -1471,8 +1471,8 @@ void ED_screen_set_scene(bContext *C, bScreen *screen, Scene *scene)
|
||||
|
||||
BKE_screen_view3d_sync(v3d, scene);
|
||||
|
||||
if (!v3d->camera || !object_in_scene(v3d->camera, scene)) {
|
||||
v3d->camera= scene_find_camera(sc->scene);
|
||||
if (!v3d->camera || !BKE_scene_base_find(scene, v3d->camera)) {
|
||||
v3d->camera= BKE_scene_camera_find(sc->scene);
|
||||
// XXX if (sc==curscreen) handle_view3d_lock();
|
||||
if (!v3d->camera) {
|
||||
ARegion *ar;
|
||||
@@ -1495,7 +1495,7 @@ void ED_screen_set_scene(bContext *C, bScreen *screen, Scene *scene)
|
||||
}
|
||||
|
||||
CTX_data_scene_set(C, scene);
|
||||
set_scene_bg(bmain, scene);
|
||||
BKE_scene_set_background(bmain, scene);
|
||||
|
||||
ED_render_engine_changed(bmain);
|
||||
ED_update_for_newframe(bmain, scene, screen, 1);
|
||||
@@ -1520,7 +1520,7 @@ void ED_screen_delete_scene(bContext *C, Scene *scene)
|
||||
|
||||
ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
|
||||
|
||||
unlink_scene(bmain, scene, newscene);
|
||||
BKE_scene_unlink(bmain, scene, newscene);
|
||||
}
|
||||
|
||||
ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
|
||||
@@ -1816,7 +1816,7 @@ void ED_screen_animation_timer_update(bScreen *screen, int redraws, int refresh)
|
||||
void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUSED(mute))
|
||||
{
|
||||
#ifdef DURIAN_CAMERA_SWITCH
|
||||
void *camera= scene_camera_switch_find(scene);
|
||||
void *camera= BKE_scene_camera_switch_find(scene);
|
||||
if (camera && scene->camera != camera) {
|
||||
bScreen *sc;
|
||||
scene->camera= camera;
|
||||
@@ -1830,14 +1830,14 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, bScreen *screen, int UNUS
|
||||
//extern void audiostream_scrub(unsigned int frame); /* seqaudio.c */
|
||||
|
||||
/* update animated image textures for gpu, etc,
|
||||
* call before scene_update_for_newframe so modifiers with textures don't lag 1 frame */
|
||||
* call before BKE_scene_update_for_newframe so modifiers with textures don't lag 1 frame */
|
||||
ED_image_update_frame(bmain, scene->r.cfra);
|
||||
|
||||
ED_clip_update_frame(bmain, scene->r.cfra);
|
||||
|
||||
/* this function applies the changes too */
|
||||
/* XXX future: do all windows */
|
||||
scene_update_for_newframe(bmain, scene, BKE_screen_visible_layers(screen, scene)); /* BKE_scene.h */
|
||||
BKE_scene_update_for_newframe(bmain, scene, BKE_screen_visible_layers(screen, scene)); /* BKE_scene.h */
|
||||
|
||||
//if ( (CFRA>1) && (!mute) && (scene->r.audio.flag & AUDIO_SCRUB))
|
||||
// audiostream_scrub( CFRA );
|
||||
|
||||
@@ -3319,10 +3319,10 @@ static int scene_new_exec(bContext *C, wmOperator *op)
|
||||
int type= RNA_enum_get(op->ptr, "type");
|
||||
|
||||
if (type == SCE_COPY_NEW) {
|
||||
newscene= add_scene("Scene");
|
||||
newscene= BKE_scene_add("Scene");
|
||||
}
|
||||
else { /* different kinds of copying */
|
||||
newscene= copy_scene(scene, type);
|
||||
newscene= BKE_scene_copy(scene, type);
|
||||
|
||||
/* these can't be handled in blenkernel curently, so do them here */
|
||||
if (type == SCE_COPY_LINK_DATA) {
|
||||
|
||||
@@ -310,7 +310,7 @@ typedef struct ProjPaintState {
|
||||
short do_occlude; /* Use raytraced occlusion? - ortherwise will paint right through to the back*/
|
||||
short do_backfacecull; /* ignore faces with normals pointing away, skips a lot of raycasts if your normals are correctly flipped */
|
||||
short do_mask_normal; /* mask out pixels based on their normals */
|
||||
short do_new_shading_nodes; /* cache scene_use_new_shading_nodes value */
|
||||
short do_new_shading_nodes; /* cache BKE_scene_use_new_shading_nodes value */
|
||||
float normal_angle; /* what angle to mask at*/
|
||||
float normal_angle_inner;
|
||||
float normal_angle_range; /* difference between normal_angle and normal_angle_inner, for easy access */
|
||||
@@ -526,7 +526,7 @@ static Image *imapaint_face_image(const ImagePaintState *s, int face_index)
|
||||
{
|
||||
Image *ima;
|
||||
|
||||
if (scene_use_new_shading_nodes(s->scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(s->scene)) {
|
||||
MFace *mf = &s->dm_mface[face_index];
|
||||
ED_object_get_active_image(s->ob, mf->mat_nr + 1, &ima, NULL, NULL);
|
||||
}
|
||||
@@ -542,7 +542,7 @@ static Image *project_paint_face_image(const ProjPaintState *ps, MTFace *dm_mtfa
|
||||
{
|
||||
Image *ima;
|
||||
|
||||
if (ps->do_new_shading_nodes) { /* cached scene_use_new_shading_nodes result */
|
||||
if (ps->do_new_shading_nodes) { /* cached BKE_scene_use_new_shading_nodes result */
|
||||
MFace *mf = ps->dm_mface + face_index;
|
||||
ED_object_get_active_image(ps->ob, mf->mat_nr + 1, &ima, NULL, NULL);
|
||||
}
|
||||
@@ -4775,7 +4775,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps)
|
||||
ps->do_backfacecull = (settings->imapaint.flag & IMAGEPAINT_PROJECT_BACKFACE) ? 0 : 1;
|
||||
ps->do_occlude = (settings->imapaint.flag & IMAGEPAINT_PROJECT_XRAY) ? 0 : 1;
|
||||
ps->do_mask_normal = (settings->imapaint.flag & IMAGEPAINT_PROJECT_FLAT) ? 0 : 1;
|
||||
ps->do_new_shading_nodes = scene_use_new_shading_nodes(scene); /* only cache the value */
|
||||
ps->do_new_shading_nodes = BKE_scene_use_new_shading_nodes(scene); /* only cache the value */
|
||||
|
||||
if (ps->tool == PAINT_TOOL_CLONE)
|
||||
ps->do_layer_clone = (settings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE);
|
||||
|
||||
@@ -286,11 +286,11 @@ static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
|
||||
for (cfra = (scene->r.sfra > 0) ? (scene->r.sfra - 1) : 0; cfra <= scene->r.efra + 1; cfra++) {
|
||||
scene->r.cfra = cfra;
|
||||
scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
BKE_scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
}
|
||||
|
||||
scene->r.cfra = oldfra;
|
||||
scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
BKE_scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
|
||||
ButsContextTexture *ct= sbuts->texuser;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
||||
if (!scene_use_new_shading_nodes(scene)) {
|
||||
if (!BKE_scene_use_new_shading_nodes(scene)) {
|
||||
if (ct) {
|
||||
BLI_freelistN(&ct->users);
|
||||
MEM_freeN(ct);
|
||||
|
||||
@@ -599,7 +599,7 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
|
||||
struct BMEditMesh *em = me->edit_btmesh;
|
||||
int sloppy = 1; /* partially selected face is ok */
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
/* new shading system, get image from material */
|
||||
BMFace *efa = BM_active_face_get(em->bm, sloppy);
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ void ED_node_shader_default(Scene *scene, ID *id)
|
||||
Material *ma= (Material*)id;
|
||||
ma->nodetree = ntree;
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
output_type = SH_NODE_OUTPUT_MATERIAL;
|
||||
shader_type = SH_NODE_BSDF_DIFFUSE;
|
||||
}
|
||||
@@ -347,7 +347,7 @@ void ED_node_shader_default(Scene *scene, ID *id)
|
||||
nodeAddLink(ntree, in, fromsock, out, tosock);
|
||||
|
||||
/* default values */
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
sock= in->inputs.first;
|
||||
copy_v3_v3(((bNodeSocketValueRGBA*)sock->default_value)->value, color);
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
|
||||
}
|
||||
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
if (scene_use_new_shading_nodes(scene))
|
||||
if (BKE_scene_use_new_shading_nodes(scene))
|
||||
compatibility= NODE_NEW_SHADING;
|
||||
else
|
||||
compatibility= NODE_OLD_SHADING;
|
||||
|
||||
@@ -333,7 +333,7 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
|
||||
int compatibility= 0;
|
||||
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
if (scene_use_new_shading_nodes(arg->scene))
|
||||
if (BKE_scene_use_new_shading_nodes(arg->scene))
|
||||
compatibility= NODE_NEW_SHADING;
|
||||
else
|
||||
compatibility= NODE_OLD_SHADING;
|
||||
|
||||
@@ -136,7 +136,7 @@ static void restrictbutton_view_cb(bContext *C, void *poin, void *poin2)
|
||||
if (ob->restrictflag & OB_RESTRICT_VIEW) {
|
||||
/* Ouch! There is no backwards pointer from Object to Base,
|
||||
* so have to do loop to find it. */
|
||||
ED_base_object_select(object_in_scene(ob, scene), BA_DESELECT);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, ob), BA_DESELECT);
|
||||
}
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
|
||||
|
||||
@@ -153,7 +153,7 @@ static void restrictbutton_sel_cb(bContext *C, void *poin, void *poin2)
|
||||
if (ob->restrictflag & OB_RESTRICT_SELECT) {
|
||||
/* Ouch! There is no backwards pointer from Object to Base,
|
||||
* so have to do loop to find it. */
|
||||
ED_base_object_select(object_in_scene(ob, scene), BA_DESELECT);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, ob), BA_DESELECT);
|
||||
}
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
|
||||
|
||||
@@ -230,7 +230,7 @@ void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag)
|
||||
|
||||
if (flag==OB_RESTRICT_VIEW)
|
||||
if (gob->ob->flag & SELECT)
|
||||
ED_base_object_select(object_in_scene(gob->ob, scene), BA_DESELECT);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, gob->ob), BA_DESELECT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -241,7 +241,7 @@ void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag)
|
||||
|
||||
if (flag==OB_RESTRICT_VIEW)
|
||||
if ((gob->ob->flag & SELECT) == 0)
|
||||
ED_base_object_select(object_in_scene(gob->ob, scene), BA_SELECT);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, gob->ob), BA_SELECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, Tre
|
||||
/* add check for edit mode */
|
||||
if (!common_restrict_check(C, ob)) return;
|
||||
|
||||
if (base || (base= object_in_scene(ob, scene))) {
|
||||
if (base || (base= BKE_scene_base_find(scene, ob))) {
|
||||
if ((base->object->restrictflag ^= OB_RESTRICT_VIEW)) {
|
||||
ED_base_object_select(base, BA_DESELECT);
|
||||
}
|
||||
@@ -395,7 +395,7 @@ void object_toggle_selectability_cb(bContext *UNUSED(C), Scene *scene, TreeEleme
|
||||
{
|
||||
Base *base= (Base *)te->directdata;
|
||||
|
||||
if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
|
||||
if (base==NULL) base= BKE_scene_base_find(scene, (Object *)tselem->id);
|
||||
if (base) {
|
||||
base->object->restrictflag^=OB_RESTRICT_SELECT;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ void object_toggle_renderability_cb(bContext *UNUSED(C), Scene *scene, TreeEleme
|
||||
{
|
||||
Base *base= (Base *)te->directdata;
|
||||
|
||||
if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
|
||||
if (base==NULL) base= BKE_scene_base_find(scene, (Object *)tselem->id);
|
||||
if (base) {
|
||||
base->object->restrictflag^=OB_RESTRICT_RENDER;
|
||||
}
|
||||
@@ -1487,7 +1487,7 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
/* check dragged object (child) is active */
|
||||
if (ob != CTX_data_active_object(C))
|
||||
ED_base_object_select(object_in_scene(ob, scene), BA_SELECT);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, ob), BA_SELECT);
|
||||
|
||||
if ((par->type != OB_ARMATURE) && (par->type != OB_CURVE) && (par->type != OB_LATTICE)) {
|
||||
if (ED_object_parent_set(op->reports, bmain, scene, ob, par, partype)) {
|
||||
@@ -1663,7 +1663,7 @@ static int parent_clear_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
|
||||
|
||||
/* check dragged object (child) is active */
|
||||
if (ob != CTX_data_active_object(C))
|
||||
ED_base_object_select(object_in_scene(ob, scene), BA_SELECT);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, ob), BA_SELECT);
|
||||
|
||||
ED_object_parent_clear(C, RNA_enum_get(op->ptr, "type"));
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static int tree_element_set_active_object(bContext *C, Scene *scene, SpaceOops
|
||||
}
|
||||
|
||||
/* find associated base in current scene */
|
||||
base= object_in_scene(ob, scene);
|
||||
base= BKE_scene_base_find(scene, ob);
|
||||
|
||||
if (base) {
|
||||
if (set==2) {
|
||||
@@ -171,7 +171,7 @@ static int tree_element_set_active_object(bContext *C, Scene *scene, SpaceOops
|
||||
}
|
||||
else {
|
||||
/* deleselect all */
|
||||
scene_deselect_all(scene);
|
||||
BKE_scene_base_deselect_all(scene);
|
||||
ED_base_object_select(base, BA_SELECT);
|
||||
}
|
||||
if (C) {
|
||||
@@ -551,7 +551,7 @@ static int tree_element_active_text(bContext *UNUSED(C), Scene *UNUSED(scene), S
|
||||
static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set)
|
||||
{
|
||||
Object *ob= (Object *)tselem->id;
|
||||
Base *base= object_in_scene(ob, scene);
|
||||
Base *base= BKE_scene_base_find(scene, ob);
|
||||
|
||||
if (set) {
|
||||
if (scene->obedit)
|
||||
@@ -745,15 +745,15 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
|
||||
}
|
||||
|
||||
for (gob= gr->gobject.first; gob; gob= gob->next) {
|
||||
ED_base_object_select(object_in_scene(gob->ob, scene), sel);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, gob->ob), sel);
|
||||
}
|
||||
}
|
||||
else {
|
||||
scene_deselect_all(scene);
|
||||
BKE_scene_base_deselect_all(scene);
|
||||
|
||||
for (gob= gr->gobject.first; gob; gob= gob->next) {
|
||||
if ((gob->ob->flag & SELECT) == 0)
|
||||
ED_base_object_select(object_in_scene(gob->ob, scene), BA_SELECT);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, gob->ob), BA_SELECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ static void object_select_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te,
|
||||
{
|
||||
Base *base= (Base *)te->directdata;
|
||||
|
||||
if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
|
||||
if (base==NULL) base= BKE_scene_base_find(scene, (Object *)tselem->id);
|
||||
if (base && ((base->object->restrictflag & OB_RESTRICT_VIEW)==0)) {
|
||||
base->flag |= SELECT;
|
||||
base->object->flag |= SELECT;
|
||||
@@ -253,7 +253,7 @@ static void object_deselect_cb(bContext *UNUSED(C), Scene *scene, TreeElement *t
|
||||
{
|
||||
Base *base= (Base *)te->directdata;
|
||||
|
||||
if (base==NULL) base= object_in_scene((Object *)tselem->id, scene);
|
||||
if (base==NULL) base= BKE_scene_base_find(scene, (Object *)tselem->id);
|
||||
if (base) {
|
||||
base->flag &= ~SELECT;
|
||||
base->object->flag &= ~SELECT;
|
||||
@@ -265,7 +265,7 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
|
||||
Base *base= (Base *)te->directdata;
|
||||
|
||||
if (base==NULL)
|
||||
base= object_in_scene((Object *)tselem->id, scene);
|
||||
base= BKE_scene_base_find(scene, (Object *)tselem->id);
|
||||
if (base) {
|
||||
// check also library later
|
||||
if (scene->obedit==base->object)
|
||||
@@ -349,7 +349,7 @@ static void group_linkobs2scene_cb(bContext *UNUSED(C), Scene *scene, TreeElemen
|
||||
Base *base;
|
||||
|
||||
for (gob=group->gobject.first; gob; gob=gob->next) {
|
||||
base= object_in_scene(gob->ob, scene);
|
||||
base= BKE_scene_base_find(scene, gob->ob);
|
||||
if (base) {
|
||||
base->object->flag |= SELECT;
|
||||
base->flag |= SELECT;
|
||||
|
||||
@@ -928,7 +928,7 @@ static int tex_mat_set_face_editmesh_cb(void *userData, int index)
|
||||
|
||||
void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, DerivedMesh *dm, int draw_flags)
|
||||
{
|
||||
if ((!scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_MODIFIERS_PREVIEW)) {
|
||||
if ((!BKE_scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_MODIFIERS_PREVIEW)) {
|
||||
draw_mesh_textured_old(scene, v3d, rv3d, ob, dm, draw_flags);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ static int check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
|
||||
return TRUE;
|
||||
|
||||
/* textured solid */
|
||||
if (v3d->drawtype == OB_SOLID && (v3d->flag2 & V3D_SOLID_TEX) && !scene_use_new_shading_nodes(scene))
|
||||
if (v3d->drawtype == OB_SOLID && (v3d->flag2 & V3D_SOLID_TEX) && !BKE_scene_use_new_shading_nodes(scene))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@@ -332,7 +332,7 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt)
|
||||
return 0;
|
||||
if (ob == OBACT && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
|
||||
return 0;
|
||||
if (scene_use_new_shading_nodes(scene))
|
||||
if (BKE_scene_use_new_shading_nodes(scene))
|
||||
return 0;
|
||||
|
||||
return (scene->gm.matmode == GAME_MAT_GLSL) && (dt > OB_SOLID);
|
||||
@@ -4285,7 +4285,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
|
||||
|
||||
totpart = psys->totpart;
|
||||
|
||||
cfra = BKE_curframe(scene);
|
||||
cfra = BKE_scene_frame_get(scene);
|
||||
|
||||
if (draw_as == PART_DRAW_PATH && psys->pathcache == NULL && psys->childcache == NULL)
|
||||
draw_as = PART_DRAW_DOT;
|
||||
@@ -7141,7 +7141,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
for (ct = targets.first; ct; ct = ct->next) {
|
||||
/* calculate target's matrix */
|
||||
if (cti->get_target_matrix)
|
||||
cti->get_target_matrix(curcon, cob, ct, BKE_curframe(scene));
|
||||
cti->get_target_matrix(curcon, cob, ct, BKE_scene_frame_get(scene));
|
||||
else
|
||||
unit_m4(ct->matrix);
|
||||
|
||||
|
||||
@@ -847,7 +847,7 @@ static void draw_selected_name(Scene *scene, Object *ob)
|
||||
short offset = 30;
|
||||
|
||||
/* get name of marker on current frame (if available) */
|
||||
markern = scene_find_marker_name(scene, CFRA);
|
||||
markern = BKE_scene_find_marker_name(scene, CFRA);
|
||||
|
||||
/* check if there is an object */
|
||||
if (ob) {
|
||||
@@ -910,7 +910,7 @@ static void draw_selected_name(Scene *scene, Object *ob)
|
||||
}
|
||||
|
||||
/* color depends on whether there is a keyframe */
|
||||
if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/ (float)(CFRA), ANIMFILTER_KEYS_LOCAL))
|
||||
if (id_frame_has_keyframe((ID *)ob, /*BKE_scene_frame_get(scene)*/ (float)(CFRA), ANIMFILTER_KEYS_LOCAL))
|
||||
UI_ThemeColor(TH_VERTEX_SELECT);
|
||||
else
|
||||
UI_ThemeColor(TH_TEXT_HI);
|
||||
@@ -2297,7 +2297,7 @@ CustomDataMask ED_view3d_datamask(Scene *scene, View3D *v3d)
|
||||
{
|
||||
mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
if (v3d->drawtype == OB_MATERIAL)
|
||||
mask |= CD_MASK_ORCO;
|
||||
}
|
||||
|
||||
@@ -2851,7 +2851,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
|
||||
v3d->camera = ob;
|
||||
|
||||
if (v3d->camera == NULL)
|
||||
v3d->camera = scene_find_camera(scene);
|
||||
v3d->camera = BKE_scene_camera_find(scene);
|
||||
|
||||
/* couldnt find any useful camera, bail out */
|
||||
if (v3d->camera == NULL)
|
||||
|
||||
@@ -1799,8 +1799,8 @@ static int game_engine_exec(bContext *C, wmOperator *op)
|
||||
RestoreState(C, prevwin);
|
||||
|
||||
//XXX restore_all_scene_cfra(scene_cfra_store);
|
||||
set_scene_bg(CTX_data_main(C), startscene);
|
||||
//XXX scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
BKE_scene_set_background(CTX_data_main(C), startscene);
|
||||
//XXX BKE_scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
#else
|
||||
|
||||
@@ -4357,7 +4357,7 @@ static void set_trans_object_base_flags(TransInfo *t)
|
||||
return;
|
||||
|
||||
/* makes sure base flags and object flags are identical */
|
||||
copy_baseflags(t->scene);
|
||||
BKE_scene_base_flag_to_objects(t->scene);
|
||||
|
||||
/* handle pending update events, otherwise they got copied below */
|
||||
for (base= scene->base.first; base; base= base->next) {
|
||||
@@ -4375,7 +4375,7 @@ static void set_trans_object_base_flags(TransInfo *t)
|
||||
/* if parent selected, deselect */
|
||||
while (parsel) {
|
||||
if (parsel->flag & SELECT) {
|
||||
Base *parbase = object_in_scene(parsel, scene);
|
||||
Base *parbase = BKE_scene_base_find(scene, parsel);
|
||||
if (parbase) { /* in rare cases this can fail */
|
||||
if (TESTBASELIB_BGMODE(v3d, scene, parbase)) {
|
||||
break;
|
||||
@@ -5878,7 +5878,7 @@ void createTransData(bContext *C, TransInfo *t)
|
||||
* lines below just check is also visible */
|
||||
Object *ob_armature= modifiers_isDeformedByArmature(ob);
|
||||
if (ob_armature && ob_armature->mode & OB_MODE_POSE) {
|
||||
Base *base_arm= object_in_scene(ob_armature, t->scene);
|
||||
Base *base_arm= BKE_scene_base_find(t->scene, ob_armature);
|
||||
if (base_arm) {
|
||||
View3D *v3d = t->view;
|
||||
if (BASE_VISIBLE(v3d, base_arm)) {
|
||||
|
||||
@@ -186,7 +186,7 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
|
||||
return;
|
||||
}
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
/* new shading system, assign image in material */
|
||||
int sloppy = 1;
|
||||
BMFace *efa = BM_active_face_get(em->bm, sloppy);
|
||||
|
||||
@@ -1076,7 +1076,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
|
||||
GPUBlendMode alphablend;
|
||||
int a;
|
||||
int gamma = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
|
||||
int new_shading_nodes = scene_use_new_shading_nodes(scene);
|
||||
int new_shading_nodes = BKE_scene_use_new_shading_nodes(scene);
|
||||
|
||||
/* initialize state */
|
||||
memset(&GMS, 0, sizeof(GMS));
|
||||
|
||||
@@ -1501,7 +1501,7 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
|
||||
GPU_material_output_link(mat, outlink);
|
||||
}
|
||||
|
||||
if (!scene_use_new_shading_nodes(scene)) {
|
||||
if (!BKE_scene_use_new_shading_nodes(scene)) {
|
||||
if (gpu_do_color_management(mat))
|
||||
if (mat->outlink)
|
||||
GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink);
|
||||
|
||||
@@ -1398,7 +1398,7 @@ typedef struct Scene {
|
||||
#define SCE_FRAME_DROP (1<<3)
|
||||
|
||||
|
||||
/* return flag next_object function */
|
||||
/* return flag BKE_scene_base_iter_next function */
|
||||
#define F_ERROR -1
|
||||
#define F_START 0
|
||||
#define F_SCENE 1
|
||||
|
||||
@@ -109,7 +109,7 @@ void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *ca
|
||||
|
||||
Scene *rna_Main_scenes_new(Main *UNUSED(bmain), const char *name)
|
||||
{
|
||||
return add_scene(name);
|
||||
return BKE_scene_add(name);
|
||||
}
|
||||
void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struct Scene *scene)
|
||||
{
|
||||
@@ -128,7 +128,7 @@ void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struc
|
||||
if (CTX_wm_screen(C)->scene == scene)
|
||||
ED_screen_set_scene(C, CTX_wm_screen(C), newscene);
|
||||
|
||||
unlink_scene(bmain, scene, newscene);
|
||||
BKE_scene_unlink(bmain, scene, newscene);
|
||||
}
|
||||
|
||||
Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const char *name, ID *data)
|
||||
|
||||
@@ -263,7 +263,7 @@ static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerR
|
||||
if (scene) {
|
||||
Object *ob = (Object*)ptr->id.data;
|
||||
short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT;
|
||||
ED_base_object_select(object_in_scene(ob, scene), mode);
|
||||
ED_base_object_select(BKE_scene_base_find(scene, ob), mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
Object *ob = (Object*)ptr->id.data;
|
||||
Base *base;
|
||||
|
||||
base = scene ? object_in_scene(ob, scene) : NULL;
|
||||
base = scene ? BKE_scene_base_find(scene, ob) : NULL;
|
||||
if (!base)
|
||||
return;
|
||||
|
||||
|
||||
@@ -330,12 +330,12 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report
|
||||
Scene *scene_act = CTX_data_scene(C);
|
||||
Base *base;
|
||||
|
||||
if (object_in_scene(ob, scene)) {
|
||||
if (BKE_scene_base_find(scene, ob)) {
|
||||
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\"", ob->id.name+2, scene->id.name+2);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
base = scene_add_base(scene, ob);
|
||||
base = BKE_scene_base_add(scene, ob);
|
||||
id_us_plus(&ob->id);
|
||||
|
||||
/* this is similar to what object_add_type and BKE_object_add do */
|
||||
@@ -357,7 +357,7 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report
|
||||
|
||||
static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *ob)
|
||||
{
|
||||
Base *base = object_in_scene(ob, scene);
|
||||
Base *base = BKE_scene_base_find(scene, ob);
|
||||
if (!base) {
|
||||
BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'", ob->id.name+2, scene->id.name+2);
|
||||
return;
|
||||
@@ -401,7 +401,7 @@ static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
|
||||
{
|
||||
Scene *scene = (Scene*)ptr->data;
|
||||
if (value.data)
|
||||
scene->basact = object_in_scene((Object*)value.data, scene);
|
||||
scene->basact = BKE_scene_base_find(scene, (Object *)value.data);
|
||||
else
|
||||
scene->basact = NULL;
|
||||
}
|
||||
@@ -993,7 +993,7 @@ static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA valu
|
||||
static SceneRenderLayer *rna_RenderLayer_new(ID *id, RenderData *UNUSED(rd), const char *name)
|
||||
{
|
||||
Scene *scene = (Scene *)id;
|
||||
SceneRenderLayer *srl = scene_add_render_layer(scene, name);
|
||||
SceneRenderLayer *srl = BKE_scene_add_render_layer(scene, name);
|
||||
|
||||
WM_main_add_notifier(NC_SCENE|ND_RENDER_OPTIONS, NULL);
|
||||
|
||||
@@ -1005,7 +1005,7 @@ static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain,
|
||||
{
|
||||
Scene *scene = (Scene *)id;
|
||||
|
||||
if (!scene_remove_render_layer(bmain, scene, srl)) {
|
||||
if (!BKE_scene_remove_render_layer(bmain, scene, srl)) {
|
||||
BKE_reportf(reports, RPT_ERROR, "RenderLayer '%s' could not be removed from scene '%s'",
|
||||
srl->name, scene->id.name+2);
|
||||
}
|
||||
@@ -1125,7 +1125,7 @@ static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
|
||||
static int rna_RenderSettings_use_shading_nodes_get(PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene = (Scene*)ptr->id.data;
|
||||
return scene_use_new_shading_nodes(scene);
|
||||
return BKE_scene_use_new_shading_nodes(scene);
|
||||
}
|
||||
|
||||
static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
|
||||
|
||||
@@ -56,11 +56,11 @@ void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
|
||||
scene->r.subframe = subframe;
|
||||
|
||||
CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
|
||||
scene_update_for_newframe(G.main, scene, (1<<20) - 1);
|
||||
scene_camera_switch_update(scene);
|
||||
BKE_scene_update_for_newframe(G.main, scene, (1<<20) - 1);
|
||||
BKE_scene_camera_switch_update(scene);
|
||||
|
||||
/* cant use NC_SCENE|ND_FRAME because this casues wm_event_do_notifiers to call
|
||||
* scene_update_for_newframe which will loose any un-keyed changes [#24690] */
|
||||
* BKE_scene_update_for_newframe which will loose any un-keyed changes [#24690] */
|
||||
/* WM_main_add_notifier(NC_SCENE|ND_FRAME, scene); */
|
||||
|
||||
/* instead just redraw the views */
|
||||
@@ -69,7 +69,7 @@ void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
|
||||
|
||||
static void rna_Scene_update_tagged(Scene *scene)
|
||||
{
|
||||
scene_update_tagged(G.main, scene);
|
||||
BKE_scene_update_tagged(G.main, scene);
|
||||
}
|
||||
|
||||
static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name)
|
||||
|
||||
@@ -494,7 +494,7 @@ static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C
|
||||
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_SOLID);
|
||||
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_TEXTURE);
|
||||
|
||||
if (scene_use_new_shading_nodes(scene))
|
||||
if (BKE_scene_use_new_shading_nodes(scene))
|
||||
RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_MATERIAL);
|
||||
|
||||
if (type->view_draw)
|
||||
|
||||
@@ -115,7 +115,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
|
||||
faceMap = MEM_callocN(sizeof(*faceMap) * numPoly_src, "build modifier faceMap");
|
||||
for (i = 0; i < numPoly_src; i++) faceMap[i] = i;
|
||||
|
||||
frac = (BKE_curframe(md->scene) - bmd->start) / bmd->length;
|
||||
frac = (BKE_scene_frame_get(md->scene) - bmd->start) / bmd->length;
|
||||
CLAMP(frac, 0.0f, 1.0f);
|
||||
|
||||
numFaces_dst = numPoly_src * frac;
|
||||
|
||||
@@ -131,7 +131,7 @@ static void deformVerts(ModifierData *md, Object *ob,
|
||||
CDDM_apply_vert_coords(dm, vertexCos);
|
||||
CDDM_calc_normals(dm);
|
||||
|
||||
current_time = BKE_curframe(md->scene);
|
||||
current_time = BKE_scene_frame_get(md->scene);
|
||||
|
||||
if (G.rt > 0)
|
||||
printf("current_time %f, collmd->time_xnew %f\n", current_time, collmd->time_xnew);
|
||||
|
||||
@@ -815,7 +815,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
||||
|
||||
/* timestep= psys_get_timestep(&sim); */
|
||||
|
||||
cfra= BKE_curframe(scene);
|
||||
cfra= BKE_scene_frame_get(scene);
|
||||
|
||||
/* hash table for vertice <-> particle relations */
|
||||
vertpahash= BLI_edgehash_new();
|
||||
|
||||
@@ -178,7 +178,7 @@ static void waveModifier_do(WaveModifierData *md,
|
||||
MVert *mvert = NULL;
|
||||
MDeformVert *dvert;
|
||||
int defgrp_index;
|
||||
float ctime = BKE_curframe(scene);
|
||||
float ctime = BKE_scene_frame_get(scene);
|
||||
float minfac =
|
||||
(float)(1.0 / exp(wmd->width * wmd->narrow * wmd->width * wmd->narrow));
|
||||
float lifefac = wmd->height;
|
||||
|
||||
@@ -83,7 +83,7 @@ static void foreach_nodeclass(Scene *scene, void *calldata, bNodeClassCallback f
|
||||
func(calldata, NODE_CLASS_INPUT, IFACE_("Input"));
|
||||
func(calldata, NODE_CLASS_OUTPUT, IFACE_("Output"));
|
||||
|
||||
if (scene_use_new_shading_nodes(scene)) {
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
func(calldata, NODE_CLASS_SHADER, IFACE_("Shader"));
|
||||
func(calldata, NODE_CLASS_TEXTURE, IFACE_("Texture"));
|
||||
}
|
||||
|
||||
@@ -1574,7 +1574,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
|
||||
float hasize, pa_size, r_tilt, r_length;
|
||||
float pa_time, pa_birthtime, pa_dietime;
|
||||
float random, simplify[2], pa_co[3];
|
||||
const float cfra= BKE_curframe(re->scene);
|
||||
const float cfra= BKE_scene_frame_get(re->scene);
|
||||
int i, a, k, max_k=0, totpart, dosimplify = 0, dosurfacecache = 0, use_duplimat = 0;
|
||||
int totchild=0;
|
||||
int seed, path_nbr=0, orco1=0, num;
|
||||
@@ -5051,12 +5051,12 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
|
||||
|
||||
/* applies changes fully */
|
||||
if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0)
|
||||
scene_update_for_newframe(re->main, re->scene, lay);
|
||||
BKE_scene_update_for_newframe(re->main, re->scene, lay);
|
||||
|
||||
/* if no camera, viewmat should have been set! */
|
||||
if (use_camera_view && camera) {
|
||||
/* called before but need to call again in case of lens animation from the
|
||||
* above call to scene_update_for_newframe, fixes bug. [#22702].
|
||||
* above call to BKE_scene_update_for_newframe, fixes bug. [#22702].
|
||||
* following calls don't depend on 'RE_SetCamera' */
|
||||
RE_SetCamera(re, camera);
|
||||
|
||||
@@ -5206,7 +5206,7 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la
|
||||
|
||||
/* applies changes fully */
|
||||
scene->r.cfra += timeoffset;
|
||||
scene_update_for_newframe(re->main, re->scene, lay);
|
||||
BKE_scene_update_for_newframe(re->main, re->scene, lay);
|
||||
|
||||
/* if no camera, viewmat should have been set! */
|
||||
if (camera) {
|
||||
|
||||
@@ -313,7 +313,7 @@ int RE_engine_render(Render *re, int do_all)
|
||||
engine->camera_override = re->camera_override;
|
||||
|
||||
if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0)
|
||||
scene_update_for_newframe(re->main, re->scene, re->lay);
|
||||
BKE_scene_update_for_newframe(re->main, re->scene, re->lay);
|
||||
|
||||
if (type->update)
|
||||
type->update(engine, re->main, re->scene);
|
||||
|
||||
@@ -1265,7 +1265,7 @@ static void render_scene(Render *re, Scene *sce, int cfra)
|
||||
|
||||
sce->r.cfra= cfra;
|
||||
|
||||
scene_camera_switch_update(sce);
|
||||
BKE_scene_camera_switch_update(sce);
|
||||
|
||||
/* exception: scene uses own size (unfinished code) */
|
||||
if (0) {
|
||||
@@ -1282,7 +1282,7 @@ static void render_scene(Render *re, Scene *sce, int cfra)
|
||||
resc->lay= sce->lay;
|
||||
|
||||
/* ensure scene has depsgraph, base flags etc OK */
|
||||
set_scene_bg(re->main, sce);
|
||||
BKE_scene_set_background(re->main, sce);
|
||||
|
||||
/* copy callbacks */
|
||||
resc->display_draw= re->display_draw;
|
||||
@@ -1368,7 +1368,7 @@ static void ntree_render_scenes(Render *re)
|
||||
|
||||
/* restore scene if we rendered another last */
|
||||
if (restore_scene)
|
||||
set_scene_bg(re->main, re->scene);
|
||||
BKE_scene_set_background(re->main, re->scene);
|
||||
}
|
||||
|
||||
/* bad call... need to think over proper method still */
|
||||
@@ -1591,7 +1591,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
|
||||
R.stats_draw= re->stats_draw;
|
||||
|
||||
if (update_newframe)
|
||||
scene_update_for_newframe(re->main, re->scene, re->lay);
|
||||
BKE_scene_update_for_newframe(re->main, re->scene, re->lay);
|
||||
|
||||
if (re->r.scemode & R_FULL_SAMPLE)
|
||||
do_merge_fullsample(re, ntree);
|
||||
@@ -1654,7 +1654,7 @@ static void do_render_seq(Render * re)
|
||||
|
||||
if (recurs_depth==0) {
|
||||
/* otherwise sequencer animation isn't updated */
|
||||
BKE_animsys_evaluate_all_animation(re->main, re->scene, (float)cfra); // XXX, was BKE_curframe(re->scene)
|
||||
BKE_animsys_evaluate_all_animation(re->main, re->scene, (float)cfra); // XXX, was BKE_scene_frame_get(re->scene)
|
||||
}
|
||||
|
||||
recurs_depth++;
|
||||
@@ -1713,7 +1713,7 @@ static void do_render_seq(Render * re)
|
||||
/* main loop: doing sequence + fields + blur + 3d render + compositing */
|
||||
static void do_render_all_options(Render *re)
|
||||
{
|
||||
scene_camera_switch_update(re->scene);
|
||||
BKE_scene_camera_switch_update(re->scene);
|
||||
|
||||
re->i.starttime= PIL_check_seconds_timer();
|
||||
|
||||
@@ -1751,7 +1751,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
|
||||
int check_comp= 1;
|
||||
|
||||
if (camera_override == NULL && scene->camera == NULL)
|
||||
scene->camera= scene_find_camera(scene);
|
||||
scene->camera= BKE_scene_camera_find(scene);
|
||||
|
||||
if (scene->r.scemode&R_DOSEQ) {
|
||||
if (scene->ed) {
|
||||
@@ -1762,7 +1762,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
|
||||
while (seq) {
|
||||
if (seq->type == SEQ_SCENE && seq->scene) {
|
||||
if (!seq->scene_camera) {
|
||||
if (!seq->scene->camera && !scene_find_camera(seq->scene)) {
|
||||
if (!seq->scene->camera && !BKE_scene_camera_find(seq->scene)) {
|
||||
if (seq->scene == scene) {
|
||||
/* for current scene camera could be unneeded due to compisite nodes */
|
||||
check_comp= 1;
|
||||
@@ -1788,7 +1788,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
|
||||
if (node->type == CMP_NODE_R_LAYERS) {
|
||||
Scene *sce= node->id ? (Scene*)node->id : scene;
|
||||
|
||||
if (!sce->camera && !scene_find_camera(sce)) {
|
||||
if (!sce->camera && !BKE_scene_camera_find(sce)) {
|
||||
/* all render layers nodes need camera */
|
||||
return 0;
|
||||
}
|
||||
@@ -2195,7 +2195,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri
|
||||
else
|
||||
updatelay= re->lay;
|
||||
|
||||
scene_update_for_newframe(bmain, scene, updatelay);
|
||||
BKE_scene_update_for_newframe(bmain, scene, updatelay);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -106,7 +106,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
|
||||
ParticleKey state;
|
||||
ParticleSimulationData sim= {NULL};
|
||||
ParticleData *pa=NULL;
|
||||
float cfra = BKE_curframe(re->scene);
|
||||
float cfra = BKE_scene_frame_get(re->scene);
|
||||
int i /*, childexists*/ /* UNUSED */;
|
||||
int total_particles, offset=0;
|
||||
int data_used = point_data_used(pd);
|
||||
|
||||
@@ -106,7 +106,7 @@ static void init_render_texture(Render *re, Tex *tex)
|
||||
if (tex->type==TEX_PLUGIN) {
|
||||
if (tex->plugin && tex->plugin->doit) {
|
||||
if (tex->plugin->cfra) {
|
||||
*(tex->plugin->cfra)= (float)cfra; //BKE_curframe(re->scene); // XXX old animsys - timing stuff to be fixed
|
||||
*(tex->plugin->cfra)= (float)cfra; //BKE_scene_frame_get(re->scene); // XXX old animsys - timing stuff to be fixed
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3558,7 +3558,7 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
|
||||
mat = localize_material(orig_mat);
|
||||
|
||||
/* update material anims */
|
||||
BKE_animsys_evaluate_animdata(scene, &mat->id, mat->adt, BKE_curframe(scene), ADT_RECALC_ANIM);
|
||||
BKE_animsys_evaluate_animdata(scene, &mat->id, mat->adt, BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
|
||||
|
||||
/* strip material copy from unsupported flags */
|
||||
for (tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
|
||||
@@ -3605,7 +3605,7 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene)
|
||||
tex= mtex->tex = localize_texture(mtex->tex);
|
||||
|
||||
/* update texture anims */
|
||||
BKE_animsys_evaluate_animdata(scene, &tex->id, tex->adt, BKE_curframe(scene), ADT_RECALC_ANIM);
|
||||
BKE_animsys_evaluate_animdata(scene, &tex->id, tex->adt, BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
|
||||
|
||||
/* update texture cache if required */
|
||||
if (tex->type==TEX_VOXELDATA) {
|
||||
|
||||
@@ -240,7 +240,7 @@ void wm_event_do_notifiers(bContext *C)
|
||||
if (do_anim) {
|
||||
|
||||
/* XXX, quick frame changes can cause a crash if framechange and rendering
|
||||
* collide (happens on slow scenes), scene_update_for_newframe can be called
|
||||
* collide (happens on slow scenes), BKE_scene_update_for_newframe can be called
|
||||
* twice which can depgraph update the same object at once */
|
||||
if (!G.rendering) {
|
||||
|
||||
@@ -311,7 +311,7 @@ void wm_event_do_notifiers(bContext *C)
|
||||
/* XXX, hack so operators can enforce datamasks [#26482], gl render */
|
||||
win->screen->scene->customdata_mask |= win->screen->scene->customdata_mask_modal;
|
||||
|
||||
scene_update_tagged(bmain, win->screen->scene);
|
||||
BKE_scene_update_tagged(bmain, win->screen->scene);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1774,7 +1774,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
|
||||
|
||||
/* now we have or selected, or an indicated file */
|
||||
if (RNA_boolean_get(op->ptr, "autoselect"))
|
||||
scene_deselect_all(scene);
|
||||
BKE_scene_base_deselect_all(scene);
|
||||
|
||||
|
||||
flag = wm_link_append_flag(op);
|
||||
@@ -3533,7 +3533,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
|
||||
|
||||
if (a & 1) scene->r.cfra--;
|
||||
else scene->r.cfra++;
|
||||
scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
BKE_scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
}
|
||||
else if (type == 5) {
|
||||
|
||||
@@ -3548,7 +3548,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
|
||||
if (scene->r.cfra > scene->r.efra)
|
||||
scene->r.cfra = scene->r.sfra;
|
||||
|
||||
scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
BKE_scene_update_for_newframe(bmain, scene, scene->lay);
|
||||
redraw_timer_window_swap(C);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -795,7 +795,7 @@ static int set_scene(int argc, const char **argv, void *data)
|
||||
{
|
||||
if (argc > 1) {
|
||||
bContext *C = data;
|
||||
Scene *scene = set_scene_name(CTX_data_main(C), argv[1]);
|
||||
Scene *scene = BKE_scene_set_name(CTX_data_main(C), argv[1]);
|
||||
if (scene) {
|
||||
CTX_data_scene_set(C, scene);
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ extern "C" {
|
||||
#endif
|
||||
//XXX #include "BSE_headerbuttons.h"
|
||||
//XXX void update_for_newframe();
|
||||
//void scene_update_for_newframe(struct Scene *sce, unsigned int lay);
|
||||
//void BKE_scene_update_for_newframe(struct Scene *sce, unsigned int lay);
|
||||
//#include "BKE_ipo.h"
|
||||
//void do_all_data_ipos(void);
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user