Skip to content

Commit

Permalink
Update for 0.04.4d, retain unknown lod in backport and fix bone optim…
Browse files Browse the repository at this point in the history
…ization
  • Loading branch information
Retera committed Oct 11, 2022
1 parent ed2f593 commit 71482b1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
15 changes: 11 additions & 4 deletions craft3data/src/com/hiveworkshop/wc3/mdl/Bone.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ public void clearAnimation(final Animation a) {
}

/**
* Returns true if this bone contains some type of data that moves, scales, rotates, or otherwise changes based on
* the time track.
* Returns true if this bone contains some type of data that moves, scales,
* rotates, or otherwise changes based on the time track.
*
* @return
*/
Expand Down Expand Up @@ -357,8 +357,15 @@ public double getClickRadius(final CoordinateSystem coordinateSystem) {

@Override
public float getRenderVisibility(final AnimatedRenderEnvironment animatedRenderEnvironment) {
if (geosetAnim != null) {
return geosetAnim.getRenderVisibility(animatedRenderEnvironment);
if (!multiGeoId) {
if (geoset != null) {
if (geoset.getGeosetAnim() != null) {
return geoset.getGeosetAnim().getRenderVisibility(animatedRenderEnvironment);
}
if (geosetAnim != null) {
return geosetAnim.getRenderVisibility(animatedRenderEnvironment);
}
}
}
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion craft3data/src/com/hiveworkshop/wc3/mdl/EditableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3295,7 +3295,7 @@ class BakingInfo {
for (final GeosetVertex vertex : geo.getVertices()) {
vertex.un900Heuristic();
}
if (geo.getLevelOfDetail() != targetLevelOfDetail) {
if (geo.getLevelOfDetail() != targetLevelOfDetail && geo.getLevelOfDetail() != -1) {
// wrong lod
wrongLOD.add(geo);
}
Expand Down
4 changes: 2 additions & 2 deletions craft3data/src/com/hiveworkshop/wc3/mdl/Material.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ public VertexData(final Vector3f tangentLightPos, final Vector3f tangentViewPos,
final Map<Vertex, VertexData> vertexToData = new HashMap<>();
final Vector3f temp = new Vector3f();
for (final Geoset geo : model.getGeosets()) {
if (geo.getLevelOfDetail() != lod) {
if (geo.getLevelOfDetail() != lod && geo.getLevelOfDetail() != -1) {
continue;
}
if (geo.getMaterial() == this || geo.getMaterial().equals(this) || geo.getMaterial().getLayers().get(0)
Expand Down Expand Up @@ -567,7 +567,7 @@ public VertexData(final Vector3f tangentLightPos, final Vector3f tangentViewPos,
}
}
for (final Geoset geo : model.getGeosets()) {
if (geo.getLevelOfDetail() != lod) {
if (geo.getLevelOfDetail() != lod && geo.getLevelOfDetail() != -1) {
continue;
}
if (geo.getMaterial() == this || geo.getMaterial().equals(this) || geo.getMaterial().getLayers().get(0)
Expand Down
2 changes: 1 addition & 1 deletion matrixeater/src/com/matrixeater/src/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public void run() {
}

JPopupMenu.setDefaultLightWeightPopupEnabled(false);
frame = new MainFrame("Retera Model Studio v0.04.4c");
frame = new MainFrame("Retera Model Studio v0.04.4d");
panel.init();
if (!startupModelPaths.isEmpty()) {
for (final String path : startupModelPaths) {
Expand Down

0 comments on commit 71482b1

Please sign in to comment.