> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/scene-fusion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager.md).

# Class sfPropertyManager

Namespace: [KS.SceneFusion.Client.Unity.Editor](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

Manages syncing of serialized properties. Converts between sfProperties and serialized properties.

```csharp
public class sfPropertyManager
```

#### Inheritance

object ← [sfPropertyManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager.md)

## Properties

### Blacklist <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_blacklist" id="ks_scenefusion_client_unity_editor_sfpropertymanager_blacklist"></a>

Properties to exclude from syncing.

```csharp
public sfTypePropertyNameMap Blacklist { get; }
```

#### Property Value

[sfTypePropertyNameMap](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sftypepropertynamemap.md)

### SyncedHiddenProperties <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_syncedhiddenproperties" id="ks_scenefusion_client_unity_editor_sfpropertymanager_syncedhiddenproperties"></a>

Hidden properties to sync.

```csharp
public sfTypePropertyNameMap SyncedHiddenProperties { get; }
```

#### Property Value

[sfTypePropertyNameMap](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sftypepropertynamemap.md)

## Methods

### ApplyProperties(Object, sfDictionaryProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_applyproperties_unityengine_object_ks_scenefusi" id="ks_scenefusion_client_unity_editor_sfpropertymanager_applyproperties_unityengine_object_ks_scenefusi"></a>

Applies property values from an sfDictionaryProperty to an object using Unity serialization.

```csharp
public void ApplyProperties(Object uobj, sfDictionaryProperty dict)
```

#### Parameters

`uobj` Object

uobj to apply property values to.

`dict` [sfDictionaryProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfdictionaryproperty.md)

dict to get property values from. If a value for a property is not in the dictionary, sets the property to its default value.

### ApplySerializedProperties() <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_applyserializedproperties" id="ks_scenefusion_client_unity_editor_sfpropertymanager_applyserializedproperties"></a>

Applies serialized properties to all cached serialized objects. Invokes post property and post uobject change events on translators for the modified uobjects.

```csharp
public void ApplySerializedProperties()
```

### ApplySerializedProperties(Object) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_applyserializedproperties_unityengine_object" id="ks_scenefusion_client_unity_editor_sfpropertymanager_applyserializedproperties_unityengine_object"></a>

Applies serialized properties from the cached serialized object for a uobject and removes it from the cache. Invokes post property and post uobject change events on the uobject's translator for the modified properties.

```csharp
public void ApplySerializedProperties(Object uobj)
```

#### Parameters

`uobj` Object

### Copy(sfBaseProperty, sfBaseProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_copy_ks_scenefusion_sfbaseproperty_ks_scenefusi" id="ks_scenefusion_client_unity_editor_sfpropertymanager_copy_ks_scenefusion_sfbaseproperty_ks_scenefusi"></a>

Copies the data from one property into another if they are the same property type.

```csharp
public bool Copy(sfBaseProperty dest, sfBaseProperty src)
```

#### Parameters

`dest` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

dest to copy into.

`src` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

src to copy from.

#### Returns

bool

false if the properties were not the same type.

### CopyList(sfListProperty, sfListProperty, ListChangeCallback) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_copylist_ks_scenefusion_sflistproperty_ks_scene" id="ks_scenefusion_client_unity_editor_sfpropertymanager_copylist_ks_scenefusion_sflistproperty_ks_scene"></a>

Adds, removes, and/or sets elements in a destination list to make it the same as a source list.

```csharp
public void CopyList(sfListProperty dest, sfListProperty src, sfPropertyManager.ListChangeCallback changeCallback = null)
```

#### Parameters

`dest` [sfListProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sflistproperty.md)

dest to modify.

`src` [sfListProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sflistproperty.md)

src to make dest a copy of.

`changeCallback` [sfPropertyManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager.md).[ListChangeCallback](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager/ks.scenefusion.client.unity.editor.sfpropertymanager.listchangecallback.md)

changeCallback to call for added or removed elements. Called after adding elements and before removing elements.

### CreateProperties(Object, sfDictionaryProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_createproperties_unityengine_object_ks_scenefus" id="ks_scenefusion_client_unity_editor_sfpropertymanager_createproperties_unityengine_object_ks_scenefus"></a>

Iterates all properties of an object using Unity serialization and creates sfProperties for properties with non-default values as fields in an sfDictionaryProperty.

```csharp
public void CreateProperties(Object uobj, sfDictionaryProperty dict)
```

#### Parameters

`uobj` Object

uobj to create properties for.

`dict` [sfDictionaryProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfdictionaryproperty.md)

dict to add properties to.

### Get() <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_get" id="ks_scenefusion_client_unity_editor_sfpropertymanager_get"></a>

```csharp
public static sfPropertyManager Get()
```

#### Returns

[sfPropertyManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager.md)

singleton instance.

### GetGeneric(SerializedProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_getgeneric_unityeditor_serializedproperty" id="ks_scenefusion_client_unity_editor_sfpropertymanager_getgeneric_unityeditor_serializedproperty"></a>

Gets a generic serialized property value converted to an sfProperty.

```csharp
public sfBaseProperty GetGeneric(SerializedProperty sprop)
```

#### Parameters

`sprop` SerializedProperty

sprop to convert.

#### Returns

[sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

converted property.

### GetParentProperty(SerializedProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_getparentproperty_unityeditor_serializedpropert" id="ks_scenefusion_client_unity_editor_sfpropertymanager_getparentproperty_unityeditor_serializedpropert"></a>

Gets the parent property of a serialized property.

```csharp
public SerializedProperty GetParentProperty(SerializedProperty prop)
```

#### Parameters

`prop` SerializedProperty

prop to get parent for.

#### Returns

SerializedProperty

parent property.

### GetSerializedObject(Object) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_getserializedobject_unityengine_object" id="ks_scenefusion_client_unity_editor_sfpropertymanager_getserializedobject_unityengine_object"></a>

Gets the cached serialized object for a uobject if one exists, otherwise creates one and caches it. Modifications to the serialized object will be applied when Scene Fusion finishes processing updates from the server, or when ApplySerializedProperties is called. If you need to modify a UObject in response to a Scene Fusion event, you should call this function and apply your changes to the returned serialized object to avoid those changes be overwriten by later updates, or call ApplySerializedProperties before making your changes.

```csharp
public SerializedObject GetSerializedObject(Object uobj)
```

#### Parameters

`uobj` Object

uobj to get serialized object for.

#### Returns

SerializedObject

### GetSerializedProperty(SerializedObject, sfBaseProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_getserializedproperty_unityeditor_serializedobj" id="ks_scenefusion_client_unity_editor_sfpropertymanager_getserializedproperty_unityeditor_serializedobj"></a>

Gets the serialized property for an sfBaseProperty.

```csharp
public SerializedProperty GetSerializedProperty(SerializedObject so, sfBaseProperty prop)
```

#### Parameters

`so` SerializedObject

`prop` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

prop to get serialized property for.

#### Returns

SerializedProperty

### GetSerializedProperty(SerializedObject, sfDictionaryProperty, string) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_getserializedproperty_unityeditor_serializedobj" id="ks_scenefusion_client_unity_editor_sfpropertymanager_getserializedproperty_unityeditor_serializedobj"></a>

Gets the serialized property for field of a sfDictionaryProperty.

```csharp
public SerializedProperty GetSerializedProperty(SerializedObject so, sfDictionaryProperty dict, string name)
```

#### Parameters

`so` SerializedObject

`dict` [sfDictionaryProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfdictionaryproperty.md)

dict to get serialized property for.

`name` string

name of the field to get serialized property for.

#### Returns

SerializedProperty

### GetValue(SerializedProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_getvalue_unityeditor_serializedproperty" id="ks_scenefusion_client_unity_editor_sfpropertymanager_getvalue_unityeditor_serializedproperty"></a>

Converts a serialized property to an sfProperty.

```csharp
public sfBaseProperty GetValue(SerializedProperty sprop)
```

#### Parameters

`sprop` SerializedProperty

#### Returns

[sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

### HasSameProperties(Object, sfDictionaryProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_hassameproperties_unityengine_object_ks_scenefu" id="ks_scenefusion_client_unity_editor_sfpropertymanager_hassameproperties_unityengine_object_ks_scenefu"></a>

Checks if a uobject has the same serialized property values as a dictionary property, and that properties that are missing from the dictionary have the default value.

```csharp
public bool HasSameProperties(Object uobj, sfDictionaryProperty dict)
```

#### Parameters

`uobj` Object

uobj to check property values of.

`dict` [sfDictionaryProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfdictionaryproperty.md)

dict to check property values against.

#### Returns

bool

true if the uobject's serialized properties have the same values as the dictionary properties, and that properties that are missing from the dictionary have the default value.

### IsDefaultValue(SerializedProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_isdefaultvalue_unityeditor_serializedproperty" id="ks_scenefusion_client_unity_editor_sfpropertymanager_isdefaultvalue_unityeditor_serializedproperty"></a>

Checks if a serialized property has its default value. For non-prefab properties, this checks against the default script value.

```csharp
public bool IsDefaultValue(SerializedProperty sprop)
```

#### Parameters

`sprop` SerializedProperty

#### Returns

bool

true if the property has its default value.

### Iterate(SerializedProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_iterate_unityeditor_serializedproperty" id="ks_scenefusion_client_unity_editor_sfpropertymanager_iterate_unityeditor_serializedproperty"></a>

Iterates all syncable root properties or subproperties of a property. To iterate root properties, call this on the iterator returned by serializedObject.GetIterator().

```csharp
public IEnumerable<SerializedProperty> Iterate(SerializedProperty property)
```

#### Parameters

`property` SerializedProperty

property to iterate the syncable subproperties of. If this is the iterator returned by serializedObject.GetIterator(), it will iterate the root properties.

#### Returns

IEnumerable\<SerializedProperty>

### OnModifyProperties(UndoPropertyModification\[]) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_onmodifyproperties_unityeditor_undopropertymodi" id="ks_scenefusion_client_unity_editor_sfpropertymanager_onmodifyproperties_unityeditor_undopropertymodi"></a>

Called when Unity serialized properties change. If the user is not dragging an asset, processes the changes now. Otherwise processes the changes at the end of the frame unless an undo occurs between now in then, in which case the changes are discarded. This is to prevent sending spam changes when dragging assets such as materials into the scene which can trigger a property change and an undo every single frame.

```csharp
public UndoPropertyModification[] OnModifyProperties(UndoPropertyModification[] modifications)
```

#### Parameters

`modifications` UndoPropertyModification\[]

#### Returns

UndoPropertyModification\[]

modifications that are allowed.

### OnSPropertyChange(string) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_onspropertychange_system_string" id="ks_scenefusion_client_unity_editor_sfpropertymanager_onspropertychange_system_string"></a>

Gets the serialized property change event map for a property.

```csharp
public sfTypeEventMap<sfPropertyManager.SPropertyChangeHandler> OnSPropertyChange(string name)
```

#### Parameters

`name` string

name of property to get event map for.

#### Returns

[sfTypeEventMap](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sftypeeventmap-1.md)<[sfPropertyManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager.md).[SPropertyChangeHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager/ks.scenefusion.client.unity.editor.sfpropertymanager.spropertychangehandler.md)>

### QueuePropertyChangeEvent(Object, sfBaseProperty, string) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_queuepropertychangeevent_unityengine_object_ks" id="ks_scenefusion_client_unity_editor_sfpropertymanager_queuepropertychangeevent_unityengine_object_ks"></a>

Queues a post property change event to be invoked when properties are applied to cached serialized objects, either when Scene Fusion finishes processing updates from the server, or when ApplySerializedProperties is called.

```csharp
public void QueuePropertyChangeEvent(Object uobj, sfBaseProperty property, string name = null)
```

#### Parameters

`uobj` Object

uobj with the changed property.

`property` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

property that changed.

`name` string

if non-empty, the name of the sub-property that was removed from a dictionary property.

### SendPropertyChanges(Object, sfDictionaryProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_sendpropertychanges_unityengine_object_ks_scene" id="ks_scenefusion_client_unity_editor_sfpropertymanager_sendpropertychanges_unityengine_object_ks_scene"></a>

Iterates all properties of an object and updates an sfDictionaryProperty when its values are different from those on the object. Removes fields from the dictionary for properties that have their default value.

```csharp
public void SendPropertyChanges(Object uobj, sfDictionaryProperty dict)
```

#### Parameters

`uobj` Object

uobj to iterate properties on.

`dict` [sfDictionaryProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfdictionaryproperty.md)

dict to update.

### SetGeneric(SerializedProperty, sfBaseProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_setgeneric_unityeditor_serializedproperty_ks_sc" id="ks_scenefusion_client_unity_editor_sfpropertymanager_setgeneric_unityeditor_serializedproperty_ks_sc"></a>

Sets a generic serialized property to a value from an sfProperty.

```csharp
public bool SetGeneric(SerializedProperty sprop, sfBaseProperty prop)
```

#### Parameters

`sprop` SerializedProperty

sprop to set.

`prop` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

prop to get value from.

#### Returns

bool

true if the property changed.

### SetReferences(Object, sfReferenceProperty\[], bool) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_setreferences_unityengine_object_ks_scenefusion" id="ks_scenefusion_client_unity_editor_sfpropertymanager_setreferences_unityengine_object_ks_scenefusion"></a>

Sets an array of references to the given uobject.

```csharp
public void SetReferences(Object uobj, sfReferenceProperty[] references, bool setDirty = true)
```

#### Parameters

`uobj` Object

uobj to set references to.

`references` [sfReferenceProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfreferenceproperty.md)\[]

references to set to the uobject.

`setDirty` bool

if false, will not set objects with changed references dirty.

### SetToDefaultValue(SerializedProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_settodefaultvalue_unityeditor_serializedpropert" id="ks_scenefusion_client_unity_editor_sfpropertymanager_settodefaultvalue_unityeditor_serializedpropert"></a>

Sets a serialized property to its default value. For non-prefab properties, this sets it to the default script value.

```csharp
public void SetToDefaultValue(SerializedProperty sprop)
```

#### Parameters

`sprop` SerializedProperty

sprop to set to default value.

### SetValue(SerializedProperty, sfBaseProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_setvalue_unityeditor_serializedproperty_ks_scen" id="ks_scenefusion_client_unity_editor_sfpropertymanager_setvalue_unityeditor_serializedproperty_ks_scen"></a>

Sets a serialized property to a value from an sfProperty.

```csharp
public bool SetValue(SerializedProperty sprop, sfBaseProperty prop)
```

#### Parameters

`sprop` SerializedProperty

sprop to set.

`prop` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

#### Returns

bool

true if the value changed.

### Start() <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_start" id="ks_scenefusion_client_unity_editor_sfpropertymanager_start"></a>

Registers event handlers for syncing property changes.

```csharp
public void Start()
```

### Stop() <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_stop" id="ks_scenefusion_client_unity_editor_sfpropertymanager_stop"></a>

Destroys the default object used for getting default property values and unregisters event handlers.

```csharp
public void Stop()
```

### UpdateDictProperty(sfDictionaryProperty, string, sfBaseProperty) <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_updatedictproperty_ks_scenefusion_sfdictionaryp" id="ks_scenefusion_client_unity_editor_sfpropertymanager_updatedictproperty_ks_scenefusion_sfdictionaryp"></a>

Updates a subproperty of a dictionary if the value is different from the current value.

```csharp
public void UpdateDictProperty(sfDictionaryProperty dict, string field, sfBaseProperty property)
```

#### Parameters

`dict` [sfDictionaryProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfdictionaryproperty.md)

dict to update.

`field` string

name of field to update.

`property` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

property value to set.

### OnMissingObject <a href="#ks_scenefusion_client_unity_editor_sfpropertymanager_onmissingobject" id="ks_scenefusion_client_unity_editor_sfpropertymanager_onmissingobject"></a>

Invoked when a reference to a missing object that cannot be synced is found.

```csharp
public event sfPropertyManager.MissingObjectHandler OnMissingObject
```

#### Event Type

[sfPropertyManager](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager.md).[MissingObjectHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfpropertymanager/ks.scenefusion.client.unity.editor.sfpropertymanager.missingobjecthandler.md)
