Commit Graph

70 Commits

Author SHA1 Message Date
Josie Yang
af65e53764 Inline edit support to material expression inputs
- Inline edit support for UPROPERTY of type float, int32, uint32, uint8, enum, bool.
- Editable UPROPERTYs with "OverridingInputProperty" metadata are created as inline widgets next to their corresponding inputs.
- Rest of the editable UPROPERTYs may specify "ShowAsInputPin" metadata to become inline edit pins, with 2 choices: "Primary" - show in primary view, "Advanced" - show in in advanced view.
- Update a bunch of material expressions to reflect the changes, rest of the expressions still need to be worked through.

#jira UE-145276
#rb kevin.Ortegren
#preflight 627a3cc8937a047d62282ba7

[CL 20122451 by Josie Yang in ue5-main branch]
2022-05-10 09:53:13 -04:00
Jason Nadro
fc3dcee397 Restore backed out CL, with fixes.
Also restores follow-up CLs 19973746, 19973782
FStaticParameterSet::MaterialLayers can't be deprecated, since a property with the same name is included via FStaticParameterSetRuntimeData
So instead, FMaterialLayersFunctionsRuntimeData is updated with SerializeFromMismatchedTag, to allow serializing a full FMaterialLayersFunction.
When this happens, the EditorOnly portion is stored in a separate heap allocation, and then transferred to FStaticParameterSet::EditorOnly::MaterialLayers
#preflight 626c3405e31dbb512cef1e98

[Backout] - CL19973745
#fyi bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL19964485
#fyi Ben.Ingram
Original CL Desc
-----------------------------------------------------------------
Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over.  So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329

[CL 20043286 by Jason Nadro in ue5-main branch]
2022-05-04 12:21:52 -04:00
bob tellez
34d8d5badd [Backout] - CL19964485
#fyi Ben.Ingram
Original CL Desc
-----------------------------------------------------------------
Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over.  So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329

[CL 19973745 by bob tellez in ue5-main branch]
2022-04-28 20:08:12 -04:00
Ben Ingram
448b0a9807 Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over.  So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329

[CL 19964485 by Ben Ingram in ue5-main branch]
2022-04-28 12:56:28 -04:00
Ben Ingram
482b59e662 Generate if{}else{} control flow rather than ?: for material switch expressions
Add non-static bool MCT type to allow plugging bool expressions into switch nodes when using new HLSL translator
#rb none
#jira none
#preflight 623caf230a073579730b4dd9

[CL 19499154 by Ben Ingram in ue5-main branch]
2022-03-24 14:07:56 -04:00
Ben Ingram
9f80c7620f Track both input/output types for material graph connections
Pins are now color-coded by type in addition to wires
#rb none
#preflight 62322c52e2541b4ff3b46c72
#jira UE-145274

[CL 19409438 by Ben Ingram in ue5-main branch]
2022-03-16 14:53:30 -04:00
Ben Ingram
3fcb3a0749 Material editor colors wires based on data type when using new HLSL generator
#rb none
#preflight 622ba22f0a614dcb0c034713
#jira UE-145274

[CL 19359292 by Ben Ingram in ue5-main branch]
2022-03-11 14:39:57 -05:00
Ben Ingram
6f2cbfee8c New material HLSL translator supports functions using control flow
#preflight 61dcc5b94d377749b662ee15
#jira none
#rb none

[CL 18567176 by Ben Ingram in ue5-main branch]
2022-01-10 19:10:49 -05:00
kevin ortegren
2d81a2b2d6 Fix Remove Unused Nodes not working properly. It would simply clean up the entire graph each time except for the nodes directly attached to the material master node.
#rb ben.ingram
[at]ben.ingram
#rnx
#jira UE-126834

#ROBOMERGE-OWNER: kevin.ortegren
#ROBOMERGE-AUTHOR: kevin.ortegren
#ROBOMERGE-COMMAND: _robomerge[starship] UE5-Main
#ROBOMERGE-SOURCE: CL 17707138 via CL 17707174 via CL 17707185 via CL 17707192 via CL 17707193
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17707351 by kevin ortegren in ue5-release-engine-test branch]
2021-10-04 09:51:47 -04:00
ben ingram
84d2bffbc3 Fix pin index assignments when collapsing material nodes
#rb none
#jira UE-121677

#ROBOMERGE-SOURCE: CL 17391239 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17391245 by ben ingram in ue5-release-engine-test branch]
2021-09-01 15:30:38 -04:00
ben ingram
6ab65ee613 Fix pin color in material editor
#rb none
#preflight skip

#ROBOMERGE-SOURCE: CL 17308821 via CL 17308839
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17308852 by ben ingram in ue5-release-engine-test branch]
2021-08-25 16:28:05 -04:00
charles derousiers
ea446402e2 Fix crash when opening material.
#rb ben.ingram
#preflight 6112b4adcf0cdd0001c4b783

#ROBOMERGE-SOURCE: CL 17120555 via CL 17120593
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17120624 by charles derousiers in ue5-release-engine-test branch]
2021-08-10 14:13:36 -04:00
ben ingram
e286aecd18 Remove code in UMaterialGraphNode_Base that associated additional data with pins via a TMap
Instead, add 'SourceIndex' directly to UEdGraphPin and remove the map
Too many edge cases where something would modify pins directly, and the map would get out of sync with actual pins
#jira UE-119861
#rb lauren.barnes

#ROBOMERGE-SOURCE: CL 16897567 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16897572 by ben ingram in ue5-release-engine-test branch]
2021-07-20 11:49:47 -04:00
ben ingram
b5d97f57c2 Remove concept of 'linked scopes', instead track number of exec input connections to each expression, and use that to process if/else scopes
- This way we don't need to move statements around, can generate both if/else scope correctly before switching back to parent scope
- Will make it easier to track locals within the current scope
#rb none
#jira none

#ROBOMERGE-SOURCE: CL 16354735 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16354746 by ben ingram in ue5-release-engine-test branch]
2021-05-17 13:03:18 -04:00
ben ingram
ef701d0ad8 Remove UMaterialExpressionReturnMaterialAttributes
- Instead, use control flow materials use the regular root node, with an exec input stacked on top
- Execution begin expression remains
- Will simplify graph processing, as now we only have a single end-point
#rb none
#jira none

#ROBOMERGE-SOURCE: CL 16331502 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16331552 by ben ingram in ue5-release-engine-test branch]
2021-05-14 13:08:51 -04:00
Ben Ingram
926e8df6c7 Add null check to handle missing data
#rb none
#jira UE-114105

[CL 16095409 by Ben Ingram in ue5-main branch]
2021-04-22 13:35:06 -04:00
christopher waters
688c029803 Tessellation Removal: Removing Tessellation specific material parameters.
#jira UE-94564
#rb ben.ingram, sebastien.hillaire, arciel.rekman, jason.nadro
#preflight 6078b15161a9060001161a4c

[CL 16034000 by christopher waters in ue5-main branch]
2021-04-16 10:46:28 -04:00
Arciel Rekman
b3c841267e Do not crash when loading a material that calls a missing function (UE-109104).
#rb Ben.Ingram
#review-15698872 @Ben.Ingram, @Kevin.Ortegren
#jira UE-109104
#robomerge Release-5.0-EarlyAccess

[CL 15699562 by Arciel Rekman in ue5-main branch]
2021-03-15 15:35:37 -04:00
Ben Ingram
9210aed795 Don't cache the results of GetInput/OutputType() for material pins, as this type can change for certain expressions
#rb none
#jira none

[CL 15391443 by Ben Ingram in ue5-main branch]
2021-02-11 16:10:11 -04:00
Sebastien Hillaire
d32298f4ce Re-exposed Starta after merge down from UE5-EA
#fyi Charles.deRousiers, Kevin.Ortegren

[CL 15371147 by Sebastien Hillaire in ue5-main branch]
2021-02-09 18:01:10 -04:00
sebastien hillaire
04e6a3a729 Strata is now hidden in UE5EA.
#rb Charles.deRousiers, Kevin.Ortegren

#ROBOMERGE-OWNER: sebastien.hillaire
#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 15364105 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15368834 by sebastien hillaire in ue5-main branch]
2021-02-09 14:59:01 -04:00
Ben Ingram
bf90b91344 Add new type FExpressionExecOutput to represent UMaterialExpression execution outputs
- Previously exec inputs/outputs were stored along with other (data) inputs/outpus
- Problem is, for exec pins, we want each output to only support 1 connection, but multiple connections to each input. This is the opposite of data, where we support multiple output connections, but only 1 input connection
- So we flip the representation around, and store output pointers, rather than input pointers...this also better matches the way we iterate exec connections while compiling
- This does complicate some UI logic, as now input/output graph pins no longer line up exeactly with UMaterialExpression inputs/outputs (we still have a flat list of pins, but separate lists of exec/non-exec inputs/outputs)
#jira none
#rb lauren.barnes

[CL 15361599 by Ben Ingram in ue5-main branch]
2021-02-08 18:55:31 -04:00
Ben Ingram
a557c4be0e Add experimental support for material control flow (if-statement, for-loop, local variables)
- Very WIP, not intended/ready for production use
- Hidden behind CVAR to enable support, and per-material flag to opt in
#jira none
#rb rune.stubbe

[CL 15251606 by Ben Ingram in ue5-main branch]
2021-01-28 17:48:58 -04:00
Marc Audy
bf80889353 UE5/Release-Engine-Staging to UE5/Main
This represents UE4/Main up to CL# 14958402

[CL 15028197 by Marc Audy in ue5-main branch]
2021-01-08 19:56:07 -04:00
Sebastien Hillaire
8428b0ea62 Strata material graph, new pin type representing the mixed and layered BSDF.
Very basic and lots of things are missing but it is tracked.

#rb Charles.deRousiers

[CL 14444435 by Sebastien Hillaire in ue5-main branch]
2020-10-08 03:11:37 -04:00