Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_util.h
| Show First 20 Lines • Show All 534 Lines • ▼ Show 20 Lines | static inline bool object_use_deform_motion(BL::Object &b_parent, BL::Object &b_ob) | ||||
| */ | */ | ||||
| if (use_deform_motion && b_parent.ptr.data != b_ob.ptr.data) { | if (use_deform_motion && b_parent.ptr.data != b_ob.ptr.data) { | ||||
| PointerRNA parent_cobject = RNA_pointer_get(&b_parent.ptr, "cycles"); | PointerRNA parent_cobject = RNA_pointer_get(&b_parent.ptr, "cycles"); | ||||
| use_deform_motion &= get_boolean(parent_cobject, "use_deform_motion"); | use_deform_motion &= get_boolean(parent_cobject, "use_deform_motion"); | ||||
| } | } | ||||
| return use_deform_motion; | return use_deform_motion; | ||||
| } | } | ||||
| static inline BL::FluidDomainSettings object_fluid_liquid_domain_find(BL::Object &b_ob) | |||||
| { | |||||
| for (BL::Modifier &b_mod : b_ob.modifiers) { | |||||
| if (b_mod.is_a(&RNA_FluidModifier)) { | |||||
| BL::FluidModifier b_mmd(b_mod); | |||||
| if (b_mmd.fluid_type() == BL::FluidModifier::fluid_type_DOMAIN && | |||||
| b_mmd.domain_settings().domain_type() == BL::FluidDomainSettings::domain_type_LIQUID) { | |||||
| return b_mmd.domain_settings(); | |||||
| } | |||||
| } | |||||
| } | |||||
| return BL::FluidDomainSettings(PointerRNA_NULL); | |||||
| } | |||||
| static inline BL::FluidDomainSettings object_fluid_gas_domain_find(BL::Object &b_ob) | static inline BL::FluidDomainSettings object_fluid_gas_domain_find(BL::Object &b_ob) | ||||
| { | { | ||||
| for (BL::Modifier &b_mod : b_ob.modifiers) { | for (BL::Modifier &b_mod : b_ob.modifiers) { | ||||
| if (b_mod.is_a(&RNA_FluidModifier)) { | if (b_mod.is_a(&RNA_FluidModifier)) { | ||||
| BL::FluidModifier b_mmd(b_mod); | BL::FluidModifier b_mmd(b_mod); | ||||
| if (b_mmd.fluid_type() == BL::FluidModifier::fluid_type_DOMAIN && | if (b_mmd.fluid_type() == BL::FluidModifier::fluid_type_DOMAIN && | ||||
| b_mmd.domain_settings().domain_type() == BL::FluidDomainSettings::domain_type_GAS) { | b_mmd.domain_settings().domain_type() == BL::FluidDomainSettings::domain_type_GAS) { | ||||
| return b_mmd.domain_settings(); | return b_mmd.domain_settings(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return BL::FluidDomainSettings(PointerRNA_NULL); | return BL::FluidDomainSettings(PointerRNA_NULL); | ||||
| } | } | ||||
| static inline BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object &b_ob, | static inline BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object &b_ob, | ||||
| bool check_velocity, | |||||
| bool *has_subdivision_modifier) | bool *has_subdivision_modifier) | ||||
| { | { | ||||
| for (int i = b_ob.modifiers.length() - 1; i >= 0; --i) { | for (int i = b_ob.modifiers.length() - 1; i >= 0; --i) { | ||||
| BL::Modifier b_mod = b_ob.modifiers[i]; | BL::Modifier b_mod = b_ob.modifiers[i]; | ||||
| if (b_mod.type() == BL::Modifier::type_MESH_SEQUENCE_CACHE) { | if (b_mod.type() == BL::Modifier::type_MESH_SEQUENCE_CACHE) { | ||||
| BL::MeshSequenceCacheModifier mesh_cache = BL::MeshSequenceCacheModifier(b_mod); | BL::MeshSequenceCacheModifier mesh_cache = BL::MeshSequenceCacheModifier(b_mod); | ||||
| if (check_velocity) { | |||||
| if (!MeshSequenceCacheModifier_has_velocity_get(&mesh_cache.ptr)) { | |||||
| return BL::MeshSequenceCacheModifier(PointerRNA_NULL); | |||||
| } | |||||
| } | |||||
| return mesh_cache; | return mesh_cache; | ||||
| } | } | ||||
| /* Skip possible particles system modifiers as they do not modify the geometry. */ | /* Skip possible particles system modifiers as they do not modify the geometry. */ | ||||
| if (b_mod.type() == BL::Modifier::type_PARTICLE_SYSTEM) { | if (b_mod.type() == BL::Modifier::type_PARTICLE_SYSTEM) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* Only skip the subsurf modifier if we are not checking for the mesh sequence cache modifier | /* Only skip the subsurf modifier if we are not checking for the mesh sequence cache modifier | ||||
| * for motion blur. */ | * for motion blur. */ | ||||
kevindietrich: This comment can now be removed. | |||||
| if (b_mod.type() == BL::Modifier::type_SUBSURF && !check_velocity) { | if (b_mod.type() == BL::Modifier::type_SUBSURF) { | ||||
| if (has_subdivision_modifier) { | if (has_subdivision_modifier) { | ||||
| *has_subdivision_modifier = true; | *has_subdivision_modifier = true; | ||||
| } | } | ||||
| continue; | continue; | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines | |||||
This comment can now be removed.