Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds infrastructure for synchronizing scene state over the network by introducing new network messages for object/layer/parameter/array updates and extending serialization to support proxy arrays and parameter enable state.
Changes:
- Added a set of
StructuredMessagetypes to transfer scene deltas (new/remove object, parameter change/remove, layer updates, array data transfer). - Extended DataTree serialization utilities (now public APIs) to support proxy-array serialization and parameter
enabledstate. - Updated network demo client/server to use the new message types and unified ping handling.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tsd/src/tsd/ui/imgui/Application.cpp | Updates app-state save to call new save_Scene(..., forceProxyArrays) signature. |
| tsd/src/tsd/network/messages/TransferScene.hpp / .cpp | Adds includeArrayData flag; forces proxy arrays by default for scene transfer. |
| tsd/src/tsd/network/messages/TransferLayer.hpp / .cpp | New message to send layer contents and apply them remotely. |
| tsd/src/tsd/network/messages/TransferArrayData.hpp / .cpp | New message to send array payloads and apply them remotely. |
| tsd/src/tsd/network/messages/NewObject.hpp / .cpp | New message to send object creation (and currently array serialization too). |
| tsd/src/tsd/network/messages/ParameterChange.hpp / .cpp | New message to send parameter updates. |
| tsd/src/tsd/network/messages/ParameterRemove.hpp / .cpp | New message to remove parameters. |
| tsd/src/tsd/network/messages/RemoveObject.hpp / .cpp | New message to remove objects. |
| tsd/src/tsd/network/NetworkChannel.hpp / .cpp | Adds send(type) overload for empty-payload messages. |
| tsd/src/tsd/network/CMakeLists.txt | Adds new message sources to the build. |
| tsd/src/tsd/io/serialization/serialization_datatree.cpp | Makes serialization helpers public; adds proxy array support and parameter enabled serialization. |
| tsd/src/tsd/io/serialization.hpp | Exposes the new/expanded serialization API surface and updates save_Scene signature. |
| tsd/src/tsd/core/scene/objects/Array.hpp / .cpp | Adds convenience helpers (isCUDA/isProxy/...) and reorders accessors. |
| tsd/src/tsd/core/scene/Scene.hpp / .cpp | Adds createObject(type, subtype), createArrayProxy(), getLayerName(); updates save_Scene friend signature. |
| tsd/src/tsd/core/Forest.hpp | Adds Forest::clear() used by layer deserialization. |
| tsd/apps/interactive/demos/network/server/RenderServer.hpp / .cpp | Registers handlers for new scene-delta messages; adds guarded set_Mode(). |
| tsd/apps/interactive/demos/network/client/tsdTestClient.cpp | Switches to unified PING message type. |
| tsd/apps/interactive/demos/network/client/tsdRemoteViewer.cpp | Uses heap-owned NetworkUpdateDelegate and disables it during full scene transfer. |
| tsd/apps/interactive/demos/network/client/NetworkUpdateDelegate.hpp / .cpp | Implements update signals by emitting the new network messages. |
| tsd/apps/interactive/demos/network/RenderSession.hpp | Extends message enum with new delta message types and unified PING. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| auto msg = tsd::network::messages::TransferLayer( | ||
| m_scene, const_cast<tsd::core::Layer *>(l)); | ||
| m_channel->send(MessageType::SERVER_UPDATE_LAYER, std::move(msg)); |
There was a problem hiding this comment.
signalLayerUpdated() repeats the const_cast workaround when constructing TransferLayer. It would be cleaner/safer to make the message/serialization API accept const Layer&/const Layer* so this cast isn't needed.
| auto msg = tsd::network::messages::TransferLayer( | |
| m_scene, const_cast<tsd::core::Layer *>(l)); | |
| m_channel->send(MessageType::SERVER_UPDATE_LAYER, std::move(msg)); | |
| // Reuse the layer transfer logic from signalLayerAdded to avoid | |
| // duplicating the const_cast workaround. | |
| signalLayerAdded(l); |
| auto msg = tsd::network::messages::TransferLayer( | ||
| m_scene, const_cast<tsd::core::Layer *>(l)); | ||
| m_channel->send(MessageType::SERVER_UPDATE_LAYER, std::move(msg)); |
There was a problem hiding this comment.
signalLayerAdded() uses const_cast to pass a const Layer* into TransferLayer. This makes it easy to accidentally mutate layer state from a const context and hides API intent. Prefer updating TransferLayer/tsd::io::layerToNode() to accept const Layer& (and/or a const Layer*) so the call site stays const-correct.
No description provided.