Hi,
Does anyone have any experience/tips loading a 3D model from outside of the application’s resources? (My application is a Windows-Only simulation, many of the cross-platform warnings about this is understood).
I’ve got a super-simple example below that loads the resource one, but not the external one.
public static void TestLoadModel(Node parent)
{
string ModelPathG = "C:/Util/Godot/Globe4-3DModels/Prep/Ship/GenericSupportShip/GenericSupportShip.glb";
string ModelPathF = "C:/Util/Godot/Globe4-3DModels/Prep/Ship/GenericSupportShip/GenericSupportShip.fbx";
string ModelPathR = "res://Resources/Models/Plane/Plane_Paper/PaperPlanes_v002.glb";
PackedScene importedModel = (PackedScene)ResourceLoader.Load(ModelPathR);
if (importedModel != null)
{
// Instance the model. Add the model to the scene
Node modelInstance = importedModel.Instantiate();
parent.AddChild(modelInstance);
GD.Print($"====== Loaded model: {ModelPathR}");
}
else
{
GD.PrintErr($"====== Failed to load model: {ModelPathR}");
}
}
I’ve looked into other examples using GLTFState, but Godot isn’t compiling these as it has no visibility of the name, and I don’t know of any addition “using” clause or anything I could need.
Any help would be great. Thanks.