godot icon indicating copy to clipboard operation
godot copied to clipboard

Importer option for permanent scaling of the scene

Open SaracenOne opened this issue 2 years ago • 7 comments

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.

SaracenOne avatar Apr 10 '22 20:04 SaracenOne

Typo on the commit message. permentant -> permanent

fire avatar Apr 11 '22 12:04 fire

Want to rebase and try resolving the review comments?

fire avatar May 10 '22 12:05 fire

According to @lyuma this resolves the blend shape bug. Will test.

fire avatar Jun 12 '22 02:06 fire

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.

TokageItLab avatar Jul 30 '22 08:07 TokageItLab

I want to propose to set the root transform as the default value of this importer option.

fire avatar Jul 30 '22 08:07 fire

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

SaracenOne avatar Jul 30 '22 18:07 SaracenOne

I'll see if I can reset the branch to avoid the big diffs.

fire avatar Aug 07 '22 08:08 fire

Seems good for the most part, should be able to merge it

reduz avatar Sep 05 '22 11:09 reduz

Will revise the for loop.

fire avatar Sep 05 '22 15:09 fire

READY TO GO

  1. scaled the blends shape test by 10 and then apply
  2. check scaling on root and the animations play
  3. done

MorphStressTest.zip

image

fire avatar Sep 05 '22 16:09 fire

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.

fire avatar Sep 05 '22 16:09 fire

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.

Calinou avatar Sep 05 '22 17:09 Calinou

@reduz can you remove the merge block? The while loop has been removed.

fire avatar Sep 05 '22 19:09 fire

Thanks!

akien-mga avatar Sep 06 '22 11:09 akien-mga