Skip to content

Commit ebc2528

Browse files
Esmeralda SalamoneEvergreen
authored andcommitted
[ShaderGraph] Ensure slot names are refreshed when renamed
1 parent 1ce7e28 commit ebc2528

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Packages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,11 +913,15 @@ public MaterialSlot AddSlot(MaterialSlot slot, bool attemptToModifyExistingInsta
913913
// Try to keep the existing instance to avoid unnecessary changes to file
914914
if (attemptToModifyExistingInstance && foundSlot != null && slot.GetType() == foundSlot.GetType())
915915
{
916-
foundSlot.displayName = slot.RawDisplayName();
916+
if (foundSlot.RawDisplayName() != slot.RawDisplayName())
917+
{
918+
foundSlot.displayName = slot.RawDisplayName();
919+
this.Dirty(ModificationScope.Topological);
920+
}
917921
foundSlot.CopyDefaultValue(slot);
918922
if (foundSlot.hideConnector != slot.hideConnector)
919923
{
920-
foundSlot.hideConnector = slot.hideConnector; // MARK DIRTY
924+
foundSlot.hideConnector = slot.hideConnector;
921925
this.Dirty(ModificationScope.Topological);
922926

923927
if (foundSlot.hideConnector && foundSlot.isConnected)

0 commit comments

Comments
 (0)