glTF export does not work with scripted bone manipulation for animation
Moderators: Víctor Paredes, Belgarath, slowtiger
glTF export does not work with scripted bone manipulation for animation
Just a quick question about glTF export.
I have to assume that script-controlled animations will not export properly. Been testing and I can use a standard regular non scripted exported glTF but anything with "heavy" bone manipulation using a script just gives errors on import into any supporting programs (Blender, Khronos, godot etc).
If this is the case I understand completely and even if slightly disappointed I can work around it.
I have to assume that script-controlled animations will not export properly. Been testing and I can use a standard regular non scripted exported glTF but anything with "heavy" bone manipulation using a script just gives errors on import into any supporting programs (Blender, Khronos, godot etc).
If this is the case I understand completely and even if slightly disappointed I can work around it.
- synthsin75
- Posts: 10604
- Joined: Mon Jan 14, 2008 2:20 pm
- Location: Oklahoma
- Contact:
Re: glTF export does not work with scripted bone manipulation for animation
I wouldn't expect anything using layerscripts to work for glTF export, but anything that you can keyframe should work.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: glTF export does not work with scripted bone manipulation for animation
I think part of the issue is that by default the glTF export looks for keyframed Frame Positions (any keyframe at a particular frame) and then jumps to those frames during the export. This is for speed, reduced output size and fidelity if subsequently editing the animation elements in application X after export.
So, on first run, any keyframed Frame Positions created by LayerScript won't exist. There are 2 possible approaches to resolving this:
1: Play the animation before export. This should create the LayerScripted keyframes, and assuming they persist - then they will be available when the export is run.
2: Use the 'Bake every frame' option. This will run the export in Frame-by-Frame mode, which will visit every (Interpolation Step) frame during export.
So, on first run, any keyframed Frame Positions created by LayerScript won't exist. There are 2 possible approaches to resolving this:
1: Play the animation before export. This should create the LayerScripted keyframes, and assuming they persist - then they will be available when the export is run.
2: Use the 'Bake every frame' option. This will run the export in Frame-by-Frame mode, which will visit every (Interpolation Step) frame during export.
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: glTF export does not work with scripted bone manipulation for animation
First off I am certain that my problem is probably the file itself. Some of you may know I tend to create massively over complex files with way too many bones.
I've fixed the file I've been testing and removed all scripting. I am only using bones with keys to move points. the bones are very simple for a run cycle of a character but the file still doesn't export. It exports but when used in blender khronos or Godot the animation isn't included it only displays frame 0. I have a simpler test file with just 3 bones a vector layer and it works after export.
I saw in the video demo a relatively complex character file included with Moho used as a sample of how the gltf export works. My file is only a wee tiny bit more complex but there could be features in it that are breaking the export. Are there any features that might not work when exporting to gilt? Is there a list of bone constraints that won't work?
Thanks for the help
I've fixed the file I've been testing and removed all scripting. I am only using bones with keys to move points. the bones are very simple for a run cycle of a character but the file still doesn't export. It exports but when used in blender khronos or Godot the animation isn't included it only displays frame 0. I have a simpler test file with just 3 bones a vector layer and it works after export.
I saw in the video demo a relatively complex character file included with Moho used as a sample of how the gltf export works. My file is only a wee tiny bit more complex but there could be features in it that are breaking the export. Are there any features that might not work when exporting to gilt? Is there a list of bone constraints that won't work?
Thanks for the help
Re: glTF export does not work with scripted bone manipulation for animation
One issue is masking. GLTF doesn't appear to like masking. I turned off masking on the main layer and the animation DID export.
Never mind!!! Got it to work... sort of... yes pretty well. It was my IMPORT SETTINGS. I fiddled with import settings in the other software and got it to show up correctly. It's a bit fiddly but should work. Now I can even go back and test my other versions to see if my changes were even absolutely needed. Sorry for ranting.
However, the layers were all moving based on the bones and keyframes, but they were randomly mixed up and reordered. The bicep switched with a leg, arm switched with a thigh etc etc. A complete mess but at LEAST i got the animation and it was "correct-ish". Just have to figure out why all my layers are flipping around randomly.
EDIT: Layers are not switched around. They are simply not aligned with the bones or rotation. It's like the translation/position isn't honored on export. I am going to spend the time to make all layers at 0 and move the vectors or visa versa.
Edit:
Giving up for now. It doesn't appear to be ready for prime time at least for me at the moment. Simply can't make it work. Plane vanilla file with standard vector layers and bones. I tried layer binding point binding reseting layer centers points etc. I keep getting offset layers that don't stick to the bones. Any information on the process would be helpful. There's plenty of other options for game import.
Never mind!!! Got it to work... sort of... yes pretty well. It was my IMPORT SETTINGS. I fiddled with import settings in the other software and got it to show up correctly. It's a bit fiddly but should work. Now I can even go back and test my other versions to see if my changes were even absolutely needed. Sorry for ranting.
However, the layers were all moving based on the bones and keyframes, but they were randomly mixed up and reordered. The bicep switched with a leg, arm switched with a thigh etc etc. A complete mess but at LEAST i got the animation and it was "correct-ish". Just have to figure out why all my layers are flipping around randomly.
EDIT: Layers are not switched around. They are simply not aligned with the bones or rotation. It's like the translation/position isn't honored on export. I am going to spend the time to make all layers at 0 and move the vectors or visa versa.
Edit:
Giving up for now. It doesn't appear to be ready for prime time at least for me at the moment. Simply can't make it work. Plane vanilla file with standard vector layers and bones. I tried layer binding point binding reseting layer centers points etc. I keep getting offset layers that don't stick to the bones. Any information on the process would be helpful. There's plenty of other options for game import.
Re: glTF export does not work with scripted bone manipulation for animation
Wooohooooo! Now I got it figured out this is awesome. A lot of it is weird attributes and goofy issues with the application you are importing into.
Re: glTF export does not work with scripted bone manipulation for animation
Have there been any new version changes that might have made glb/gltf export fail? I am playing around with the original file that was working and now it produces no images either in the glb or the gltf folder. Just curious. I had it working and testing it today nothing is exporting correctly.
This could be user error again but i have the old files that show up fine and were exporting correctly back in April that now produce no images on export, only the grid and animation.
I am simply using the web viewer to test. The old files from April show up and work fine. Anything current exported has zero image data. errors in the glb file indicate 0 images.
This could be user error again but i have the old files that show up fine and were exporting correctly back in April that now produce no images on export, only the grid and animation.
I am simply using the web viewer to test. The old files from April show up and work fine. Anything current exported has zero image data. errors in the glb file indicate 0 images.
Re: glTF export does not work with scripted bone manipulation for animation
UPDATE UPDATE! IT FAILS ON MAC ONLY
I am sad but happy at the same time. My experiment will still work I can continue with my testing! The issue is the platform/OS. for some reason the Mac version of Moho refuses to export the images for the layers for the gltf glb files. On windows it's flawless no issues at all!!!
So is this a bug with newer versions of mac? I know there was a discussion about thumbnail quick look being broken by recent update to mac. Could this be same thing?
I noticed that when exporting on mac, it simply does nothing. it just exports without images. On windows when exporting the TIMELINE RUNS THROUGH EVERY FRAME all on it's own. that doesn't happen on the mac version.
I am sad but happy at the same time. My experiment will still work I can continue with my testing! The issue is the platform/OS. for some reason the Mac version of Moho refuses to export the images for the layers for the gltf glb files. On windows it's flawless no issues at all!!!
So is this a bug with newer versions of mac? I know there was a discussion about thumbnail quick look being broken by recent update to mac. Could this be same thing?
I noticed that when exporting on mac, it simply does nothing. it just exports without images. On windows when exporting the TIMELINE RUNS THROUGH EVERY FRAME all on it's own. that doesn't happen on the mac version.
Re: glTF export does not work with scripted bone manipulation for animation
There is a Test script for the Render Engine that glTF Export uses: Scripts > Script Writing > Render Layer -- which should render and present a small image of the current layer (after you click OK).
If that works, then the ability to create images is OK. I don't have a new Mac so can't test, but the export works on my old Mac.
If that works, then the ability to create images is OK. I don't have a new Mac so can't test, but the export works on my old Mac.
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: glTF export does not work with scripted bone manipulation for animation
That script works but still no joy on mac exporting the gltf or glb with the export menu. The issue is no images are generated either embedded in glb or in the folder for gltf. During the export there is a run though of the timeline on windows. You see the timeline run through. There is NO run through on the time line on Mac. On windows right before the export the timeline runs through. It skips that on mac and INSTANTLY exports the glb/gltf and of course no images. Also because there are no files generated the glb on mac is a fraction of the size. There is some sort of error. The gltf on mac is CORRECTLY EXPORTED... seemingly. The LINKS to the proper files are IN the code but the images are never generated so the viewer gives errors for missing images.
I have a file that works fine on windows, has no features that can't be exported, and it creates a working animated glb file but only on windows. When running this on Mac, it only exports the white mesh, and no images are exported. So, there must either be something new/wrong with Mac os and the exporter or... something else? Aliens? Zombies? The exporter appears to be the same version on both? I don't know if I was using mac back in april yet but may have? It might have happened since then?
For now all my testing has to be done only on Windows.
I have a file that works fine on windows, has no features that can't be exported, and it creates a working animated glb file but only on windows. When running this on Mac, it only exports the white mesh, and no images are exported. So, there must either be something new/wrong with Mac os and the exporter or... something else? Aliens? Zombies? The exporter appears to be the same version on both? I don't know if I was using mac back in april yet but may have? It might have happened since then?
For now all my testing has to be done only on Windows.
Re: glTF export does not work with scripted bone manipulation for animation
Hello Heyvern, how did you ensure the masks transferred into Blender? Is that also preserved in Import Settings?heyvern wrote: ↑Mon Apr 13, 2026 12:31 pm One issue is masking. GLTF doesn't appear to like masking. I turned off masking on the main layer and the animation DID export.
Never mind!!! Got it to work... sort of... yes pretty well. It was my IMPORT SETTINGS. I fiddled with import settings in the other software and got it to show up correctly. It's a bit fiddly but should work. Now I can even go back and test my other versions to see if my changes were even absolutely needed. Sorry for ranting.
I've heard that non-bone Point Animation has trouble being imported into Blender from Side Quest as well.
Is that true or can hand-manipulated Point Animation be preserved in Blender as long as one ensures the Point Animation keys are recorded in the timeline?
Thanks for letting me know either way,
Anigrrl
Re: glTF export does not work with scripted bone manipulation for animation
most of my testing has been in Godot and the online gpl viewer. I may have tried it in blender but I never intended to use it there so it was only for previewing and testing the format. Masking doesn't work though at all. no masking. no export with masking at all on windows or mac for me. Basically what I find on mac is that the animation exports fine as long as all the fancy features are removed. or possibly it's a combination of other things? If I turn on masking, there is 0 animations listed. I turn off masking, and the animations are in the file.
I did discover I was wrong about bone/point binding. It DOES export. As long as the bones still have strength. You can't bind a point to a bone with zero strength. That could be a way around smart bones. Instead of moving points in a smart bone have a bone assigned to each point and use a smart bone to move the points.
Another kind of small deal breaker for me right now is BONE OFFSET. I still have a bunch of files that use bone offset. One thing I could use to eliminate other features would be offset bones so they don't influence each other. Since point binding requires bone strength it makes it a bit more tricky figuring out how to rig stuff.
I did discover I was wrong about bone/point binding. It DOES export. As long as the bones still have strength. You can't bind a point to a bone with zero strength. That could be a way around smart bones. Instead of moving points in a smart bone have a bone assigned to each point and use a smart bone to move the points.
Another kind of small deal breaker for me right now is BONE OFFSET. I still have a bunch of files that use bone offset. One thing I could use to eliminate other features would be offset bones so they don't influence each other. Since point binding requires bone strength it makes it a bit more tricky figuring out how to rig stuff.
Re: glTF export does not work with scripted bone manipulation for animation
You can DM a test file, and I can see if that runs on my Mac, or see if there are 'hidden' errors.
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: glTF export does not work with scripted bone manipulation for animation
Oh I have tested it thoroughly. I created plain vanilla test files. Basic simple nothing fancy. a few bones one vector layer. It renders brilliantly on Moho windows but nothing on mac. It renders animation fine but zero images either in the gltf or the glb. These are simple simple basic bare bones minimal test files.
I am still JUMPING UP AND DOWN OVER THE FANTASTIC POTENTIAL. I've started testing three.js and creating funky little characters I can "program" to animate on my website. Yes, for this type of thing I will have to change my file creation DRASTICALLY in moho. The file size isn't "horrible", it's about the same as video but the freaking POTENTIAL is amazing.
p.s. hoping and dreaming of more robust export support in the future. i know it's not easy. Just think to be able to INSTANTLY export my Moho files and embedd easily into a web page is exciting.
Re: glTF export does not work with scripted bone manipulation for animation
ISSUE SOLVED OH MY GOODNESS!!!!!
I do not know WHY it doesn't work exactly but I know where the problem is.
I got it working and it exports the images to both the gltf folder AND INTERNALLY TO THE glb file... BUT ONLY ON THE MAC MAIN DRIVE.
It WILL not export images to any EXTERNAL DRIVES. as far as I know I have zero permissions issues. Even if i did I would get errors? How is the export creating the folders and data files but can't create images? is it a path issue?
I've tested all my failed files and they worked fine as long as I only export to the mac internal drive. If I render to any of my external drives it fails.
(fail simply means an empty gltf folder and no images embedded in the glb file)
It must be a bug. I checked all my options for hard drive access. moho has FULL access to all the drives. There is a "disconnect" after it creates the folders and files and THEN goes and renders and embedds them? It seems to be blocked or fails to put them on an external drive? It loses the reference? My files are ON the external drive and exports are fine as long as they are not glb or gltf.
I do not know WHY it doesn't work exactly but I know where the problem is.
I got it working and it exports the images to both the gltf folder AND INTERNALLY TO THE glb file... BUT ONLY ON THE MAC MAIN DRIVE.
It WILL not export images to any EXTERNAL DRIVES. as far as I know I have zero permissions issues. Even if i did I would get errors? How is the export creating the folders and data files but can't create images? is it a path issue?
I've tested all my failed files and they worked fine as long as I only export to the mac internal drive. If I render to any of my external drives it fails.
(fail simply means an empty gltf folder and no images embedded in the glb file)
It must be a bug. I checked all my options for hard drive access. moho has FULL access to all the drives. There is a "disconnect" after it creates the folders and files and THEN goes and renders and embedds them? It seems to be blocked or fails to put them on an external drive? It loses the reference? My files are ON the external drive and exports are fine as long as they are not glb or gltf.