Synchronize Object Color (Unreal Editor)

The following steps will setup a basic scene to synchronize a Vector parameter.

  • Object material color (Color Vector)

Sample_02_ObjectColor.png

1. Reference Space Connection

image-20240506-193022.png

a. Attempting to post a property update to a Space before the connection is complete will throw an error.

b. The Cavrnus blueprint “Await Any Space Connection” allows you to bind a custom event that will be issued once the connection is made.

c. This technique assures that no updates will be attempted until a valid Space is connected.

d. Store a pointer to the Space as a variable. This will serve as a convenient reference for future steps.

2. Bind UI Properties to Journal

In this example, there is no feedback in the menu that requires update from the Journal. The SetupUI event flows straight to the Post Property blueprint.

a. The variables reference the connected Space, the color options, and data location strings for the Journal.

i. Space Connection: The reference to the Cavrnus Space assigned in Step 1.

ii. Container Name: The name of the container (String) in the Journal where the property value can be located. (NB: This is Case Sensitive.)

iii. Property Name: The name of the property (String) in the Journal that stores the specific property value. (NB: This is Case Sensitive).

iv. Colors: An array of color vectors corresponding to the menu options.

c. From here, the “Set Up” function flows straight to Step 4.

 

3. Bind Scene Properties to Journal

In this example, the parameter to bind is the “BaseColor” property of the Dynamic Material Instance (MID). This property expects a color vector, so we first assign the MID to the static mesh, then bind the “BaseColor” setter function to the Color Property Value function with the corresponding container/property location in the Journal.

a. Use a custom event to bind the “BaseColor” property of the object’s material to the Journal. This will trigger an update to the local instance when changes are made to that container/property in the Journal.

b. The variable references are the same as above, corresponding to the connected Space, and the Container/Property string values.

c. When the Container/Parameter value in the Journal is updated, the value is assigned to the BaseColor of the Sphere’s material.

 

4. Post Color Property Updates From Interaction

The last step in the cycle is to post updates to the Journal as changes are made in the local scene. In this case, this step flows through the menu widget from Step 2.

a. Trigger the update using an event trigger in the scene. Be sure to use an event trigger that will occur frequently enough to keep the Journal current. However, avoid generating too many updates from high frequency events, such as Tick events.

b. Post the Color Property using the Cavrnus “Post Color Property Update” blueprint.

c. Be sure to confirm Container and Property string values match with other users connected to your Space.

 


References:

For more information on these Cavrnus blueprints, refer to the Cavrnus API Reference .


 

Next Steps

The object in the scene is configured to toggle on and off in sync with both the local UI and the Journal. Next, let’s Synchronize Light Colors and Materials!