Skip to content

Commit

Permalink
Cache render materials in proxy object manager
Browse files Browse the repository at this point in the history
  • Loading branch information
SaladDais committed Jan 9, 2024
1 parent adf5295 commit 4898c85
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hippolyzer/lib/proxy/object_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(
"RequestMultipleObjects",
self._handle_request_multiple_objects,
)
region.http_message_handler.subscribe("RenderMaterials", self._handle_render_materials)

def load_cache(self):
if not self.may_use_vo_cache or self.cache_loaded:
Expand Down Expand Up @@ -100,6 +101,13 @@ def _handle_request_multiple_objects(self, msg: Message):
# Remove any queued cache misses that the viewer just requested for itself
self.queued_cache_misses -= {b["ID"] for b in msg["ObjectData"]}

def _handle_render_materials(self, flow: HippoHTTPFlow):
if flow.response.status_code != 200:
return
if flow.request.method not in ("GET", "POST"):
return
self._process_materials_response(flow.response.content)


class ProxyWorldObjectManager(ClientWorldObjectManager):
_session: Session
Expand Down

0 comments on commit 4898c85

Please sign in to comment.