psy*_*brm 4 photoshop jsx photoshop-script
使用Free Transform工具将图层旋转90度后......
如何使用jsx脚本找到此值?
psy*_*brm 11
哦,我的好,我花了4个小时才找到这个:(
function angleFromMatrix(yy, xy)
{
var toDegs = 180/Math.PI;
return Math.atan2(yy, xy) * toDegs - 90;
}
function getActiveLayerRotation()
{
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('textKey'))
if (desc.hasKey(stringIDToTypeID('transform')))
{
desc = desc.getObjectValue(stringIDToTypeID('transform'))
var yy = desc.getDouble(stringIDToTypeID('yy'));
var xy = desc.getDouble(stringIDToTypeID('xy'));
return angleFromMatrix(yy, xy);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2447 次 |
| 最近记录: |