Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/DerivedMesh.cc
| Show First 20 Lines • Show All 915 Lines • ▼ Show 20 Lines | else { | ||||
| mesh_component.replace(input_mesh, GeometryOwnershipType::Editable); | mesh_component.replace(input_mesh, GeometryOwnershipType::Editable); | ||||
| /* Let the modifier change the geometry set. */ | /* Let the modifier change the geometry set. */ | ||||
| mti->modifyGeometrySet(md, &mectx, &geometry_set); | mti->modifyGeometrySet(md, &mectx, &geometry_set); | ||||
| /* Release the mesh from the geometry set again. */ | /* Release the mesh from the geometry set again. */ | ||||
| if (geometry_set.has<MeshComponent>()) { | if (geometry_set.has<MeshComponent>()) { | ||||
| MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); | MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); | ||||
| if (mesh_component.get_for_read() != input_mesh) { | |||||
| /* Make sure the mesh component actually owns the mesh before taking over ownership. */ | |||||
| mesh_component.ensure_owns_direct_data(); | |||||
| } | |||||
| mesh_output = mesh_component.release(); | mesh_output = mesh_component.release(); | ||||
| } | } | ||||
| /* Return an empty mesh instead of null. */ | /* Return an empty mesh instead of null. */ | ||||
| if (mesh_output == nullptr) { | if (mesh_output == nullptr) { | ||||
| mesh_output = BKE_mesh_new_nomain(0, 0, 0, 0, 0); | mesh_output = BKE_mesh_new_nomain(0, 0, 0, 0, 0); | ||||
| BKE_mesh_copy_parameters_for_eval(mesh_output, input_mesh); | BKE_mesh_copy_parameters_for_eval(mesh_output, input_mesh); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,557 Lines • Show Last 20 Lines | |||||