mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #1781 from Areloch/ShapeImportFixes_20260627
Some checks failed
MacOSX Build / macOS ARM Xcode (push) Has been cancelled
Linux Build / Ubuntu GCC Latest (push) Has been cancelled
Linux Build / Ubuntu GCC 13 (push) Has been cancelled
MacOSX Build / macOS ARM Clang Ninja (push) Has been cancelled
Windows Build / Windows MSVC Ninja (push) Has been cancelled
Windows Build / Windows MSVC Visual Studio 2022 (push) Has been cancelled
Windows Build / Windows MSVC Visual Studio 2026 (push) Has been cancelled
Some checks failed
MacOSX Build / macOS ARM Xcode (push) Has been cancelled
Linux Build / Ubuntu GCC Latest (push) Has been cancelled
Linux Build / Ubuntu GCC 13 (push) Has been cancelled
MacOSX Build / macOS ARM Clang Ninja (push) Has been cancelled
Windows Build / Windows MSVC Ninja (push) Has been cancelled
Windows Build / Windows MSVC Visual Studio 2022 (push) Has been cancelled
Windows Build / Windows MSVC Visual Studio 2026 (push) Has been cancelled
Fixes for shape importing/taml writing
This commit is contained in:
commit
6d8f83bd3a
2 changed files with 29 additions and 3 deletions
|
|
@ -3044,9 +3044,11 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
|
||||||
|
|
||||||
StringTableEntry assetName = StringTable->insert(assetItem->assetName.c_str());
|
StringTableEntry assetName = StringTable->insert(assetItem->assetName.c_str());
|
||||||
|
|
||||||
String shapeFileName = "@" + assetItem->filePath.getFileName() + "." + assetItem->filePath.getExtension();
|
String shapeFileName =assetItem->filePath.getFileName() + "." + assetItem->filePath.getExtension();
|
||||||
String constructorFileName = assetItem->filePath.getFileName() + "." TORQUE_SCRIPT_EXTENSION;
|
|
||||||
String assetPath = targetPath + "/" + shapeFileName;
|
String assetPath = targetPath + "/" + shapeFileName;
|
||||||
|
shapeFileName = "@" + shapeFileName;
|
||||||
|
|
||||||
|
String constructorFileName = assetItem->filePath.getFileName() + "." TORQUE_SCRIPT_EXTENSION;
|
||||||
String constructorPath = targetPath + "/" + constructorFileName;
|
String constructorPath = targetPath + "/" + constructorFileName;
|
||||||
constructorFileName = "@" + constructorFileName;
|
constructorFileName = "@" + constructorFileName;
|
||||||
String tamlPath = targetPath + "/" + assetName + ".asset.taml";
|
String tamlPath = targetPath + "/" + assetName + ".asset.taml";
|
||||||
|
|
@ -3130,6 +3132,29 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isReimport)
|
||||||
|
{
|
||||||
|
char qualifiedFromFile[2048];
|
||||||
|
char qualifiedToFile[2048];
|
||||||
|
|
||||||
|
#ifndef TORQUE_SECURE_VFS
|
||||||
|
Platform::makeFullPathName(originalPath.c_str(), qualifiedFromFile, sizeof(qualifiedFromFile));
|
||||||
|
Platform::makeFullPathName(assetPath.c_str(), qualifiedToFile, sizeof(qualifiedToFile));
|
||||||
|
#else
|
||||||
|
dStrcpy(qualifiedFromFile, originalPath.c_str(), sizeof(qualifiedFromFile));
|
||||||
|
dStrcpy(qualifiedToFile, assetPath.c_str(), sizeof(qualifiedToFile));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool isInPlace = !String::compare(qualifiedFromFile, qualifiedToFile);
|
||||||
|
|
||||||
|
if (!isInPlace && !Torque::FS::CopyFile(qualifiedFromFile, qualifiedToFile, !isReimport))
|
||||||
|
{
|
||||||
|
dSprintf(importLogBuffer, sizeof(importLogBuffer), "Error! Unable to copy file %s", qualifiedFromFile);
|
||||||
|
activityLog.push_back(importLogBuffer);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool makeNewConstructor = true;
|
bool makeNewConstructor = true;
|
||||||
if (!isReimport)
|
if (!isReimport)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -252,8 +252,9 @@ bool Taml::write(SimObject* pSimObject, const char* pFilename)
|
||||||
stream.close();
|
stream.close();
|
||||||
|
|
||||||
// Reset the compilation.
|
// Reset the compilation.
|
||||||
resetCompilation();
|
|
||||||
mWriteLocked = false;
|
mWriteLocked = false;
|
||||||
|
resetCompilation();
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue