mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge branch 'Preview4_0_DevHead' into tsneo
This commit is contained in:
commit
ada1c5a021
521 changed files with 259 additions and 162 deletions
|
|
@ -543,7 +543,7 @@ function AssetBrowser::doRefresh(%this)
|
|||
%this.navigateTo(%this.dirHandler.currentAddress);
|
||||
|
||||
//Forces a clean collapse of the tree for any not-really-exposed items
|
||||
%dataItem = AssetBrowser-->filterTree.findItemByName("Data");
|
||||
%dataItem = AssetBrowser-->filterTree.findItemByName("data");
|
||||
|
||||
AssetBrowser-->filterTree.expandItem(%dataItem, false);
|
||||
AssetBrowser-->filterTree.expandItem(%dataItem);
|
||||
|
|
@ -580,11 +580,11 @@ function AssetBrowser::loadDirectories( %this )
|
|||
|
||||
AssetBrowser-->filterTree.modulesIdx = AssetBrowser-->filterTree.insertItem(1, "Modules");
|
||||
|
||||
%dataItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "Data");
|
||||
%dataItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "data");
|
||||
AssetBrowser-->filterTree.tagsIdx = AssetBrowser-->filterTree.insertItem(1, "Tags");
|
||||
AssetBrowser-->filterTree.creatorIdx = AssetBrowser-->filterTree.insertItem(1, "Creator");
|
||||
|
||||
%this.dirHandler.loadFolders("Data", %dataItem);
|
||||
%this.dirHandler.loadFolders("data", %dataItem);
|
||||
|
||||
%this.loadCollectionSets();
|
||||
|
||||
|
|
@ -595,15 +595,15 @@ function AssetBrowser::loadDirectories( %this )
|
|||
//If set to, show core
|
||||
if(EditorSettings.value("Assets/Browser/showCoreModule", false) == 1)
|
||||
{
|
||||
%coreItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "Core");
|
||||
%this.dirHandler.loadFolders("Core", %coreItem);
|
||||
%coreItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "core");
|
||||
%this.dirHandler.loadFolders("core", %coreItem);
|
||||
}
|
||||
|
||||
//If set to, show tools
|
||||
if(EditorSettings.value("Assets/Browser/showToolsModule", false) == 1)
|
||||
{
|
||||
%toolsItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "Tools");
|
||||
%this.dirHandler.loadFolders("Tools", %toolsItem);
|
||||
%toolsItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "tools");
|
||||
%this.dirHandler.loadFolders("tools", %toolsItem);
|
||||
}
|
||||
|
||||
//Add Non-Asset Scripted Objects. Datablock, etc based
|
||||
|
|
@ -676,7 +676,7 @@ function AssetBrowser::loadDirectories( %this )
|
|||
AssetBrowser.newModuleId = "";
|
||||
}
|
||||
|
||||
//%dataItem = AssetBrowser-->filterTree.findItemByName("Data");
|
||||
//%dataItem = AssetBrowser-->filterTree.findItemByName("data");
|
||||
//AssetBrowser-->filterTree.expandItem(%dataItem);
|
||||
|
||||
AssetBrowser.dirHandler.expandTreeToAddress(AssetBrowser.dirHandler.currentAddress);
|
||||
|
|
@ -1219,14 +1219,14 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId)
|
|||
}
|
||||
else
|
||||
{
|
||||
if( %this.getSelectedItemsCount() > 0 && (%itemText !$= "Data" && %itemText !$= "Core" && %itemText !$= "Tools"))
|
||||
if( %this.getSelectedItemsCount() > 0 && (%itemText !$= "data" && %itemText !$="core" && %itemText !$= "tools"))
|
||||
{
|
||||
//AddNewAssetPopup.showPopup(Canvas);
|
||||
|
||||
//We have something clicked, so figure out if it's a sub-filter or a module filter, then push the correct
|
||||
//popup menu
|
||||
%parentItem = %this.getParentItem(%itemId);
|
||||
if(%this.getItemText(%parentItem) $= "Data") //if it's a data module, continue
|
||||
if(%this.getItemText(%parentItem) $= "data") //if it's a data module, continue
|
||||
{
|
||||
//find out if it's a folder or a module!
|
||||
if(ModuleDatabase.findModule(%itemText))
|
||||
|
|
@ -1248,11 +1248,11 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId)
|
|||
EditFolderPopup.assetType = "Folder";
|
||||
}
|
||||
}
|
||||
else if(%itemText $= "Data")
|
||||
else if(%itemText $= "data")
|
||||
{
|
||||
AddNewModulePopup.showPopup(Canvas);
|
||||
}
|
||||
else if(%itemText $= "Tools")
|
||||
else if(%itemText $= "tools")
|
||||
{
|
||||
AddNewToolPopup.showPopup(Canvas);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
$Tools::resourcePath = "tools/";
|
||||
|
||||
// These must be loaded first, in this order, before anything else is loaded
|
||||
$Tools::loadFirst = "editorClasses base worldEditor";
|
||||
$Tools::loadFirst = "editorClasses base worldEditor assetBrowser";
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Object that holds the simObject id that the materialEditor uses to interpret its material list
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function MaterialEditorGui::establishMaterials(%this)
|
|||
singleton CustomMaterial( materialEd_justAlphaMaterial )
|
||||
{
|
||||
mapTo = "matEd_mappedMatB";
|
||||
texture[0] = materialEd_previewMaterial.diffuseMap[0];
|
||||
texture[0] = materialEd_previewMaterial.getdiffuseMap(0);
|
||||
};
|
||||
|
||||
//Custom shader to allow the display of just the alpha channel.
|
||||
|
|
@ -176,7 +176,7 @@ function MaterialEditorGui::quit(%this)
|
|||
// Now we can delete the preview materials and shaders
|
||||
// knowing that there are no matinstances using them.
|
||||
matEdCubeMapPreviewMat.delete();
|
||||
materialEd_previewMaterial.delete();
|
||||
//materialEd_previewMaterial.delete();
|
||||
materialEd_justAlphaMaterial.delete();
|
||||
materialEd_justAlphaShader.delete();
|
||||
}
|
||||
|
|
@ -387,32 +387,32 @@ function MaterialEditorGui::updatePreviewObject(%this)
|
|||
{
|
||||
case "sphere":
|
||||
matEd_quickPreview_Popup.selected = %newModel;
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/spherePreview.dts");
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/spherepreview.dts");
|
||||
matEd_previewObjectView.setOrbitDistance(4);
|
||||
|
||||
case "cube":
|
||||
matEd_quickPreview_Popup.selected = %newModel;
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/cubePreview.dts");
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/cubepreview.dts");
|
||||
matEd_previewObjectView.setOrbitDistance(5);
|
||||
|
||||
case "pyramid":
|
||||
matEd_quickPreview_Popup.selected = %newModel;
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/pyramidPreview.dts");
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/pyramidpreview.dts");
|
||||
matEd_previewObjectView.setOrbitDistance(5);
|
||||
|
||||
case "cylinder":
|
||||
matEd_quickPreview_Popup.selected = %newModel;
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/cylinderPreview.dts");
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/cylinderpreview.dts");
|
||||
matEd_previewObjectView.setOrbitDistance(4.2);
|
||||
|
||||
case "torus":
|
||||
matEd_quickPreview_Popup.selected = %newModel;
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/torusPreview.dts");
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/toruspreview.dts");
|
||||
matEd_previewObjectView.setOrbitDistance(4.2);
|
||||
|
||||
case "knot":
|
||||
matEd_quickPreview_Popup.selected = %newModel;
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/torusknotPreview.dts");
|
||||
matEd_previewObjectView.setModel("tools/materialEditor/gui/torusknotpreview.dts");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,8 +77,15 @@ function T3Dpre4ProjectImporter::copyFiles(%this)
|
|||
{
|
||||
%filePath = filePath(%file);
|
||||
%fileName = fileName(%file);
|
||||
%fileBase = fileBase(%file);
|
||||
%fileExt = fileExt(%file);
|
||||
|
||||
if(endsWith(%fileName, ".asset.taml"))
|
||||
{
|
||||
%fileBase = strreplace(%fileBase, ".asset", "");
|
||||
%fileExt = ".asset.taml";
|
||||
}
|
||||
|
||||
if(%fileExt $= ".dll" || %fileExt $= ".log" || %fileExt $= ".exe" || %fileExt $= ".manifest"|| %fileExt $= ".h" ||
|
||||
%fileExt $= ".cpp" || %fileExt $= ".so" || %fileExt $= ".do" || %fileExt $= ".lib" ||%fileExt $= ".exp")
|
||||
{
|
||||
|
|
@ -99,6 +106,17 @@ function T3Dpre4ProjectImporter::copyFiles(%this)
|
|||
}
|
||||
|
||||
%targetFilePath = strReplace(%file, $ProjectImporter::sourceContentFolder, $ProjectImporter::modulePath);
|
||||
|
||||
%sanitizedFilename = sanitizeString(%fileBase);
|
||||
if(startsWith(%sanitizedFilename, "_"))
|
||||
{
|
||||
%sanitizedFilename = substr(%sanitizedFilename, 1, -1);
|
||||
}
|
||||
if(%sanitizedFilename !$= %fileBase)
|
||||
{
|
||||
%targetFilePath = filePath(%targetFilePath) @ "/" @ %sanitizedFilename @ %fileExt;
|
||||
}
|
||||
|
||||
%targetFolder = filePath(%targetFilePath);
|
||||
|
||||
if(!isDirectory(%targetFolder))
|
||||
|
|
@ -214,7 +232,7 @@ function T3Dpre4ProjectImporter::beginMaterialFilesImport(%this)
|
|||
%line = $ProjectImporter::fileObject.readLine();
|
||||
%trimmedLine = trim(%line);
|
||||
|
||||
if(strIsMatchExpr("*new*(*)*", %line))
|
||||
if(strIsMatchExpr("*new*(*)*", %line) && strpos(%line, "::") == -1)
|
||||
{
|
||||
%className = findObjectClass(%line, "new");
|
||||
|
||||
|
|
@ -246,6 +264,18 @@ function T3Dpre4ProjectImporter::beginMaterialFilesImport(%this)
|
|||
%fileWasChanged = true;
|
||||
}
|
||||
|
||||
%sanitizedName = sanitizeString(%objectName);
|
||||
if(startsWith(%sanitizedName, "_"))
|
||||
{
|
||||
%sanitizedName = substr(%sanitizedName, 1, -1);
|
||||
}
|
||||
if(%sanitizedName !$= %objectName)
|
||||
{
|
||||
%line = strReplace(%line, %objectName, %sanitizedName);
|
||||
|
||||
%fileWasChanged = true;
|
||||
}
|
||||
|
||||
if(%objectClassStack.count() == 1)
|
||||
{
|
||||
%currentObjClass = %objectClassStack.getKey(%objectClassStack.count()-1);
|
||||
|
|
@ -278,6 +308,18 @@ function T3Dpre4ProjectImporter::beginMaterialFilesImport(%this)
|
|||
|
||||
%objectName = findObjectName(%line, "singleton");
|
||||
|
||||
%sanitizedName = sanitizeString(%objectName);
|
||||
if(startsWith(%sanitizedName, "_"))
|
||||
{
|
||||
%sanitizedName = substr(%sanitizedName, 1, -1);
|
||||
}
|
||||
if(%sanitizedName !$= %objectName)
|
||||
{
|
||||
%line = strReplace(%line, %objectName, %sanitizedName);
|
||||
|
||||
%fileWasChanged = true;
|
||||
}
|
||||
|
||||
if(%objectClassStack.count() == 1)
|
||||
{
|
||||
%currentObjClass = %objectClassStack.getKey(%objectClassStack.count()-1);
|
||||
|
|
@ -418,7 +460,7 @@ function T3Dpre4ProjectImporter::beginCodeFilesImport(%this)
|
|||
%line = $ProjectImporter::fileObject.readLine();
|
||||
%trimmedLine = trim(%line);
|
||||
|
||||
if(strIsMatchExpr("*new*(*)*", %line))
|
||||
if(strIsMatchExpr("*new*(*)*", %line) && strpos(%line, "::") == -1)
|
||||
{
|
||||
%className = findObjectClass(%line, "new");
|
||||
|
||||
|
|
@ -428,6 +470,18 @@ function T3Dpre4ProjectImporter::beginCodeFilesImport(%this)
|
|||
|
||||
if(%objectName !$= "")
|
||||
{
|
||||
%sanitizedName = sanitizeString(%objectName);
|
||||
if(startsWith(%sanitizedName, "_"))
|
||||
{
|
||||
%sanitizedName = substr(%sanitizedName, 1, -1);
|
||||
}
|
||||
if(%sanitizedName !$= %objectName)
|
||||
{
|
||||
%line = strReplace(%line, %objectName, %sanitizedName);
|
||||
|
||||
%fileWasChanged = true;
|
||||
}
|
||||
|
||||
if(%objectClassStack.count() == 1)
|
||||
{
|
||||
%currentObjClass = %objectClassStack.getKey(%objectClassStack.count()-1);
|
||||
|
|
@ -513,6 +567,18 @@ function T3Dpre4ProjectImporter::beginCodeFilesImport(%this)
|
|||
|
||||
if(%objectName !$= "")
|
||||
{
|
||||
%sanitizedName = sanitizeString(%objectName);
|
||||
if(startsWith(%sanitizedName, "_"))
|
||||
{
|
||||
%sanitizedName = substr(%sanitizedName, 1, -1);
|
||||
}
|
||||
if(%sanitizedName !$= %objectName)
|
||||
{
|
||||
%line = strReplace(%line, %objectName, %sanitizedName);
|
||||
|
||||
%fileWasChanged = true;
|
||||
}
|
||||
|
||||
if(%objectClassStack.count() == 1)
|
||||
{
|
||||
%currentObjClass = %objectClassStack.getKey(%objectClassStack.count()-1);
|
||||
|
|
@ -764,6 +830,7 @@ T3Dpre4ProjectImporter::genProcessor("GroundPlane", "material materialAsset");
|
|||
T3Dpre4ProjectImporter::genProcessor("LevelInfo", "accuTexture accuTextureAsset");
|
||||
T3Dpre4ProjectImporter::genProcessor("TSStatic", "shape shapeAsset shapeName shapeAsset");
|
||||
T3Dpre4ProjectImporter::genProcessor("TSForestItemData", "shape shapeAsset shapeName shapeAsset shapeFile shapeAsset");
|
||||
T3Dpre4ProjectImporter::genProcessor("TerrainBlock", "terrainFile terrainAsset");
|
||||
//==============================================================================
|
||||
// Levels
|
||||
//==============================================================================
|
||||
|
|
@ -1034,57 +1101,8 @@ function processGuiBitmapButtonCtrlField(%line, %originalFieldName, %newFieldNam
|
|||
//These are going to be texture/render targets, and we can leave them alone
|
||||
return %line;
|
||||
}
|
||||
//find any assets with that filename
|
||||
else if(startsWith(%value, "./"))
|
||||
{
|
||||
%targetFilename = strReplace(%value, "./", $ProjectImporter::currentFilePath @ "/");
|
||||
}
|
||||
else if(startsWith(%value, "../"))
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/");
|
||||
if(%slashPos == strlen($ProjectImporter::currentFilePath)-1) //if it's right at the end, we'll get the next one up
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/", 2);
|
||||
}
|
||||
|
||||
%parentPath = getSubStr($ProjectImporter::currentFilePath, 0, %slashPos);
|
||||
%targetFilename = strReplace(%value, "../", %parentPath @ "/");
|
||||
}
|
||||
else if(startsWith(%value, "~"))
|
||||
{
|
||||
%targetFilename = strReplace(%value, "~", $ProjectImporter::modulePath @ "/");
|
||||
if(!isFile(%targetFilename))
|
||||
{
|
||||
%targetFilename = strReplace(%value, "~", $ProjectImporter::modulePath @ "/main/");
|
||||
}
|
||||
}
|
||||
else if ((strpos(%value,"/") == -1)&&(strpos(%value,"\\") == -1))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::currentFilePath @ %value;
|
||||
}
|
||||
else if(!startsWith(%value, $ProjectImporter::modulePath @ "/"))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::modulePath @ "/" @ %value;
|
||||
}
|
||||
else
|
||||
{
|
||||
%targetFilename = %value;
|
||||
}
|
||||
|
||||
%targetFilename = strReplace(%targetFilename, "//", "/");
|
||||
%targetFilename = testFilenameExtensions(%targetFilename);
|
||||
|
||||
if(!isFile(%targetFilename)) //if our presumed file target is bad, just bail out
|
||||
{
|
||||
//Now we test for a suffix
|
||||
%targetPath = filePath(%targetFilename);
|
||||
%targetName = fileBase(%targetFilename);
|
||||
%targetExt = fileExt(%targetFilename);
|
||||
|
||||
%targetFilename = %targetPath @ "/" @ %targetName @ "_n" @ %targetExt;
|
||||
%targetFilename = strReplace(%targetFilename, "//", "/");
|
||||
%targetFilename = testFilenameExtensions(%targetFilename);
|
||||
}
|
||||
%targetFilename = sanitizeFilename(%value);
|
||||
|
||||
//If we still have nothing, then we fail it out
|
||||
if(!isFile(%targetFilename))
|
||||
|
|
|
|||
|
|
@ -220,10 +220,7 @@ function ProjectImportWizardPage3::openPage(%this)
|
|||
%topFolder = getToken($ProjectImporter::sourceContentFolder, "/", %slashCount-2);
|
||||
|
||||
//clean up invalid characters and stuff
|
||||
%topFolder = strReplace(%topFolder, " ", "");
|
||||
%topFolder = strReplace(%topFolder, "!", "");
|
||||
%topFolder = strReplace(%topFolder, "-", "");
|
||||
%topFolder = strReplace(%topFolder, ".", "");
|
||||
%topFolder = sanitizeString(%topFolder);
|
||||
|
||||
$ProjectImporter::useExistingModule = false;
|
||||
$ProjectImporter::moduleName = %topFolder; //preseed the module name
|
||||
|
|
@ -366,6 +363,91 @@ function beginProjectImport()
|
|||
AssetBrowser.refresh(); //update the AB just in case
|
||||
}
|
||||
|
||||
function sanitizeFilename(%file)
|
||||
{
|
||||
if(startsWith(%file, "./"))
|
||||
{
|
||||
%targetFilename = strReplace(%file, "./", $ProjectImporter::currentFilePath @ "/");
|
||||
}
|
||||
else if(startsWith(%file, "../"))
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/");
|
||||
if(%slashPos == strlen($ProjectImporter::currentFilePath)-1) //if it's right at the end, we'll get the next one up
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/", 2);
|
||||
}
|
||||
|
||||
%parentPath = getSubStr($ProjectImporter::currentFilePath, 0, %slashPos);
|
||||
%targetFilename = strReplace(%file, "../", %parentPath @ "/");
|
||||
}
|
||||
else if(startsWith(%file, "~"))
|
||||
{
|
||||
%targetFilename = strReplace(%file, "~", $ProjectImporter::modulePath @ "/");
|
||||
if(!isFile(%targetFilename))
|
||||
{
|
||||
%targetFilename = strReplace(%file, "~", $ProjectImporter::modulePath @ "/main/");
|
||||
}
|
||||
}
|
||||
else if ((strpos(%file,"/") == -1)&&(strpos(%file,"\\") == -1))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::currentFilePath @ %file;
|
||||
}
|
||||
else if(!startsWith(%file, $ProjectImporter::modulePath @ "/"))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::modulePath @ "/" @ %file;
|
||||
}
|
||||
else
|
||||
{
|
||||
%targetFilename = %file;
|
||||
}
|
||||
|
||||
//Now we test for a suffix
|
||||
%flName = fileName(%targetFilename);
|
||||
%targetPath = filePath(%targetFilename);
|
||||
%targetName = fileBase(%targetFilename);
|
||||
%targetExt = fileExt(%targetFilename);
|
||||
|
||||
if(endsWith(%flName, ".asset.taml"))
|
||||
{
|
||||
%targetName = strreplace(%targetName, ".asset", "");
|
||||
%targetExt = ".asset.taml";
|
||||
}
|
||||
|
||||
%sanitizedName = sanitizeString(%targetName);
|
||||
if(startsWith(%sanitizedName, "_"))
|
||||
{
|
||||
%sanitizedName = substr(%sanitizedName, 1, -1);
|
||||
}
|
||||
if(%sanitizedName !$= %targetName)
|
||||
{
|
||||
%targetName = %sanitizedName;
|
||||
%targetFilename = %targetPath @ "/" @ %targetName @ %targetExt;
|
||||
}
|
||||
|
||||
if(!isFile(%targetFilename))
|
||||
{
|
||||
%bitmapFile = %targetPath @ "/" @ %targetName @ "_n" @ %targetExt;
|
||||
if(isFile(%bitmapFile))
|
||||
%targetFilename = %bitmapFile;
|
||||
}
|
||||
|
||||
if(!isFile(%targetFilename))
|
||||
{
|
||||
%targetFilename = testFilenameExtensions(%targetFilename);
|
||||
}
|
||||
|
||||
%targetFilename = strReplace(%targetFilename, "//", "/");
|
||||
|
||||
if(!isFile(%targetFilename)) //if our presumed file target is bad, just bail out
|
||||
{
|
||||
return %file;
|
||||
}
|
||||
else
|
||||
{
|
||||
return %targetFilename;
|
||||
}
|
||||
}
|
||||
|
||||
function testFilenameExtensions(%filename)
|
||||
{
|
||||
%ext = fileExt(%filename);
|
||||
|
|
@ -432,47 +514,17 @@ function processLegacyField(%line, %originalFieldName, %newFieldName)
|
|||
//These are going to be texture/render targets, and we can leave them alone
|
||||
return %line;
|
||||
}
|
||||
//find any assets with that filename
|
||||
else if(startsWith(%value, "./"))
|
||||
{
|
||||
%targetFilename = strReplace(%value, "./", $ProjectImporter::currentFilePath @ "/");
|
||||
}
|
||||
else if(startsWith(%value, "../"))
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/");
|
||||
if(%slashPos == strlen($ProjectImporter::currentFilePath)-1) //if it's right at the end, we'll get the next one up
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/", 2);
|
||||
}
|
||||
|
||||
%parentPath = getSubStr($ProjectImporter::currentFilePath, 0, %slashPos);
|
||||
%targetFilename = strReplace(%value, "../", %parentPath @ "/");
|
||||
}
|
||||
else if(startsWith(%value, "~"))
|
||||
{
|
||||
%targetFilename = strReplace(%value, "~", $ProjectImporter::modulePath @ "/");
|
||||
if(!isFile(%targetFilename))
|
||||
%targetFilename = sanitizeFilename(%value);
|
||||
|
||||
if(isObject(%targetFilename))
|
||||
{
|
||||
%targetFilename = strReplace(%value, "~", $ProjectImporter::modulePath @ "/main/");
|
||||
}
|
||||
}
|
||||
else if ((strpos(%value,"/") == -1)&&(strpos(%value,"\\") == -1))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::currentFilePath @ %value;
|
||||
}
|
||||
else if(!startsWith(%value, $ProjectImporter::modulePath @ "/"))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::modulePath @ "/" @ %value;
|
||||
//likely a material name, so handle it that way
|
||||
%assetId = MaterialAsset::getAssetIdByMaterialName(%targetFilename);
|
||||
}
|
||||
else
|
||||
{
|
||||
%targetFilename = %value;
|
||||
}
|
||||
|
||||
%targetFilename = strReplace(%targetFilename, "//", "/");
|
||||
%targetFilename = testFilenameExtensions(%targetFilename);
|
||||
|
||||
if(!isFile(%targetFilename)) //if our presumed file target is bad, just bail out
|
||||
if(!isFile(%targetFilename))
|
||||
{
|
||||
error("Legacy Project Importer - file described in line could not be found/is not valid");
|
||||
return %line;
|
||||
|
|
@ -483,11 +535,12 @@ function processLegacyField(%line, %originalFieldName, %newFieldName)
|
|||
if(%foundAssets != 0)
|
||||
{
|
||||
%assetId = $ProjectImporter::assetQuery.getAsset(0);
|
||||
echo("Legacy Project Importer - processing of legacy field line's value: " @ %value @ " has found a matching AssetId: " @ %assetId);
|
||||
}
|
||||
}
|
||||
|
||||
if(%assetId !$= "" && AssetDatabase.isDeclaredAsset(%assetId))
|
||||
{
|
||||
echo("Legacy Project Importer - processing of legacy field line's value: " @ %value @ " has found a matching AssetId: " @ %assetId);
|
||||
//if (%assetId.getStatusString() $= "Ok")
|
||||
%outLine = strReplace(%outLine, %value, %assetId);
|
||||
//else
|
||||
|
|
@ -523,45 +576,7 @@ function processLegacyShapeConstructorField(%line)
|
|||
if(strPos(%animSourcePath, ":") != -1)
|
||||
return %line;
|
||||
|
||||
//otherwise, try and see if we've got an animation source file here
|
||||
if(startsWith(%animSourcePath, "./"))
|
||||
{
|
||||
%targetFilename = strReplace(%animSourcePath, "./", $ProjectImporter::currentFilePath @ "/");
|
||||
}
|
||||
else if(startsWith(%animSourcePath, "../"))
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/");
|
||||
if(%slashPos == strlen($ProjectImporter::currentFilePath)-1) //if it's right at the end, we'll get the next one up
|
||||
{
|
||||
%slashPos = strposr($ProjectImporter::currentFilePath, "/", 2);
|
||||
}
|
||||
|
||||
%parentPath = getSubStr($ProjectImporter::currentFilePath, 0, %slashPos);
|
||||
%targetFilename = strReplace(%animSourcePath, "../", %parentPath @ "/");
|
||||
}
|
||||
else if(startsWith(%animSourcePath, "~"))
|
||||
{
|
||||
%targetFilename = strReplace(%animSourcePath, "~", $ProjectImporter::modulePath @ "/");
|
||||
if(!isFile(%targetFilename))
|
||||
{
|
||||
%targetFilename = strReplace(%animSourcePath, "~", $ProjectImporter::modulePath @ "/main/");
|
||||
}
|
||||
}
|
||||
else if ((strpos(%animSourcePath,"/") == -1)&&(strpos(%animSourcePath,"\\") == -1))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::currentFilePath @ %animSourcePath;
|
||||
}
|
||||
else if(!startsWith(%animSourcePath, $ProjectImporter::modulePath @ "/"))
|
||||
{
|
||||
%targetFilename = $ProjectImporter::modulePath @ "/" @ %animSourcePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
%targetFilename = %animSourcePath;
|
||||
}
|
||||
|
||||
%targetFilename = strReplace(%targetFilename, "//", "/");
|
||||
%targetFilename = testFilenameExtensions(%targetFilename);
|
||||
%targetFilename = sanitizeFilename(%animSourcePath);
|
||||
|
||||
if(!isFile(%targetFilename))
|
||||
{
|
||||
|
|
@ -828,6 +843,14 @@ function beginTerrainImport()
|
|||
%filePath = filePath(%file);
|
||||
if(%fileExt $= ".ter")
|
||||
{
|
||||
%sanitizedFile = sanitizeFilename(%file);
|
||||
if(%sanitizedFile !$= %file)
|
||||
{
|
||||
%file = %sanitizedFile;
|
||||
%fileName = fileName(%file);
|
||||
%filePath = filePath(%file);
|
||||
}
|
||||
|
||||
$ProjectImporter::assetQuery.clear();
|
||||
%assetsFound = AssetDatabase.findAssetLooseFile($ProjectImporter::assetQuery, %file);
|
||||
if(%assetsFound == 0)
|
||||
|
|
|
|||
|
|
@ -3369,7 +3369,7 @@ function ShapeEdMountWindow::mountShape( %this, %slot )
|
|||
%type = %this-->mountType.getText();
|
||||
|
||||
if ( %model $= "Browse..." )
|
||||
%model = "core/shapes/octahedron.dts";
|
||||
%model = "core/gameObjects/shapes/octahedron.dts";
|
||||
|
||||
if ( ShapeEdShapeView.mountShape( %model, %node, %type, %slot ) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue