Its still a work in progress. I need to redo it because I don’t work with the Skeleton foreshortening feature, and that’s important to get the knee, shank, foot, in the correct place. … and do all the limbs.
Thank you Rodolfo for making and correcting the MapRange function!!!
At least my plan was to re-do some of this leg, because it needs to work with bones
update: ufff. I detected that the "animated…id=“right thigh flexion” block was moved a few lines under where it should be. Here’s the version 5 that works:
For future reference: this is how the end foreshortening is implemented.
fs=bone_local_length_scale
If the limb end is a ball, or a shape that should stay the same length as the limb foreshortens, I calculate the “anti-foreshortening”=afs=1/fs and apply it as the x or y scale that is parallel to the bone.
If the end is a flat surface, I calculate the “co-foreshortening”=cfs=sqrt(1-fs^2)/fs=sqrt(1/fs^2-1)=sqrt(afs^2-1) and apply it to the x or y scale of that group that will become the end cross section. This way, the end starts looking like a line when the limb is 100% length, but it appears 100% towards the viewer, when the limb is 0% length.
This “co-foreshortening” is also applicable to circles that wrap around the cylindrical (or conical) surface anywhere in the middle.
If the bone local length is greater than 1, then the flat end will continue to look like a line.
I created a valuenode named “Pythag_Compl_Prop”, which calculates the sqrt(1/x^2-1). I need this for perpendicular surface foreshortening. It’s based on the valuenode_angle and pow.cpp/h.
Your formula can actually be built using several existing converters. However, it requires quite a lot of them. I ran into the same issue when I created the IK Bone setup using many converters, and the result was that Synfig became noticeably slower.
Pin bones are actually possible in Synfig as well, but the functionality is quite limited. It may need something like SmartBone to make it more practical. Based on what I’ve seen in Moho, I’m not sure whether their implementation also relies on SmartBone as an additional component.
As far as I know, pin bones don’t involve any stretching. The bones only translate and rotate, with each bone following the position of its corresponding pin.
To rotate a bone toward a target, you can use the Vector Angle and Subtract converters. You can refer to the example files for how they’re used. If you need the position of a bone that has a parent, you can use the Bone Link converter.
I looked at the way that you keep the limb end shape constant, when the bone rotates and shortens. I see there’s a difference to how we apply the skeleton to the body parts:
Mine: all my limbs are a separate group, each with its own “Transformation” property. When I link the limb to the bone, the limb’s “Transformation” gets converted to a function of the bone status. This way the whole limb get’s stretched when the bone is stretched… even that end part that doesn’t need to be stretched. I mitigate this with the “anti-foreshortening method”.
Yours: the limbs are not grouped separately. The region vertices were converted to “Bone Link”. I have never seen that I still don’t know how it works, but it may solve my problem with limb foreshortening.
I didn’t find documentation about Bone Links applied to Vertices… but I figured out how you do it. I also figured out that there are two skeletons:
“Pin bone” skeleton with bones Target, Knee, and Bone 24. This skeleton can be controlled directyl by the animator.
“Bone Bind” skeleton, with bones Bone 27 (thigh top),28 (thigh bottom),29 (shank top),30 (shank bottom). These bones should not be manipulated directly by the animator. It will mess the skeleton. It seems that there are functions that make these bones follow the bones in the “Pin Bone” skeleton, but maintain their length.
The limb vertices that must only rotate with the bone, should be linked to the correct Bone Bind bone.
The limb vertices that should stretch with the bone length, should be linked to a bone in the “Pin Bone” skeleton.
Yes, your approach is quite different. I’m still trying to understand how it is intended to be used as well, but I think it’s worth continuing to develop it and make it as practical and appealing as possible.
My approach started because I was challenged by a demo I saw in Moho. I spent quite a bit of time studying how the pin bone system works, then tried to recreate the same behavior in Synfig. After many experiments, I managed to get something similar working, although it’s still not perfect.
The Moho demo was in Chinese, so I couldn’t fully understand all the explanations, but it gave me enough insight to experiment and develop the idea further.
This is just a reminder for myself and anyone who wants to open the sifz, the MapRange converter feature is needed for the outlines to appear and erase at the appropriate times, and there’s this “Pull Request” that solved a bug to make it work 100% right.
There are instructions in that discussion above, to build it yourself. More reference below.
This is needed, until the next synfig release is released… to work with my character sifz.