Skip to content

Commit

Permalink
[ut3] better 3d scaling of staticmesh actors
Browse files Browse the repository at this point in the history
  • Loading branch information
xtremexp committed Sep 13, 2015
1 parent 82a5027 commit 3091b00
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/main/java/org/xtx/ut4converter/t3d/T3DActor.java
Expand Up @@ -234,7 +234,19 @@ else if (line.startsWith("DrawScale3D")) {
}

else if (line.startsWith("DrawScale=")) {
drawScale = T3DUtils.getDouble(line);

double scale = T3DUtils.getDouble(line);

// Scale and Scale3d can both be used to scale up/down staticmeshes in UT3
if(mapConverter.isFrom(UnrealEngine.UE3) && this instanceof T3DStaticMesh){
if(scale3d == null){
scale3d = new Vector3d(scale, scale, scale);
} else {
scale3d.scale(scale);
}
} else {
drawScale = T3DUtils.getDouble(line);
}
}

else if (line.startsWith("Rotation")) {
Expand Down Expand Up @@ -519,11 +531,7 @@ protected void writeEndActor() {

if (mapConverter.toUnrealEngine4()) {
if (drawScale != null) {
// limited sprite scale for staticmeshes because UT3 uses
// drawscale as drawscale3d in same time
if (!"StaticMeshActor".equals(t3dOriginClass)) {
sbf.append(IDT).append("\tSpriteScale=").append(drawScale).append("\n");
}
sbf.append(IDT).append("\tSpriteScale=").append(drawScale).append("\n");
}
sbf.append(IDT).append("\tActorLabel=\"").append(name).append("\"\n");
}
Expand Down

0 comments on commit 3091b00

Please sign in to comment.