Fix #67700: EEVEE: Particle Viewport Display affects Render result
This is caused by the display check not taking into consideration the render mode. Pull Request: https://projects.blender.org/blender/blender/pulls/140877
This commit is contained in:
committed by
Clément Foucault
parent
8219e2202f
commit
2cc5787885
@@ -394,7 +394,7 @@ void Instance::object_sync(ObjectRef &ob_ref, Manager & /*manager*/)
|
||||
ob->object_to_world());
|
||||
sync.sync_curves(ob, hair_handle, ob_ref, _res_handle, &md, &particle_sys);
|
||||
};
|
||||
foreach_hair_particle_handle(ob_ref, ob_handle, sync_hair);
|
||||
foreach_hair_particle_handle(*this, ob_ref, ob_handle, sync_hair);
|
||||
}
|
||||
|
||||
if (object_is_visible) {
|
||||
|
||||
@@ -465,7 +465,8 @@ void SyncModule::sync_curves(Object *ob,
|
||||
|
||||
/** \} */
|
||||
|
||||
void foreach_hair_particle_handle(ObjectRef &ob_ref,
|
||||
void foreach_hair_particle_handle(Instance &inst,
|
||||
ObjectRef &ob_ref,
|
||||
ObjectHandle ob_handle,
|
||||
HairHandleCallback callback)
|
||||
{
|
||||
@@ -475,8 +476,10 @@ void foreach_hair_particle_handle(ObjectRef &ob_ref,
|
||||
if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystem *particle_sys = reinterpret_cast<ParticleSystemModifierData *>(md)->psys;
|
||||
ParticleSettings *part_settings = particle_sys->part;
|
||||
const int draw_as = (part_settings->draw_as == PART_DRAW_REND) ? part_settings->ren_as :
|
||||
part_settings->draw_as;
|
||||
/* Only use the viewport drawing mode for material preview. */
|
||||
const int draw_as = (part_settings->draw_as == PART_DRAW_REND || !inst.is_viewport()) ?
|
||||
part_settings->ren_as :
|
||||
part_settings->draw_as;
|
||||
if (draw_as != PART_DRAW_PATH ||
|
||||
!DRW_object_is_visible_psys_in_active_context(ob_ref.object, particle_sys))
|
||||
{
|
||||
|
||||
@@ -67,7 +67,8 @@ class SyncModule {
|
||||
};
|
||||
|
||||
using HairHandleCallback = FunctionRef<void(ObjectHandle, ModifierData &, ParticleSystem &)>;
|
||||
void foreach_hair_particle_handle(ObjectRef &ob_ref,
|
||||
void foreach_hair_particle_handle(Instance &inst,
|
||||
ObjectRef &ob_ref,
|
||||
ObjectHandle ob_handle,
|
||||
HairHandleCallback callback);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ static void step_object_sync_render(Instance &inst, ObjectRef &ob_ref)
|
||||
inst.velocity.step_object_sync(
|
||||
hair_handle.object_key, ob_ref, hair_handle.recalc, resource_handle, &md, &particle_sys);
|
||||
};
|
||||
foreach_hair_particle_handle(ob_ref, ob_handle, sync_hair);
|
||||
foreach_hair_particle_handle(inst, ob_ref, ob_handle, sync_hair);
|
||||
};
|
||||
|
||||
if (object_is_visible) {
|
||||
|
||||
Reference in New Issue
Block a user