-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRemoveLandContactLOD_CmdLine.bio2s
More file actions
46 lines (35 loc) · 1013 Bytes
/
RemoveLandContactLOD_CmdLine.bio2s
File metadata and controls
46 lines (35 loc) · 1013 Bytes
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
#include "std\lodNames.inc"
console=openStandardIO;
//example usage
//O2Script.exe -a O2Scripts\RemoveLastResLOD_CmdLine.bio2s p:\test\name.p3d
//Library methods
//==================
// main
_sourcePath = this @ 0;
_targetPath = _sourcePath;
_p3d = newLODObject;
_p3d loadP3D _sourcePath;
_LODs = getObjects _p3d;
_resolutions = getResolutions _p3d;
_changed = false;
for "_i" from 0 to ((count _p3d) - 1) do
{
private["_currentLOD","_currentResolution"];
_currentLOD = _LODs @ _i;
_currentResolution = _resolutions @ _i;
console<<"_currentResolution "<<str _currentResolution<<eoln;
console<<"_currentLOD "<<str _currentLOD<<eoln;
console<<"_currentLOD "<<str (_currentResolution == LOD_LANDCONTACT)<<eoln;
if (_currentResolution == LOD_LANDCONTACT) exitWith
{
_p3d setActiveSpecial _currentResolution;
_p3d deleteLevel (activeLevel _p3d);
// _p3d deleteLevel (_currentResolution);
_changed = true;
};
};
if (_changed) then
{
console<<"changed"<<eoln;
save (_p3d as _targetPath);
};