The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

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 Frequently asked questions and 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 [email protected] with your username.