Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on saving .tpproj file in a folder within the folder the .atlas file is exported to #126

Closed
MoeruCore opened this issue Jan 9, 2022 · 3 comments
Labels
crash report Crash reports sent from a built-in issue constructor

Comments

@MoeruCore
Copy link

Hey, just started using this about 20 minutes ago and the program's exactly what I was hoping for, but I ran into a crash that's fortunately pretty easy to work around.

My folder structure looks like this:

model
| textures
| | .kra files
| | mouth

It's a bit wonky, but "textures" contains all of the exported textures the model uses, ".kra files" contains the source files the textures were exported from, and "mouth" contains a bunch of mouth image sprites that I was atlasing, which are the only images in the atlas. The resulting .atlas and .png files were saved in "textures". Attempting to save the .tpproj file in ".kra files" crashes the program, but saving it in "model" does not. I also tried saving it in a new folder in "textures" called "kra files" (without the period), and that also crashed, so the period in the folder name doesn't appear to be the issue.

You can see in the log that I also got an exception when I tried to pack the assets without setting an output folder, but the crash happens whether or not you do that first.

Application Log Version: 4.10.2 OS: Windows 10 10.0 x86 JRE: 1.8.0_301 Oracle Corporation GPU: Intel(R) HD Graphics 630 OpenGL vendor: Intel OpenGL version: 4.5.0 - Build 22.20.16.4749 [ExtensionModuleRepositoryService] Cached data is outdated. [ExtensionModuleRepositoryService] Requesting new data from remote server. [ConfigurationController] Incremental fonts are disabled [GlobalShortcutHandler] Parsing shortcut file: hotkeys_default.txt [SystemUtils] Recognized system configuration is Windows (Other) [ExtensionModuleRepositoryService] Data was loaded from remote server. [text-red]Exception occurred:[] Output directory is not specified [text-red]Stack trace:[] java.lang.IllegalStateException: Output directory is not specified at com.crashinvaders.texturepackergui.controllers.packing.processors.DataValidationProcessor.processPackage(DataValidationProcessor.java:22) at com.crashinvaders.texturepackergui.utils.packprocessing.CompositePackProcessor.processPackage(CompositePackProcessor.java:20) at com.crashinvaders.texturepackergui.utils.packprocessing.PackProcessingManager.lambda$execute$0(PackProcessingManager.java:60) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Packing is started
PackingWriting 1960x1268: C:\Files\Code\Unity[Assets]\model\textures\Mouth.png
Packing is done
Total pack files size is 322648 bytes
1 pages
Total processing time: 2.41sec

Packing is started
PackingWriting 1960x1268: C:\Files\Code\Unity[Assets]\model\textures\Mouth.png
Packing is done
Total pack files size is 323457 bytes
1 pages
Total processing time: 2.28sec

Packing is started
PackingWriting 1960x1268: C:\Files\Code\Unity[Assets]\model\textures\Mouth.png
Packing is done
Total pack files size is 322648 bytes
1 pages
Total processing time: 2.31sec

java.lang.RuntimeException: Actor: VisTextButton: Save
at com.badlogic.gdx.scenes.scene2d.Actor.notify(Actor.java:192)
at com.badlogic.gdx.scenes.scene2d.Actor.fire(Actor.java:152)
at com.badlogic.gdx.scenes.scene2d.ui.Button.setChecked(Button.java:125)
at com.badlogic.gdx.scenes.scene2d.ui.Button$1.clicked(Button.java:93)
at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:88)
at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:71)
at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:355)
at com.crashinvaders.common.PrioritizedInputMultiplexer$Wrapper.touchUp(PrioritizedInputMultiplexer.java:136)
at com.crashinvaders.common.PrioritizedInputMultiplexer.touchUp(PrioritizedInputMultiplexer.java:83)
at com.badlogic.gdx.InputEventQueue.drain(InputEventQueue.java:70)
at com.badlogic.gdx.backends.lwjgl3.DefaultLwjgl3Input.update(DefaultLwjgl3Input.java:189)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:394)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:143)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.(Lwjgl3Application.java:116)
at com.crashinvaders.texturepackergui.desktop.ApplicationStarter.start(ApplicationStarter.java:57)
at com.crashinvaders.texturepackergui.desktop.ApplicationStarter.main(ApplicationStarter.java:35)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.crashinvaders.texturepackergui.utils.PathUtils.relativize(PathUtils.java:96)
at com.crashinvaders.texturepackergui.controllers.projectserializer.ProjectSerializer.serializePack(ProjectSerializer.java:127)
at com.crashinvaders.texturepackergui.controllers.projectserializer.ProjectSerializer.serializeProject(ProjectSerializer.java:94)
at com.crashinvaders.texturepackergui.controllers.projectserializer.ProjectSerializer.saveProject(ProjectSerializer.java:52)
at com.crashinvaders.texturepackergui.controllers.GlobalActions$5.selected(GlobalActions.java:254)
at com.kotcrab.vis.ui.widget.file.FileChooser.notifyListenerAndCloseDialog(FileChooser.java:727)
at com.kotcrab.vis.ui.widget.file.FileChooser.selectionFinished(FileChooser.java:689)
at com.kotcrab.vis.ui.widget.file.FileChooser.access$2200(FileChooser.java:76)
at com.kotcrab.vis.ui.widget.file.FileChooser$18.changed(FileChooser.java:618)
at com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.handle(ChangeListener.java:28)
at com.badlogic.gdx.scenes.scene2d.Actor.notify(Actor.java:188)
... 15 more

</details>
@MoeruCore MoeruCore added the crash report Crash reports sent from a built-in issue constructor label Jan 9, 2022
@metaphore
Copy link
Member

metaphore commented Jan 9, 2022

Hi @MoeruCore and thanks for the detailed explanation.

Yeah, looks like a fairly basic error somewhere in my code.

Just to make it simpler to reproduce on my end, may I ask for the zipped minimalistic project setup that crashes constantly? All the path data is saved relatively to the .tpproj file, so it's safe to put it in the root of the dir structure.

Cheers!

@Rubonnek
Copy link
Contributor

I just stumbled upon this issue as well.

@metaphore you could use this archive as an example.

The following steps should reproduce the error:

  1. Open hellhound.tppproj
  2. Set the output directory to the folder above that (i.e. godot-libgdx-texture-packer-atlas-importer*)
  3. Press Ctrl-S to crash

@metaphore
Copy link
Member

Thanks @Rubonnek
The bug is fixed. It was only a problem in case you output to any parent dir of the project's containing dir.

metaphore added a commit that referenced this issue Feb 17, 2023
…endant parent dir of the project containing folder.

Closes #126
metaphore added a commit that referenced this issue Feb 17, 2023
…endant parent dir of the project containing folder.

Closes #126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash report Crash reports sent from a built-in issue constructor
Projects
None yet
Development

No branches or pull requests

3 participants