0 votes

Hey :)

I want to pack external .obj files into a pck file, which I can use later. All at runtime... But when try to using the .obj file from the loaded .pck following error message comes:

Loading resource: res://Resources/Test-Track/Objects/untitled.obj
ERROR: _load: No loader found for resource: res://Resources/Test-Track/Objects/untitled.obj.
    At: core/io/resource_loader.cpp:290.

My code for packing an .obj file is only:

var packer = PCKPacker.new()
packer.pck_start(pck_path)
packer.add_file("res://Resources/" + resource_path, external_path_to_obj)
packer.flush()

I think there's missing something. Does anyone have an idea?
Everything should work at runtime..

Godot version 3.3.2
in Engine by (19 points)
edited by

Note about formatting: The Q&A platform does not support triple backticks. Instead, every line must be indented with 4 spaces. I edited your post to fix formatting.

Thank you very much

1 Answer

0 votes
Best answer

Did a workaround and wrote a new godot project with plugin:
https://github.com/Jean28518/Libre-TrainSim-Resource-Importer

Imported:

jEssentials.remove_folder_recursively("res://Resources")
jEssentials.copy_folder_recursively(editor_directory_path + "Resources", "res://Resources")
emit_signal("resources_imported")
print("Finished copying files.")

# signal resources_imported:
# get_editor_interface().get_resource_filesystem().scan()

Exported .pck:

var files_to_export = []
files_to_export.append_array(jEssentials.crawl_directory_for("res://.import/", "stex"))
files_to_export.append_array(jEssentials.crawl_directory_for("res://.import/", "mesh"))
files_to_export.append_array(jEssentials.crawl_directory_for("res://Resources/", "import"))
files_to_export.append_array(jEssentials.crawl_directory_for("res://Resources/", "tres"))
files_to_export.append_array(jEssentials.crawl_directory_for("res://Resources/", "tscn"))

var packer = PCKPacker.new()
packer.pck_start(pck_path)
for file in files_to_export:
    packer.add_file(file, file)
packer.flush()

jEssentials can be found here: https://github.com/Jean28518/Godot-jTools

by (19 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.