This commit is contained in:
Lukas Tönne
2024-07-22 09:52:19 +02:00
parent de443e038c
commit c4f99bcb6c
2 changed files with 7 additions and 1 deletions

View File

@@ -574,6 +574,7 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval();
BL::Depsgraph::object_instances_iterator b_instance_iter;
std::cout << "Instances: " << b_depsgraph.object_instances.length() << std::endl;
for (b_depsgraph.object_instances.begin(b_instance_iter);
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
++b_instance_iter)

View File

@@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0 */
#include "scene/particles.h"
#include "RNA_blender_cpp.hh"
#include "scene/mesh.h"
#include "scene/object.h"
@@ -61,8 +62,12 @@ bool BlenderSync::sync_dupli_particle(BL::Object &b_ob,
/* add particle */
BL::Particle b_pa = b_psys.particles[persistent_id[0]];
Particle pa;
if (!ELEM(b_pa.alive_state(), BL::Particle::alive_state_ALIVE, BL::Particle::alive_state_DYING))
{
return false;
}
Particle pa;
pa.index = persistent_id[0];
pa.age = b_scene.frame_current_final() - b_pa.birth_time();
pa.lifetime = b_pa.lifetime();