Hello, thanks for trying to help me. Much appreciated.
I indeed tryd to negate the rotation angles. In all possible combinations. But it seems to just make the values positive or negative.
I honestly think that it is a Matrix problem of some kind.
Here is the function that gets fed with the 3D-app( Softimage XSI) data.
void SpawnSMActor(const TCHAR *path,float sX,float sY,float sZ,float rX,float rY,float rZ,float pX,float pY,float pZ)
{
// Load Static Mesh from given Reference Path from UE4 Explorer
UStaticMesh* StaMesh = LoadObject<UStaticMesh>(nullptr, path);
// Transform
FVector objectScale(sX, sY, sZ); // Scale
// ************************************************************************************
// Conversion XSI Coordinate System to UE4 Coordinate System
FVector NewPosition;
FRotator NewRotation;
// We just simply swap the Z and Y Coordinates
NewPosition.X = pX * 100; // TX
NewPosition.Y = pZ * 100; // TZ
NewPosition.Z = pY * 100; // TY
// We just simply swap the Pitch(Y) and Yaw(Z) angles
NewRotation.Roll = rX; // RX
NewRotation.Pitch = -rZ; // RZ
NewRotation.Yaw = rY; // RY
FRotator NewobjectRotation(NewRotation.Quaternion());
FTransform objectTransform(NewobjectRotation, NewPosition, objectScale);
// ************************************************************************************
// Creating the Actor and Positioning it in the World based on the Static Mesh
UWorld* currentWorld = GEditor->GetEditorWorldContext().World();
ULevel* currentLevel = currentWorld->GetCurrentLevel();
UClass* StaticMeshClass = AStaticMeshActor::StaticClass();
AActor* NewActorCreated = GEditor->AddActor(currentLevel, StaticMeshClass, objectTransform, true, RF_Public | RF_Standalone | RF_Transactional);
AStaticMeshActor* smActor = Cast<AStaticMeshActor>(NewActorCreated);
smActor->GetStaticMeshComponent()->SetStaticMesh(StaMesh);
smActor->SetActorScale3D(objectScale);
// ID Name & Visible Name
//smActor->Rename(TEXT("MyStaticMeshInTheWorld"));
//smActor->SetActorLabel("MyStaticMeshInTheWorld");
GEditor->EditorUpdateComponents();
smActor->GetStaticMeshComponent()->RegisterComponentWithWorld(currentWorld);
currentWorld->UpdateWorldComponents(true, false);
smActor->RerunConstructionScripts();
GLevelEditorModeTools().MapChangeNotify();
}