Change material parameter collection from editor plugin

Hello,

I am currently trying to change the default value of a material parameter collection from an editor button.
I made a lot of try, commenting/uncommenting some lines, but I did not find a way to make it work.

// Update the asset
// scalarParameter.DefaultValue = (scalarParameter.DefaultValue > 0.5f) ? 0.0f : 1.0f;
// mpc->PostEditChange();
//mpc->MarkPackageDirty();
//package->MarkPackageDirty();
//UPackage::SavePackage(package, nullptr, EObjectFlags::RF_Public, *PackagePath.ToString());

// Update the world parameter collection instance
UWorld* world = GEditor->GetEditorWorldContext().World();
if (world != nullptr)
{
	UKismetMaterialLibrary::SetScalarParameterValue(world, mpc, ParameterName, (scalarParameter.DefaultValue > 0.5f) ? 0.0f : 1.0f);
	// world->UpdateParameterCollectionInstances(true);
	//UMaterialParameterCollectionInstance* mpci = world->GetParameterCollectionInstance(mpc);
	//mpci->PostEditChange();
}

Whenever theses lines are called, it seems to break a link between the Material Parameter Collection asset, and the one used in the level. After the call, changing the value in the Material Parameter Collection manually does not work anymore (I have to reload the level).

Any clue ?

I noticed this issue too in 4.10, didn’t have this problem in 4.9. I set MPC parameter values from custom c++ actor in editor mode (before playing), add new parameter to collection through editor, then collection seems broken.

Same issue (using 4.10 too)

anyone know if this has been fixed in 4.11 ?

Still fighting this issue in 4.13