I am writing a GDExtension for binding libpd, library version of PureData. I have added a property with appropriate getter and seterr.

  ADD_PROPERTY(
      PropertyInfo(Variant::STRING, "patch_path", PROPERTY_HINT_FILE, "*.pd"),
      "set_patch_path", "get_patch_path");

I do something like this to get the file path and load it to puredata

Ref<FileAccess> file = FileAccess::open(path, FileAccess::READ);
patch = pd.openPatch(
      file->get_path_absolute().utf8().get_data()->get_path_absolute().utf8().get_data(), "/");

I can select *.pd files from my resources directory, they load and work normally inside the editor. However, they do not work when I export the project.

The complete error message:

Godot Engine v4.3.stable.official.77dcf97d8 - 
Vulkan 1.3.296 - Forward+ - Using Device #0: Intel - Intel(R) Iris(R) Xe Graphics (RPL-U)

pd 0.55.2
bonk version 1.5
fiddle version 1.1 TEST4
pd~ version 0.54
pique 0.1 for PD version 23
PureDataGD constructor
ERROR: File does not exist: 
   at: file_exists (/home/kureta/Documents/repos/PureDataGD/src/puredatagd.cpp:60)
Trying to set path to: res://patches/test-2.pd

read (31 184) -> -1
//: Is a directory
Set patch path to: res://patches/test-2.pd
Setting DSP status to truehttps://godotengine.org

What am I doing wrong? Full code is here.

    • kureta@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      The problem was a bit more than that but I solved it. I write packed resource into /tmp and read the file from there. Thanks.