From 2a886a8666e53a196dbda634a0eebc6afd0d53c7 Mon Sep 17 00:00:00 2001 From: AnishGulati Date: Jun 07 2019 19:20:29 +0000 Subject: Check if pip is installed on Mac, then only install it; Tangent values consistent in code now --- diff --git a/1-setup-osx-brew.sh b/1-setup-osx-brew.sh index 91938e3..1c16152 100755 --- a/1-setup-osx-brew.sh +++ b/1-setup-osx-brew.sh @@ -45,9 +45,13 @@ do brew info "$pkg" | grep --quiet 'Not installed' && brew install "$pkg" done -echo "Running python in sudo (you need root privelegies to do that)..." -# Dependency for lxml -curl https://bootstrap.pypa.io/get-pip.py | sudo python +if ! ( which pip >/dev/null ); then + echo "No pip found. Installing..." + echo "Running python in sudo (you need root privelegies to do that)..." + # Dependency for lxml + curl https://bootstrap.pypa.io/get-pip.py | sudo python +fi + # Installing lxml using pip STATIC_DEPS=true sudo pip install lxml diff --git a/synfig-studio/plugins/lottie-exporter/properties/offsetKeyframe.py b/synfig-studio/plugins/lottie-exporter/properties/offsetKeyframe.py index 892214b..fe8033a 100644 --- a/synfig-studio/plugins/lottie-exporter/properties/offsetKeyframe.py +++ b/synfig-studio/plugins/lottie-exporter/properties/offsetKeyframe.py @@ -59,12 +59,12 @@ def clamped_vector(p1, p2, p3, animated, i, lottie, ease): return Vector(clamped_tangent(p1.x, p2.x, p3.x, animated, i), clamped_tangent(p1.y, p2.y, p3.y, animated, i)) def ease_out(lottie): - lottie["o"]["x"] = 0.42 - lottie["o"]["y"] = 0 + lottie["o"]["x"] = settings.OUT_TANGENT_X + lottie["o"]["y"] = settings.OUT_TANGENT_Y def ease_in(lottie): - lottie["i"]["x"] = 0.58 - lottie["i"]["y"] = 1 + lottie["i"]["x"] = settings.IN_TANGENT_X + lottie["i"]["y"] = settings.IN_TANGENT_Y def gen_properties_offset_keyframe(curve_list, animated, i): """ @@ -189,8 +189,8 @@ def gen_properties_offset_keyframe(curve_list, animated, i): curve_list[-2]["ti"] = [-item/settings.TANGENT_FACTOR for item in curve_list[-2]["ti"]] curve_list[-2]["ti"][1] = -curve_list[-2]["ti"][1] if cur_get_after == "halt": - curve_list[-2]["i"]["x"] = 0.7 - curve_list[-2]["i"]["y"] = 1 + curve_list[-2]["i"]["x"] = settings.IN_TANGENT_X + curve_list[-2]["i"]["y"] = settings.IN_TANGENT_Y # Lottie and synfig use different tangents SEE DOCUMENTATION lottie["ti"] = [-item for item in lottie["ti"]] diff --git a/synfig-studio/plugins/lottie-exporter/settings.py b/synfig-studio/plugins/lottie-exporter/settings.py index 453a6ec..895af4e 100644 --- a/synfig-studio/plugins/lottie-exporter/settings.py +++ b/synfig-studio/plugins/lottie-exporter/settings.py @@ -24,6 +24,10 @@ DEFAULT_OPACITY = 100 GAMMA = 2.2 PIX_PER_UNIT = 0 TANGENT_FACTOR = 3.0 +IN_TANGENT_X = 0.58 +IN_TANGENT_Y = 1 +OUT_TANGENT_X = 0.42 +OUT_TANGENT_Y = 0 def init(): # Final converted dictionary