34 if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
47 BL::Material material_override = view_layer.material_override;
53 for (BL::MaterialSlot &b_slot : b_ob.material_slots) {
54 if (material_override) {
55 find_shader(material_override, used_shaders, default_shader);
58 BL::ID b_material(b_slot.material());
59 find_shader(b_material, used_shaders, default_shader);
63 if (used_shaders.size() == 0) {
64 if (material_override)
65 find_shader(material_override, used_shaders, default_shader);
67 used_shaders.push_back_slow(default_shader);
77 bool use_particle_hair,
81 BL::ID b_ob_data = b_ob.data();
82 BL::ID b_key_id = (BKE_object_is_modified(b_ob)) ? b_ob_instance : b_ob_data;
92 if (geometry_synced.find(geom) != geometry_synced.end()) {
110 geometry_map.
add(key, geom);
114 sync = geometry_map.
update(geom, b_key_id);
124 else if (geom->get_used_shaders() != used_shaders) {
130 bool attribute_recalc =
false;
132 foreach (
Node *
node, geom->get_used_shaders()) {
134 if (
shader->need_update_geometry()) {
135 attribute_recalc =
true;
139 if (!attribute_recalc) {
145 geometry_synced.insert(geom);
147 geom->
name = ustring(b_ob_data.name().c_str());
150 geom->set_used_shaders(used_shaders);
159 Hair *hair =
static_cast<Hair *
>(geom);
160 sync_hair(b_depsgraph, b_ob, hair);
164 sync_volume(b_ob, volume);
168 sync_mesh(b_depsgraph, b_ob,
mesh);
183 void BlenderSync::sync_geometry_motion(
BL::Depsgraph &b_depsgraph,
187 bool use_particle_hair,
191 Geometry *geom =
object->get_geometry();
193 if (geometry_motion_synced.find(geom) != geometry_motion_synced.end())
196 geometry_motion_synced.insert(geom);
200 if (geometry_synced.find(geom) == geometry_synced.end())
205 if (motion_step < 0) {
213 if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
214 Hair *hair =
static_cast<Hair *
>(geom);
215 sync_hair_motion(b_depsgraph, b_ob, hair, motion_step);
222 sync_mesh_motion(b_depsgraph, b_ob,
mesh, motion_step);
struct Depsgraph Depsgraph
static CCL_NAMESPACE_BEGIN Geometry::Type determine_geom_type(BL::Object &b_ob, bool use_particle_hair)
static PyObject * sync_func(PyObject *, PyObject *args)
static BL::FluidDomainSettings object_fluid_gas_domain_find(BL::Object &b_ob)
int motion_step(float time) const
void set_sync_status(const string &status_, const string &substatus_="")
void add(const K &key, T *data)
bool update(T *data, const BL::ID &id)
T * find(const BL::ID &id)
#define CCL_NAMESPACE_END
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
T * create_node(Args &&... args)
void push(TaskRunFunction &&task)