@@ -270,9 +270,14 @@ PyObject *py_ue_skeletal_mesh_set_soft_vertices(ue_PyUObject *self, PyObject * a
270270 model.Sections [section_index].NumVertices = soft_vertices.Num ();
271271 model.Sections [section_index].CalcMaxBoneInfluences ();
272272
273+ #if ENGINE_MINOR_VERSION == 27
274+ mesh->GetRefBasesInvMatrix ().Empty ();
275+ #else
273276 mesh->RefBasesInvMatrix .Empty ();
277+ #endif
274278 mesh->CalculateInvRefMatrices ();
275279
280+
276281#if WITH_EDITOR
277282 mesh->PostEditChange ();
278283#endif
@@ -468,11 +473,18 @@ PyObject *py_ue_skeletal_mesh_set_skeleton(ue_PyUObject * self, PyObject * args)
468473 mesh->ReleaseResources ();
469474 mesh->ReleaseResourcesFence .Wait ();
470475
476+ #if ENGINE_MINOR_VERSION == 27
477+ mesh->SetSkeleton ( skeleton );
478+ mesh->SetRefSkeleton ( skeleton->GetReferenceSkeleton () );
479+ mesh->GetRefBasesInvMatrix ().Empty ();
480+ #else
471481 mesh->Skeleton = skeleton;
472482
473483 mesh->RefSkeleton = skeleton->GetReferenceSkeleton ();
474484
475485 mesh->RefBasesInvMatrix .Empty ();
486+ #endif
487+
476488 mesh->CalculateInvRefMatrices ();
477489
478490#if WITH_EDITOR
@@ -548,7 +560,12 @@ PyObject *py_ue_skeletal_mesh_set_bone_map(ue_PyUObject *self, PyObject * args)
548560
549561 model.Sections [section_index].BoneMap = bone_map;
550562
563+ #if ENGINE_MINOR_VERSION == 27
564+ mesh->GetRefBasesInvMatrix ().Empty ();
565+ #else
551566 mesh->RefBasesInvMatrix .Empty ();
567+ #endif
568+
552569 mesh->CalculateInvRefMatrices ();
553570
554571#if WITH_EDITOR
@@ -701,7 +718,12 @@ PyObject *py_ue_skeletal_mesh_set_active_bone_indices(ue_PyUObject *self, PyObje
701718 model.ActiveBoneIndices = active_indices;
702719 model.ActiveBoneIndices .Sort ();
703720
721+ #if ENGINE_MINOR_VERSION == 27
722+ mesh->GetRefBasesInvMatrix ().Empty ();
723+ #else
704724 mesh->RefBasesInvMatrix .Empty ();
725+ #endif
726+
705727 mesh->CalculateInvRefMatrices ();
706728
707729#if WITH_EDITOR
@@ -810,7 +832,11 @@ PyObject *py_ue_skeletal_mesh_set_required_bones(ue_PyUObject *self, PyObject *
810832 model.RequiredBones = required_bones;
811833 model.RequiredBones .Sort ();
812834
835+ #if ENGINE_MINOR_VERSION == 27
836+ mesh->GetRefBasesInvMatrix ().Empty ();
837+ #else
813838 mesh->RefBasesInvMatrix .Empty ();
839+ #endif
814840 mesh->CalculateInvRefMatrices ();
815841
816842#if WITH_EDITOR
@@ -1065,7 +1091,11 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO
10651091 build_settings.bComputeTangents = (py_compute_tangents && PyObject_IsTrue (py_compute_tangents));
10661092 build_settings.bRemoveDegenerateTriangles = true ;
10671093
1094+ #if ENGINE_MINOR_VERSION == 27
1095+ bool success = MeshUtilities.BuildSkeletalMesh (lod_model, mesh->GetName (), mesh->GetRefSkeleton (), influences, wedges, faces, points, points_to_map, build_settings);
1096+ #else
10681097 bool success = MeshUtilities.BuildSkeletalMesh (lod_model, mesh->RefSkeleton , influences, wedges, faces, points, points_to_map, build_settings);
1098+ #endif
10691099
10701100 if (!success)
10711101 {
@@ -1079,17 +1109,31 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO
10791109 }
10801110#endif
10811111
1112+ #if ENGINE_MINOR_VERSION == 27
1113+ mesh->CalculateRequiredBones (LODModel, mesh->GetRefSkeleton (), nullptr );
1114+ #else
10821115 mesh->CalculateRequiredBones (LODModel, mesh->RefSkeleton , nullptr );
1116+ #endif
10831117 mesh->CalculateInvRefMatrices ();
10841118
1119+ #if ENGINE_MINOR_VERSION == 27
1120+ mesh->GetSkeleton ()->RecreateBoneTree (mesh);
1121+ mesh->GetSkeleton ()->SetPreviewMesh (mesh);
1122+ #else
10851123 mesh->Skeleton ->RecreateBoneTree (mesh);
10861124 mesh->Skeleton ->SetPreviewMesh (mesh);
1125+ #endif
10871126
10881127 // calculate bounds from points
10891128 mesh->SetImportedBounds (FBoxSphereBounds (points.GetData (), points.Num ()));
10901129
1130+ #if ENGINE_MINOR_VERSION == 27
1131+ mesh->GetSkeleton ()->PostEditChange ();
1132+ mesh->GetSkeleton ()->MarkPackageDirty ();
1133+ #else
10911134 mesh->Skeleton ->PostEditChange ();
10921135 mesh->Skeleton ->MarkPackageDirty ();
1136+ #endif
10931137
10941138 mesh->PostEditChange ();
10951139 mesh->MarkPackageDirty ();
0 commit comments