Up to now I have been in the habit of defining vessel meshes and masses within the Lua script file for an addon, which is identified in the cfg file. I wanted to see if I could use the cfg file properly to define the vessel meshes, propellant resources, etc..
From my reading of the Orbiter Developer Manual, page 58, there are a number of default vessel configuration options that can be used, and I presume are passed with the cfg handle, to clbk_setclasscaps(cfg). So I tried to pass the mesh file through the cfg file like this:
VWThingScript.cfg:
And I load the file in VWThingScript.lua in clbk_setclasscaps as follows:
The mesh appears to load, but I get a host of errors from animations that are attempting to act on a nil mesh:

In the Orbiter.log, preceding these errors is an initial error that suggests a problem with the filename string:
So how is the mesh visual getting loaded but still producing this error?
I am using Orbiter 2024 but I get identical behavior in OpenOrbiter 05142024 and don't believe it to be an issue with Orbiter per se.
From my reading of the Orbiter Developer Manual, page 58, there are a number of default vessel configuration options that can be used, and I presume are passed with the cfg handle, to clbk_setclasscaps(cfg). So I tried to pass the mesh file through the cfg file like this:
VWThingScript.cfg:
Code:
ClassName = VWThingScript
Module = ScriptVessel
Script = VWThingScript/VWThingScript.lua
MeshName = VWThing/VWThing
And I load the file in VWThingScript.lua in clbk_setclasscaps as follows:
Code:
hmesh = oapi.load_meshglobal(MeshName)
vi:add_mesh(hmesh)
vi:set_mesh_visibility_mode(hmesh, MESHVIS.ALWAYS)
The mesh appears to load, but I get a host of errors from animations that are attempting to act on a nil mesh:

In the Orbiter.log, preceding these errors is an initial error that suggests a problem with the filename string:
Code:
Config/Vessels/VWThingScript/VWThingScript.lua:87: Interpreter::oapi_load_meshglobal: argument 1: invalid type (expected string)
stack traceback:
[C]: in function 'load_meshglobal'
Config/Vessels/VWThingScript/VWThingScript.lua:87: in function <Config/Vessels/VWThingScript/VWThingScript.lua:75>
000014.376: [ScriptVessel::LuaCall | D:\a\orbiter\orbiter\Src\Vessel\ScriptVessel\ScriptVessel.cpp | 262]
So how is the mesh visual getting loaded but still producing this error?
I am using Orbiter 2024 but I get identical behavior in OpenOrbiter 05142024 and don't believe it to be an issue with Orbiter per se.