Skip to content

Commit ddc5b12

Browse files
committed
Fixed relay node not doing the custom conversion when needed
1 parent 644efea commit ddc5b12

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Assets/com.alelievr.NodeGraphProcessor/Runtime/Elements/NodePort.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,16 @@ public void PullData()
310310
// Only one input connection is handled by this code, if you want to
311311
// take multiple inputs, you must create a custom input function see CustomPortsNode.cs
312312
if (edges.Count > 0)
313-
fieldInfo.SetValue(fieldOwner, edges.First().passThroughBuffer);
313+
{
314+
var passThroughObject = edges.First().passThroughBuffer;
315+
316+
// We do an extra convertion step in case the buffer output is not compatible with the input port
317+
if (passThroughObject != null)
318+
if (TypeAdapter.AreAssignable(fieldInfo.FieldType, passThroughObject.GetType()))
319+
passThroughObject = TypeAdapter.Convert(passThroughObject, fieldInfo.FieldType);
320+
321+
fieldInfo.SetValue(fieldOwner, passThroughObject);
322+
}
314323
}
315324
}
316325

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.2.1]
8+
9+
### Fixed
10+
- Fixed relay node not applying custom conversions when needed
11+
712
## [1.2.0]
813

914
### Added

0 commit comments

Comments
 (0)