For example, create one material instance with two float4 parameters, then right click “Parameter Groups” and select copy all properties, then in the debugger we can find this two float4 parameters treated as same name.
[Attachment Removed]
For example, create one material instance with two float4 parameters, then right click “Parameter Groups” and select copy all properties, then in the debugger we can find this two float4 parameters treated as same name.
[Attachment Removed]
Hi Huafu,
Thanks for your question. MaterialInstance editing is governed significantly by a details customization (FMaterialInstanceParameterDetails). Internally this customization adds the “Parameter Groups” category to the details panel, grouping the UMaterialEditorInstanceConstant::ParameterGroups into a category with subcategories by type. There are specific copy/paste override actions that have been added so that copying a subcategory will result in unambiguous clipboard data:
Param.Override=True,Param.Value="(R=0.000000,G=0.000000,B=0.000000,A=0.000000)",Param_1.Override=True,Param_1.Value="(R=0.000000,G=0.000000,B=0.000000,A=0.000000)"Internally this customization is virtually hoisting the subobjects of type UDEditorParameterValue up to the view of the Material Instance in the editor by adding them as direct property rows of the subcategory. I believe here is where you might be running into trouble with respect to copying the “Parameter Group” category.
You will end up with something along the lines of:
{
"Tagged": [
[
"ParameterValue",
"(R=0.000000,G=0.000000,B=0.000000,A=0.000000)"
],
[
"ParameterValue.R",
"0.000000"
],
[
"ParameterValue.G",
"0.000000"
],
[
"ParameterValue.B",
"0.000000"
],
[
"ParameterValue.A",
"0.000000"
]
]
}
The copy action on the Parameter Group category does not have a copy/paste override (as far as I can tell). Instead, it falls back to the default copy-paste implemented for SDetailCategoryTagleRow (see: FPropertyEditorClipboard::ClipboardCopy). A breakpoint in `SDetailCategoryTableRow::OnCopyCategory()` should give you an idea of how the Property Handles ended up being laid out to enable the earlier grouping. All of the objects that these properties represent are UDEditorParameterValue, which contain the “ParameterValue” property.
This is where the multiple same named parameters come from - there are actually several UDEditorParameterValue all with the same “ParameterValue” property. When we copy it, the system falls back to tagged property json serialization and amalgamates them into one which has dubious usefulness here. This is a result of the details customization for material instance manipulating the Property Node tree in order to organize the nodes in a way to be grouped together as they are.
I hope that answers your immediate question. However, what I would like to know is what you are trying to accomplish? Is the issue that you wanted to copy the entire Parameter Group and paste it elsewhere?
Logan
[Attachment Removed]