godot
godot copied to clipboard
Importer option for permanent scaling of the scene
This is a draft PR tied to a proposal to replace or provide an alternative to the existing importer root_scale option (https://github.com/godotengine/godot-proposals/issues/4379). The root_scale option only provides a one off modification to the root node's scale value when its instantiated, whereas this option provides a permentant modification to the underlying geometry and animations of a scene.
Left in draft while proposal is considered and the PR is being throughly tested for bugs.
Thanks to @lyuma for the original script implementation of this which I used as reference when writing this C++ version.
Typo on the commit message. permentant
-> permanent
Want to rebase and try resolving the review comments?
According to @lyuma this resolves the blend shape bug. Will test.
Can this function be applied to rotations as well? I was thinking of something similar in #63662. I prefer that those transformations need to be PreProcess for retargeting.
I want to propose to set the root transform as the default value of this importer option.
I'm opening this up for review again based on the changes implemented by @lyuma and @fire. I shall check it again though since I haven't touched it for a while
I'll see if I can reset the branch to avoid the big diffs.
Seems good for the most part, should be able to merge it
Will revise the for loop.
READY TO GO
- scaled the blends shape test by 10 and then apply
- check scaling on root and the animations play
- done
Consider other objects types for rescaling? For example, light attenuation? camera scale/near/far?
Cameras and punctual lights are like points, so scaling a point doesn't do much. I don't know if scaling a light's light-units by distance-scale has a good formula since the physical light units is not default.
A camera is a node 3d, might work by chance.
tl;dr not a blocker.
Cameras and punctual lights are like points, so scaling a point doesn't do much. I don't know if scaling a light's light-units by distance-scale has a good formula since the physical light units is not default.
Scaling a positional light by increasing its range should work well enough in some cases. Keep the same attenuation, and keep the same spot angle.
Cameras should be kept identical – don't change their FOV depending on scale.
@reduz can you remove the merge block? The while loop has been removed.
Thanks!