diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-09 18:11:20 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-09 18:23:41 +0300 |
commit | c35f1d05eaa13348d4f33cdb44f6fb62f68e1ba3 (patch) | |
tree | 698066b5eade15949b0453796c4d9fc466df42ac /source/blender/blenkernel | |
parent | 09d26cab0bdde16529debd3e0271252012ba69eb (diff) |
Farewell Scene->basact
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_particle.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 15 |
5 files changed, 21 insertions, 25 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index a563fcbc99e..406a6b0e982 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -63,6 +63,7 @@ struct BVHTreeRay; struct BVHTreeRayHit; struct EdgeHash; struct EvaluationContext; +struct SceneLayer; #define PARTICLE_COLLISION_MAX_COLLISIONS 10 @@ -296,7 +297,7 @@ void psys_set_current_num(Object *ob, int index); struct LatticeDeformData *psys_create_lattice_deform_data(struct ParticleSimulationData *sim); -bool psys_in_edit_mode(struct Scene *scene, struct ParticleSystem *psys); +bool psys_in_edit_mode(struct SceneLayer *scene_layer, struct ParticleSystem *psys); bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params); bool psys_check_edited(struct ParticleSystem *psys); diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index fac11edea75..b9a9b6452d9 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -106,10 +106,8 @@ int BKE_scene_base_iter_next( const struct EvaluationContext *eval_ctx, struct SceneBaseIter *iter, struct Scene **scene, int val, struct BaseLegacy **base, struct Object **ob); -void BKE_scene_base_flag_to_objects(struct SceneLayer *sl); +void BKE_scene_base_flag_to_objects(struct SceneLayer *scene_layer); void BKE_scene_base_flag_from_objects(struct Scene *scene); -void BKE_scene_base_flag_sync_from_base(struct BaseLegacy *base); -void BKE_scene_base_flag_sync_from_object(struct BaseLegacy *base); void BKE_scene_object_base_flag_sync_from_base(struct Base *base); void BKE_scene_object_base_flag_sync_from_object(struct Base *base); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 7ba7c13fe40..ee1c94554e3 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -252,7 +252,7 @@ struct LatticeDeformData *psys_create_lattice_deform_data(ParticleSimulationData { struct LatticeDeformData *lattice_deform_data = NULL; - if (psys_in_edit_mode(sim->scene, sim->psys) == 0) { + if (psys_in_edit_mode(sim->eval_ctx->scene_layer, sim->psys) == 0) { Object *lattice = NULL; ModifierData *md = (ModifierData *)psys_get_modifier(sim->ob, sim->psys); int mode = G.is_rendering ? eModifierMode_Render : eModifierMode_Realtime; @@ -288,10 +288,16 @@ void psys_enable_all(Object *ob) for (; psys; psys = psys->next) psys->flag &= ~PSYS_DISABLED; } -bool psys_in_edit_mode(Scene *scene, ParticleSystem *psys) + +bool psys_in_edit_mode(SceneLayer *scene_layer, ParticleSystem *psys) { - return (scene->basact && (scene->basact->object->mode & OB_MODE_PARTICLE_EDIT) && psys == psys_get_current((scene->basact)->object) && (psys->edit || psys->pointcache->edit) && !psys->renderdata); + return (scene_layer->basact && + (scene_layer->basact->object->mode & OB_MODE_PARTICLE_EDIT) && + psys == psys_get_current((scene_layer->basact)->object) && + (psys->edit || psys->pointcache->edit) && + !psys->renderdata); } + bool psys_check_enabled(Object *ob, ParticleSystem *psys, const bool use_render_params) { ParticleSystemModifierData *psmd; @@ -2091,7 +2097,7 @@ static bool psys_thread_context_init_path( psys_thread_context_init(ctx, sim); /*---start figuring out what is actually wanted---*/ - if (psys_in_edit_mode(scene, psys)) { + if (psys_in_edit_mode(sim->eval_ctx->scene_layer, psys)) { ParticleEditSettings *pset = &scene->toolsettings->particle; if ((psys->renderdata == 0 && use_render_params == 0) && (psys->edit == NULL || pset->flag & PE_DRAW_PART) == 0) @@ -2180,7 +2186,7 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp ParticleSystem *psys = ctx->sim.psys; ParticleSettings *part = psys->part; ParticleCacheKey **cache = psys->childcache; - ParticleCacheKey **pcache = psys_in_edit_mode(ctx->sim.scene, psys) && psys->edit ? psys->edit->pathcache : psys->pathcache; + ParticleCacheKey **pcache = psys_in_edit_mode(ctx->sim.eval_ctx->scene_layer, psys) && psys->edit ? psys->edit->pathcache : psys->pathcache; ParticleCacheKey *child, *key[4]; ParticleTexture ptex; float *cpa_fuv = 0, *par_rot = 0, rot[4]; @@ -2589,7 +2595,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re if ((psys->flag & PSYS_HAIR_DONE || psys->flag & PSYS_KEYED || psys->pointcache) == 0) return; - if (psys_in_edit_mode(sim->scene, psys)) + if (psys_in_edit_mode(sim->eval_ctx->scene_layer, psys)) if (psys->renderdata == 0 && (psys->edit == NULL || pset->flag & PE_DRAW_PART) == 0) return; @@ -3772,7 +3778,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * pind.bspline = (psys->part->flag & PART_HAIR_BSPLINE); /* pind.dm disabled in editmode means we don't get effectors taken into * account when subdividing for instance */ - pind.dm = psys_in_edit_mode(sim->scene, psys) ? NULL : psys->hair_out_dm; + pind.dm = psys_in_edit_mode(sim->eval_ctx->scene_layer, psys) ? NULL : psys->hair_out_dm; init_particle_interpolation(sim->ob, psys, pa, &pind); do_particle_interpolation(psys, p, pa, t, &pind, state); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index ddf4f04c808..14f67aaea39 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -90,6 +90,8 @@ #include "BKE_scene.h" #include "BKE_bvhutils.h" +#include "DEG_depsgraph.h" + #include "PIL_time.h" #include "RE_shader_ext.h" @@ -2931,7 +2933,7 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra, cons skip = 1; /* draw visualization */ else if (psys->pointcache->flag & PTCACHE_BAKING) skip = 1; /* no need to cache paths while baking dynamics */ - else if (psys_in_edit_mode(sim->scene, psys)) { + else if (psys_in_edit_mode(sim->eval_ctx->scene_layer, psys)) { if ((pset->flag & PE_DRAW_PART)==0) skip = 1; else if (part->childtype==0 && (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED)==0) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index ccdd785986d..015d688c1dd 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -579,7 +579,6 @@ void BKE_scene_free_ex(Scene *sce, const bool do_id_user) /* check all sequences */ BKE_sequencer_clear_scene_in_allseqs(G.main, sce); - sce->basact = NULL; BKE_sequencer_editing_free(sce); BKE_keyingsets_free(&sce->keyingsets); @@ -1832,9 +1831,9 @@ bool BKE_scene_uses_blender_eevee(const Scene *scene) return BKE_viewrender_uses_blender_eevee(&scene->view_render); } -void BKE_scene_base_flag_to_objects(SceneLayer *sl) +void BKE_scene_base_flag_to_objects(SceneLayer *scene_layer) { - Base *base = sl->object_bases.first; + Base *base = scene_layer->object_bases.first; while (base) { BKE_scene_object_base_flag_sync_from_base(base); @@ -1842,16 +1841,6 @@ void BKE_scene_base_flag_to_objects(SceneLayer *sl) } } -void BKE_scene_base_flag_sync_from_base(BaseLegacy *base) -{ - BKE_scene_object_base_flag_sync_from_base(base); -} - -void BKE_scene_base_flag_sync_from_object(BaseLegacy *base) -{ - BKE_scene_object_base_flag_sync_from_object(base); -} - void BKE_scene_object_base_flag_sync_from_base(Base *base) { Object *ob = base->object; |