Closed joric closed 1 year ago
this worked:
provider = DefaultFileProvider(path, VersionContainer(EUEVersion.GAME_UE4_27))
Images are fine now.
Still, can't collect hierarchy. Any help? How FModel parses that? Tried that POS FModel again, it could not parse 11Mb file, ate up 8 gigs or RAM and froze. There's an object that doesn't get referenced, but it should. What should I do to identify it? It's in DLC2_SecretLavaArea, I can only find it by the coordinates:
{
"Type": "SceneComponent",
"Name": "DefaultSceneRoot",
"Properties": {
"RelativeLocation": {
"X": 11637.44140625,
"Y": 12546.80078125,
"Z": 4227.0
},
"RelativeRotation": {
"Pitch": 0.0,
"Yaw": -81.9996109008789,
"Roll": 0.0
},
"Mobility": "EComponentMobility::Static",
"CreationMethod": "EComponentCreationMethod::Instance"
}
},
In FModel this object has an "outer" key ("Outer": "FortressRoot"), so I can find it by name.
Here we have hundreds of SceneComponent:DefaultSceneRoot objects, index doesn't help either, nobody refers them by index. Are there properties that should be there but skipped by the reader? FModel exports ObjectPath with index 2905 like this:
"ObjectPath": "SupralandSIU/Content/FirstPersonBP/Maps/DLC2_SecretLavaArea.2905"
but I don't see this number in ue4parse json. Is it possible to add support for this key perhaps so I can find referred items?
Upd. Ok I did this and now I have working references to parent nodes, i.e. "ObjectName": "DefaultSceneRoot:SceneComponent.2905",
(+1 rather, so it's 2906).
- ObjectName = f"{Resource.ObjectName.string}:{Resource.ClassIndex.Name.string}"
+ ObjectName = f"{Resource.ObjectName.string}:{Resource.ClassIndex.Name.string}.{self.Index}"
Is there more elegant non-breaking way? Maybe like so:
@@ -100,6 +101,7 @@ class FPackageIndex:
else:
ObjectName = f"{Resource.ObjectName.string}:{Resource.ClassIndex.Name.string}"
return {
+ "ObjectIndex": self.Index,
"ObjectName": ObjectName,
"OuterIndex": Resource.OuterIndex.GetValue()
}
Love you, man! I was able to collect all nodes https://gist.github.com/joric/075e4a2689cd18d69dee6caf19da33de
Upd. did the interactive map https://joric.github.io/supraland and the script that does all export automatically https://github.com/joric/supraland/blob/main/scripts/supraland_parser.py
Could not load texture from Supraland (~UE 4.27). What am I doing wrong? WIndows 10, used VC 2017 to build the module.
Also what's up with the output format? FModel has hierarchy but here it looks just like an array of dictionaries that do not really refer to each other, I'm not sure, does order matter? How to collect hierarchical nodes? FModel can't read large files and cannot be automated so I can't use it.