Profile editor - Fix undoing profile editor commands

- Undoing a change to an existing keyframe's value restores the value instead of deleting the keyframe
- Undoing "remove effect" puts the effect back in its place instead of below the next one
- Undoing "toggle keyframes" restores what it was before
- Undoing a brush change on a layer that had no brush removes the brush again, using the new Layer.RemoveLayerBrush
- Undoing "add element" disables the element again
- Undoing an event path change back to no path goes back to an event start node, like a new condition
- MoveProfileElement says "Move folder" for folders
- UpdateLayerProperty without a time no longer calls itself "Add ... keyframe"
This commit is contained in:
RobertBeekman committed 2026-10-20 09:47:43 +02:00
1 parent 504845c7d2
commit 0920cf8917
14 files changed
+80 -71

No files matched your search

@@ -167,15 +167,13 @@ public class EventCondition : CorePropertyChanged, INodeScriptCondition
/// </summary>
public void UpdateEventNode(bool updateScript)
{
if (EventPath == null)
Type? pathType = EventPath?.GetPropertyType();
if (EventPath != null && pathType == null)
return;
Type? pathType = EventPath.GetPropertyType();
if (pathType == null)
return;
// Create an event node if the path type is a data model event
if (pathType.IsAssignableTo(typeof(IDataModelEvent)))
// Create an event node if the path type is a data model event, without a path go back to the event node a new
// condition starts with
if (pathType == null || pathType.IsAssignableTo(typeof(IDataModelEvent)))
{
EventConditionEventStartNode eventNode;
// Ensure the start node is an event node
+18
View File
@@ -847,6 +847,24 @@ public sealed class Layer : RenderProfileElement
ActivateLayerBrush();
}
/// <summary>
/// Removes the current layer brush, leaving the layer without a brush
/// </summary>
public void RemoveLayerBrush()
{
if (LayerBrush == null)
return;
BaseLayerBrush oldLayerBrush = LayerBrush;
General.BrushReference.SetCurrentValue(null!);
LayerBrush = null;
// Don't dispose the brush, only disable it
// That way an undo-action does not need to worry about disposed brushes
oldLayerBrush.InternalDisable();
ActivateLayerBrush();
}
private void ActivateLayerBrush()
{
try