Skip to content

Commit d2d19c2

Browse files
committed
updated the LogView and added to handle exception on a tangent generator.
1 parent cd17497 commit d2d19c2

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

src/com/ss/editor/model/tool/TangentGenerator.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import com.jme3.scene.Spatial;
44
import com.jme3.util.TangentBinormalGenerator;
55
import com.jme3.util.mikktspace.MikktspaceTangentGenerator;
6+
import com.ss.editor.util.EditorUtil;
7+
8+
import rlib.logging.Logger;
9+
import rlib.logging.LoggerManager;
610

711
/**
812
* Tangent generators.
@@ -11,17 +15,27 @@
1115
*/
1216
public class TangentGenerator {
1317

18+
private static final Logger LOGGER = LoggerManager.getLogger(TangentGenerator.class);
19+
1420
/**
1521
* Generate tangents using a standard algorithm.
1622
*/
1723
public static void useStandardGenerator(final Spatial spatial, final boolean splitMirrored) {
18-
TangentBinormalGenerator.generate(spatial, splitMirrored);
24+
try {
25+
TangentBinormalGenerator.generate(spatial, splitMirrored);
26+
} catch (final Exception e) {
27+
EditorUtil.handleException(LOGGER, null, e);
28+
}
1929
}
2030

2131
/**
2232
* Generate tangents using a Mikktspace algorithm.
2333
*/
2434
public static void useMikktspaceGenerator(final Spatial spatial) {
25-
MikktspaceTangentGenerator.generate(spatial);
35+
try {
36+
MikktspaceTangentGenerator.generate(spatial);
37+
} catch (final Exception e) {
38+
EditorUtil.handleException(LOGGER, null, e);
39+
}
2640
}
2741
}

src/com/ss/editor/ui/component/log/LogView.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import static java.util.Collections.singleton;
44

5-
import com.jme3.material.Material;
6-
import com.jme3.scene.plugins.fbx.misc.FbxGlobalSettings;
75
import com.jme3x.jfx.util.JFXPlatform;
86
import com.ss.editor.ui.css.CSSClasses;
97
import com.ss.editor.ui.css.CSSIds;
@@ -13,6 +11,7 @@
1311
import org.fxmisc.richtext.StyleSpansBuilder;
1412
import org.jetbrains.annotations.NotNull;
1513

14+
import java.nio.BufferOverflowException;
1615
import java.util.Collection;
1716
import java.util.function.Consumer;
1817
import java.util.regex.Matcher;
@@ -35,11 +34,18 @@ public static LogView getInstance() {
3534

3635
private static final String[] FRAMEWORKS = {
3736
"log4j",
37+
"com.jme3.util.",
38+
"com.jme3.material.",
39+
"com.ss.editor.ui.",
40+
"com.ss.editor.model.",
3841
};
3942

4043
private static final String[] CLASSES = {
41-
Material.class.getName(),
42-
FbxGlobalSettings.class.getName(),
44+
BufferOverflowException.class.getName(),
45+
NullPointerException.class.getName(),
46+
47+
BufferOverflowException.class.getSimpleName(),
48+
NullPointerException.class.getSimpleName(),
4349
};
4450

4551
private static final String[] SEVERITIES = {

0 commit comments

Comments
 (0)