Skip to content

Commit

Permalink
🛠 fix: SamplerState
Browse files Browse the repository at this point in the history
  • Loading branch information
deepkolos committed Jul 23, 2023
1 parent 929009f commit d4f129b
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 12 deletions.
18 changes: 9 additions & 9 deletions example/demo/demoCartoonWater/CartoonWater.json
Original file line number Diff line number Diff line change
Expand Up @@ -2655,8 +2655,8 @@
"id": 28664,
"data": {
"outValue": {
"filter": "point",
"warp": "clamp"
"filter": "linear",
"warp": "repeat"
},
"outValueType": "sampler",
"expanded": true
Expand Down Expand Up @@ -2684,8 +2684,8 @@
"id": 28845,
"data": {
"outValue": {
"filter": "point",
"warp": "clamp"
"filter": "linear",
"warp": "repeat"
},
"outValueType": "sampler",
"expanded": true
Expand All @@ -2704,17 +2704,17 @@
},
"blocks": [],
"position": [
1288.8858125601228,
448.2416755020956
1289.1701824829677,
448.2417411461221
],
"name": "SamplerState"
},
"29026": {
"id": 29026,
"data": {
"outValue": {
"filter": "point",
"warp": "clamp"
"filter": "linear",
"warp": "repeat"
},
"outValueType": "sampler",
"expanded": true
Expand All @@ -2734,7 +2734,7 @@
"blocks": [],
"position": [
2066.96779559463,
336.66181536053745
336.846153226274
],
"name": "SamplerState"
}
Expand Down
74 changes: 72 additions & 2 deletions example/demo/demoFlowMapSubGraph.json
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,13 @@
]
},
"sampler": {
"connections": []
"connections": [
{
"node": 4810,
"output": "out",
"data": {}
}
]
}
},
"outputs": {
Expand Down Expand Up @@ -1490,7 +1496,13 @@
]
},
"sampler": {
"connections": []
"connections": [
{
"node": 4489,
"output": "out",
"data": {}
}
]
}
},
"outputs": {
Expand Down Expand Up @@ -1714,6 +1726,64 @@
372.05846716460866
],
"name": "Lerp"
},
"4489": {
"id": 4489,
"data": {
"outValue": {
"filter": "point",
"warp": "mirror"
},
"outValueType": "sampler",
"expanded": true
},
"inputs": {},
"outputs": {
"out": {
"connections": [
{
"node": 3780,
"input": "sampler",
"data": {}
}
]
}
},
"blocks": [],
"position": [
2540.626659700583,
744.2776345778565
],
"name": "SamplerState"
},
"4810": {
"id": 4810,
"data": {
"outValue": {
"filter": "point",
"warp": "mirror"
},
"outValueType": "sampler",
"expanded": true
},
"inputs": {},
"outputs": {
"out": {
"connections": [
{
"node": 3713,
"input": "sampler",
"data": {}
}
]
}
},
"blocks": [],
"position": [
2581.4578327760037,
234.96895611927152
],
"name": "SamplerState"
}
},
"UIState": {
Expand Down
7 changes: 6 additions & 1 deletion src/rete/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ export class Node {
}

setValue(prefix: string, value: any) {
this.data[prefix + 'Value'] = value;
const [dataPrefix, valuePrefix] = prefix.split('.');
if (valuePrefix && this.data[dataPrefix + 'Value']) {
(this.data[dataPrefix + 'Value'] as Record<string, any>)[valuePrefix] = value;
} else {
this.data[dataPrefix + 'Value'] = value;
}
this.dataChanged = true;
}

Expand Down

0 comments on commit d4f129b

Please sign in to comment.