Expose parent sync in editor UX
This commit is contained in:
parent
3845c5a1e1
commit
0c36d32276
5 changed files with 20 additions and 3 deletions
|
|
@ -124,6 +124,12 @@ class BrokkrPreferences(bpy.types.AddonPreferences):
|
|||
description="Synchronize object transforms",
|
||||
)
|
||||
|
||||
sync_parent: bpy.props.BoolProperty(
|
||||
name="Sync Parent",
|
||||
default=True,
|
||||
description="Synchronize object parent relationships",
|
||||
)
|
||||
|
||||
sync_material: bpy.props.BoolProperty(
|
||||
name="Sync Material",
|
||||
default=True,
|
||||
|
|
@ -254,6 +260,7 @@ class BrokkrPreferences(bpy.types.AddonPreferences):
|
|||
layout.prop(self, "unity_object_id")
|
||||
layout.prop(self, "unity_object_path")
|
||||
layout.prop(self, "sync_transform")
|
||||
layout.prop(self, "sync_parent")
|
||||
layout.prop(self, "sync_material")
|
||||
layout.prop(self, "sync_visibility")
|
||||
layout.prop(self, "sync_custom_properties")
|
||||
|
|
@ -417,6 +424,7 @@ class BROKKR_OT_publish_object_sync(bpy.types.Operator):
|
|||
prefs.unity_object_id,
|
||||
prefs.unity_object_path,
|
||||
prefs.sync_transform,
|
||||
prefs.sync_parent,
|
||||
prefs.sync_material,
|
||||
prefs.sync_visibility,
|
||||
prefs.sync_custom_properties,
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ class BrokkrBlenderTarget:
|
|||
unity_object_id: str,
|
||||
unity_path: str,
|
||||
sync_transform: bool,
|
||||
sync_parent: bool,
|
||||
sync_material: bool,
|
||||
sync_visibility: bool,
|
||||
sync_custom_properties: bool,
|
||||
|
|
@ -176,6 +177,7 @@ class BrokkrBlenderTarget:
|
|||
node.database.put(documents["sync_session"], f"sync/sessions/{normalized_session_id}", session)
|
||||
node.database.put(documents["sync_object_binding"], f"sync/bindings/objects/{binding_id}", binding)
|
||||
self._put_sync_var(node, documents, normalized_session_id, binding_id, "transform", "Transform", "Transform", "location,rotationEuler,scale", "blender-to-unity", sync_transform, "linear", now)
|
||||
self._put_sync_var(node, documents, normalized_session_id, binding_id, "parent", "Parent", "parentId", "parentName", "blender-to-unity", sync_parent, "step", now)
|
||||
self._put_sync_var(node, documents, normalized_session_id, binding_id, "active-state", "Active State", "m_IsActive", "visible", "blender-to-unity", sync_visibility, "step", now)
|
||||
self._put_sync_var(node, documents, normalized_session_id, binding_id, "material", "Material", "Renderer.m_Materials", "materials", "blender-to-unity", sync_material, "step", now)
|
||||
unity_custom_path = _unity_custom_property_path(
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ owns the mirror state.
|
|||
9. Use the reported `cultnet://host:port` endpoint from a CultMesh/CultNet
|
||||
client to read snapshots or write command intents.
|
||||
10. Select a Blender object and click `Object Sync` to publish a
|
||||
`brokkr.sync.object_binding.v0` plus per-lane `brokkr.sync.var.v0` records.
|
||||
`brokkr.sync.object_binding.v0` plus per-lane `brokkr.sync.var.v0` records
|
||||
for transform, parent, visibility, material, and custom property sync.
|
||||
11. Click `Timeline Sync` to publish a `brokkr.sync.timeline_binding.v0` for
|
||||
Blender frame/action data and Unity Timeline/Cinemachine lanes.
|
||||
12. After running `brokkr-daemon sync-once` or `sync-loop`, click
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ namespace GameCult.Brokkr.Editor
|
|||
private string blenderCollectionName = "";
|
||||
private bool syncObjectEnabled = true;
|
||||
private bool syncTransform = true;
|
||||
private bool syncParent = true;
|
||||
private bool syncActiveState = true;
|
||||
private bool syncMaterial;
|
||||
private bool syncCustomProperty;
|
||||
|
|
@ -256,6 +257,7 @@ namespace GameCult.Brokkr.Editor
|
|||
blenderCollectionName = EditorGUILayout.TextField("Blender Collection", blenderCollectionName);
|
||||
syncObjectEnabled = EditorGUILayout.Toggle("Enable Object Binding", syncObjectEnabled);
|
||||
syncTransform = EditorGUILayout.Toggle("Sync Transform", syncTransform);
|
||||
syncParent = EditorGUILayout.Toggle("Sync Parent", syncParent);
|
||||
syncActiveState = EditorGUILayout.Toggle("Sync Active State", syncActiveState);
|
||||
syncMaterial = EditorGUILayout.Toggle("Sync Material", syncMaterial);
|
||||
syncCustomProperty = EditorGUILayout.Toggle("Sync Custom Property", syncCustomProperty);
|
||||
|
|
@ -552,6 +554,7 @@ namespace GameCult.Brokkr.Editor
|
|||
mirror.PublishSyncSessionAsync(session).GetAwaiter().GetResult();
|
||||
mirror.PublishSyncObjectBindingAsync(binding).GetAwaiter().GetResult();
|
||||
PublishSyncVar(bindingId, "transform", "Transform", "m_LocalPosition,m_LocalRotation,m_LocalScale", "location,rotationEuler,scale", syncTransform, "linear", now);
|
||||
PublishSyncVar(bindingId, "parent", "Parent", "parentId", "parentName", syncParent, "step", now);
|
||||
PublishSyncVar(bindingId, "active-state", "Active State", "m_IsActive", "visible", syncActiveState, "step", now);
|
||||
PublishSyncVar(bindingId, "material", "Material", "Renderer.m_Materials", "materials", syncMaterial, "step", now);
|
||||
if (syncCustomProperty)
|
||||
|
|
|
|||
|
|
@ -35,10 +35,13 @@ In Unity:
|
|||
8. To instantiate or variant a prefab through the mirror, fill `Prefab Asset
|
||||
Path`, optional `Instance Name`, and optional `Variant Path`, then click the
|
||||
matching prefab command.
|
||||
9. With the mirror running, run `brokkr-daemon sync-once` or `sync-loop`, then
|
||||
9. To publish object sync policy, select a GameObject, set the object lane
|
||||
toggles including transform, parent, active state, material, and property
|
||||
lanes, then click `Publish Object Sync`.
|
||||
10. With the mirror running, run `brokkr-daemon sync-once` or `sync-loop`, then
|
||||
click `Poll Sync Receipt` or leave the window open to show the latest daemon
|
||||
sync pass receipt.
|
||||
10. To publish an ad hoc sync variable, fill `Ad Hoc Sync Var` with a binding id
|
||||
11. To publish an ad hoc sync variable, fill `Ad Hoc Sync Var` with a binding id
|
||||
or leave it blank for a generated id, set kind/paths/authority/interpolation,
|
||||
then click `Publish Sync Var`.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue