Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_mesh.cpp
| Show First 20 Lines • Show All 996 Lines • ▼ Show 20 Lines | Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph, | ||||
| /* compares curve_keys rather than strands in order to handle quick hair | /* compares curve_keys rather than strands in order to handle quick hair | ||||
| * adjustments in dynamic BVH - other methods could probably do this better*/ | * adjustments in dynamic BVH - other methods could probably do this better*/ | ||||
| array<float3> oldcurve_keys; | array<float3> oldcurve_keys; | ||||
| array<float> oldcurve_radius; | array<float> oldcurve_radius; | ||||
| oldcurve_keys.steal_data(mesh->curve_keys); | oldcurve_keys.steal_data(mesh->curve_keys); | ||||
| oldcurve_radius.steal_data(mesh->curve_radius); | oldcurve_radius.steal_data(mesh->curve_radius); | ||||
| /* ensure bvh rebuild (instead of refit) if has_voxel_attributes() changed */ | |||||
| bool oldhas_voxel_attributes = mesh->has_voxel_attributes(); | |||||
| mesh->clear(); | mesh->clear(); | ||||
| mesh->used_shaders = used_shaders; | mesh->used_shaders = used_shaders; | ||||
| mesh->name = ustring(b_ob_data.name().c_str()); | mesh->name = ustring(b_ob_data.name().c_str()); | ||||
| if (requested_geometry_flags != Mesh::GEOMETRY_NONE) { | if (requested_geometry_flags != Mesh::GEOMETRY_NONE) { | ||||
| /* Adaptive subdivision setup. Not for baking since that requires | /* Adaptive subdivision setup. Not for baking since that requires | ||||
| * exact mapping to the Blender mesh. */ | * exact mapping to the Blender mesh. */ | ||||
| if (scene->bake_manager->get_baking()) { | if (scene->bake_manager->get_baking()) { | ||||
| Show All 32 Lines | Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph, | ||||
| mesh->geometry_flags = requested_geometry_flags; | mesh->geometry_flags = requested_geometry_flags; | ||||
| /* fluid motion */ | /* fluid motion */ | ||||
| sync_mesh_fluid_motion(b_ob, scene, mesh); | sync_mesh_fluid_motion(b_ob, scene, mesh); | ||||
| /* tag update */ | /* tag update */ | ||||
| bool rebuild = (oldtriangles != mesh->triangles) || (oldsubd_faces != mesh->subd_faces) || | bool rebuild = (oldtriangles != mesh->triangles) || (oldsubd_faces != mesh->subd_faces) || | ||||
| (oldsubd_face_corners != mesh->subd_face_corners) || | (oldsubd_face_corners != mesh->subd_face_corners) || | ||||
| (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius); | (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius) || | ||||
| (oldhas_voxel_attributes != mesh->has_voxel_attributes()); | |||||
| mesh->tag_update(scene, rebuild); | mesh->tag_update(scene, rebuild); | ||||
| return mesh; | return mesh; | ||||
| } | } | ||||
| void BlenderSync::sync_mesh_motion(BL::Depsgraph &b_depsgraph, | void BlenderSync::sync_mesh_motion(BL::Depsgraph &b_depsgraph, | ||||
| BL::Object &b_ob, | BL::Object &b_ob, | ||||
| ▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines | |||||