Disable appearance exporting when triangulation is enabled

This commit is contained in:
SiboVG 2023-08-23 17:29:42 +02:00
parent c32f524803
commit 29b60d723e
2 changed files with 17 additions and 0 deletions

View File

@ -1494,6 +1494,7 @@ OBJOptionChooser.checkbox.exportAppearance = Export appearance
OBJOptionChooser.checkbox.exportAppearance.ttip = If true, export the component appearances to an MTL file.
OBJOptionChooser.checkbox.exportAsSeparateFiles = Export as separate files
OBJOptionChooser.checkbox.exportAsSeparateFiles.ttip = If true, export each component as a separate OBJ file.
OBJOptionChooser.checkbox.exportAppearance.ttip.triangulate = You can not export the appearance with the triangulate feature enabled.
OBJOptionChooser.checkbox.removeOffset = Remove origin offset
OBJOptionChooser.checkbox.removeOffset.ttip = <html>If true, remove the offset of the component from the origin.<br>If false, the component is exported at its original location in the rocket.</html>
OBJOptionChooser.btn.showAdvanced = Show Advanced options

View File

@ -102,6 +102,22 @@ public class OBJOptionChooser extends JPanel {
this.triangulate = new JCheckBox(trans.get("OBJOptionChooser.checkbox.triangulate"));
this.triangulate.setToolTipText(trans.get("OBJOptionChooser.checkbox.triangulate.ttip"));
advancedOptionsPanel.add(triangulate, "spanx, wrap");
this.triangulate.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
// Disable the export appearance, it is not supported in combination with triangulate
exportAppearance.setEnabled(false);
exportAppearance.setSelected(false);
exportAppearance.setToolTipText(trans.get("OBJOptionChooser.checkbox.exportAppearance.ttip.triangulate"));
} else {
// Re-enable
exportAppearance.setEnabled(true);
exportAppearance.setSelected(opts.isExportAppearance());
exportAppearance.setToolTipText(trans.get("OBJOptionChooser.checkbox.exportAppearance.ttip"));
}
}
});
//// Level of detail
JLabel LODLabel = new JLabel(trans.get("OBJOptionChooser.lbl.LevelOfDetail"));