You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new: Allow to use the LegacyComponentConverter between a lumberyard and o3de project (o3de#17397)
* fix: use the correct cache location and fix for python 3.10
* new: Allow to use specific asset catalog as new arg
* fix: Arguments parsing more than one arg
* clean: handle review comments
* clean: handle review comments 2
* fix: Remove default and unused material slot from entry
* new: Support non uniform scale conversion
---------
Signed-off-by: guillaume-haerinck <[email protected]>
Copy file name to clipboardExpand all lines: Gems/AtomLyIntegration/CommonFeatures/Assets/Editor/Scripts/LegacyContentConversion/LegacyActorComponentConverter.py
Copy file name to clipboardExpand all lines: Gems/AtomLyIntegration/CommonFeatures/Assets/Editor/Scripts/LegacyContentConversion/LegacyComponentConverter.py
+36-13Lines changed: 36 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -15,14 +15,17 @@
15
15
project and attempts to convert the following components into something
16
16
reasonably similar that renders in Atom:
17
17
Mesh
18
+
Material
19
+
PointLight
18
20
Actor
19
21
20
22
21
23
Do materials get carried over?
22
24
================================================
23
25
For the mesh component, this script will attempt to create an atom mesh component
24
26
that uses the same material, pre-supposing that you have already run the
25
-
LegacyMaterialConverter.py script sto generate Atom .material files out of legacy .mtl files
27
+
LegacyAssetConverter script to generate Atom .material files out of legacy .mtl files.
For meshes that only have one sub-mesh, this is straightforward as the mesh will only
27
30
have one material to apply, and this script will look for a material with the same
28
31
name but a .material extension.
@@ -35,14 +38,26 @@
35
38
re-named the submaterials, it should find a match. This applies to both the
36
39
ActorComponent and the MeshComponent
37
40
41
+
42
+
What does this script needs?
43
+
================================================
44
+
This script will parse the assetcatalog.xml from the cache folder to get asset ids and path.
45
+
This file is in binary by default, you need to rebuild the engine with a modification to make it useable by this script.
46
+
- In lumberyard, modify dev\Code\Tools\AssetProcessor\native\AssetManager\AssetCatalog.cpp line 343 to use AZ::ObjectStream::ST_XML instead of ST_BINARY
47
+
- In o3de (if you use assetCatalogOverridePath), modify Code\Framework\AzFramework\AzFramework\Asset\AssetCatalog.cpp
48
+
and Code\Tools\AssetProcessor\native\AssetManager\AssetCatalog.cpp in the same fashion
49
+
50
+
Note that after the modification and rebuild, you will need to delete the cache folder and launch the engine for the catalog to be rebuilt
51
+
38
52
How do I run this script from a command line?
39
53
================================================
40
54
1) Check out any .slice, .layer, .ly, and .cry files you want to convert from source control
41
55
- This script will remove the legacy components entirely, so make sure you have your files
42
56
backed up before you run this script in case you want to run it again
43
-
2) From the Lumberyard root folder, run LegacyComponentConverter.py project=<ProjectName> --include_gems
44
-
- --include_gems is optional
45
-
- if you include Gems, it will run all all Gems, not just the ones enabled by your project
57
+
2) From the Lumberyard root folder, run LegacyComponentConverter.py -project=<ProjectName> -include_gems -assetCatalogOverridePath=<ExternalProjectPath\Cache\pc\assetcatalog.xml>
58
+
- -include_gems is optional. If you include Gems, it will run all all Gems, not just the ones enabled by your project
59
+
- -assetCatalogOverridePath is optional. It will replace mesh/material asset id from the source project to this target project
60
+
based on relative asset path from the project root (in general, Objects/Models/yourasset.fbx)
# TODO - we're about to change the tree structure while iterating, which is apparently undefined but appears to work. Might be better to just build up a list of things that need to be modified, then do a second pass to replace the legacy component
191
206
# Seems to be okay since we only change or add elements, never remove entirely
Copy file name to clipboardExpand all lines: Gems/AtomLyIntegration/CommonFeatures/Assets/Editor/Scripts/LegacyContentConversion/LegacyConversionHelpers.py
+25-13Lines changed: 25 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
"""
9
9
10
10
importos
11
+
importplatform
11
12
importxml.etree.ElementTree
12
13
13
14
classStats_Collector(object):
@@ -101,30 +102,36 @@ class Common_Command_Line_Options(object):
Copy file name to clipboardExpand all lines: Gems/AtomLyIntegration/CommonFeatures/Assets/Editor/Scripts/LegacyContentConversion/LegacyMaterialComponentConverter.py
0 commit comments