ata4 / disunity

An experimental toolset for Unity asset and asset bundle files.
The Unlicense
2.7k stars 659 forks source link

Error when bundle extracting with property file #228

Open davidferguson opened 7 years ago

davidferguson commented 7 years ago

I'm trying to extract, modify and then pack a .unity3d webplayer bundle. Looking at the readme, I need to unpack with the --prop option to generate a bundle property file which is needed to repack the bundle. However, when I use the --prop option, I get an error. The files are extracted, however no property file is created.

My file is main.unity3d, the output folder is unpacked

Running the command ./disunity.sh bundle unpack --output unpacked --prop main.unity3d gives me the output:


thelabKunaiEngine.dll
thelabForgeEngine.dll
aquirisSplatPainterEngine.dll
UnityScript.Lang.dll
System.Xml.dll
Boo.Lang.dll
Assembly-UnityScript.dll
Assembly-UnityScript-firstpass.dll
Assembly-CSharp.dll
Assembly-CSharp-firstpass.dll
sharedassets0.assets
resources.assets
mainData
sharedassets1.assets
level0
[error] DisUnityCli: Fatal error, caused by java.lang.NullPointerException
    at info.ata4.disunity.cli.command.bundle.BundleUnpack.runFile(BundleUnpack.java:102)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at info.ata4.disunity.cli.command.FileCommand.run(FileCommand.java:32)
    at info.ata4.disunity.cli.command.Command.run(Command.java:50)
    at info.ata4.disunity.cli.command.Command.run(Command.java:50)
    at info.ata4.disunity.cli.command.DisUnityRoot.run(DisUnityRoot.java:62)
    at info.ata4.disunity.cli.DisUnityCli.main(DisUnityCli.java:46)```
RupW commented 7 years ago

There's a few parts of disunity that don't like relative paths, and it looks like this is one of them. That line is

Path propsFile = outputDir.getParent().resolve(bundleName + ".json");

so I'd guess it's outputDir.getParent() that's null. Try specifying at least --output as an absolute path (or possibly .\unpacked will do).