Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for unreal spline output rotations being incorrect #279

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 4 additions & 14 deletions Source/HoudiniEngine/Private/HoudiniSplineTranslator.cpp
Expand Up @@ -1638,9 +1638,11 @@ FHoudiniSplineTranslator::CreateOutputUnrealSplineComponent(
NewSplineComponent->ClearSplinePoints();
NewSplineComponent->bEditableWhenInherited = false;

ESplinePointType::Type SplinePointType = bIsLinear ? ESplinePointType::Linear : ESplinePointType::Curve;
for (int32 n = 0; n < CurvePoints.Num(); ++n)
{
NewSplineComponent->AddSplinePoint(CurvePoints[n], ESplineCoordinateSpace::Local);
NewSplineComponent->SetSplinePointType(n, SplinePointType);
}

bool bHasScales = CurveScales.Num() == CurvePoints.Num();
Expand All @@ -1657,22 +1659,10 @@ FHoudiniSplineTranslator::CreateOutputUnrealSplineComponent(
{
for (int32 n = 0; n < CurvePoints.Num(); ++n)
{
NewSplineComponent->SetRotationAtSplinePoint(n, CurveRotations[n].Rotation(), ESplineCoordinateSpace::Local, false);
NewSplineComponent->SetRotationAtSplinePoint(n, FRotator::MakeFromEuler(CurveRotations[n]), ESplineCoordinateSpace::Local, false);
}
}

if (bIsLinear)
{
for (int32 n = 0; n < CurvePoints.Num(); ++n)
NewSplineComponent->SetSplinePointType(n, ESplinePointType::Linear);
}
else
{
for (int32 n = 0; n < CurvePoints.Num(); ++n)
NewSplineComponent->SetSplinePointType(n, ESplinePointType::Curve);
}


NewSplineComponent->SetClosedLoop(bIsClosed);

NewSplineComponent->UpdateSpline();
Expand Down Expand Up @@ -1729,7 +1719,7 @@ FHoudiniSplineTranslator::UpdateOutputUnrealSplineComponent(
{
for (int32 n = 0; n < CurvePoints.Num(); ++n)
{
EditedSplineComponent->SetRotationAtSplinePoint(n, CurveRotations[n].Rotation(), ESplineCoordinateSpace::Local, false);
EditedSplineComponent->SetRotationAtSplinePoint(n, FRotator::MakeFromEuler(CurveRotations[n]), ESplineCoordinateSpace::Local, false);
}
}

Expand Down