Python Script (carXML, carLODs, ExternalStudioModule)
class ExtractableReference
# ...
@abstractmethod
extract()
""" Create a new ExternalStudio Asset or propagate updated Forza content update to an exising Asset. """
externalAsset = ExternalStudioModule.getAssetByForzaID(self.ID)
if externalAsset:
externalAsset.update(self.mergeableData)
else:
externalAsset = ExternalStudioModule.newAsset(ForzaID, self.mergeableData)
# ...
recurFileReferences(filePath)
"""Create a new instance of suffix-specific extractable, extract the file, and recur into child references."""
extractableReference = ExtractableReferenceFactory.construct(file path) # ExtractableXML/TIF/SHADER/MATERIAL
ExtractableReference.extract()
# For Reference: ExtractableTIF.extract()
Copy the file to filePath.relative_to(ExternalStudioModule.ROOT)
Super().extract()
# For Reference: ExtractableXML.extract()
extractableXmlData = {}
children = []
From external studio module's mappings of Forza XML types → project-relevant XML queries, get the query
For each node in Element Tree → find_all(query),
Update the extractable XML data dictionary with the '*Parameter*: *Value* pairs
If the current pair is a '*Parameter*: *Root-Relative Path*,
children.append(*Root-Relative Path*)
Super().extract()
If extractableReference is ExtractableTif, # base case
Return extractableReference
If extractableReference has children, # recursive case
For childPath in extractableReference.childPaths,
Return recurFileReferences(childPath)
main()
Open the user-specified carXML
Create a list containing any referenced MAX files in the 'model' section of the Element Tree
Open PowerShell
3dsmaxbatch('ExportFBX.ms', MAX files list)
MaxScript
For all 'Editable_Poly' objects in the scene,
If the object's LOD is in the range of LODs to export,
Export the object as an FBX
recurFileReferences(carXML)