Pierre Marc Dumuid wrote:
> We'll probably also need to include backward compatible loading of previous
> files. (i.e. increase
> the version no in the xml file, and if xml version is less < AND
> CONTROL_{IN,OUT}_VALUE != 0)
> then they should be modified to get exactly the same behaviour... (or
> alternatively, a message
> should pop-up saying the types of incompatibilities that may exists between
> different versions of
> xml files -- less elegant, but probably easier since cinelerra seems to be a
> moving target..
>
> Pierre
>
Yesterday night, I did more "code exploring" and got a somewhat clearer picture.
I thik now, most of this problem could be a "GUI and editing" problem, so old
session files should work the same way as before.
Even if we add a new state field to every keyframe (my proposal for this was
the three states "smooth", "linear", and "free") we need to asure only that
every old keyframe without this state value gets the value "free". Then it
should work as before.
I looked up the use of the fields control_{in,out}_{value,positon} in the
source. As far as I could see, every keyframe gets this values (initially
set to zero). They are preserved in the respective XML properties and correspond
to the posititon of the control point handles you can drag off with ctrl-mouse
and edit for every keyframe node.
But for the real calculation of the bezier courve, the x-coordinates of the
control points (the *_position-field) are simply thrown away and not used.
Only the information of the y-coordinates is used.
After working a bit with the automation courves, I got the impression this
bezier feature "feels strange" in some way, if you are experienced with bezier
courves (photoshop, corel draw, inkscape...). This would explain why: the
control points you see in the GUI arn't the control points used for the
calculation.
It /is/ a real bezier courve, but in fact the movement of the control points is
restricted to y-direction, as the x-coordinates are fixed to certain values.
I draw this conclusion from the properties of the bezier function
V(t) = (1-t)^3 * V0 + 3*(1-t)^2*t * V1 + 3*(1-t)*t^2 * V2 + t^3 * V3
The V-s are vectors, V0 and V3 are the end points, V1 and V2 the two control
points.
This functon yields a simple linear progression with t along a linear segment
if we set:
V(t)= ((1-t)^3 * 1 + 3*(1-t)^2*t * 1 + 3*(1-t)*t^2 * 1 + t^3 * 1 ) * V0
+ ( 0 + 3*(1-t)^2*t *1/3 + 3*(1-t)*t^2 *2/3 + t^3 * 1 ) * (V3-V0)
= 1 * V0
+ t*(1-t +t)^2 * (V3-V0) (by using the binomial theorem)
My Argument is: if we don't calculate the x-component of the function V(t),
we effectively set it to this linear function Vx(t) = V0x + t*(V3x-V0x)
I think, according to the WYSIWYG philosophy we should modify the gui and
constrain
the control points, so they reflect this behaviour visually!
After considering this, I think, the modifications needed are not difficult,
form a conceptual point of view. The practical problem is: if we want to
implement
some rule to set the control points automatically in some way (for allways smoth
courve or for always linear segments), we have to take into account the
neibouring
keyframes. The current code /elegantly/ gets around this problem by initially
setting V1y=V2y=0
OK, next I will be looking more in the details how this could be done. As a
sidenote,
we all have the same problem: we are rather busy with other things... :-)
Cheers,
Hermann
_______________________________________________
Cinelerra mailing list
[email protected]
https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra