Browse Source

Fixed some missing stuff with IsExposed

Krzysztof Krysiński 2 weeks ago
parent
commit
83ba4908e2

+ 1 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/NodeGraph.cs

@@ -133,7 +133,7 @@ public class NodeGraph : IReadOnlyNodeGraph
                 valueCopy = kvp.Value.Value;
             }
 
-            newGraph.Blackboard.SetVariable(kvp.Key, kvp.Value.Type, valueCopy);
+            newGraph.Blackboard.SetVariable(kvp.Key, kvp.Value.Type, valueCopy, kvp.Value.Unit, kvp.Value.Min, kvp.Value.Max, kvp.Value.IsExposed);
         }
 
         return newGraph;

+ 5 - 1
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/NestedDocumentNode.cs

@@ -128,7 +128,9 @@ public class NestedDocumentNode : LayerNode, IInputDependentOutputs, ITransforma
         {
             if (InputProperties.Any(x =>
                     x.InternalPropertyName == variable.Key && x.ValueType == variable.Value.Type))
+            {
                 continue;
+            }
 
             if(!variable.Value.IsExposed)
                 continue;
@@ -163,7 +165,9 @@ public class NestedDocumentNode : LayerNode, IInputDependentOutputs, ITransforma
 
             bool shouldRemove = document.DocumentInstance.NodeGraph.Blackboard.Variables
                 .All(x => x.Key != input.InternalPropertyName ||
-                          x.Value.Type != input.ValueType);
+                          x.Value.Type != input.ValueType) ||
+                              !document.DocumentInstance.NodeGraph.Blackboard.Variables[input.InternalPropertyName]
+                                  .IsExposed;
 
             if (shouldRemove)
             {

+ 2 - 2
src/PixiEditor.ChangeableDocument/Changes/NodeGraph/Blackboard/SetBlackboardVariable_Change.cs

@@ -89,10 +89,10 @@ internal class SetBlackboardVariable_Change : Change
         }
 
         var oldVar = target.NodeGraph.Blackboard.Variables[variable];
-        target.NodeGraph.Blackboard.SetVariable(variable, oldVar.Type, value, oldVar.Unit, min, max);
+        target.NodeGraph.Blackboard.SetVariable(variable, oldVar.Type, value, oldVar.Unit, min, max, isExposed);
 
         InformBlackboardAccessingNodes(target, variable);
-        return new BlackboardVariable_ChangeInfo(variable, oldVar.Type, value, oldVar.Min ?? double.MinValue, oldVar.Max ?? double.MaxValue, oldVar.Unit);
+        return new List<IChangeInfo>() { new BlackboardVariable_ChangeInfo(variable, oldVar.Type, value, oldVar.Min ?? double.MinValue, oldVar.Max ?? double.MaxValue, oldVar.Unit), new BlackboardVariableExposed_ChangeInfo(variable, isExposed) };
     }
 
     public override OneOf<None, IChangeInfo, List<IChangeInfo>> Revert(Document target)

+ 3 - 1
src/PixiEditor/Data/Localization/Languages/en.json

@@ -1256,5 +1256,7 @@
   "PLACE_ELEMENT": "Place Element",
   "PLACE_ELEMENT_DESCRIPTIVE": "Place an external image or document as a new layer",
   "FAILED_TO_PLACE_ELEMENT": "Failed to place element: {0}",
-  "EXPOSE_VARIABLE_TOOLTIP": "Expose variable outside of the graph (Brush toolbar setting, Nested Node Input)"
+  "EXPOSE_VARIABLE_TOOLTIP": "Expose variable outside of the graph (Brush toolbar setting, Nested Node Input)",
+  "STAMP_BLEND_MODE": "Stamp Blend Mode",
+  "SNAP_TO_PIXELS": "Snap to Pixels"
 }