Browse Source

Added logic to correctly associate constructor script file for shape asset to asset as an assetfile

Areloch 4 years ago
parent
commit
9a10d52e0b
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Engine/source/T3D/assets/assetImporter.cpp

+ 4 - 2
Engine/source/T3D/assets/assetImporter.cpp

@@ -2877,11 +2877,12 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
    StringTableEntry assetName = StringTable->insert(assetItem->assetName.c_str());
 
    String shapeFileName = assetItem->filePath.getFileName() + "." + assetItem->filePath.getExtension();
+   String constructorFileName = assetItem->filePath.getFileName() + "." TORQUE_SCRIPT_EXTENSION;
    String assetPath = targetPath + "/" + shapeFileName;
-   String constructorPath = targetPath + "/" + assetItem->filePath.getFileName() + "." TORQUE_SCRIPT_EXTENSION;
+   String constructorPath = targetPath + "/" + constructorFileName;
    String tamlPath = targetPath + "/" + assetName + ".asset.taml";
    String originalPath = assetItem->filePath.getFullPath().c_str();
-   String originalConstructorPath = assetItem->filePath.getPath() + "/" + assetItem->filePath.getFileName() + "." TORQUE_SCRIPT_EXTENSION;
+   String originalConstructorPath = assetItem->filePath.getPath() + "/" + constructorFileName;
 
    char qualifiedFromFile[2048];
    char qualifiedToFile[2048];
@@ -2896,6 +2897,7 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
 
    newAsset->setAssetName(assetName);
    newAsset->setShapeFile(shapeFileName.c_str());
+   newAsset->setShapeConstructorFile(constructorFileName.c_str());
 
    AssetImportConfig* cachedConfig = new AssetImportConfig();;
    cachedConfig->registerObject();