No announcement yet.

Create compiled resource (.wpk) at Runtime

  • Filter
  • Time
  • Show
Clear All
new posts

  • Create compiled resource (.wpk) at Runtime

    Hi everyone!

    I am starting to create a "Unity like" tool.
    What I want to achieve is when the user Imports a sprite, 3D model, audio file or whatever, it is compiled at runtime to generate the corresponding .wpk file.
    I was trying to use the WaveExporterCMD.exe. It has two required parameters (-i input) and (-t target), I don't know what target should be. I just put "Windows" on it but after that it just threw an ArgumentNullException on "rootPath" parameter, I really don't know what it means. Maybe it is expecting a .weproj file.

    Later on I tried to use your WaveEditor.Core.Services.AssetFactory.CreateAsset, but I don't have a clue how to use it.

    Could you please give me some advice about this??


  • #2
    Hi Luis,

    WaveExporterCMD.exe is a command tool that allow you to convert assets to wpk format.

    The first is write
    > WaveExporterCMD.exe -help
    Copyright c  2014
      -i/--input required option is missing.
      -t/--target required option is missing.
      -i, --input           Required. Input project, directory or file to be
      -o, --output          Output directory.
      -v, --verbose         (Default: False) Prints all messages and progress bars
                            to standard output.
      -t, --target          Required. Target platforms to generate.
      -z, --zip             (Default: False) Compress output files using Zip
                            compresion algorithm.
      -e, --exportparams    Export parameters. Override every platforms default
      --help                Display this help screen.
    Press Any Key to exit
    The input and target parameters are required. The Input parameter is a filename of a asset that you can export to wpk format and Target parameter is the platform and the valid values Windows, Android, iOS, Linux, Metro, WP or Mac.

    For example:
    > WaveExporterCMD.exe -i .\ball.PNG -t Windows (Generate ball.wpk file to Windows platform)


    > WaveExporterCMD.exe -i .\ball.PNG -t Android (Generate ball.wpk file to Android platform)

    Additional parameters can be used to specific options:

    Output parameter (-o or --output): Output directory name
    > WaveExporterCMD.exe -i .\ball.PNG -t Mac -o MyFolder (Create a new MyFolder directory if don't exist)

    Zip parameter (-z or --zip): Compress wpk file
    > WaveExporterCMD.exe -i .\ball.PNG -t Windows -z true

    to be continued ...


    • #3
      Hi Jorgemagic,

      Thanks for the response.
      What I was missing was the root path "./".

      After that when I tried to run the command with -t Windows and using the -v option, it gives me a "platform not found" message. To compile for windows I believe I must use another text.
      I tried with the Android platform and it seemed to work, It shows me a "100% completed, Exporting Android" message, but I can't find the .wpk file anywhere, even if I set the output path.

      I am calling the command like this:
      WaveExporterCMD.exe -i ./image.jpg -t Android -o C:\MyDirectoryPath -v


      • #4
        Hi Luis,

        Maybe you can check if you are using the last version. You can download the last version of Asset Exporter from our download page below Nightly build (unstable) Asset Exporter - Windows | Linux | Mac.



        • #5
          Hi Jorgemagic,

          I tried with the latest Nightly build, and it had the same result.
          I don't really know what could I be doing wrong, or if maybe the WaveExporterCMD is broken.
          Is there any other way to compile assets at runtime?

          I tested it the same way
          WaveExporterCMD.exe -i ./image.jpg -t Windows -o C:/MyDirectoryPath


          • #6
            Hi Luis,

            You have checked that the output path exists and the input file exists in the cmd current folder? Try to specify a global path, instead a local path.

            We have just tested the WaveExporterCMD and everything works ok for us

            Best regards,
            David Ávila


            • #7
              Hi David,

              I just checked that every path exists and I can't get it to work.

              I receive a little bar and this message:
              100% Completed, Exporting Windows (1/1)
              I used the WaveExporterCMD.exe from the ProgramFiles/Wave Engine/Tools directory, and use absolute paths in everything.
              I tested it sending a NON existing file for the -i parameter, and I got the same 100% completed message, I really don't know what is happening.

              I used it like this:
              WaveExporterCMD.exe -i AbsolutePath\image.jpg -t Windows -o AbsolutePath\samePathOfImage

              I checked the path where the WaveExporterCMD.exe is, and the file is not there, I even searched in all the computer and it is not there, so it is not being generated.

              Can you give some advice on how are you exactly using it, or if there is another way around?


              Edited [Solved]:
              I was testing the wave exporter in the PC at my work (in my spare time ). Even though I have permissions, I don't have all permissions, so I tried it back at home, and it worked as expected.
              If someone has this issue, just be sure to call the WaveExporterCMD.exe as an Administrator.
              Even if you copy all the AssetExporter folder to a place where there should be no issues with permissions, it will not work.

              Thanks for taking the time to answer.
              Last edited by Luis Arturo López Malo; 08-28-2014, 09:58 PM.


              • #8
                I copied a WaveEngine solution to a different machine with WaveEngine installed, and during the build in Visual Studio error appears at WaveExporterCMD.exe command (access violation, protected memory, etc.) - while running WaveExporterCMD on the same folders, but from CommandPrompt - everything is OK, i.e. files are processed.