Skip to content

Commit

Permalink
Fix blending for Layr_SkeletonDeformation
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwarthog committed Apr 19, 2019
1 parent 2c15242 commit 8eaf6c7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion synfig-core/src/synfig/layers/layer_meshtransform.cpp
Expand Up @@ -87,7 +87,8 @@ namespace {

/* === M E T H O D S ======================================================= */

Layer_MeshTransform::Layer_MeshTransform():
Layer_MeshTransform::Layer_MeshTransform(Real amount, Color::BlendMethod blend_method):
Layer_CompositeFork(amount, blend_method),
mesh(new rendering::Mesh())
{
SET_INTERPOLATION_DEFAULTS();
Expand Down
2 changes: 1 addition & 1 deletion synfig-core/src/synfig/layers/layer_meshtransform.h
Expand Up @@ -49,7 +49,7 @@ class Layer_MeshTransform : public Layer_CompositeFork

public:
//! Default constructor
Layer_MeshTransform();
explicit Layer_MeshTransform(Real amount=1.0, Color::BlendMethod blend_method=Color::BLEND_COMPOSITE);
//! Destructor
virtual ~Layer_MeshTransform();

Expand Down
3 changes: 2 additions & 1 deletion synfig-core/src/synfig/layers/layer_skeletondeformation.cpp
Expand Up @@ -67,12 +67,13 @@ SYNFIG_LAYER_INIT(Layer_SkeletonDeformation);
SYNFIG_LAYER_SET_NAME(Layer_SkeletonDeformation,"skeleton_deformation");
SYNFIG_LAYER_SET_LOCAL_NAME(Layer_SkeletonDeformation,N_("Skeleton Deformation"));
SYNFIG_LAYER_SET_CATEGORY(Layer_SkeletonDeformation,N_("Distortions"));
SYNFIG_LAYER_SET_VERSION(Layer_SkeletonDeformation,"0.1");
SYNFIG_LAYER_SET_VERSION(Layer_SkeletonDeformation,"0.2");
SYNFIG_LAYER_SET_CVS_ID(Layer_SkeletonDeformation,"$Id$");

/* === M E T H O D S ======================================================= */

Layer_SkeletonDeformation::Layer_SkeletonDeformation():
Layer_MeshTransform(1.0, Color::BLEND_STRAIGHT),
param_point1(ValueBase(Point(-4,4))),
param_point2(ValueBase(Point(4,-4))),
param_x_subdivisions(32),
Expand Down
9 changes: 9 additions & 0 deletions synfig-core/src/synfig/loadcanvas.cpp
Expand Up @@ -3116,6 +3116,15 @@ CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas)
}
}

// init blending for skeleton_deformation
if (layer->get_name() == "skeleton_deformation" && (version == "0.0" || version == "0.1"))
{
layer->disconnect_dynamic_param("amount");
layer->disconnect_dynamic_param("blend_method");
layer->set_param("amount", 1.0);
layer->set_param("blend_method", Color::BLEND_STRAIGHT);
}

layer->reset_version();
return layer;
}
Expand Down

0 comments on commit 8eaf6c7

Please sign in to comment.