@@ -270,9 +270,14 @@ PyObject *py_ue_skeletal_mesh_set_soft_vertices(ue_PyUObject *self, PyObject * a
270
270
model.Sections [section_index].NumVertices = soft_vertices.Num ();
271
271
model.Sections [section_index].CalcMaxBoneInfluences ();
272
272
273
+ #if ENGINE_MINOR_VERSION == 27
274
+ mesh->GetRefBasesInvMatrix ().Empty ();
275
+ #else
273
276
mesh->RefBasesInvMatrix .Empty ();
277
+ #endif
274
278
mesh->CalculateInvRefMatrices ();
275
279
280
+
276
281
#if WITH_EDITOR
277
282
mesh->PostEditChange ();
278
283
#endif
@@ -468,11 +473,18 @@ PyObject *py_ue_skeletal_mesh_set_skeleton(ue_PyUObject * self, PyObject * args)
468
473
mesh->ReleaseResources ();
469
474
mesh->ReleaseResourcesFence .Wait ();
470
475
476
+ #if ENGINE_MINOR_VERSION == 27
477
+ mesh->SetSkeleton ( skeleton );
478
+ mesh->SetRefSkeleton ( skeleton->GetReferenceSkeleton () );
479
+ mesh->GetRefBasesInvMatrix ().Empty ();
480
+ #else
471
481
mesh->Skeleton = skeleton;
472
482
473
483
mesh->RefSkeleton = skeleton->GetReferenceSkeleton ();
474
484
475
485
mesh->RefBasesInvMatrix .Empty ();
486
+ #endif
487
+
476
488
mesh->CalculateInvRefMatrices ();
477
489
478
490
#if WITH_EDITOR
@@ -548,7 +560,12 @@ PyObject *py_ue_skeletal_mesh_set_bone_map(ue_PyUObject *self, PyObject * args)
548
560
549
561
model.Sections [section_index].BoneMap = bone_map;
550
562
563
+ #if ENGINE_MINOR_VERSION == 27
564
+ mesh->GetRefBasesInvMatrix ().Empty ();
565
+ #else
551
566
mesh->RefBasesInvMatrix .Empty ();
567
+ #endif
568
+
552
569
mesh->CalculateInvRefMatrices ();
553
570
554
571
#if WITH_EDITOR
@@ -701,7 +718,12 @@ PyObject *py_ue_skeletal_mesh_set_active_bone_indices(ue_PyUObject *self, PyObje
701
718
model.ActiveBoneIndices = active_indices;
702
719
model.ActiveBoneIndices .Sort ();
703
720
721
+ #if ENGINE_MINOR_VERSION == 27
722
+ mesh->GetRefBasesInvMatrix ().Empty ();
723
+ #else
704
724
mesh->RefBasesInvMatrix .Empty ();
725
+ #endif
726
+
705
727
mesh->CalculateInvRefMatrices ();
706
728
707
729
#if WITH_EDITOR
@@ -810,7 +832,11 @@ PyObject *py_ue_skeletal_mesh_set_required_bones(ue_PyUObject *self, PyObject *
810
832
model.RequiredBones = required_bones;
811
833
model.RequiredBones .Sort ();
812
834
835
+ #if ENGINE_MINOR_VERSION == 27
836
+ mesh->GetRefBasesInvMatrix ().Empty ();
837
+ #else
813
838
mesh->RefBasesInvMatrix .Empty ();
839
+ #endif
814
840
mesh->CalculateInvRefMatrices ();
815
841
816
842
#if WITH_EDITOR
@@ -1065,7 +1091,11 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO
1065
1091
build_settings.bComputeTangents = (py_compute_tangents && PyObject_IsTrue (py_compute_tangents));
1066
1092
build_settings.bRemoveDegenerateTriangles = true ;
1067
1093
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
1068
1097
bool success = MeshUtilities.BuildSkeletalMesh (lod_model, mesh->RefSkeleton , influences, wedges, faces, points, points_to_map, build_settings);
1098
+ #endif
1069
1099
1070
1100
if (!success)
1071
1101
{
@@ -1079,17 +1109,31 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO
1079
1109
}
1080
1110
#endif
1081
1111
1112
+ #if ENGINE_MINOR_VERSION == 27
1113
+ mesh->CalculateRequiredBones (LODModel, mesh->GetRefSkeleton (), nullptr );
1114
+ #else
1082
1115
mesh->CalculateRequiredBones (LODModel, mesh->RefSkeleton , nullptr );
1116
+ #endif
1083
1117
mesh->CalculateInvRefMatrices ();
1084
1118
1119
+ #if ENGINE_MINOR_VERSION == 27
1120
+ mesh->GetSkeleton ()->RecreateBoneTree (mesh);
1121
+ mesh->GetSkeleton ()->SetPreviewMesh (mesh);
1122
+ #else
1085
1123
mesh->Skeleton ->RecreateBoneTree (mesh);
1086
1124
mesh->Skeleton ->SetPreviewMesh (mesh);
1125
+ #endif
1087
1126
1088
1127
// calculate bounds from points
1089
1128
mesh->SetImportedBounds (FBoxSphereBounds (points.GetData (), points.Num ()));
1090
1129
1130
+ #if ENGINE_MINOR_VERSION == 27
1131
+ mesh->GetSkeleton ()->PostEditChange ();
1132
+ mesh->GetSkeleton ()->MarkPackageDirty ();
1133
+ #else
1091
1134
mesh->Skeleton ->PostEditChange ();
1092
1135
mesh->Skeleton ->MarkPackageDirty ();
1136
+ #endif
1093
1137
1094
1138
mesh->PostEditChange ();
1095
1139
mesh->MarkPackageDirty ();
0 commit comments