Skip to content

Blender import duplicates textures #98932

Open
@demolke

Description

Tested versions

System information

n/a

Issue description

#96778 introduces fallback mechanism to write textures to the disk if import fails, but this does not work well with blender files.

Specifically the issue is with this line

if (!p_base_path.begins_with("res://.godot/imported")) {

.blend files get converted to .gltf and placed in res://.godot/imported folder, so any external textures referenced are processed relative to that.

Considering a file layout like this

.godot/imported/model.gltf
assets/model.blend
assets/texture.png

The code will try to import res://.godot/imported/../../assets/texture.png, fails on the check and thinks it's placed in .imported folder and falls through to writing copy of the texture to the disk and will import that.

Steps to reproduce

  1. open the attached project
  2. observe the texture gets duplicated after import finishes

Minimal reproduction project (MRP)

nonembed.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions