Skip to content

Error creating .vmt files #103

Description

@TheBreadPerson

Describe the bug
Creating .vmt files fails when the source texture is not already inside the configured materials folder.

Not sure if I missed something, but I had an error creating .vmt files from texutres. I'd get the following error each time unless the texture was in the set materials folder:

res://addons/godotvmf/godotvmt/vmt_material_conversion_context_menu.gd:89 - Cannot call method 'store_string' on a null value.

I looked at the code and saw the basetexture var seems to be relying on the texture to be actively in the VMFConfig materials folder:

var basetexture := path.replace(VMFConfig.materials.target_folder, '').substr(1).replace('.' + path.get_extension(), '') as String;

Not sure if this is intended, but I just changed this line to something that wasn't reliant on the texture's path:

var basetexture := path.get_file().get_basename() as String

This worked for me, please lmk if I did something wrong or if this is a geniune bug.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingresourcesIssues related to resources the plugin use

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions