Hi!
recently the Sound layer has been added to the development branch what is a
fantastic news.

When I review the code on GitHub I noticed something strange at first
glance, or at last that attract my curiosity.

Layer_Sound inherits from Layer_Composite and Layer_NoDeform. I asked Ivan
whether there was some reason for that that I don't foresee. Check our
conversation here [1]

So, thinking on Ivan's reply, I get back to the Layer hierarchy and
reviewed it to try to explain to Ivan how do the layers (I believe) work.

So I surprised the following: Layer_Skeleton_Deformation has the following
hierarchy:

Layer_Composite <-Layer_MeshTransform <- Layer_Skeleton_Deformation

That was a surprise to me for the initially but I was more surprised when I
reviewed all the layer hierarchy:

For what I understand, one class inherits from other because it wants to
reuse some of the properties and code of the ancestor class.

By definition, ALL Layer_Composite layers have available the following
parameters: Amount & Blend Method, so I expect that all the inherited
layers would use those parameters for its render.

But surprise! It is not only Layer_Skeleton_Deformation the one that
doesn't use those parameters, some other layers also hide them to the user
because they aren't used at all but the layer inherits from Layer_Composite.

Those layers are:

Twirl (hides z_depth, amount and blend method)
Layer_MotionBlur (hides z_depth, amount and blend method)
Layer_MeshTransform (expose all)

In my opinion those layers are badly situated in the class hierarchy. The
most important thing to fix is the Layer_MeshTransform because it will be
the base class of the layers that currently are not Layer_Composite and
would potentially inherit from Layer_MeshTransform (beacuse they can be a
mesh transform type). Those are:

CurveWarp
InsideOut
Layer_SphereDistort
Layer_Warp
Twirl

Maybe those could be too:
SuperSample
Mandelbrot
Julia

So my proposal is to move Twirl, Motion Blur and MeshTransform to inherit
directly from Layer because they don't use Amount and Blend Method at all.

Alternatively to that, Twirl could be converted into a Composite layer if
we change the code and make it use of amount and blend method, leaving them
to 1.0 and Straight by default.

Cheers!

[1]
https://github.com/blackwarthog/synfig/commit/1e7b9c0e94f257c2ef35cb34383c75c6c6c59340#diff-26d173bf091a0f23e115aca16d6f82a0R41

-- 
Carlos
http://synfig.org
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to