godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Import as raw #1739

Closed Shadowblitz16 closed 3 years ago

Shadowblitz16 commented 4 years ago

Describe the project you are working on: Mario game

Describe the problem or limitation you are having in your project: I am trying to make a editor where people can modify the sprites of a object

Files imported in godot are converted to .res files which are not good for things like modding. The issue with this is if someone wants to edit a sprite they need a editable image format so they can open it up and modify it in a image editor.

Describe the feature / enhancement and how it helps to overcome the problem or limitation: I suggest a import as raw option be added to the godot importer for all types.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: basically if your image is a png its is imported as .png if its a obj file its imported as .obj

If this enhancement will not be used often, can it be worked around with a few lines of script?: it would be used for modding and It can be worked around but it requires fighting the engine and takes more then a few lines of script.

Is there a reason why this should be core and not an add-on in the asset library?: it would improve modding support.

YuriSizov commented 4 years ago

That doesn't make sense. Storing assets as is is not importing them, it's just copying them. Importing prepares an asset to be used by the engine. You cannot import an asset and somehow keep it as it was originally.

Shadowblitz16 commented 4 years ago

You can't add them to the project without importing them as a .res file I guess what I am suggesting is allowing us to add them without importing, and since the import tab is what controls this I called it importing

YuriSizov commented 4 years ago

What would "adding" mean then? If files are not imported, they cannot be used. You can just ignore them using gdignore.

Shadowblitz16 commented 4 years ago

dude I have raw json files with a .import file extension. what I am suggesting is the same with other resource files.

just because they aren't imported as a .res doesn't mean they can't be imported

Xrayez commented 4 years ago

I suggest a import as raw option be added to the godot importer for all types.

In C++, Godot provides ResourceLoaderBinary and ResourceSaverBinary, but that's likely not what you ask for.

Perhaps what you ask for is:

godot_export_raw

YuriSizov commented 4 years ago

dude I have raw json files with a .import file extension. what I am suggesting is the same with other resource files.

What are you calling resources? Actual resources or assets? Because in your opening post you are talking about pngs and objs. Those would be assets and they are imported as assets in the same way you describe, with a *.png.import file that stores import settings for the source file. The actual image is then imported as .stex resource (StreamTexture) and stored in the .import folder. This is the only file the engine actually works with.

Shadowblitz16 commented 4 years ago

@Xrayez the issue with that is you have to export to zip or pck files and I want to export as folder

@pycbouh sorry I mean assets.

I think I need to explain better. what I am trying to do is have a assets folder along side the game which contains the following folders..

in which each folder has a json with the list of paths to files of the entity configs (also in json format) these entity configs contain the following information

where gfx_image is a path to a image file (aka png, jpeg, gif, ...)

fire commented 4 years ago

Realize that you already have the ability to read raw binaries in Godot Engine.

The problem is that Godot Engine converts for example FBX and GLTF2 to PackedScene and saves it to a resource file.

Also, PNG and OpenEXR convert to STEX. This code is removed when Godot Engine is built without tools.

I don't know how these differences can be resolved in code.

Shadowblitz16 commented 4 years ago

are you saying texture would export to png after the game is compiled?

fire commented 4 years ago

Godot Engine has a few hard coded functions that allow memory buffers to images.

PNG and OpenEXR is on that list.

However, there are many other STEX imports and many scene formats.

Those won't be readable in Godot Engine at release time.

Xrayez commented 4 years ago

Those won't be readable in Godot Engine at release time.

There's a proposal for this: #1632.

Calinou commented 3 years ago

This was implemented by https://github.com/godotengine/godot/pull/47268, closing. The feature will also be available in 3.3 thanks to https://github.com/godotengine/godot/pull/47300.