概括一下思路:

1.锁死缩放属性,缩放属性不能改变,否则描边一定会被挤压

2.不改变缩放,那就改变形状的比例,也就是说,用鼠标伸缩形状图层,但不改变图层的缩放属性,而是改变形状的比例属性

3.然后将 描边属性 应用到改变后的形状,即:把形状属性组里的描边,移到外层的内容属性组,与它原先的父级属性组平级

但是没有这种功能,只能在内容属性组下新添加一个描边属性,把原先的描边属性里的参数一个个复制过来

app.beginUndoGroup("neverchange")
var curcomp = app.project.activeItem;
var curlayer = curcomp.selectedLayers[0];
var curPro = curcomp.selectedProperties[0];

//锁死缩放

curlayer.scale.expression = "if(time<thisLayer.outPoint)\n" + "	{[" + curlayer.scale.value[0] + "," + curlayer.scale.value[1] + "]}\n" + "else\n" + "	{value}"

//比例值由缩放的原始值改变

curlayer("ADBE Root Vectors Group")(1)("ADBE Vector Transform Group")("ADBE Vector Scale").expression = "a=transform.scale.valueAtTime(outPoint);\n" + "b=transform.scale.value;\n" + "[a[0]/b[0]*100,a[1]/b[1]*100]"

//在内容组里添加描边,把形状组里的描边属性拷贝到内容组里的描边
curlayer("ADBE Root Vectors Group").addProperty("ADBE Vector Graphic - Stroke")

var newstroke = curlayer("ADBE Root Vectors Group")("ADBE Vector Graphic - Stroke")
var oldstroke = curlayer("ADBE Root Vectors Group")("ADBE Vector Group")("ADBE Vectors Group")("ADBE Vector Graphic - Stroke")

//复制描边里的基础属性
for (i = 1; i <= 7; i++) {
    newstroke(i).setValue(oldstroke(i).value)
}

//复制虚线组下的属性
for (i = 1; i <= 7; i++) {
    if (oldstroke("ADBE Vector Stroke Dashes")(i).isModified) {
        newstroke("ADBE Vector Stroke Dashes").addProperty(oldstroke("ADBE Vector Stroke Dashes")(i).matchName);
        newstroke("ADBE Vector Stroke Dashes")(i).setValue(oldstroke("ADBE Vector Stroke Dashes")(i).value);
    }
}

//锥度
for (i = 1; i <= 9; i++) {
    if (oldstroke("ADBE Vector Stroke Taper")(i).isModified) {
        newstroke("ADBE Vector Stroke Taper")(i).setValue(oldstroke("ADBE Vector Stroke Taper")(i).value);
    }
}

//波形
for (i = 1; i <= 5; i++) {
    if (oldstroke("ADBE Vector Stroke Wave")(i).isModified) {
        newstroke("ADBE Vector Stroke Wave")(i).setValue(oldstroke("ADBE Vector Stroke Wave")(i).value);
    }
}

//移除形状组里的描边
oldstroke.remove()

app.endUndoGroup()