Git Product home page Git Product logo

Comments (7)

alecazam avatar alecazam commented on May 29, 2024

Workaround for now is in scripts to call this before calling cuttlefish.

mkdir -p "$(dirname "$output")"

from cuttlefish.

akb825 avatar akb825 commented on May 29, 2024

What version of PVRTexToolCLI and on what operating system were you running? When running PVRTexToolCLI 4.23 (from the 2019.R2 install) on Linux, I get the following error message if the parent directory doesn't exist:

Error: Unable to save texture as requested format, please check the format being used is supported.

I did verify that the same command succeeds when the parent directory does exist.

It's been my impression that tools that output a single file by path (as opposed to providing an output directory) error out if the parent directory doesn't exist. To verify this, I tried a few other tools such as gcc and another texture conversion tool I found online, and none of them create the parent directory for you.

While I agree it can be useful, it's also good practice to make as few changes to the filesystem as possible inside the tool. Since the general trend among similar tools is to not create the parent directories, I would be hesitant to do so for cuttlefish.

from cuttlefish.

alecazam avatar alecazam commented on May 29, 2024

Yeah, I found most tools don't create directories including PVTexToolCLI. I was working with a script that was failing when I switched to Cuttlefish, but I found out later it needed that directory creation for PVRTexToolCLI as well. There's a workaround, but it means more scripting instead of keeping it all in C++. EtcTool does have some directory creation calls inside it.

Also I'm on macOS, and make sure to updated to 4.24 of PRVTexToolCLI. The 4.23 versions and below don't handle srGB correctly, and neither does EtcTool. I posted some fixes to EtcTool to the Issues list, but it hasn't been updated in 4 years.

from cuttlefish.

akb825 avatar akb825 commented on May 29, 2024

I feel it's better to keep consistent with the conventions used with other command-line utilities, since it offers fewer surprises when working with multiple tools. While it can be useful to create the parent directories for you, it can also be useful to be given an error if you passed it the wrong directory name. (e.g. you get an error if you have a typo in the directory name rather than creating the directory)

Rather than calling mkdir -p "$(dirname "$output")" before invoking Cuttlefish for each texture, I would recommend creating your directory structure at the start of the build process. That is pretty common practice, will provide some protections if you accidentally put something in the wrong place, and will also work more gracefully when integrating other tools into your build process.

from cuttlefish.

alecazam avatar alecazam commented on May 29, 2024

I this case I want to let the artists to organize their content they way they feel best, so new folders could appear/disappear at any time. Draconian measures to stuff all textures into a flatter hierarchy aren't always best, but certainly easier for the engine to deal with then.

from cuttlefish.

akb825 avatar akb825 commented on May 29, 2024

I was thinking along the lines of building an asset package, but in the case of a tool for artists I agree it would ideally follow the directory structure of their source images.

Since I think the default behavior should stay as it is, as a compromise I can add a command-line argument to have Cuttlefish create the parent directory for you.

from cuttlefish.

akb825 avatar akb825 commented on May 29, 2024

You can now use the --create-dir command-line argument in version 2.1.0.

from cuttlefish.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.