forked from reyhard/o2scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pathsIN.bio2s
150 lines (133 loc) · 3.79 KB
/
pathsIN.bio2s
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
console=openStandardIO;
o2NoRunScriptDialog;
_p3d = newLODObject;
_radio=1;
_in = 0;
_in=0;
_isinsel=0;
_activeobject = getActiveObject this;
_selekce = getSelections _activeobject;
_pocetselekci = count _selekce;
_naselektenebody = getSelectedPoints (_activeobject loadSelection "_current");
_pocetnaselektenych = count _naselektenebody;
if (_pocetnaselektenych == 0) then
{
messageBox ["No point selected!!!",48,"Error"];
}
else
{
if (_pocetnaselektenych > 1) then
{
for "_i" from 0 to (_pocetselekci-1) do
{
_nazevselekce = _selekce @ _i;
_prvnitri = _nazevselekce @ [0,3];
if (_prvnitri == "in") then
{
_pocetpismennazvu = count _nazevselekce;
_poradipozice = val(_nazevselekce @ [3,(_pocetpismennazvu+1)]);
if (_poradipozice > _in) then
{
_in = _poradipozice;
};
};
};
{
_prvnibod = _x;
_isinsel=0;
{
if (((_x @ [0,3])=="in")||((_x @ [0,2])=="in")) then
{
_bodyvselu = getSelectedPoints (_activeobject loadSelection _x);
if (_prvnibod in _bodyvselu) then
{
messageBox ["Point "+str(_prvnibod)+" is already in "+str(_x)+" selection!!!",48,"Error"];
_isinsel=1;
};
};
} forEach _selekce;
if (_isinsel==0) then
{
_in=_in+1;
_bodik=newSelection _activeobject;
_bodik selectPoint _prvnibod;
_activeobject save ((_bodik) as ("in"+str(_in)));
};
} forEach _naselektenebody;
}
else
{
{
if (((_x @ [0,3])=="in")||((_x @ [0,2])=="in")) then
{
_bodyvselu = getSelectedPoints (_activeobject loadSelection _x);
if (((_naselektenebody @ 0)in _bodyvselu)&&_isinsel==0) then
{
messageBox ["Point is already in "+str(_x)+" selection!!!",48,"Error"];
_isinsel=1;
};
};
} forEach _selekce;
if (_isinsel==0) then
{
_dlg = dialogBox
[70,80,"Paths",
["move-to",0,0],
["begin-subframe",60,35,""],
["move-to",10,10],
["radio-button",50,10,"Position","_radio",1],
["radio-button",50,10,"Entry Point","_radio",2],
["end-subframe"],
["break"],
["move-to",10,40],
["ok-button",45,15],
["break"],
["move-to",10,60],
["cancel-button",45,15]
];
if (_dlg==1) then
{
if (_radio==1) then
{
for "_i" from 0 to (_pocetselekci-1) do
{
_nazevselekce = _selekce @ _i;
_prvnitri = _nazevselekce @ [0,3];
if (_prvnitri == "in") then
{
_pocetpismennazvu = count _nazevselekce;
_poradipozice = val(_nazevselekce @ [3,(_pocetpismennazvu+1)]);
if (_poradipozice > _in) then
{
_in = _poradipozice;
};
};
};
_activeobject save ((_activeobject loadSelection "_current") as ("in"+str(_in+1)));
};
if (_radio==2) then
{
for "_i" from 0 to (_pocetselekci-1) do
{
_nazevselekce = _selekce @ _i;
_prvnidva = _nazevselekce @ [0,2];
if (_prvnidva == "in") then
{
_pocetpismennazvu = count _nazevselekce;
_poradiinsertu = val(_nazevselekce @ [2,(_pocetpismennazvu+1)]);
if (_poradiinsertu > _in) then
{
_in = _poradiinsertu;
};
};
};
_activeobject save ((_activeobject loadSelection "_current") as ("in"+str(_in+1)));
};
}
else
{
messageBox ["You pressed Cancel",0,"Cancel!"];
};
};
};
};