Skip to content

Commit aa1ab1f

Browse files
committed
feat: add model thumbnail support
certain games may opt to use roblox-generated thumbnails as decal textures. since we're already using the roblox thumbnail api, we can pipe `/Thumbs/Asset.ashx` through there too. obviously, due to old assets, certain games may not have those assets correctly rendered. a good example would be work at a pizza place, which used to utilize the pizza model thumbnail as the cashier button. its model has since changed, so now all 3 pizzas appear the same. but you can always either modify the place itself or replace the rbxthmb asset in the cache.
1 parent 3b7871b commit aa1ab1f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Source/assets/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def resolve_asset_version_id(self, id_str: str | None) -> int | None:
110110
def resolve_asset_query(self, query: dict[str, str]) -> int | str | None:
111111
candidate_funcs = [
112112
(query.get('id'), self.resolve_asset_id),
113+
(query.get('aid'), self.resolve_asset_id),
114+
(query.get('AssetID'), self.resolve_asset_id),
113115
(query.get('assetversionid'), self.resolve_asset_version_id),
114116
]
115117

Source/web_server/endpoints/assets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ def _(self: web_server_handler) -> bool:
6060
return True
6161

6262
@server_path('/Game/Tools/ThumbnailAsset.ashx')
63+
@server_path('/Thumbs/Asset.ashx') # we can pass this too since we're calling rbx api regardless
6364
def _(self: web_server_handler) -> bool:
6465
asset_cache = self.game_config.asset_cache
65-
asset_id = self.query["aid"]
66+
asset_id = asset_cache.resolve_asset_query(self.query)
6667
if asset_id is None:
6768
self.send_error(404)
6869
return True

0 commit comments

Comments
 (0)