GLB/GLTF export on mac to external drives won't export images
Moderators: Víctor Paredes, Belgarath, slowtiger
GLB/GLTF export on mac to external drives won't export images
I isolated the failure to external volumes on macOS. The same Moho file and glTF export settings produce a complete GLB with textures when exported to the internal drive. When I export to my external drive, Moho creates the GLB/GLTF, but the rendered texture images are missing. Normal Moho Save, Render, and Export Animation operations can write to that external drive without issue, and Moho on Windows can export the complete GLB to that same external drive over the network. Full Disk Access for Moho on macOS does not change the behavior. Your LM_RenderLayerImage test succeeds, but its RenderLayerImage() output is automatically written to the Desktop/internal drive, so it doesn’t exercise the failing external-volume issue.
Re: GLB/GLTF export on mac to external drives won't export images
Looks like this issues occurs because some low-level file system protections.
The images are generated to the OS temp folder area, and then moved to the glTF output folder. That move is performed with the os.rename function, and unfortunately - certain systems block os.rename from performing "Cross-device linking" - when the new and old file references are on different file system devices.
The images are generated to the OS temp folder area, and then moved to the glTF output folder. That move is performed with the os.rename function, and unfortunately - certain systems block os.rename from performing "Cross-device linking" - when the new and old file references are on different file system devices.
Moho 14.5 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.5 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.5 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Re: GLB/GLTF export on mac to external drives won't export images
I looked into this and apparently there is a fix for it in the program level? It has something to with using a different method instead of the os.rename. That is always blocked when accessing external drives. I can't change my system but the exporter could use a different method to copy or move those files that won't cause the failure. Just passing on what I found and you may already know about this. For now will have to export only to the internal drive. hopefully it can get fixed in future.
Re: GLB/GLTF export on mac to external drives won't export images
For now you can 'hack' the ss_gltf_export code and replace the relevant os.rename function with an os.execute process -- which then executes a system move function. Note: Not suitable for Windows systems as it would cause popups.
To edit: ss_gltf_export
Find: <Moho Install>/Resources/Support/Scripts/Tool/ss_gltf_export.lua
Copy to: <Custom Content Folder>/Scripts/Tool/ss_gltf_export.lua
TextEdit the copy...
Replace:
with:
Save the file (copy)
Reload (CTRL+ALT+SHIFT+L) or Restart Moho
To edit: ss_gltf_export
Find: <Moho Install>/Resources/Support/Scripts/Tool/ss_gltf_export.lua
Copy to: <Custom Content Folder>/Scripts/Tool/ss_gltf_export.lua
TextEdit the copy...
Replace:
Code: Select all
local ok, err, code = os.rename(imgPath, imgPathNR)Code: Select all
os.execute(("mv '%s' '%s'"):format(imgPath, imgPathNR))Reload (CTRL+ALT+SHIFT+L) or Restart Moho
Moho 14.5 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.5 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.5 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Re: GLB/GLTF export on mac to external drives won't export images
OH WOW! Thanks. I had NO IDEA the script for the plugin was in the application script folder. AWESOMENESS. WORKS PERFECTLY NOW. WOOOOHOOOOO.
I mean I don't hate my windows machine and I'm sure its very sad and jealous I bought the mac but I hate switching back and forth.
I mean I don't hate my windows machine and I'm sure its very sad and jealous I bought the mac but I hate switching back and forth.