Skip to content

Commit

Permalink
Merge branch 'master' of github.com:/Retera/ReterasModelStudio
Browse files Browse the repository at this point in the history
  • Loading branch information
Retera committed Dec 6, 2022
2 parents a1c3bd1 + a2f2f71 commit 30aa0ee
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 10 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
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public static String getEditorMetaDataDisplayKey(int level, final GameObject met
if (upgradeExtensionLevel > 0) {
metaDataName += Integer.toString(upgradeExtensionLevel);
}
} else if (repeats && index == -1) {
} else if (repeats && (index == -1 || repeatCount >= 10)) {
if (level == 0) {
level = 1;
}
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
17 changes: 16 additions & 1 deletion matrixeater/src/com/matrixeater/src/MainPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,21 @@ public void actionPerformed(final ActionEvent e) {
}
};
AbstractAction deleteAction = new AbstractAction("Delete") {
@Override
public void actionPerformed(final ActionEvent e) {
final ModelPanel mpanel = currentModelPanel();
if (mpanel != null) {
if (animationModeState) {
timeSliderPanel.deleteSelectedKeyframes();
} else {
mpanel.getUndoManager()
.pushAction(mpanel.getModelEditorManager().getModelEditor().deleteSelectedComponents());
}
}
repaintSelfAndChildren(mpanel);
}
};
AbstractAction deleteHotkeyAction = new AbstractAction("Delete") {
@Override
public void actionPerformed(final ActionEvent e) {
final ModelPanel mpanel = currentModelPanel();
Expand Down Expand Up @@ -2137,7 +2152,7 @@ private void linkActions(final JComponent root) {
root.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("control Y"),
"Redo");

root.getActionMap().put("Delete", deleteAction);
root.getActionMap().put("Delete", deleteHotkeyAction);
root.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("DELETE"), "Delete");

root.getActionMap().put("CloneSelection", cloneAction);
Expand Down

0 comments on commit 30aa0ee

Please sign in to comment.