From 991a0575bc74408e0e852eac1aadc33afc8add8f Mon Sep 17 00:00:00 2001 From: Ramadan <90788933+mu-ramadan@users.noreply.github.com> Date: Sun, 31 Mar 2024 21:07:25 +0400 Subject: [PATCH] update graph posts --- graph_posts/GetRoomBounds.json | 5 +++++ matterport-dl.py | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 graph_posts/GetRoomBounds.json diff --git a/graph_posts/GetRoomBounds.json b/graph_posts/GetRoomBounds.json new file mode 100644 index 000000000..0b8dd41a6 --- /dev/null +++ b/graph_posts/GetRoomBounds.json @@ -0,0 +1,5 @@ +{ + "operationName": "GetRoomBounds", + "variables": { "modelId": "[MATTERPORT_MODEL_ID]" }, + "query": "query GetRoomBounds($modelId: ID!) {\n model(id: $modelId) {\n floors {\n id\n layer {\n id\n __typename\n }\n edges(includeUsed: true) {\n id\n layer {\n id\n __typename\n }\n type\n vertices {\n id\n layer {\n id\n __typename\n }\n position {\n x\n y\n __typename\n }\n __typename\n }\n centerLineBias\n thickness\n openings {\n id\n width\n relativeCenter\n type\n height\n lowerElevation\n layer {\n id\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n rooms {\n id\n layer {\n id\n __typename\n }\n floor {\n id\n __typename\n }\n classifications {\n id\n confidence\n label\n __typename\n }\n boundary {\n edges {\n id\n __typename\n }\n __typename\n }\n holes {\n edges {\n id\n __typename\n }\n __typename\n }\n dimensionEstimates {\n area\n areaIndoor\n width\n depth\n height\n units\n __typename\n }\n label\n keywords\n __typename\n }\n __typename\n }\n}\n" +} diff --git a/matterport-dl.py b/matterport-dl.py index bef001f85..003714e1a 100644 --- a/matterport-dl.py +++ b/matterport-dl.py @@ -203,7 +203,7 @@ def downloadAssets(base): "vert_arrows","headset-quest-2","pinIconDefault","tagColor"] assets = ["css/showcase.css", "css/unsupported_browser.css", "cursors/grab.png", "cursors/grabbing.png", "cursors/zoom-in.png", - "cursors/zoom-out.png", "locale/strings.json", "css/ws-blur.css", "css/core.css", "css/split.css","css/late.css"] + "cursors/zoom-out.png", "locale/strings.json", "css/ws-blur.css", "css/core.css", "css/split.css","css/late.css", "matterport-logo.svg"] downloadFile("https://my.matterport.com/favicon.ico", "favicon.ico") downloadFile(base + "js/showcase.js", "js/showcase.js") @@ -252,14 +252,13 @@ def setAccessURLs(pageid): def downloadInfo(pageid): assets = [f"api/v1/jsonstore/model/highlights/{pageid}", f"api/v1/jsonstore/model/Labels/{pageid}", f"api/v1/jsonstore/model/mattertags/{pageid}", f"api/v1/jsonstore/model/measurements/{pageid}", - f"api/v1/player/models/{pageid}/thumb?width=1707&dpr=1.5&disable=upscale", f"api/v1/player/models/{pageid}/", f"api/v2/models/{pageid}/sweeps", "api/v2/users/current", f"api/player/models/{pageid}/files", f"api/v1/jsonstore/model/trims/{pageid}"] + f"api/v1/player/models/{pageid}/thumb?width=1707&dpr=1.5&disable=upscale", f"api/v1/player/models/{pageid}/", f"api/v2/models/{pageid}/sweeps", "api/v2/users/current", f"api/player/models/{pageid}/files", f"api/v1/jsonstore/model/trims/{pageid}", "api/v1/plugins?manifest=true"] with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor: for asset in assets: local_file = asset if local_file.endswith('/'): local_file = local_file + "index.html" - executor.submit( - downloadFile, f"https://my.matterport.com/{asset}", local_file) + executor.submit(downloadFile, f"https://my.matterport.com/{asset}", local_file) makeDirs("api/mp/models") with open(f"api/mp/models/graph", "w", encoding="UTF-8") as f: f.write('{"data": "empty"}')