Farewell Scene->basact
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user