forked from reyhard/o2scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
refineTreeMemPoint.bio2s
78 lines (67 loc) · 2.15 KB
/
refineTreeMemPoint.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
#include "std\lodNames.inc"
#include "std\o2config.inc"
#include "std\paramFile.inc"
#include "CheckMat.inc.bio2s"
#include "std\flags.inc"
scopeName "CheckAll";
console=openStandardIO;
if (typename this=="STRING") then
{
p3d=newLODObject;
p3dname=this;
if (!(p3d loadP3d this)) then { console<<"Unable to open:"<<this<<eoln;BreakTo "CheckAll";};
runFromO2=false;
texpath=((splitPath p3dname) @ 0);
console<<"----------------------------------------------------------------------"<<eoln;
console<<"Checking file: "<<p3dname<<eoln;
}
else
{
p3dname=nameof this;
p3dname=splitPath p3dname;
p3dname=p3dname @ 2 + p3dname @ 3;
runFromO2=true;
p3d=this;
texpath=o2GetConfig IDS_CFGPATHFORTEX;
console<<"--------- Checking "<<p3dname<<" ------"<<eoln;
};
_changed = false;
_LODs = getObjects p3d;
_resolutions = getResolutions p3d;
_objects = getObjects p3d;
for "_i" from 0 to ((count p3d) - 1) do
{
_currentLOD = _LODs @ _i;
_currentResolution = _resolutions @ _i;
_currentObject = _objects @ _i;
if(LOD_MEMORY == _currentResolution)then
{
{
// Only perform check on sound memory points
if(_x @ [0,5] == "sound")then
{
_sel = _currentObject loadSelection _x;
_sel = getSelectedPoints _sel;
//_currentObject forEachPoint ["((_this getPoint _x) @ 1 ) >1","_point= _this getpoint _x;_this setPoint [_x,[_point @ 0, 1 ,_point @ 2]];"];
{
_point = _currentObject getpoint _x;
// Max point height is 10 meters
if(_point @ 1 > 10)then
{
_currentObject setPoint [_x,[_point @ 0, 10 ,_point @ 2]];
_changed = true;
};
}foreach _sel;
};
}forEach (getSelections _currentObject);
};
};
if (_changed and !runFromO2) then
{
console<<"----------------------------------------------------------------------"<<eoln<<eoln;
console<<"--------- Changed memory point position - saving file "<<eoln;
console<<"----------------------------------------------------------------------"<<eoln<<eoln;;
if (!save p3d)then {console <<"unable to SAVE "<<p3dname<<eoln;};
}else{
console<<"--------- No change ------" << eoln << eolnф;
};