summaryrefslogtreecommitdiffstats
path: root/Scripts/Fold/Editor/KeyframeNodeView.cs
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-01-02 17:32:05 -0800
committeryum <yum.food.vr@gmail.com>2026-01-02 17:32:14 -0800
commit9b45bce6d4ca528cf5bbc78aeaa0b6b06e0f1a29 (patch)
tree6fa297bf6c768d3c4552762d572a55e23f2978e8 /Scripts/Fold/Editor/KeyframeNodeView.cs
parentfcc76b257ef5cfb4514669df3b0144f8e8dd76ef (diff)
Fold: add more nodes
Diffstat (limited to 'Scripts/Fold/Editor/KeyframeNodeView.cs')
-rw-r--r--Scripts/Fold/Editor/KeyframeNodeView.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/Scripts/Fold/Editor/KeyframeNodeView.cs b/Scripts/Fold/Editor/KeyframeNodeView.cs
index 225b5b6..65d839b 100644
--- a/Scripts/Fold/Editor/KeyframeNodeView.cs
+++ b/Scripts/Fold/Editor/KeyframeNodeView.cs
@@ -25,6 +25,10 @@ public class KeyframeNodeView : BaseNodeView
void OnGenerateClick()
{
+ // Process the graph to propagate values through connections
+ var processor = new ProcessGraphProcessor(nodeTarget.graph);
+ processor.Run();
+
var go = GetConnectedGameObject();
if (go == null) return;
var rend = go.GetComponent<MeshRenderer>();
@@ -45,12 +49,16 @@ public class KeyframeNodeView : BaseNodeView
rend.GetPropertyBlock(mpb);
// Set material properties for all 16 slots.
- for (int i = 0; i < 16; i++) {
+ const int kNumSlots = 16;
+ for (int i = 0; i < kNumSlots; i++) {
string slotPrefix = $"_Vertex_Deformation_Slot_{i}_";
BaseFoldNode node = (foldNodes.Count > 0) ? foldNodes.Pop() : null;
FoldNodeSerialized data = node?.Serialize();
bool active = data != null;
+ if (active) {
+ Debug.Log($"Setting opcode {data.opcode}");
+ }
mpb.SetFloat(slotPrefix + "Enabled", active ? 1.0f : 0.0f);
mpb.SetInt(slotPrefix + "Opcode", active ? data.opcode : 0);
@@ -60,13 +68,15 @@ public class KeyframeNodeView : BaseNodeView
mpb.SetFloat(slotPrefix + "Float_3", active ? data.float3 : 0.0f);
mpb.SetVector(slotPrefix + "Vector_0", active ? data.vec0 : Vector4.zero);
+ if (active) {
+ Debug.Log($"Setting vec0 {data.vec0}");
+ }
mpb.SetVector(slotPrefix + "Vector_1", active ? data.vec1 : Vector4.zero);
mpb.SetVector(slotPrefix + "Vector_2", active ? data.vec2 : Vector4.zero);
mpb.SetVector(slotPrefix + "Vector_3", active ? data.vec3 : Vector4.zero);
}
rend.SetPropertyBlock(mpb);
- Debug.Log($"Generated Keyframe for '{go.name}' with properties applied to all 16 slots.");
}
BaseFoldNode GetInputFoldNode(BaseFoldNode node)