Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/DerivedMesh.c
| Show First 20 Lines • Show All 1,169 Lines • ▼ Show 20 Lines | else { | ||||
| if ((md_datamask->mask.lmask) & CD_MASK_ORIGSPACE_MLOOP) { | if ((md_datamask->mask.lmask) & CD_MASK_ORIGSPACE_MLOOP) { | ||||
| if (!CustomData_has_layer(&mesh_final->ldata, CD_ORIGSPACE_MLOOP)) { | if (!CustomData_has_layer(&mesh_final->ldata, CD_ORIGSPACE_MLOOP)) { | ||||
| CustomData_add_layer( | CustomData_add_layer( | ||||
| &mesh_final->ldata, CD_ORIGSPACE_MLOOP, CD_CALLOC, NULL, mesh_final->totloop); | &mesh_final->ldata, CD_ORIGSPACE_MLOOP, CD_CALLOC, NULL, mesh_final->totloop); | ||||
| mesh_init_origspace(mesh_final); | mesh_init_origspace(mesh_final); | ||||
| } | } | ||||
| } | } | ||||
| Mesh *mesh_next = modwrap_applyModifier(md, &mectx, mesh_final); | Mesh *mesh_next = modwrap_modifyMesh(md, &mectx, mesh_final); | ||||
| ASSERT_IS_VALID_MESH(mesh_next); | ASSERT_IS_VALID_MESH(mesh_next); | ||||
| if (mesh_next) { | if (mesh_next) { | ||||
| /* if the modifier returned a new mesh, release the old one */ | /* if the modifier returned a new mesh, release the old one */ | ||||
| if (mesh_final != mesh_next) { | if (mesh_final != mesh_next) { | ||||
| BLI_assert(mesh_final != mesh_input); | BLI_assert(mesh_final != mesh_input); | ||||
| BKE_id_free(NULL, mesh_final); | BKE_id_free(NULL, mesh_final); | ||||
| } | } | ||||
| Show All 19 Lines | else { | ||||
| .pmask = CD_MASK_ORIGINDEX, | .pmask = CD_MASK_ORIGINDEX, | ||||
| }; | }; | ||||
| if (mti->requiredDataMask != NULL) { | if (mti->requiredDataMask != NULL) { | ||||
| mti->requiredDataMask(ob, md, &temp_cddata_masks); | mti->requiredDataMask(ob, md, &temp_cddata_masks); | ||||
| } | } | ||||
| CustomData_MeshMasks_update(&temp_cddata_masks, &nextmask); | CustomData_MeshMasks_update(&temp_cddata_masks, &nextmask); | ||||
| mesh_set_only_copy(mesh_orco, &temp_cddata_masks); | mesh_set_only_copy(mesh_orco, &temp_cddata_masks); | ||||
| mesh_next = modwrap_applyModifier(md, &mectx_orco, mesh_orco); | mesh_next = modwrap_modifyMesh(md, &mectx_orco, mesh_orco); | ||||
| ASSERT_IS_VALID_MESH(mesh_next); | ASSERT_IS_VALID_MESH(mesh_next); | ||||
| if (mesh_next) { | if (mesh_next) { | ||||
| /* if the modifier returned a new mesh, release the old one */ | /* if the modifier returned a new mesh, release the old one */ | ||||
| if (mesh_orco != mesh_next) { | if (mesh_orco != mesh_next) { | ||||
| BLI_assert(mesh_orco != mesh_input); | BLI_assert(mesh_orco != mesh_input); | ||||
| BKE_id_free(NULL, mesh_orco); | BKE_id_free(NULL, mesh_orco); | ||||
| } | } | ||||
| Show All 9 Lines | else { | ||||
| } | } | ||||
| nextmask.vmask &= ~CD_MASK_CLOTH_ORCO; | nextmask.vmask &= ~CD_MASK_CLOTH_ORCO; | ||||
| nextmask.vmask |= CD_MASK_ORIGINDEX; | nextmask.vmask |= CD_MASK_ORIGINDEX; | ||||
| nextmask.emask |= CD_MASK_ORIGINDEX; | nextmask.emask |= CD_MASK_ORIGINDEX; | ||||
| nextmask.pmask |= CD_MASK_ORIGINDEX; | nextmask.pmask |= CD_MASK_ORIGINDEX; | ||||
| mesh_set_only_copy(mesh_orco_cloth, &nextmask); | mesh_set_only_copy(mesh_orco_cloth, &nextmask); | ||||
| mesh_next = modwrap_applyModifier(md, &mectx_orco, mesh_orco_cloth); | mesh_next = modwrap_modifyMesh(md, &mectx_orco, mesh_orco_cloth); | ||||
| ASSERT_IS_VALID_MESH(mesh_next); | ASSERT_IS_VALID_MESH(mesh_next); | ||||
| if (mesh_next) { | if (mesh_next) { | ||||
| /* if the modifier returned a new mesh, release the old one */ | /* if the modifier returned a new mesh, release the old one */ | ||||
| if (mesh_orco_cloth != mesh_next) { | if (mesh_orco_cloth != mesh_next) { | ||||
| BLI_assert(mesh_orco != mesh_input); | BLI_assert(mesh_orco != mesh_input); | ||||
| BKE_id_free(NULL, mesh_orco_cloth); | BKE_id_free(NULL, mesh_orco_cloth); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | else { | ||||
| } | } | ||||
| mask.vmask &= ~CD_MASK_ORCO; | mask.vmask &= ~CD_MASK_ORCO; | ||||
| mask.vmask |= CD_MASK_ORIGINDEX; | mask.vmask |= CD_MASK_ORIGINDEX; | ||||
| mask.emask |= CD_MASK_ORIGINDEX; | mask.emask |= CD_MASK_ORIGINDEX; | ||||
| mask.pmask |= CD_MASK_ORIGINDEX; | mask.pmask |= CD_MASK_ORIGINDEX; | ||||
| mesh_set_only_copy(mesh_orco, &mask); | mesh_set_only_copy(mesh_orco, &mask); | ||||
| Mesh *mesh_next = modwrap_applyModifier(md, &mectx_orco, mesh_orco); | Mesh *mesh_next = modwrap_modifyMesh(md, &mectx_orco, mesh_orco); | ||||
| ASSERT_IS_VALID_MESH(mesh_next); | ASSERT_IS_VALID_MESH(mesh_next); | ||||
| if (mesh_next) { | if (mesh_next) { | ||||
| /* if the modifier returned a new dm, release the old one */ | /* if the modifier returned a new dm, release the old one */ | ||||
| if (mesh_orco && mesh_orco != mesh_next) { | if (mesh_orco && mesh_orco != mesh_next) { | ||||
| BKE_id_free(NULL, mesh_orco); | BKE_id_free(NULL, mesh_orco); | ||||
| } | } | ||||
| mesh_orco = mesh_next; | mesh_orco = mesh_next; | ||||
| Show All 14 Lines | else { | ||||
| if (mask.lmask & CD_MASK_ORIGSPACE_MLOOP) { | if (mask.lmask & CD_MASK_ORIGSPACE_MLOOP) { | ||||
| if (!CustomData_has_layer(&mesh_final->ldata, CD_ORIGSPACE_MLOOP)) { | if (!CustomData_has_layer(&mesh_final->ldata, CD_ORIGSPACE_MLOOP)) { | ||||
| CustomData_add_layer( | CustomData_add_layer( | ||||
| &mesh_final->ldata, CD_ORIGSPACE_MLOOP, CD_CALLOC, NULL, mesh_final->totloop); | &mesh_final->ldata, CD_ORIGSPACE_MLOOP, CD_CALLOC, NULL, mesh_final->totloop); | ||||
| mesh_init_origspace(mesh_final); | mesh_init_origspace(mesh_final); | ||||
| } | } | ||||
| } | } | ||||
| Mesh *mesh_next = modwrap_applyModifier(md, &mectx, mesh_final); | Mesh *mesh_next = modwrap_modifyMesh(md, &mectx, mesh_final); | ||||
| ASSERT_IS_VALID_MESH(mesh_next); | ASSERT_IS_VALID_MESH(mesh_next); | ||||
| if (mesh_next) { | if (mesh_next) { | ||||
| if (mesh_final && mesh_final != mesh_next) { | if (mesh_final && mesh_final != mesh_next) { | ||||
| BKE_id_free(NULL, mesh_final); | BKE_id_free(NULL, mesh_final); | ||||
| } | } | ||||
| mesh_final = mesh_next; | mesh_final = mesh_next; | ||||
| ▲ Show 20 Lines • Show All 775 Lines • Show Last 20 Lines | |||||