Search Issue Tracker
By Design
Votes
0
Found in [Package]
2021.2.0a9
2021.2.0b11
2022.1
Issue ID
1366095
Regression
Yes
Custom Function Node with Type > File mode does not use function from within the referenced file
Steps to reproduce:
1. Create a new HDRP project
2. Right-click in Project > Assets then click Import Package > Custom Package... then select attached "SwitchColorOnDefine.unitypackage", then click Import
3. Enter Play Mode
Expected result: both spheres are green
Actual result: one sphere is red and another one is green
Reproducible with: 12.0.0 (2021.2.0a9, 2021.2.0b12, 2022.1.0a10), 13.0.0 (2022.1.0a11)
Not reproducible with: 10.6.0 (2020.3.19f1), 10.7.0 (2020.3.19f1), 11.0.0 (2021.1.21f1), 12.0.0 (2021.2.0a8)
Couldn't test with: 2019.4.31f1 - due to package importing errors
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Prefab override popup is cropped/positioned incorrectly when more than one display is used and a higher display Scale is set
- Opening a dropdown on a small screen results in its instant closing when mouse cursor is pressed where the dropdown is going to be opened
- Only "ArgumentNullException: Value cannot be null" is displayed instead of all the actual errors when opening a project with numerous compilation errors
- MultiColumnListView and MultiColumnTreeView do not change selection on first input when focus is set by code
- SerializedProperty.DataEquals is returning false when SerializedProperty.EqualContents return true
Resolution Note:
So the file type is still used with a custom function node. However, this workaround for adding in a define will not work since the include file for the SwitchColorOnDefine happens earlier than the vertex function actually #define's the ONCOLOR. A long term fix for this would potentially be allowing users to decide where exactly includes are placed in custom function nodes, which is something we have in mind. A short term fix would be to move the define function done in the custom function node to a file rather (rather than the string custom function it is now) so that the include pastes in the define before the switchoncolor function checks the #ifdef (I have verified that this makes the ball render green). Since this is not actually a bug though, closing.