-
-
Notifications
You must be signed in to change notification settings - Fork 22.4k
Fix import for unused animation slice information. #95538
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
base: master
Are you sure you want to change the base?
Conversation
Hmm I see what you're doing and it could work... basically it stops checking for slices (sets has_slices to false) at 1 + slice count. It does feel a little hacky, and I would prefer if the underlying cause could somehow be addressed directly without having to make this loop kore complicated. but honestly if it comes time for 4.4 or a 4.3 bugfix release and there isn't a better fix, I could go for this. I don't think it should cause any issues. |
7f41c23
to
6959333
Compare
Glad to hear that. I'm still getting familiarized with Godot's code so I'm a bit unsure about bigger changes. I took a closer look how the import scene worked. To fix the root of this problem we'd need to change the behavior of creating all of the slice_data slots at once, and procedurally add or remove them only when the slice amount is changed. I'll leave this PR open in case this can be accepted, but feel free to close it and implement a better solution if anyone wants to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like how short this approach is, and it does solve an issue. That said, I'm a bit concerned that it is technically a hack. But seeing as the code immediately before this also has a bunch of special casing for animation slices, I guess it's okay.
What do others think?
Seems less hacky than having hundreds of unset settings stored in the .import file for every animation. :) It'd be nice to get this in sooner rather than later to avoid file bloat. |
Fixes #68936
Problem brief: The gltf importer would import 256 slice information for each animation if a single animation option was changed. Making the .import file unnecessarily big.
This makes the gltf importer only save slice data default values for slices created by the user.
This won't fix imported assets that have already been bloated. But it won't create bloat on new imported assets.
This is my first time with Godot source so I chose this simple approach first to see if it works. It did.
Maybe a better way to solve this is to avoid creating the 256 ImportOptions in the first place here
godot/editor/import/3d/resource_importer_scene.cpp
Lines 2028 to 2036 in 33c30b9
This is created when the import settings window is loaded, and it will always create those 256 slice default data.
But as they are all the same anyways, maybe its better to just load something like "slice_data" and use a similar strategy, where I checked for the slice_amount to decide if the slice default values needs to be filled or not.
Inside both the
post_fix_node
andpost_fix_animation
where we have that value.