When an Niagara Parameter Collection (NPC) is selected as the parent Collection for an NPC Instance (NPCI), all of its current parameters are carried over to the NPCI with their current values as the default, non-overriden values. After that, if parameters are added to, removed from, or updated on the NPC, those changes do not get reflected on the NPCI.
Also, unlinking the parent NPC from the NPCI does not cause its parameters to disappear from the list.
Clearing and reselecting the parent NPC on the NPCI forces a resynchronization and everything gets up-to-date correctly, but the same problem continues from that point on.
If the NPCI editor window is closed and reopened, added and removed parameters are synchronized, and from then on any other added/removed parameters are synchronized correctly and automatically. However, parameters that changed values are still not synchronized even after closing and reopening the NPCI editor window.
Possible explanation for the synchronization failure with an NPCI when adding/removing parameters from the parent NPC:
1. TNiagaraViewModelManager::[Un]RegisterViewModelWithMap() is not called when the parent NPC assignment changes on the NPCI.
2. When reopening the NPCI window, that function is reached by the following call chain:
ContentBrowserAssetData::EditItems() ContentBrowserAssetData::EditOrPreviewItems() ContentBrowserAssetData::EditOrPreviewAssetFileItems() UAssetEditorSubsystem::OpenEditorForAssets() UAssetEditorSubsystem::OpenEditorForAssets_Advanced() UAssetEditorSubsystem::OpenEditorForAsset() FAssetDefinitionProxy::OpenAssetEditor() UAssetDefinition_NiagaraParameterCollectionInstance::OpenAssets() FNiagaraParameterCollectionToolkit::Initialize() FNiagaraParameterCollectionAssetViewModel::FNiagaraParameterCollectionAssetViewModel() TNiagaraViewModelManager::RegisterViewModelWithMap()
3. If the viewmodel is not registered correctly, the following call chain fails:
FNiagaraParameterCollectionAssetViewModel::CollectionChanged() FNiagaraParameterCollectionAssetViewModel::UpdateOpenInstances() FNiagaraParameterCollectionAssetViewModel::GetAllViewModelsForObject()
1. Create a Niagara Parameter Collection (NPC)
2. Open the NPC and add two float parameters
3. Create a Niagara Parameter Collection Instance (NPCI)
4. Open the NPCI and set the NPC as its parent Collection.
4.1. The float parameters on the NPC are correctly carried over to the NPCI
5. Make each of the following changes to the NPC:
5.1. Delete a float parameter
5.2. Change the value of the other float parameter
5.3. Add a new float parameter
6. Note that none of the changes above are carried over to the NPC, even after saving the assets (bug).
7. Close and reopen the NPCI editor. Changes are now synchronized.
8. Repeat the tests on step 5.
8.1. This time, parameter adds and removals are automatically carried over to the NPCI. Parameter value changes are not (bug).
9. Unlink the NPC by clearing the NPCI's parent Collection
9.1. The existing parameters on the NPCI are unaffected (bug)
10. Make more changes to the parent NPC, or create another one with different parameters, and relink as the NPCI's parent.
10.1. All parameters are now fully correctly synchronized.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-226654 in the post.
0 |
Component | UE - Niagara |
---|---|
Affects Versions | 5.4.4 |
Created | Oct 4, 2024 |
---|---|
Updated | Oct 22, 2024 |