Automatically set the object transflag for nparticle duplis, like
current particles (but actual code is in nparticle to stay out of object code as much as possible).
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "BLI_sys_types.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
struct Object;
|
||||
struct NParticleSystem;
|
||||
struct NParticleAttribute;
|
||||
struct NParticleState;
|
||||
@@ -119,4 +120,7 @@ struct NParticleDisplay *BKE_nparticle_display_add_dupli(struct NParticleSystem
|
||||
struct NParticleDisplay *BKE_nparticle_display_copy(struct NParticleSystem *psys, struct NParticleDisplay *display);
|
||||
void BKE_nparticle_display_free(struct NParticleSystem *psys, struct NParticleDisplay *display);
|
||||
|
||||
/* update object transflag for nparticle duplis */
|
||||
void BKE_nparticle_update_object_dupli_flags(struct Object *ob, struct NParticleSystem *psys);
|
||||
|
||||
#endif /* BKE_NPARTICLE_H */
|
||||
|
@@ -644,3 +644,13 @@ void BKE_nparticle_display_free(NParticleSystem *psys, NParticleDisplay *display
|
||||
|
||||
MEM_freeN(display);
|
||||
}
|
||||
|
||||
void BKE_nparticle_update_object_dupli_flags(Object *ob, NParticleSystem *psys)
|
||||
{
|
||||
NParticleDisplay *display;
|
||||
ob->transflag &= ~OB_DUPLI_NPARTICLE;
|
||||
for (display = psys->display.first; display; display = display->next) {
|
||||
if (display->type == PAR_DISPLAY_DUPLI)
|
||||
ob->transflag |= OB_DUPLI_NPARTICLE;
|
||||
}
|
||||
}
|
||||
|
@@ -99,6 +99,7 @@
|
||||
#include "BKE_mball.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_nparticle.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_particle.h"
|
||||
@@ -2893,6 +2894,7 @@ void BKE_object_handle_update_ex(EvaluationContext *eval_ctx,
|
||||
AnimData *adt = BKE_animdata_from_id(data_id);
|
||||
Key *key;
|
||||
float ctime = BKE_scene_frame_get(scene);
|
||||
ModifierData *md;
|
||||
|
||||
if (G.debug & G_DEBUG_DEPSGRAPH)
|
||||
printf("recalcdata %s\n", ob->id.name + 2);
|
||||
@@ -3022,7 +3024,15 @@ void BKE_object_handle_update_ex(EvaluationContext *eval_ctx,
|
||||
psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* nparticles */
|
||||
for (md = ob->modifiers.first; md; md = md->next) {
|
||||
if (md->type == eModifierType_NParticleSystem) {
|
||||
NParticleSystemModifierData *pmd = (NParticleSystemModifierData*)md;
|
||||
BKE_nparticle_update_object_dupli_flags(ob, pmd->psys);
|
||||
}
|
||||
}
|
||||
|
||||
/* quick cache removed */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user