fixes #1313 paths with expressions targetting other paths are now calculated before passing the prop
diff --git a/player/js/utils/expressions/ExpressionManager.js b/player/js/utils/expressions/ExpressionManager.js
index c05506f..4e9dcbd 100644
--- a/player/js/utils/expressions/ExpressionManager.js
+++ b/player/js/utils/expressions/ExpressionManager.js
@@ -632,7 +632,7 @@
//TODO: Check if it's possible to return on ShapeInterface the .v value
if (scoped_bm_rt.propType === "shape") {
- scoped_bm_rt = shape_pool.clone(scoped_bm_rt.v);
+ scoped_bm_rt = scoped_bm_rt.v;
}
// globalData.popExpression();
return scoped_bm_rt;
diff --git a/player/js/utils/expressions/ExpressionPropertyDecorator.js b/player/js/utils/expressions/ExpressionPropertyDecorator.js
index c0dd2ec..fda3123 100644
--- a/player/js/utils/expressions/ExpressionPropertyDecorator.js
+++ b/player/js/utils/expressions/ExpressionPropertyDecorator.js
@@ -305,6 +305,9 @@
function ShapeExpressions(){}
ShapeExpressions.prototype = {
vertices: function(prop, time){
+ if (this.k) {
+ this.getValue();
+ }
var shapePath = this.v;
if(time !== undefined) {
shapePath = this.getValueAtTime(time, 0);
diff --git a/player/js/utils/shapes/ShapeProperty.js b/player/js/utils/shapes/ShapeProperty.js
index 17f518e..c301eae 100644
--- a/player/js/utils/shapes/ShapeProperty.js
+++ b/player/js/utils/shapes/ShapeProperty.js
@@ -94,33 +94,46 @@
}
var i, len = shape1._length;
for(i = 0; i < len; i += 1) {
- if(shape1.v[i][0] !== shape2.v[i][0] || shape1.v[i][1] !== shape2.v[i][1] || shape1.o[i][0] !== shape2.o[i][0] || shape1.o[i][1] !== shape2.o[i][1] || shape1.i[i][0] !== shape2.i[i][0] || shape1.i[i][1] !== shape2.i[i][1]){
+ if(shape1.v[i][0] !== shape2.v[i][0]
+ || shape1.v[i][1] !== shape2.v[i][1]
+ || shape1.o[i][0] !== shape2.o[i][0]
+ || shape1.o[i][1] !== shape2.o[i][1]
+ || shape1.i[i][0] !== shape2.i[i][0]
+ || shape1.i[i][1] !== shape2.i[i][1]) {
return false;
}
}
return true;
}
+ function setVValue(newPath) {
+ if(!shapesEqual(this.v, newPath)) {
+ this.v = shape_pool.clone(newPath);
+ this.localShapeCollection.releaseShapes();
+ this.localShapeCollection.addShape(this.v);
+ this._mdf = true;
+ this.paths = this.localShapeCollection;
+ }
+ }
+
function processEffectsSequence() {
- if(this.lock || this.elem.globalData.frameId === this.frameId) {
+ if(this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+ return;
+ }
+ if(this.lock) {
+ this.setVValue(this.pv);
return;
}
this.lock = true;
- this.frameId = this.elem.globalData.frameId;
this._mdf = false;
var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
var i, len = this.effectsSequence.length;
for(i = 0; i < len; i += 1) {
finalValue = this.effectsSequence[i](finalValue);
}
- if(!shapesEqual(this.v, finalValue)) {
- this.v = shape_pool.clone(finalValue);
- this.localShapeCollection.releaseShapes();
- this.localShapeCollection.addShape(this.v);
- this._mdf = true;
- this.paths = this.localShapeCollection;
- }
+ this.setVValue(finalValue);
this.lock = false;
+ this.frameId = this.elem.globalData.frameId;
};
function ShapeProperty(elem, data, type){
@@ -149,7 +162,7 @@
ShapeProperty.prototype.interpolateShape = interpolateShape;
ShapeProperty.prototype.getValue = processEffectsSequence;
- ShapeProperty.prototype.getValue = processEffectsSequence;
+ ShapeProperty.prototype.setVValue = setVValue;
ShapeProperty.prototype.addEffect = addEffect;
function KeyframedShapeProperty(elem,data,type){
@@ -176,6 +189,7 @@
}
KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+ KeyframedShapeProperty.prototype.setVValue = setVValue;
KeyframedShapeProperty.prototype.addEffect = addEffect;
var EllShapeProperty = (function(){