editor-assets vollständig nach blight-assets migriert
TreeGeneratorState, PalmGeneratorState und EzTreeState zeigten noch auf editor-assets/ für Models, Texturen und Impostors. Alle Pfade auf blight-assets/src/main/resources/ umgestellt: - models/ → Models/ - textures/ → Textures/impostor/ - Palmen → trees/palm/ (konsistent mit EzTree) - ASSET_ROOT/BLIGHT_ASSET_ROOT-Doppelung in EzTreeState bereinigt - verbleibende System.out/err durch log.warn/error ersetzt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -177,7 +177,7 @@ public class SharedInput {
|
|||||||
/** Wird von JME3 gesetzt, wenn ein Objekt gerade neu platziert wurde (nicht nur selektiert). */
|
/** Wird von JME3 gesetzt, wenn ein Objekt gerade neu platziert wurde (nicht nur selektiert). */
|
||||||
public volatile boolean objectJustPlaced = false;
|
public volatile boolean objectJustPlaced = false;
|
||||||
|
|
||||||
/** JavaFX → JME3: Modell-Pfad für nächste Platzierung (relativ zu editor-assets/). */
|
/** JavaFX → JME3: Modell-Pfad für nächste Platzierung (relativ zu blight-assets/src/main/resources/). */
|
||||||
public volatile String pendingModelPath = null;
|
public volatile String pendingModelPath = null;
|
||||||
|
|
||||||
/** Wenn gesetzt: Baum-Ordner-Platzierungsmodus. Relativ zu blight-assets/src/main/resources. */
|
/** Wenn gesetzt: Baum-Ordner-Platzierungsmodus. Relativ zu blight-assets/src/main/resources. */
|
||||||
@@ -185,7 +185,7 @@ public class SharedInput {
|
|||||||
/** Status-Meldung aus JME: welcher Baum gerade ausgewählt ist. */
|
/** Status-Meldung aus JME: welcher Baum gerade ausgewählt ist. */
|
||||||
public volatile String randomTreeStatus = "";
|
public volatile String randomTreeStatus = "";
|
||||||
|
|
||||||
/** JavaFX → JME3: Textur-Pfad für nächste Platzierung (relativ zu editor-assets/, "" = keine). */
|
/** JavaFX → JME3: Textur-Pfad für nächste Platzierung (relativ zu blight-assets/src/main/resources/, "" = keine). */
|
||||||
public volatile String pendingTexturePath = "";
|
public volatile String pendingTexturePath = "";
|
||||||
/** JavaFX → JME3: Normal-Map-Pfad für nächste Platzierung ("" = keine). */
|
/** JavaFX → JME3: Normal-Map-Pfad für nächste Platzierung ("" = keine). */
|
||||||
public volatile String pendingNormalMapPath = "";
|
public volatile String pendingNormalMapPath = "";
|
||||||
@@ -222,7 +222,7 @@ public class SharedInput {
|
|||||||
* sizeY: Höhe (Box/Zylinder)
|
* sizeY: Höhe (Box/Zylinder)
|
||||||
* sizeZ: Tiefe (Box/Ebene)
|
* sizeZ: Tiefe (Box/Ebene)
|
||||||
* matType: "Unshaded" | "Phong"
|
* matType: "Unshaded" | "Phong"
|
||||||
* texturePath: relativ zu editor-assets/ oder null
|
* texturePath: relativ zu blight-assets/src/main/resources/ oder null
|
||||||
*/
|
*/
|
||||||
public record MeshCreateRequest(
|
public record MeshCreateRequest(
|
||||||
String form,
|
String form,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class SceneObject extends PlacedObject {
|
|||||||
private float rotZ; // Z-Achsen-Rotation in Radiant
|
private float rotZ; // Z-Achsen-Rotation in Radiant
|
||||||
private float scale;
|
private float scale;
|
||||||
public boolean solid; // Charakter-Kollision
|
public boolean solid; // Charakter-Kollision
|
||||||
public String modelPath; // relativ zu editor-assets/
|
public String modelPath; // relativ zu blight-assets/src/main/resources/
|
||||||
public String texturePath = "";
|
public String texturePath = "";
|
||||||
public String normalMapPath = "";
|
public String normalMapPath = "";
|
||||||
public String materialPath = "";
|
public String materialPath = "";
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ public class EzTreeState extends BaseAppState {
|
|||||||
private static final Logger log = LoggerFactory.getLogger(EzTreeState.class);
|
private static final Logger log = LoggerFactory.getLogger(EzTreeState.class);
|
||||||
|
|
||||||
private static final int IMPOSTOR_SIZE = 512;
|
private static final int IMPOSTOR_SIZE = 512;
|
||||||
private static final Path ASSET_ROOT = de.blight.editor.ProjectRoot.resolve("editor-assets");
|
private static final Path ASSET_ROOT = de.blight.editor.ProjectRoot.resolve("blight-assets", "src", "main", "resources");
|
||||||
private static final Path BLIGHT_ASSET_ROOT = de.blight.editor.ProjectRoot.resolve("blight-assets", "src", "main", "resources");
|
|
||||||
private static final Path TOOLS_DIR = de.blight.editor.ProjectRoot.resolve("tools");
|
private static final Path TOOLS_DIR = de.blight.editor.ProjectRoot.resolve("tools");
|
||||||
private static final Gson GSON = new Gson();
|
private static final Gson GSON = new Gson();
|
||||||
|
|
||||||
@@ -533,7 +532,7 @@ public class EzTreeState extends BaseAppState {
|
|||||||
img.setRGB(x, IMPOSTOR_SIZE - 1 - y, (a<<24)|(r<<16)|(g<<8)|b);
|
img.setRGB(x, IMPOSTOR_SIZE - 1 - y, (a<<24)|(r<<16)|(g<<8)|b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Path texDir = ASSET_ROOT.resolve("textures");
|
Path texDir = ASSET_ROOT.resolve("Textures").resolve("impostor");
|
||||||
Files.createDirectories(texDir);
|
Files.createDirectories(texDir);
|
||||||
ImageIO.write(img, "PNG", texDir.resolve(name + ".png").toFile());
|
ImageIO.write(img, "PNG", texDir.resolve(name + ".png").toFile());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -544,8 +543,8 @@ public class EzTreeState extends BaseAppState {
|
|||||||
private void exportTree(Node treeNode, String name, String treeCategory) {
|
private void exportTree(Node treeNode, String name, String treeCategory) {
|
||||||
try {
|
try {
|
||||||
Path baseDir = (treeCategory != null && !treeCategory.isBlank())
|
Path baseDir = (treeCategory != null && !treeCategory.isBlank())
|
||||||
? BLIGHT_ASSET_ROOT.resolve("trees").resolve(treeCategory)
|
? ASSET_ROOT.resolve("trees").resolve(treeCategory)
|
||||||
: ASSET_ROOT.resolve("models");
|
: ASSET_ROOT.resolve("Models");
|
||||||
Files.createDirectories(baseDir);
|
Files.createDirectories(baseDir);
|
||||||
File out = baseDir.resolve(name + ".j3o").toFile();
|
File out = baseDir.resolve(name + ".j3o").toFile();
|
||||||
BinaryExporter.getInstance().save(treeNode, out);
|
BinaryExporter.getInstance().save(treeNode, out);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class PalmGeneratorState extends BaseAppState {
|
|||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(PalmGeneratorState.class);
|
private static final Logger log = LoggerFactory.getLogger(PalmGeneratorState.class);
|
||||||
|
|
||||||
private static final Path ASSET_ROOT = de.blight.editor.ProjectRoot.resolve("editor-assets");
|
private static final Path ASSET_ROOT = de.blight.editor.ProjectRoot.resolve("blight-assets", "src", "main", "resources");
|
||||||
|
|
||||||
private final SharedInput input;
|
private final SharedInput input;
|
||||||
private SimpleApplication app;
|
private SimpleApplication app;
|
||||||
@@ -192,7 +192,7 @@ public class PalmGeneratorState extends BaseAppState {
|
|||||||
|
|
||||||
private void exportPalm(Node palmNode, String name) {
|
private void exportPalm(Node palmNode, String name) {
|
||||||
try {
|
try {
|
||||||
Path modelDir = ASSET_ROOT.resolve("models");
|
Path modelDir = ASSET_ROOT.resolve("trees").resolve("palm");
|
||||||
Files.createDirectories(modelDir);
|
Files.createDirectories(modelDir);
|
||||||
String stampedName = name + "_"
|
String stampedName = name + "_"
|
||||||
+ DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss").format(LocalDateTime.now());
|
+ DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss").format(LocalDateTime.now());
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class TreeGeneratorState extends BaseAppState {
|
|||||||
|
|
||||||
private static final int IMPOSTOR_SIZE = 512;
|
private static final int IMPOSTOR_SIZE = 512;
|
||||||
private static final int PREVIEW_SIZE = 1024;
|
private static final int PREVIEW_SIZE = 1024;
|
||||||
private static final Path ASSET_ROOT = de.blight.editor.ProjectRoot.resolve("editor-assets");
|
private static final Path ASSET_ROOT = de.blight.editor.ProjectRoot.resolve("blight-assets", "src", "main", "resources");
|
||||||
|
|
||||||
private final SharedInput input;
|
private final SharedInput input;
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@ public class TreeGeneratorState extends BaseAppState {
|
|||||||
mat.setTexture("BarkMap", barkTex);
|
mat.setTexture("BarkMap", barkTex);
|
||||||
mat.setBoolean("HasBarkMap", true);
|
mat.setBoolean("HasBarkMap", true);
|
||||||
} catch (Exception tex) {
|
} catch (Exception tex) {
|
||||||
System.err.println("[TreeGenerator] Bark-Textur nicht gefunden: " + p.barkTexture);
|
log.warn("[Blight-Baum] Bark-Textur nicht gefunden: {}", p.barkTexture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mat;
|
return mat;
|
||||||
@@ -535,14 +535,14 @@ public class TreeGeneratorState extends BaseAppState {
|
|||||||
img.setRGB(x, IMPOSTOR_SIZE - 1 - y, (a<<24)|(r<<16)|(g<<8)|b);
|
img.setRGB(x, IMPOSTOR_SIZE - 1 - y, (a<<24)|(r<<16)|(g<<8)|b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Path texDir = ASSET_ROOT.resolve("textures");
|
Path texDir = ASSET_ROOT.resolve("Textures").resolve("impostor");
|
||||||
Files.createDirectories(texDir);
|
Files.createDirectories(texDir);
|
||||||
File pngFile = texDir.resolve(name + ".png").toFile();
|
File pngFile = texDir.resolve(name + ".png").toFile();
|
||||||
ImageIO.write(img, "PNG", pngFile);
|
ImageIO.write(img, "PNG", pngFile);
|
||||||
System.out.println("[TreeGenerator] Impostor: " + pngFile.getAbsolutePath());
|
log.info("[Blight-Baum] Impostor: {}", pngFile.getAbsolutePath());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return (Texture2D) assets.loadTexture("textures/" + name + ".png");
|
return (Texture2D) assets.loadTexture("Textures/impostor/" + name + ".png");
|
||||||
} catch (Exception loadEx) {
|
} catch (Exception loadEx) {
|
||||||
pixels.rewind();
|
pixels.rewind();
|
||||||
Image jmeImg = new Image(Image.Format.RGBA8, IMPOSTOR_SIZE, IMPOSTOR_SIZE,
|
Image jmeImg = new Image(Image.Format.RGBA8, IMPOSTOR_SIZE, IMPOSTOR_SIZE,
|
||||||
@@ -559,7 +559,7 @@ public class TreeGeneratorState extends BaseAppState {
|
|||||||
|
|
||||||
private void exportTree(Node treeNode, String name) {
|
private void exportTree(Node treeNode, String name) {
|
||||||
try {
|
try {
|
||||||
Path modelDir = ASSET_ROOT.resolve("models");
|
Path modelDir = ASSET_ROOT.resolve("Models");
|
||||||
Files.createDirectories(modelDir);
|
Files.createDirectories(modelDir);
|
||||||
File out = modelDir.resolve("GeneratedTree_" + name + ".j3o").toFile();
|
File out = modelDir.resolve("GeneratedTree_" + name + ".j3o").toFile();
|
||||||
// Strip runtime controls before export — they lack no-arg constructors
|
// Strip runtime controls before export — they lack no-arg constructors
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class TextureChooser extends Dialog<String> {
|
|||||||
private String selectedPath;
|
private String selectedPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param assetRoot path to the editor-assets directory (may be {@code null} to skip user textures)
|
* @param assetRoot path to the blight-assets directory (may be {@code null} to skip user textures)
|
||||||
* @param includeJmeBuiltin whether to include JME built-in terrain textures
|
* @param includeJmeBuiltin whether to include JME built-in terrain textures
|
||||||
*/
|
*/
|
||||||
public TextureChooser(Path assetRoot, boolean includeJmeBuiltin) {
|
public TextureChooser(Path assetRoot, boolean includeJmeBuiltin) {
|
||||||
|
|||||||
Reference in New Issue
Block a user