Commit Graph

41 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
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
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
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
JeanMichel Dignard
d9a86518c3 Interchange attribute storage: Added support for uint8 enum classes
#rb julien.stjean
#preflight 627447beca0ad32a968e5f16

[CL 20065848 by JeanMichel Dignard in ue5-main branch]
2022-05-05 18:15:08 -04:00
Julien StJean
35fcf99d86 Changed how the interchange texture factory test the non-power of two texture to reduce the code duplication and remove the config reads from ouside of the game thread.
Added the option to allow the import of non-power of two textures in the interchange generic texture pipeline.
Added some static assert to the interchange texture factory to help the long term maintenance.
Added some functions to the interchange texture 2d factory node to help the manipulation of udims source blocks.
Removed some texture translators since they can share their implementation. That also fixed the difference between interchange and the legacy factory.
Removed a copy of the raw source data for most of the image that are imported by the image wrappers (Tiff was already able to avoid the copy before that). This will greatly reduce the peak memory usage during the imports.
Fixed some other minor issues.

#jira UE-146448, UE-146450, UE-146715, UE-146718
#rb Alexis.Mate
#preflight 6269899ff97c319beba3575c

[CL 19944368 by Julien StJean in ue5-main branch]
2022-04-27 15:02:17 -04:00
Alexis Matte
a01677d4f0 Interchange AttributeKey will use FName instead of FString. FName are more appropriate since the keys are repeated for each node.
Add a children cache in the base node container to optimize the queries.
#jira none
#rnx
#rb benoit.deschenes
#preflight 62683174430b9997ebe6db18

[CL 19926008 by Alexis Matte in ue5-main branch]
2022-04-26 14:54:00 -04:00
Alexis Matte
0a5bc2e83d - Alternate skinning now use interchange (if interchange is enabled)
- Custom LOD import now use interchange (if interchange is enabled)
- Add an InterchangeManager API function to retrieve per asset type extensions format
- Add an interchange mesh utilities to create a common place to add mesh import code.
- Add an interchange file picker interface which can be implemented by plugin
- Add an editor plugin that implement the file picker, The file picker can be customize to import specific asset type.

#jira UETOOL-5050
#jira UETOOL-5049
#rb jeanmichel.dignard
#preflight 626819fa430b9997ebe3bece
#rnx

[CL 19923170 by Alexis Matte in ue5-main branch]
2022-04-26 12:53:38 -04:00
benoit deschenes
d4ad3eaab0 Interchange Framework - Adding a reimport interface to Interchange so that UInterchangeReimportHandler no longer relies on hardcoded asset types.
We now use the registered Translators and Factories to fetch the asset source file and determine if a reimport is supported.

#rb Alexis.Matte
#preflight 6259cd2fb53385f954985288

[CL 19777158 by benoit deschenes in ue5-main branch]
2022-04-15 16:08:36 -04:00
Richard TalbotWatkin
07d5402b9e Made interchange factory base nodes a more concrete and distinct base type. Amended various parts of Interchange Manager to require factory base nodes where they are expected. Moved factory node specific properties, such as the ReferencedObject, out of the base node class.
#rb JeanMichel.Dignard, Alexis.Matte
#preflight 624b69ffb33098a72d223c21

[CL 19616062 by Richard TalbotWatkin in ue5-main branch]
2022-04-04 18:10:20 -04:00
Alexis Matte
2dc81e36ad Add a translator API function to get a list of extensions for a specific asset. Also add a file picker Interchange can use from its runtime code.
#jira UETOOL-5049
#rb none
#rnx
#preflight 6245d462e434babd8af60383
#preflight 6245dc05292f228e0904a5e9

[CL 19574783 by Alexis Matte in ue5-main branch]
2022-03-31 13:13:24 -04:00
benoit deschenes
f5c223f9c3 Interchange Scene Import - Changing the scene import to from having a single factory in charge of instanciating the whole scene, to using one factory for each scene factory node.
This allows additional types to be imported without modifying the UInterchangeActorFactory (a requirement for implementing custom interchange import plugins), and better matches the rest of interchange design.
Moving away from a single-call scene instanciation will also allow us to further improve of the scene import with changes such as:
 - Distributing the scene instanciation on multiple tick, relying of interchange's dependency system, rather than waiting for all the assets to be imported.
 - Calling the pre/post-import pipeline events per actor.
 - Having inter-actor import dependencies (right now the interchange scene import task only consider asset dependencies)

#rb Alexis.Matte JeanMichel.Dignard
#preflight 6241f2cb637925b5d3999cff
#preflight 624476d773665f7d5e428b14

[CL 19558429 by benoit deschenes in ue5-main branch]
2022-03-30 12:01:35 -04:00
benoit deschenes
bf72ed2fc1 Fix UInterchangeBaseNodeContainer::GetNode() const-correctness.
#rb Alexis.Matte
#preflight 6241e2da323cb7b991dfda8a

[CL 19529579 by benoit deschenes in ue5-main branch]
2022-03-28 12:54:38 -04:00
Alexis Matte
8638da8691 Fix CIS build
#rb none
#rnx
#jira none
#preflight 623cbb497c62f317a647ded6

[CL 19500159 by Alexis Matte in ue5-main branch]
2022-03-24 14:46:31 -04:00
Alexis Matte
0fc421e0bf Add UPackage meta data for static and skeletal meshes and for anim sequence.
#jira UETOOL-5048
#rnx
#rb richard.talbotwatkin
#preflight 623c8542bc1cf2803889efa0

[CL 19495829 by Alexis Matte in ue5-main branch]
2022-03-24 11:11:35 -04:00
Alexis Matte
011f9a4e07 Add intechange animation pipeline and support joint animation
#jira UETOOL-3727
#rb Jeanmichel.dignard
#rnx
#preflight 6238a67fbc1cf2803855fc32

[CL 19454181 by Alexis Matte in ue5-main branch]
2022-03-21 13:18:42 -04:00
Richard TalbotWatkin
81b660560e Improvements and bug fixes to Interchange automation tests.
#rb Alexis.Matte
#preflight 622b257acd605bd993b36329

[CL 19352263 by Richard TalbotWatkin in ue5-main branch]
2022-03-11 05:50:18 -05:00
JeanMichel Dignard
ff0899c19c Interchange import dialog
- Added sections to navigate between the settings of different asset types.
- Fixed the tooltips for the reimport strategy being on the wrong entries.

PropertyEditor
- Fixed an issue where a category with a space in its name would fail the section category comparison as spaces are removed from section category names.

#rb Alexis.Matte, Sebastian.Nordgren
#preflight 621e8149ca28c5563436bd6a

[CL 19205853 by JeanMichel Dignard in ue5-main branch]
2022-03-01 16:02:16 -05:00
marc audy
cff01aa9fa Added support for native FProperty setters and getters.
Setters and getters are native functions called by FProperties when setting property values with *_InContainer functions.
Setters and getter function names can be manually specified with Setter = Func and Getter = Func keywords inside of UPROEPRTY macro but they will also be automatically parsed if the name is not explicitly specified if the setter or getter function name matches SetPropertyName and GetPropertyName pattern.
The latter behavior can be disabled in UHT's DefaultEngine.ini by setting AutomaticSettersAndGetters=False.
ImportText and ExportTextItem functions have been deprecated and should be replaced with *_InContainer or *_Direct variants.

#rb Steve.Robb
#preflight 6210a377a83e0bcefd03d9e1

#ROBOMERGE-OWNER: marc.audy
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 19070318 via CL 19098059 via CL 19104650 via CL 19104661 via CL 19110012
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19147839 by marc audy in ue5-main branch]
2022-02-25 10:39:39 -05:00
Alexis Matte
9775bb4fbd Add Interchange support for Import geo/skinning only workflow
#UETOOL-4729
#rb richard.talbotwatkin
#rnx
#preflight 62178d841a114ad504392e3f

[CL 19112941 by Alexis Matte in ue5-main branch]
2022-02-24 09:10:50 -05:00
Richard TalbotWatkin
6b7adaff53 Interchange test framework. This implements a framework for testing asset imports, but it is designed with the idea of extending it to testing scene import, and asset exports.
#rb Alexis.Matte, JeanMichel.Dignard
#preflight 621293a3db49742f95e2b4f4

[CL 19064598 by Richard TalbotWatkin in ue5-main branch]
2022-02-20 15:14:42 -05:00
benoit deschenes
5b40df98aa Interchange Framework - Adding UInterChangeFactoryBaseNode class with "subpath" attribute, allowing to customize the imported package locations. Also removing unnecessary constructors.
#rb Alexis.Matte
#preflight 620bd59b483ff0ae5ebe5c18

[CL 18997737 by benoit deschenes in ue5-main branch]
2022-02-15 11:54:39 -05:00
JeanMichel Dignard
0a111a1b4e Interchange
- Interchange now adds its supported extensions to the import and import into level file pickers.
- Added a GetSupportedFormats on the Interchange Translators.
- UInterchangeTranslatorBase::CanImportSource now defaults to checking the file extension and matching it against the supported formats.
- Added a translator type on the translators to indicate what type of data they can translate (assets or actors for now). This is used by the file pickers to indicate which extensions they want to gather.
#preflight 6203eaca174d2620c3c11d9b

[CL 18919107 by JeanMichel Dignard in ue5-main branch]
2022-02-09 11:43:32 -05:00
Alexis Matte
e8b71cb606 Add fbx user defined node attribute. Create an extra attribute API in UInterchangeBaseNode to enable add and query of the attribute.
User defined attribute are normally attribute user add to a node in the DCC application.

#jira UETOOL-3236
#rb jeanmichel.dignard
#rnx
#preflight 6203bff48e53010a1868431e

[CL 18916814 by Alexis Matte in ue5-main branch]
2022-02-09 08:31:08 -05:00
Alexis Matte
712aff43d4 Make sure all 3f/3d type are supported correctly
- Remove from the attribute storage the type that represent 3f or 3d (i.e FVector, FTransform).
- Make sure the detail viewer for the interchange node support the specific 3f/3d type

#jira none
#rb jeanmichel.dignard
#rnx
#preflight 61fd8d71f370b0d3111eeb17

[CL 18872263 by Alexis Matte in ue5-main branch]
2022-02-04 15:48:49 -05:00