21 if (b_ob_info.
object_data.is_a(&RNA_Curves) || use_particle_hair) {
40 BL::Material material_override = view_layer.material_override;
46 for (BL::MaterialSlot &b_slot : b_ob.material_slots) {
47 if (material_override) {
48 find_shader(material_override, used_shaders, default_shader);
51 BL::ID b_material(b_slot.material());
52 find_shader(b_material, used_shaders, default_shader);
56 if (used_shaders.size() == 0) {
57 if (material_override)
58 find_shader(material_override, used_shaders, default_shader);
60 used_shaders.push_back_slow(default_shader);
69 bool use_particle_hair,
86 if (geometry_synced.find(geom) != geometry_synced.end()) {
107 geometry_map.
add(key, geom);
111 sync = geometry_map.
update(geom, b_key_id);
121 else if (geom->get_used_shaders() != used_shaders) {
127 bool attribute_recalc =
false;
129 foreach (
Node *
node, geom->get_used_shaders()) {
132 attribute_recalc =
true;
136 if (!attribute_recalc) {
142 geometry_synced.insert(geom);
147 geom->set_used_shaders(used_shaders);
156 Hair *hair =
static_cast<Hair *
>(geom);
157 sync_hair(b_depsgraph, b_ob_info, hair);
161 sync_volume(b_ob_info, volume);
165 sync_pointcloud(pointcloud, b_ob_info);
169 sync_mesh(b_depsgraph, b_ob_info,
mesh);
184 void BlenderSync::sync_geometry_motion(
BL::Depsgraph &b_depsgraph,
188 bool use_particle_hair,
192 Geometry *geom =
object->get_geometry();
194 if (geometry_motion_synced.find(geom) != geometry_motion_synced.end() ||
195 geometry_motion_attribute_synced.find(geom) != geometry_motion_attribute_synced.end()) {
199 geometry_motion_synced.insert(geom);
203 if (geometry_synced.find(geom) == geometry_synced.end())
208 if (motion_step < 0) {
216 if (b_ob_info.
object_data.is_a(&RNA_Curves) || use_particle_hair) {
217 Hair *hair =
static_cast<Hair *
>(geom);
218 sync_hair_motion(b_depsgraph, b_ob_info, hair, motion_step);
220 else if (b_ob_info.
object_data.is_a(&RNA_Volume) ||
224 else if (b_ob_info.
object_data.is_a(&RNA_PointCloud)) {
226 sync_pointcloud_motion(pointcloud, b_ob_info, motion_step);
230 sync_mesh_motion(b_depsgraph, b_ob_info,
mesh, motion_step);
struct Depsgraph Depsgraph
static CCL_NAMESPACE_BEGIN Geometry::Type determine_geom_type(BObjectInfo &b_ob_info, bool use_particle_hair)
int motion_step(float time) const
void set_sync_status(const string &status_, const string &substatus_="")
bool need_update_geometry() const
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
static BL::FluidDomainSettings object_fluid_gas_domain_find(BL::Object &b_ob)
static PyObject * sync_func(PyObject *, PyObject *args)
bool is_real_object_data() const
T * create_node(Args &&...args)
void push(TaskRunFunction &&task)