Commit Graph

141 Commits

Author SHA1 Message Date
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
JeanLuc Corenthin
ce327d173b Added support for MaterialFunction:
- Added UInterchangeMateriaFunctionlFactoryNode to store data to create a MaterialFunction object
  - Added UInterchangeMaterialFunctionFactory to create aMaterialFunction from a UInterchangeMateriaFunctionlFactoryNode
  -Added UInterchangeFunctionCallShaderNode to carry over the unique id of the material function to be called by the resulting function call expression
  - Reworked CreateExpressionsForNode & CreateExpression in InterchangeMaterialFactory.cpp  as helper functions to serve UInterchangeMaterialFactory and UInterchangeMaterialFunctionFactory
  -
Added support for materials using the 'material attributes' input
  - Added MaterialAttributes namespace under UE::Interchange::Materials::Standard::Nodes to list MaterialAttributes expression's inputs
  - Add method to properly handle material using MakeMaterialAttributes

#jira UE-153392
#rb jeanmichel.dignard
#preflight 6290ebc16c4b4192f2a09961

[CL 20394638 by JeanLuc Corenthin in ue5-main branch]
2022-05-27 12:18:20 -04:00
Leon Huang
19877e39c5 Fix for duplicate localization key warnings and missing localization defines/undefines in various files.
#rnx
#rb: Vincent.Gauthier
#jira: UE-151614
#preflight: 628fc4a98c23e52ef0fdfa7d

[CL 20384450 by Leon Huang in ue5-main branch]
2022-05-26 16:11:10 -04:00
Danny Kabrane
85c0e9e579 Add Subsurface into InterchangeGenericMaterialPipeline.cpp
#preflight none

[CL 20351664 by Danny Kabrane in ue5-main branch]
2022-05-24 13:45:05 -04:00
Danny Kabrane
2ed6266937 Add support of Tangent and SubsurfaceColor inputs for materials.
#rb JeanMichel.Dignard
#preflight https://horde.devtools.epicgames.com/job/628d0bc6710271c3182446f6

[CL 20351475 by Danny Kabrane in ue5-main branch]
2022-05-24 13:36:09 -04:00
JeanLuc Corenthin
85bb4343e5 Interchange:
- Removed use of ensure based on wrong assumption about presence of slot information  in factory nodes for meshes
 - Fixed logic in ApplySlotMaterialDependencies to check for UInterchangeBaseMaterialFactoryNode instead of UInterchangeMaterialFactoryNode

Datasmith:
 - Removed use of InterchangeGenericAssetPipeline for Datasmith import
 - Added logic to the translator to pro
 - Added Datasmith static mesh pipeline to handle case where allslots of a mesh have the same material
 - Modified level pipeline to handle case where all overrides of a mesh actor have the same material
 - Temporarily forced creation of all assets during a Datasmith import
 - Limit compilation of DatasmithInterchange module to Win64, Mac and Linux

#jira UETOOL-5082
#rb benoit.deschenes
#preflight 628cfe81710271c318226ed7

[CL 20351139 by JeanLuc Corenthin in ue5-main branch]
2022-05-24 13:19:16 -04:00
Alexis Matte
5470f5098f Fix gimbal lock by avoiding euler angle when importing fbx bone animation, we instead bake the data like the legacy importer did.
To achieve this a new type of payload was added to the payload interface which allow the client asking for payload to describe the bake settings (Hz, start time, end time)
#jira UE-151896
#rb benoit.deschenes
#preflight 62869cdd153b5ae9cdcc92d1
#rnx

[CL 20286621 by Alexis Matte in ue5-main branch]
2022-05-19 16:07:20 -04:00
JeanLuc Corenthin
31d2589aca Added support for material slot names and their associated materials for static meshes and static mesh actors
Added  storage of correspondence between slot names and material names to UInterchangeMeshNode
Added  storage of correspondence between slot names and material names to UInterchangeStaticMeshFactoryNode
Added  storage of correspondence between slot names and material names to UInterchangeSceneNode
Added  storage of correspondence between slot names and material names to UInterchangeActorFactoryNode
Modified UInterchangeGenericMeshPipeline to use  UInterchangeSceneNode's slot dependency
Modified UInterchangeGenericScenesPipeline to use  UInterchangeSceneNode's slot dependency and create UInterchangeMeshActorFactoryNode
Added logic in UInterchangeStaticMeshFactory to apply correspondence between slot names and material names stored in UInterchangeStaticMeshFactoryNode to the static mesh
Added logic in UInterchangeStaticMeshActorFactory to apply correspondence between slot names and material names stored in UInterchangeStaticMeshFactoryNode to the static mesh
Added logic in UInterchangeSkeletalMeshActorFactory to apply correspondence between slot names and material names stored in UInterchangeActorFactoryNode to the static mesh component
Added code to skip FStaticMeshOperations::AppendMeshDescription if there is only one mesh in the payload
Modified UE::Interchange::TMapAttributeHelper<FString, FString> by adding a method to rebuild the cache from the attributes. This was needed to rebuild cache after Interchange nodes using this helper were deserialized.
Fixed issue in InterchangeTexture2DFactoryNode and  InterchangeTexture2DNode with serialization of Interchange nodes using UE::Interchange::TMapAttributeHelper<FString, FString>. Serialize method needed to be override in order to restore the cache.
Added UInterchangeMeshActorFactoryNode class to manage slots on static mesh and skeletal mesh actors.
Added helper function to transfer slot dependencies from translated node to factory node
Added abstract class UInterchangeMeshFactoryNode from which UInterchangeSkeletalMeshFactoryNode and UInterchangeStaticMeshFactoryNode now derived
Modified UInterchangeSkeletalMeshFactoryNode and UInterchangeStaticMeshFactoryNode based on new UInterchangeMeshFactoryNode class
Added logic in UInterchangeSkeletalMeshFactory::CreateAsset to handle slot material dependencies
Added logic in UInterchangeGenericMeshPipeline::AddLodDataToSkeletalMesh to handle slot material dependencies

Note:
 - LODs' material assignment does not work for skeletal and static meshes for a scene import. This needs to be fixed separately

#rb alexis.matte, richard.talbotwatkin, benoit.deschenes
#preflight 62868650045aba22796bf3fa

[CL 20285082 by JeanLuc Corenthin in ue5-main branch]
2022-05-19 15:09:31 -04:00
JeanMichel Dignard
ab3740d226 Interchange: tweak some material processing in the generic pipeline
- Favor translucency over coats when creating materials, as we do when creating instances.
- Ignore twosidedness for thin translucency as the results look visually wrong.

#rb none
#preflight 6282489ccf7e4667a98c0833

[CL 20222545 by JeanMichel Dignard in ue5-main branch]
2022-05-16 09:08:28 -04:00
JeanLuc Corenthin
b8a2358169 Fixed build break when building a game
#jira UE-151885
#rb none
#fyi matt.johnson
#preflight 627ea9a71748fbc85bc32411

[CL 20190397 by JeanLuc Corenthin in ue5-main branch]
2022-05-13 18:08:55 -04:00
Alexis Matte
39914106e6 Fix crash when adding error message. The sub generic asset pipelines result container was not set, and this was triggering assert when adding message to the unset container.
Add a error message in case we have a zero scale in the UI. Set back the scale to the default value 1.0f
#jira UE-151310
#rb jeanmichel.dignard
#rnx
#preflight 627eaa120f72dc21c7dcee62

[CL 20186509 by Alexis Matte in ue5-main branch]
2022-05-13 15:04:11 -04:00
Alexis Matte
7501efa769 Interchange: Add rigid mesh support, we need to translate animation on any scene node. Then the pipeline can decide to create or not a rigid skeletal mesh.
#jira UETOOL-3641
#jira UETOOL-4719
#rb jeanmichel.dignard
#rnx
#preflight 627e6f959650a277337ac9a9

[CL 20183396 by Alexis Matte in ue5-main branch]
2022-05-13 13:14:07 -04:00
JeanLuc Corenthin
63178e7f5e Add ability for translators to force the creation of unused materials. To do so:
- Indicate uniqueness of  UInterchangeSourceNode in the node container by providing two static functions to find/create and get.
 - Added methods  GetCustomImportUnusedMaterial and SetCustomImportUnusedMaterial on UInterchangeSourceNode to check ability or not to import unused materials.
 - Modified UInterchangeGenericMaterialPipeline to enable or not material factory nodes based on the value returned by GetCustomImportUnusedMaterial on the UInterchangeSourceNode when added to the node container.

#jira none
#rb alexis.matte
#preflight 627e66735d0fe3ffef40bedc

[CL 20181133 by JeanLuc Corenthin in ue5-main branch]
2022-05-13 10:35:06 -04:00
Danny Kabrane
a730cc7d4c Fix warning: missing copyright boilerplate
#preflight none

[CL 20177350 by Danny Kabrane in ue5-main branch]
2022-05-12 23:36:45 -04:00
Danny Kabrane
a147d340e3 Add MaterialX Translator to Interchange module
* Ignore MaterialX warning -Wmissing-braces on clang
* Only enable the Translator with the editor for the moment, because of the MaterialX exceptions during Runtime

#rb JeanLuc.Corenthin
#rb JeanMichel.Dignard
#rb Alexis.Matte
#preflight https://horde.devtools.epicgames.com/job/627d4bb2332e182a58424952

[CL 20169252 by Danny Kabrane in ue5-main branch]
2022-05-12 15:34:48 -04:00
JeanLuc Corenthin
8d47c207ff Fixed crash when obj file does not contain UV data
Fixed incorrect name of Interchange node created for material

#jira none
#rb richard.talbotwatkin
#preflight 627d11c6a82f3adab87a2ff2

[CL 20164659 by JeanLuc Corenthin in ue5-main branch]
2022-05-12 10:57:22 -04:00
JeanMichel Dignard
e284d6285a Interchange: First pass on an API to create nodes and standardize unique ids.
- Added a static Create function on UInterchangeTexture2DNode, UInterchangeShaderGraphNode and UInterchangeShaderNode.
- Added a static MakeNodeUid function on UInterchangeTextureNode, UInterchangeShaderGraphNode and UInterchangeShaderNode.
- Updated the FBX, GLTF and OBJ translators to leverage the new APIs.
#preflight 627bcefc0a5817c9d94df8ed

[CL 20140773 by JeanMichel Dignard in ue5-main branch]
2022-05-11 11:12:53 -04:00
Alexis Matte
a69d8bbdb8 Fix crash when using interchange to import an already existing skeletalmesh. The interchange skeletalmesh factory now find the situation and do a re-import.
#jira UE-151469
#rb benoit.deschenes
#rnx
#preflight 627bc8d41e749933438d6515

[CL 20140203 by Alexis Matte in ue5-main branch]
2022-05-11 10:52:33 -04:00
Alexis Matte
9f2dd7dd88 Make sure sub generic asset pipelines are not showing in the pipeline stack dropdown list.
#rb jeanmichel.dignard
#jira UE-151336
#preflight 627a668bbd643341fef406d7

[CL 20122224 by Alexis Matte in ue5-main branch]
2022-05-10 09:36:43 -04:00
Alexis Matte
cd142d56c1 Change the default value for the import uniform scale to 1.0
#jira none
#rb none
#preflight skip

[CL 20110927 by Alexis Matte in ue5-main branch]
2022-05-09 17:05:28 -04:00
Alexis Matte
d52f6501e7 Implement ImportOffset generic options
#jira UETOOL-5152
#rb benoit.deschenes
#rnx
#preflight 62796c5e6b12e5fcd2edf606

[CL 20110035 by Alexis Matte in ue5-main branch]
2022-05-09 16:03:02 -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
JeanMichel Dignard
01ed81a334 Interchange GLTF: Fixed texture names when it's missing from the source data. Use the URI in that case.
#rb none
#preflight 627597eff27a22404d1fe5e0

[CL 20086330 by JeanMichel Dignard in ue5-main branch]
2022-05-06 17:57:19 -04:00
JeanMichel Dignard
d19e90cfc8 Interchange Textures
- Added address mode support for 2D texture nodes.

Interchange GLTF
- Translated GLTF wrap mode.
- Renamed texture nodes to use the GLTFTexture name instead of the file URI since the same file can be sampled differently and result in multiple textures.

#fyi danny.kabrane, emil.kirichev
#jira UETOOL-5138
#rb julien.stjean
#preflight 6275278c491d570f2240db4d

[CL 20075318 by JeanMichel Dignard in ue5-main branch]
2022-05-06 10:22:19 -04:00
JeanMichel Dignard
2e52c70724 Interchange: Fixed importing into level multiple times.
- Moved setting the static mesh on the static mesh component to the post import callback as the component wants the static mesh render data to be initialized if it's not null.
#preflight 6273d1c2f54f151f4eee0bad

[CL 20056945 by JeanMichel Dignard in ue5-main branch]
2022-05-05 09:37:03 -04:00