McManning / Coherence

Blender viewport renderer using the Unity Engine
MIT License
30 stars 0 forks source link

Add support for arbitrary byte data in component props #41

Closed McManning closed 2 years ago

McManning commented 3 years ago

Looking over my network refactoring notes - I've settled on simplifying things down further than originally planned. I really don't want to go down the road of exposing raw network read/write stream functionality out of LibCoherence to support overly complicated scenarios.

Instead - I'm just going to go the route of allowing arbitrary data packing right into component props. I'm going to assume that's sufficient to handle plenty of third party requirements, since we can easily write change detection on those properties on the Unity side of things and hide those properties from the Blender UI. It then lets us automatically bind them to specific scene objects + components for tracking. For anything that needs to be "global" I'd just recommend that the properties should be attached to some sort of global master scene object (much like Unity often does for singleton "Game Master"-type GOs)

The tl;dr of this ends up being:

  1. Add InteropPropertyType.Bytes
  2. Refactor InteropProperty into size + byte data instead of the current lazy intValue/stringValue/vectorValue fixed struct.
  3. Write up some guidance/samples on passing more arbitrary data into properties on the Unity side.

Bonus work - maybe figure out how to automatically massage the data into the proper type on Unity's side of things. So someone can declare a property like BoneStruct[] bones on their Unity component and we can auto-convert the raw byte data over to the arrayable.

McManning commented 2 years ago

Resolved as part of the new C++ core