1
1
export script_name = " Shapery"
2
2
export script_description = " Does several types of shape manipulations from the simplest to the most complex"
3
- export script_version = " 2.5.6 "
3
+ export script_version = " 2.5.7 "
4
4
export script_author = " ILLTeam"
5
5
export script_namespace = " ILL.Shapery"
6
6
32
32
ILL = require " ILL.ILL"
33
33
{ : Aegi , : Ass , : Config , : Line , : Curve , : Path , : Point , : Util , : Math , : Table , : Util } = ILL
34
34
35
+ clipboard = require " aegisub.clipboard"
36
+
35
37
checkPathClockWise = ( path) ->
36
38
sum = 0
37
39
for i = 1 , # path
@@ -44,10 +46,10 @@ interfaces = {
44
46
config : -> {
45
47
{ class : " label" , label : " Expand" , x : 0 , y : 0 }
46
48
{ class : " floatedit" , x : 0 , y : 1 , name : " cutBordShadow" , min : 0.1 , max : 2 , step : 0.1 , value : 1 }
47
- { class : " checkbox" , label : " Cut" , x : 0 , y : 2 , name : " expandBordShadow" , value : false }
49
+ { class : " checkbox" , label : " Shape Expand Outline" , x : 0 , y : 2 , name : " expandBordShadow" , value : false }
50
+ { class : " checkbox" , label : " Comment Current Lines" , x : 0 , y : 3 , name : " saveLines" , value : false }
48
51
{ class : " label" , label : " Reset Macro" , x : 0 , y : 5 }
49
- { class : " dropdown" , items : { " All" , " Config" , " Pathfinder" , " Offsetting" , " Manipulate" , " Transform" , " Utilities" } , x : 5 , y : 5 , name : " reset" , value : " All" }
50
- { class : " checkbox" , label : " Save lines" , x : 5 , y : 0 , name : " saveLines" , value : false }
52
+ { class : " dropdown" , items : { " All" , " Config" , " Pathfinder" , " Offsetting" , " Manipulate" , " Transform" , " Utilities" } , x : 0 , y : 6 , name : " reset" , value : " All" }
51
53
}
52
54
pathfinder : -> {
53
55
{ class : " label" , label : " Operation:" , x : 0 , y : 0 }
@@ -464,7 +466,7 @@ ShaperyMacrosDialog = (macro) ->
464
466
ass\ insertLine line, s
465
467
else
466
468
ass\ warning s, " Expected \\ clip or \\ iclip tag"
467
- when " Shape to clip"
469
+ when " Shape to clip" , " Shape to clip (clipboard) "
468
470
clip = {}
469
471
Line . callBackExpand ass, l, nil , ( line) ->
470
472
{ px, py} = line. data. pos
@@ -476,7 +478,10 @@ ShaperyMacrosDialog = (macro) ->
476
478
l. tags\ insert {{ " clip" , clip}}
477
479
unless l. isShape
478
480
l. text\ modifyBlock l. tags
479
- ass\ setLine l, s
481
+ if macro == " Shape to clip (clipboard)"
482
+ clipboard. set " \\ clip(#{clip})"
483
+ else
484
+ ass\ setLine l, s
480
485
when " Clip to shape"
481
486
{ : an, : pos, : clip} = l. data
482
487
if clip
@@ -629,18 +634,19 @@ if haveDepCtrl
629
634
}
630
635
631
636
depctrl\ registerMacros {
632
- { " Shape expand" , " " , ShaperyMacrosDialog " Shape expand" }
633
- { " Shape clipper" , " " , ShaperyMacrosDialog " Shape clipper" }
634
- { " Clip to shape" , " " , ShaperyMacrosDialog " Clip to shape" }
635
- { " Shape to clip" , " " , ShaperyMacrosDialog " Shape to clip" }
636
- { " Shape merge" , " " , ShaperyMacrosDialog " Shape merge" }
637
- { " Shape trim" , " " , ShaperyMacrosDialog " Shape trim" }
638
- { " Shape to 0,0" , " " , ShaperyMacrosDialog " Shape to 0,0" }
639
- { " Shape to pos" , " " , ShaperyMacrosDialog " Shape to pos" }
640
- { " Shape to origin" , " " , ShaperyMacrosDialog " Shape to origin" }
641
- { " Shape to center" , " " , ShaperyMacrosDialog " Shape to center" }
642
- { " Shape without holes" , " " , ShaperyMacrosDialog " Shape without holes" }
643
- { " Shape bounding box" , " " , ShaperyMacrosDialog " Shape bounding box" }
637
+ { " Shape expand" , " " , ShaperyMacrosDialog " Shape expand" }
638
+ { " Shape clipper" , " " , ShaperyMacrosDialog " Shape clipper" }
639
+ { " Clip to shape" , " " , ShaperyMacrosDialog " Clip to shape" }
640
+ { " Shape to clip" , " " , ShaperyMacrosDialog " Shape to clip" }
641
+ { " Shape to clip (clipboard)" , " " , ShaperyMacrosDialog " Shape to clip (clipboard)" }
642
+ { " Shape merge" , " " , ShaperyMacrosDialog " Shape merge" }
643
+ { " Shape trim" , " " , ShaperyMacrosDialog " Shape trim" }
644
+ { " Shape to 0,0" , " " , ShaperyMacrosDialog " Shape to 0,0" }
645
+ { " Shape to pos" , " " , ShaperyMacrosDialog " Shape to pos" }
646
+ { " Shape to origin" , " " , ShaperyMacrosDialog " Shape to origin" }
647
+ { " Shape to center" , " " , ShaperyMacrosDialog " Shape to center" }
648
+ { " Shape without holes" , " " , ShaperyMacrosDialog " Shape without holes" }
649
+ { " Shape bounding box" , " " , ShaperyMacrosDialog " Shape bounding box" }
644
650
} , " : Shapery macros :"
645
651
else
646
652
aegisub. register_macro " #{script_name}/Pathfinder" , " " , PathfinderDialog
@@ -651,15 +657,16 @@ else
651
657
aegisub. register_macro " #{script_name}/Cut Contour" , " " , CutContourDialog
652
658
aegisub. register_macro " #{script_name}/Config" , " " , ConfigDialog
653
659
654
- aegisub. register_macro " : Shapery macros :/Shape expand" , " " , ShaperyMacrosDialog " Shape expand"
655
- aegisub. register_macro " : Shapery macros :/Shape clipper" , " " , ShaperyMacrosDialog " Shape clipper"
656
- aegisub. register_macro " : Shapery macros :/Clip to shape" , " " , ShaperyMacrosDialog " Clip to shape"
657
- aegisub. register_macro " : Shapery macros :/Shape to clip" , " " , ShaperyMacrosDialog " Shape to clip"
658
- aegisub. register_macro " : Shapery macros :/Shape merge" , " " , ShaperyMacrosDialog " Shape merge"
659
- aegisub. register_macro " : Shapery macros :/Shape trim" , " " , ShaperyMacrosDialog " Shape trim"
660
- aegisub. register_macro " : Shapery macros :/Shape to 0,0" , " " , ShaperyMacrosDialog " Shape to 0,0"
661
- aegisub. register_macro " : Shapery macros :/Shape to pos" , " " , ShaperyMacrosDialog " Shape to pos"
662
- aegisub. register_macro " : Shapery macros :/Shape to origin" , " " , ShaperyMacrosDialog " Shape to origin"
663
- aegisub. register_macro " : Shapery macros :/Shape to center" , " " , ShaperyMacrosDialog " Shape to center"
664
- aegisub. register_macro " : Shapery macros :/Shape without holes" , " " , ShaperyMacrosDialog " Shape without holes"
665
- aegisub. register_macro " : Shapery macros :/Shape bounding box" , " " , ShaperyMacrosDialog " Shape bounding box"
660
+ aegisub. register_macro " : Shapery macros :/Shape expand" , " " , ShaperyMacrosDialog " Shape expand"
661
+ aegisub. register_macro " : Shapery macros :/Shape clipper" , " " , ShaperyMacrosDialog " Shape clipper"
662
+ aegisub. register_macro " : Shapery macros :/Clip to shape" , " " , ShaperyMacrosDialog " Clip to shape"
663
+ aegisub. register_macro " : Shapery macros :/Shape to clip" , " " , ShaperyMacrosDialog " Shape to clip"
664
+ aegisub. register_macro " : Shapery macros :/Shape to clip (clipboard)" , " " , ShaperyMacrosDialog " Shape to clip (clipboard)"
665
+ aegisub. register_macro " : Shapery macros :/Shape merge" , " " , ShaperyMacrosDialog " Shape merge"
666
+ aegisub. register_macro " : Shapery macros :/Shape trim" , " " , ShaperyMacrosDialog " Shape trim"
667
+ aegisub. register_macro " : Shapery macros :/Shape to 0,0" , " " , ShaperyMacrosDialog " Shape to 0,0"
668
+ aegisub. register_macro " : Shapery macros :/Shape to pos" , " " , ShaperyMacrosDialog " Shape to pos"
669
+ aegisub. register_macro " : Shapery macros :/Shape to origin" , " " , ShaperyMacrosDialog " Shape to origin"
670
+ aegisub. register_macro " : Shapery macros :/Shape to center" , " " , ShaperyMacrosDialog " Shape to center"
671
+ aegisub. register_macro " : Shapery macros :/Shape without holes" , " " , ShaperyMacrosDialog " Shape without holes"
672
+ aegisub. register_macro " : Shapery macros :/Shape bounding box" , " " , ShaperyMacrosDialog " Shape bounding box"
0 commit comments