Rename scale to anim_scale #219
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another small rename I hope you'll consider.
From what I can ascertain, actors may have several different scales in their def files:
actor_scale
,mesh_scale
,bone_scale
, andscale
. My PR concerns this last one,scale
. The current naming is a bit ambiguous and the purpose of it is not clear. At first I thought it might be associated withactor->scale
, but no, that's dynamic scaling that is applied viaADD_NEW_ENHANCED_ACTOR
.After digging through the code a bit I can see this
scale
is only used in 3 places: for scaling the Cal3D animation keyframe translations. So it's an animation scale. For this reason, I'd like to suggest renaming it toanim_scale
. It'd be nice to rename thescale
elements in the xml files too.Fun fact:
For animations it's typically best to use the skeleton scale (
bone_scale
) or you risk the mesh becoming deformed when animating, so I questioned why EL has this separate animation scale in the first place. Looking at the actor def files, I found that big spiders are the only actors with an animation scale that is different from the skeleton scale. Their skeleton is much smaller than the mesh, which results in the mesh becoming a bit deformed when animating. Here's their walking animation slowed down:spider_scale1.mp4
Increasing the skeleton size to match the mesh results in a much nicer animation and mesh:
spider_scale3.2.mp4
I was going to make a PR removing the redundant animation scale entirely in favor of skeleton scale, but then when I set the animation speed back to normal I saw why the deviation was needed for big spiders – the walking animation simply doesn't look good when the skeleton is properly sized:
spider_walk.mp4
So unfortunately because of spiders the separate animation scale is still needed.