2022-05-23 14:56:04 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
#include "SMetasoundGraphNodeComment.h"
|
|
|
|
|
|
|
|
|
|
#include "EdGraphNode_Comment.h"
|
2022-10-26 12:57:32 -04:00
|
|
|
#include "Framework/Application/SlateApplication.h"
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
#include "MetasoundEditorGraphCommentNode.h"
|
2022-05-23 14:56:04 -04:00
|
|
|
#include "MetasoundEditorGraphNode.h"
|
|
|
|
|
|
|
|
|
|
namespace Metasound
|
|
|
|
|
{
|
|
|
|
|
namespace Editor
|
|
|
|
|
{
|
|
|
|
|
void SMetasoundGraphNodeComment::MoveTo(const FVector2D& NewPosition, FNodeSet& NodeFilter, bool bMarkDirty)
|
|
|
|
|
{
|
|
|
|
|
SGraphNodeComment::MoveTo(NewPosition, NodeFilter, bMarkDirty);
|
|
|
|
|
|
2024-07-26 14:24:18 -04:00
|
|
|
// Update frontend node position for current node
|
|
|
|
|
UEdGraphNode* Node = GetNodeObj();
|
|
|
|
|
if (UMetasoundEditorGraphCommentNode* MetaSoundCommentNode = Cast<UMetasoundEditorGraphCommentNode>(Node))
|
|
|
|
|
{
|
|
|
|
|
MetaSoundCommentNode->GetMetasoundChecked().Modify();
|
|
|
|
|
MetaSoundCommentNode->UpdateFrontendNodeLocation();
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-23 14:56:04 -04:00
|
|
|
// Update Frontend node positions for unselected nodes that are dragged along with the comment box
|
|
|
|
|
// partially copied from SGraphNodeComment::MoveTo
|
|
|
|
|
// Don't drag note content if either of the shift keys are down.
|
|
|
|
|
FModifierKeysState KeysState = FSlateApplication::Get().GetModifierKeys();
|
|
|
|
|
if (!KeysState.IsShiftDown())
|
|
|
|
|
{
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
UMetasoundEditorGraphCommentNode* CommentNode = Cast<UMetasoundEditorGraphCommentNode>(GraphNode);
|
2022-05-23 14:56:04 -04:00
|
|
|
if (CommentNode && CommentNode->MoveMode == ECommentBoxMode::GroupMovement)
|
|
|
|
|
{
|
|
|
|
|
FVector2D PositionDelta = NewPosition - GetPosition();
|
|
|
|
|
|
|
|
|
|
// Now update any nodes which are touching the comment but *not* selected
|
|
|
|
|
// Selected nodes will be moved as part of the normal selection code
|
|
|
|
|
TSharedPtr< SGraphPanel > Panel = GetOwnerPanel();
|
|
|
|
|
for (FCommentNodeSet::TConstIterator NodeIt(CommentNode->GetNodesUnderComment()); NodeIt; ++NodeIt)
|
|
|
|
|
{
|
|
|
|
|
if (UMetasoundEditorGraphNode* MetasoundGraphNode = Cast<UMetasoundEditorGraphNode>(*NodeIt))
|
|
|
|
|
{
|
|
|
|
|
FVector2D MetasoundNodePosition = FVector2D(MetasoundGraphNode->NodePosX, MetasoundGraphNode->NodePosY);
|
|
|
|
|
MetasoundNodePosition += PositionDelta;
|
|
|
|
|
MetasoundGraphNode->GetMetasoundChecked().Modify();
|
|
|
|
|
MetasoundGraphNode->UpdateFrontendNodeLocation(MetasoundNodePosition);
|
|
|
|
|
}
|
2024-07-26 14:24:18 -04:00
|
|
|
else if (UMetasoundEditorGraphCommentNode* MetasoundCommentNode = Cast<UMetasoundEditorGraphCommentNode>(*NodeIt))
|
|
|
|
|
{
|
|
|
|
|
MetasoundCommentNode->GetMetasoundChecked().Modify();
|
|
|
|
|
MetasoundCommentNode->UpdateFrontendNodeLocation();
|
|
|
|
|
}
|
2022-05-23 14:56:04 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Editor
|
|
|
|
|
} // namespace Metasound
|