
帮朋友写的一个小插件,在样条线中选择两个点,按住快捷键即可将其连接
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 macroScript ConnectTwoVertices
category:"lshTools"
buttonText:"Connect Two Vertices"
toolTip:""
(
fn drawLineBetweenTwoPoints pointA pointB =
(
ss = SplineShape pos:pointA
addNewSpline ss
addKnot ss 1 #corner #line PointA
addKnot ss 1 #corner #line PointB
updateShape ss
ss
)
fn get_vertices_selection spline_obj =
(
selection_coords= #()
for i=1 to (numSplines spline_obj) do
(
selected_vertices = getKnotSelection spline_obj i
if selected_vertices.count > 0 then
(
for j in selected_vertices do
append selection_coords (getKnotPoint spline_obj i j)
)
)
selection_coords
)
selected_points_coords = #()
selected_points_coords = get_vertices_selection $
updateShape $
if selected_points_coords.count == 2 then
(
connectionSpline = drawLineBetweenTwoPoints selected_points_coords[1] selected_points_coords[2]
addAndWeld $ connectionSpline 1.0
updateShape $
)
)
进入快捷键界面,在Category下来列表中找到lshTools,设置成想要的快捷键即可
百度网盘:密码:wl7y




近期评论