Comments (7)
Workaround for now is in scripts to call this before calling cuttlefish.
mkdir -p "$(dirname "$output")"
from cuttlefish.
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.
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.
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.
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.
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.
You can now use the --create-dir
command-line argument in version 2.1.0.
from cuttlefish.
Related Issues (17)
- Configure prints "FreeImage not found" and "PVRTexLib not found" even though all git submodules are present HOT 2
- missing submodule commit for libsquish HOT 2
- image from TGA RGBA -> BC7 getting a weird transformation HOT 3
- Many tests fail: error: couldn't load image 'texture.png' HOT 14
- Many tests fail: error: couldn't load image 'texture.png' HOT 1
- Many tests fail: error: couldn't load image 'texture.png' HOT 11
- Artifacts in alpha channel with BC1_RGB compression HOT 2
- error: file format DDS doesn't support format A8B8G8R8 with type (*insert any*) HOT 1
- Typo in when using "--help" to see list of commands. HOT 1
- BC7 encoder is very slow HOT 15
- --swizzle channel ordering not working as expected. HOT 3
- PVRTC needs a squarepo2 option HOT 3
- BC1 vs. BC7 HOT 1
- Texture::maxMipmapLevels returns (seemingly) incorrect value for non-square images HOT 2
- error: cannot initialize return object of type 'BOOL' (aka 'int') with an rvalue of type 'nullptr_t' HOT 2
- error: unknown type name 'CMP_Vec3ui' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cuttlefish.