Commit Graph

278 Commits

Author SHA1 Message Date
massimo tristano
b0f2eb49b5 Added MaterialEditor override for "FEditorUndoClient::MatchesContext()" function to limit the undo operations only to Material related UObjects.
This fixes the issue of the user undoing something unrelated to the Material and the MaterialEditor erroneously flagging the Material as dirty, causing the "Save Material" dialog to show up when the user closest he MaterialEditor window.

#jira UE-145484
#preflight 62ffa02e7d17941e9f8a7cd0

[CL 21457393 by massimo tristano in ue5-main branch]
2022-08-19 10:44:39 -04:00
Sebastien Hillaire
b0c4655f47 Strata - added material graph preview on node.
This is simply done by an added PreviewColor on the FStrataData that flows between the node to be able to work with parameter blending or StrataTree BSDF composition. Can be updated later to anything else.
#rb none
#preflight https://horde.devtools.epicgames.com/job/62f10d02a035cdf05e9b6a90
#fyi charles.derousiers

[CL 21269064 by Sebastien Hillaire in ue5-main branch]
2022-08-08 11:04:57 -04:00
massimo tristano
dbb452c096 Fixed assertion fired when the input or output preview of a collapsed node is expanded.
Issue was caused by the code assuming that the expression always has at least one output.

#rb jason.nadro
#preflight 62d6cb5cdc4397d3840b660d
#jira UE-155891

[CL 21163269 by massimo tristano in ue5-main branch]
2022-07-19 11:45:19 -04:00
dave jones2
ffcfa0aaca UE-131224 - Fix LWC preview issue in FMaterialEditor::OnNodeDoubleClicked
We currently have Blueprint real number support for all of the basic core types, including FVector4f. We can remove the LWC_TODO, and change the PreviewValue to a FVector4f.

#jira UE-131224
#rb jason.nadro
#preflight 62c70d2fa6654f9729dbe100

[CL 20989323 by dave jones2 in ue5-main branch]
2022-07-07 14:51:56 -04:00
Robb Surridge
64d1e34588 Support multiple tooltip sources and multiple base URLs for documentation.
- When the editor checks for enhanced tooltip content, it now looks in the Documentation/Source folder within the project folder and all enabled plugin folders.
- If the enhanced tooltip content contains a variable named ToolTipOverride, the content of that variable is used to override the default content for the initial simple tooltip.
- Documentation links can now use custom base URLs instead of always having the page ID appended to DocumentationURL in BaseEditor.ini.
- New base URLs can be defined in BaseEditor.ini or in DefaultEditor.ini within the project folder, as follows:
[/Script/Documentation.DocumentationSettings]
+DocumentationBaseUrls=(Id="ID",Url="http://myBaseUrl/{PAGEID}")
- They can also be added programmatically by calling IDocumentation::RegisterBaseUrl(), so plugins can add their own.
- The base URL can be specified anywhere a doc link is used. For links in code, the IDocumentation methods now accept an optional base URL parameter. For links taken from enhanced tooltip files, the ID of the base URL can now be specified at the file level in the BaseUrl metadata, or at the excerpt level in the [VAR:BaseUrl] variable.
- We now use {PAGEID} as a placeholder for where the doc link should go within the base URL.
#jira UE-139773
#rb jamie.dale
#preflight 62b08abdde510ae06e51f1dd

[CL 20936555 by Robb Surridge in ue5-main branch]
2022-07-04 14:37:49 -04:00
robert manuszewski
d1443992e1 Deprecating ANY_PACKAGE.
This change consists of multiple changes:

Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used  in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values

AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes

Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names

#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32

#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
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
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -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
Marc Audy
82b04b5ae9 Fix static analysis warnings
#fyi Mateo.Egey, Sebastien.Hillaire, john.vanderburg
#rnx
#preflight

[CL 20030018 by Marc Audy in ue5-main branch]
2022-05-03 14:59:07 -04:00
Matt Peters
7ad238a806 AssetRegistry includes (Engine/Source): change #include "AssetData.h" -> #include "AssetRegistry/AssetData.h", and similar for the other moved AssetRegistry headers.
#rb Zousar.Shaker
#rnx
#preflight 6270509a220f89f0ad573030

[CL 20016982 by Matt Peters in ue5-main branch]
2022-05-02 18:06:48 -04:00
Sebastien Hillaire
22cf010b9a Strata - added contextual pin menu to add most used Strata nodes. For input or ouput pins.
#rb none
#preflight https://horde.devtools.epicgames.com/job/6270361a283fccd7387096d0
#fyi charles.derousiers

[CL 20014706 by Sebastien Hillaire in ue5-main branch]
2022-05-02 16:13:24 -04:00
Sebastien Hillaire
97511ef9f0 Strata - added material editor context to simply create/link a Slab node from the context of a pin.
#rb none
#preflight https://horde.devtools.epicgames.com/job/626fede7ad00dced62c5afad
#fyi charles.derousiers

[CL 20008945 by Sebastien Hillaire in ue5-main branch]
2022-05-02 11:08:21 -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
christopher waters
61a048f407 Adding SM6 preview to the Material Editor.
#rb jason.nadro
#preflight 623a38d9bc1cf280386a6452

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 19481618 via CL 19481762 via CL 19481801
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v936-19480137)

[CL 19484071 by christopher waters in ue5-main branch]
2022-03-23 15:56:13 -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
7072c6557d Run two passes of PrepareExpression, first pass to determine types, second pass to flag expressions that are used.
This way we can skip flagging constant/zero expressions (which we don't know about during the first pass)
#rb none
#jira none
#preflight 6227cb21671c913c052ca22f

[CL 19311693 by Ben Ingram in ue5-main branch]
2022-03-08 16:47:52 -05:00
Ben Ingram
a6d3274332 Fix material editor preview thumbnails when using new HLSL translator
#jira none
#rb none
#preflight 621ff47231454c90cc0e53de

[CL 19232396 by Ben Ingram in ue5-main branch]
2022-03-02 18:09:26 -05:00
Ben Ingram
b6f8dbd89b Use HLSLTree to generate cached data when using new HLSL translator
This allows cached data to be based on expressions that are active/connected
#rb none
#jira none
#preflight 621fce7831454c90cc079dd2

[CL 19227403 by Ben Ingram in ue5-main branch]
2022-03-02 15:20:48 -05:00
Ben Ingram
e6f2147048 Misc fixes for enabling/disabling control flow in material editor
#rb none
#jira none
#preflight none

[CL 18573247 by Ben Ingram in ue5-main branch]
2022-01-11 11:51:35 -05:00
Ben Ingram
ff516caf95 Hide UMaterialFunction UI options for new HLSL generator/control flow, if the global CVARs are disabled
#rb none
#jira none
#preflight none

[CL 18567303 by Ben Ingram in ue5-main branch]
2022-01-10 19:25:13 -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
ben ingram
5dae45efae Hand integrate CL 17250155:
Prevent stack overflow from material editor setting color from details view that doesn't own current color picker.
#jira UE-120042
#rb none

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18238668 via CL 18239212 via CL 18239370 via CL 18240762 via CL 18240831
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18242931 by ben ingram in ue5-release-engine-test branch]
2021-11-18 15:23:37 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00