-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Export models with skeleton #8
Conversation
Still needs the rotations and translations and bone indices to be fixed up. Bone indices appear to be offset from the actual values, maybe there's something in the vertex groups that indicates this? Rotations and translations need to be adjusted to gltf relative coordinates. Finally, <file>.bones need to be used to map the bone hashes to names
Wow! Your results look great so far! Can you tell me more about how you managed to create the animation you shared? When I load the model into blender, the bones are just huge spheres. I'd like to merge this PR once I can understand how it's directly useful to non-technical people using the app. But maybe I'm just missing something since I'm not very educated in terms of 3D art / blender. Also, you mentioned creating IK constraints yourself. If you pass In any case, nice work so far! I love seeing this project move forward although I don't have a lot of time to dedicate to it right now. |
Don't worry about the conflicts I created with my last commit, I'll resolve them before merging. |
Yes, if you look at the As for the huge spheres, that sounds like something with how blender is configured to display bones? Could you add a screenshot? |
Found this video about it: https://www.youtube.com/watch?v=U5XboSEw7-o Looks like it has to do with viewport display -> shapes being selected? I've never seen that happen with gltf skeletons before in blender. I also saw some people saying there is a setting in the import menu about "Bone Shape" that can be set to default to prevent it from happening, but I don't see that option when importing gltf files |
Well, I guess that's good enough to merge into main for now. I'm very excited to see how this will continue to improve with IK and proper pose positioning. Thanks again for your work on this! |
I'm not sure if we'll be able to implement IK on export to gltf since I don't think the format supports it - we may need to add a second format if we want to have IK exported. Maybe direct to .blend? Either way the IK skeleton should have some interesting data, which will probably be useful even if we don't export it immediately |
Hmm, I guess that's true. I just assumed without knowing that there'd be a standard for IK, allowing for exports/imports, but apparently there's nothing like that. While it might have some interesting data, I think focusing on animations and getting the pose to work correctly is probably more important right now. |
This change adds support for exporting skeletons from unit files.
Currently the bones' local transforms are not correctly converted from Stingray global coordinates to gltf local coordinates, but resetting the pose in Blender will get the skeleton into the correct orientation. This isn't a big deal right now, but once we start exporting animations as well it will be more important to have the bones oriented correctly.
To enable skeleton export, there is a new unit config option
bones
that can either bedisabled
(default) orenabled
.Here's an example of a bile titan with all its bones visible (after resetting the pose)
and an example animation using only a couple of IK constraints on the exported bones
bile_titan_leg_stab.mp4