-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMassOverview_CmdLine.bio2s
More file actions
63 lines (45 loc) · 1.38 KB
/
MassOverview_CmdLine.bio2s
File metadata and controls
63 lines (45 loc) · 1.38 KB
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
#include "std\lodNames.inc"
console=openStandardIO;
//example usage
//O2Script.exe -a O2Scripts\NamedSelectionsOverview.bio2s p:\test\name.p3d >> p:\test\NamedSelectionsOverview.txt
//Library methods
//==================
_createOverviewForCurrentLOD =
{
private["_currentLOD","_totalMass"];
_currentLOD = _this select 0;
_totalMass = 0;
{
private ["_selectionName","_selection,_selectedPoints"];
_selectionName = _x;
_selection = _currentLOD loadSelection _selectionName;
_selectedPoints = getSelectedPoints _selection;
{
private["_point","_pointMass"];
_point = _x;
_pointMass = _currentLOD getPointMass _x;
_totalMass = _totalMass + _pointMass;
console<<"_point: "<<str _point<<eoln;
console<<"_pointMass: "<<str _pointMass<<eoln;
} forEach _selectedPoints;
} forEach (getSelections _currentLOD);
console<<"_totalMass: "<<str _totalMass<<eoln;
};
// main
_sourcePath = this@0;
_p3d = newLODObject;
_p3d loadP3D _sourcePath;
_LODs = getObjects _p3d;
_resolutions = getResolutions _p3d;
console<<"_sourcePath: "<<_sourcePath<<eoln;
for "_i" from 0 to ((count _p3d) - 1) do
{
private["_currentLOD","_currentResolution"];
_currentLOD = _LODs @ _i;
_currentResolution = _resolutions @ _i;
if (_currentResolution == LOD_GEOMETRY) then
{
console<<"_currentResolution: "<<str _currentResolution<<eoln;
[_currentLOD] call _createOverviewForCurrentLOD;
};
};