-
toWorldVec Error when Scale is 0
Hey,
I’m having trouble understanding toWorldVec. I’m trying to use it so that I can convert a layer’s scale to world space so that no matter how many parents that layer has, the expression uses the scale amount that takes into account the parents’ scales as well.
When either the layer scale or any of the parent scales are 0, I get this error:
layer to world matrix isn’t invertible in fromWorld
Is the problem just that toWorldVec doesn’t like scales to be 0?
thisScale = transform.scale;
thisScaleParent = thisLayer.toWorldVec(transform.scale);scaleFactor = 100/thisScale[0];
scaleFactorParent = thisScaleParent[0]/100;scaleFactor = scaleFactor * scaleFactorParent;
value*scaleFactor;