Merge pull request #719 from Areloch/UpdatedProjectImporter

Updated project importer
This commit is contained in:
Brian Roberts 2022-01-20 17:52:25 -06:00 committed by GitHub
commit d14ffc8714
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 3092 additions and 2788 deletions

View file

@ -102,7 +102,7 @@ void GUIAsset::initPersistFields()
&setScriptFile, &getScriptFile, "Path to the script file for the gui"); &setScriptFile, &getScriptFile, "Path to the script file for the gui");
addProtectedField("GUIFile", TypeAssetLooseFilePath, Offset(mGUIFile, GUIAsset), addProtectedField("GUIFile", TypeAssetLooseFilePath, Offset(mGUIFile, GUIAsset),
&setScriptFile, &getScriptFile, "Path to the gui file"); &setGUIFile, &getGUIFile, "Path to the gui file");
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View file

@ -623,8 +623,8 @@ const char* ShapeAsset::generateCachedPreviewImage(S32 resolution, String overri
String dumpPath = String(mFilePath) + "_Preview.dds"; String dumpPath = String(mFilePath) + "_Preview.dds";
char* returnBuffer = Con::getReturnBuffer(dumpPath.length()); char* returnBuffer = Con::getReturnBuffer(128);
dSprintf(returnBuffer, dumpPath.length(), "%s", dumpPath.c_str()); dSprintf(returnBuffer, 128, "%s", dumpPath.c_str());
/*FileStream stream; /*FileStream stream;
if (stream.open(dumpPath, Torque::FS::File::Write)) if (stream.open(dumpPath, Torque::FS::File::Write))

View file

@ -2099,10 +2099,15 @@ void AssetImporter::processShapeMaterialInfo(AssetImportObject* assetItem, S32 m
String imgFileName = AssetImporter::findImagePath(testFilePath.getPath() + "/" + testFilePath.getFileName()); String imgFileName = AssetImporter::findImagePath(testFilePath.getPath() + "/" + testFilePath.getFileName());
if (imgFileName.isNotEmpty()) if (imgFileName.isNotEmpty())
filePath = imgFileName; filePath = imgFileName;
else
filePath = ""; //no luck, so we just won't try importing in the image
} }
} }
matAssetItem = addImportingAsset("MaterialAsset", shapePathBase + "/" + matName, assetItem, matName); matAssetItem = addImportingAsset("MaterialAsset", shapePathBase + "/" + matName, assetItem, matName);
if (!filePath.isEmpty())
{
AssetImportObject* imageAssetItem = addImportingAsset("ImageAsset", filePath, matAssetItem, ""); AssetImportObject* imageAssetItem = addImportingAsset("ImageAsset", filePath, matAssetItem, "");
String suffixType; String suffixType;
@ -2117,6 +2122,7 @@ void AssetImporter::processShapeMaterialInfo(AssetImportObject* assetItem, S32 m
imageAssetItem->imageSuffixType = "Albedo"; imageAssetItem->imageSuffixType = "Albedo";
} }
} }
}
else else
{ {
matAssetItem = addImportingAsset("MaterialAsset", shapePathBase + "/" + matName, assetItem, matName); matAssetItem = addImportingAsset("MaterialAsset", shapePathBase + "/" + matName, assetItem, matName);

View file

@ -217,6 +217,11 @@ ImplementEnumType(_TamlFormatMode,
FileStream stream; FileStream stream;
if (StringTable->insert("c://.asset.taml") == StringTable->insert(mFilePathBuffer))
{
bool asdfasdf = true;
}
// File opened? // File opened?
if (!stream.open(mFilePathBuffer, Torque::FS::File::Write)) if (!stream.open(mFilePathBuffer, Torque::FS::File::Write))
{ {

View file

@ -256,8 +256,10 @@ DefineEngineFunction(TamlWrite, bool, (SimObject* simObject, const char* filenam
} }
else else
{ {
#ifdef TORQUE_DEBUG
// No, so warn. // No, so warn.
Con::warnf( "TamlWrite() - Setting binary compression is only valid for XML formatting." ); Con::warnf( "TamlWrite() - Setting binary compression is only valid for XML formatting." );
#endif
} }
// Turn-off auto-formatting. // Turn-off auto-formatting.

View file

@ -100,7 +100,7 @@
<Setting name="LOSCollisionMeshPrefix">LOS</Setting> <Setting name="LOSCollisionMeshPrefix">LOS</Setting>
</Group> </Group>
<Group name="General"> <Group name="General">
<Setting name="AddDirectoryPrefixToAssetName">1</Setting> <Setting name="AddDirectoryPrefixToAssetName">0</Setting>
<Setting name="AutomaticallyPromptMissingFiles">0</Setting> <Setting name="AutomaticallyPromptMissingFiles">0</Setting>
<Setting name="DuplicateAutoResolution">FolderPrefix</Setting> <Setting name="DuplicateAutoResolution">FolderPrefix</Setting>
<Setting name="PreventImportWithErrors">1</Setting> <Setting name="PreventImportWithErrors">1</Setting>

View file

@ -45,57 +45,7 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiSplitContainer() { new GuiScrollCtrl(ProejctImportPageContainer) {
orientation = "Vertical";
splitterSize = "2";
splitPoint = "152 100";
fixedPanel = "FirstPanel";
fixedSize = "100";
docking = "None";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "6 24";
extent = "531 445";
minExtent = "64 64";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiSolidDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiPanel() {
docking = "Client";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "150 445";
minExtent = "16 16";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "Panel1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiScrollCtrl() {
willFirstRespond = "1"; willFirstRespond = "1";
hScrollBar = "dynamic"; hScrollBar = "dynamic";
vScrollBar = "dynamic"; vScrollBar = "dynamic";
@ -110,97 +60,8 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorBottom = "0"; anchorBottom = "0";
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "0 0"; position = "0 25";
extent = "150 445"; extent = "541 437";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextListCtrl() {
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
rowHeightPadding = "2";
position = "1 1";
extent = "135 128";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "stepsList";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiControl() {
position = "1 1";
extent = "150 445";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
new GuiPanel() {
docking = "Client";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "154 0";
extent = "377 445";
minExtent = "16 16";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "panel2";
canSave = "1";
canSaveDynamicFields = "0";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "dynamic";
vScrollBar = "dynamic";
lockHorizScroll = "0";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "377 445";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "width"; horizSizing = "width";
vertSizing = "height"; vertSizing = "height";
@ -223,7 +84,7 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
position = "1 1"; position = "1 1";
extent = "365 429"; extent = "365 429";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "width";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "0"; visible = "0";
@ -242,9 +103,6 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "Welcome! This project importer will assist you in importing in legacy projects into this build of Torque3D."; text = "Welcome! This project importer will assist you in importing in legacy projects into this build of Torque3D.";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 21"; position = "23 21";
extent = "328 28"; extent = "328 28";
minExtent = "8 2"; minExtent = "8 2";
@ -265,9 +123,6 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "To continue, click Next."; text = "To continue, click Next.";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 77"; position = "23 77";
extent = "328 14"; extent = "328 14";
minExtent = "8 2"; minExtent = "8 2";
@ -291,9 +146,9 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "1 1"; position = "1 1";
extent = "365 429"; extent = "539 429";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "width";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "0"; visible = "0";
@ -312,20 +167,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "First, you must select what version of Torque3D the prior project\'s content is coming from."; text = "First, you must select what version of Torque3D the prior project\'s content is coming from.";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 21"; position = "23 21";
extent = "328 28"; extent = "328 28";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -341,18 +194,19 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorBottom = "0"; anchorBottom = "0";
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "50 104"; position = "138 104";
extent = "268 18"; extent = "268 18";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "center";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiPopUpMenuProfile"; profile = "ToolsGuiPopUpMenuProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
internalName = "previousContentVersionPopup"; internalName = "previousContentVersionPopup";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -362,20 +216,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "Now that that\'s selected, press Next to continue."; text = "Now that that\'s selected, press Next to continue.";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 181"; position = "23 181";
extent = "328 14"; extent = "328 14";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -388,17 +240,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "1 1"; position = "1 1";
extent = "365 429"; extent = "538 429";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "width";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
internalName = "page2"; internalName = "page2";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
@ -408,80 +261,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "Next, where is the previous project\'s content?"; text = "Next, where is the previous project\'s content?";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 21"; position = "23 21";
extent = "328 14"; extent = "328 14";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
canSave = "1"; hidden = "1";
canSaveDynamicFields = "0";
};
new GuiRadioCtrl() {
text = "Existing folder in current project\'s data/ folder";
groupNum = "-1";
buttonType = "RadioButton";
useMouseEvents = "0";
position = "22 53";
extent = "320 52";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiRadioProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "internalFolderBtn";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiRadioCtrl() {
text = "Existing folder not in the current project\'s data/ folder";
groupNum = "-1";
buttonType = "RadioButton";
useMouseEvents = "0";
position = "22 109";
extent = "320 52";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiRadioProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "externalFolderBtn";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiRadioCtrl() {
text = "Core and Tools";
groupNum = "-1";
buttonType = "RadioButton";
useMouseEvents = "0";
position = "22 157";
extent = "320 52";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiRadioProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "coreAndToolsBtn";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -491,20 +282,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "Now, point to the folder to be imported."; text = "Now, point to the folder to be imported.";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0"; position = "123 221";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 221";
extent = "328 14"; extent = "328 14";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -513,19 +302,20 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
groupNum = "-1"; groupNum = "-1";
buttonType = "PushButton"; buttonType = "PushButton";
useMouseEvents = "0"; useMouseEvents = "0";
position = "19 246"; position = "123 246";
extent = "330 30"; extent = "330 30";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiButtonProfile"; profile = "ToolsGuiButtonProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
command = "ProjectImportWindow.selectOGFolder();"; command = "ProjectImportWindow.selectOGFolder();";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "selectOriginalContentFolderBtn"; internalName = "selectOriginalContentFolderBtn";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -534,21 +324,19 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
allowColorChars = "0"; allowColorChars = "0";
maxChars = "-1"; maxChars = "-1";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 341"; position = "23 341";
extent = "328 14"; extent = "500 14";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "center";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "targetImportingPath"; internalName = "targetImportingPath";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -561,7 +349,7 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "1 1"; position = "1 1";
extent = "365 429"; extent = "539 429";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
@ -582,20 +370,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "Under normal circumstances, all game content in Torque3D is grouped together in packages named Modules. These are placed into the game\'s data/ directory, which the system automatically scans on start. "; text = "Under normal circumstances, all game content in Torque3D is grouped together in packages named Modules. These are placed into the game\'s data/ directory, which the system automatically scans on start. ";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 21"; position = "23 21";
extent = "328 56"; extent = "328 56";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -605,20 +391,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "To port your legacy content, first we need a module to port the content into. Please provide a module name in the text field below, and the importer will create a new module folder for you."; text = "To port your legacy content, first we need a module to port the content into. Please provide a module name in the text field below, and the importer will create a new module folder for you.";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 85"; position = "23 85";
extent = "325 42"; extent = "325 42";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -628,20 +412,18 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
maxChars = "-1"; maxChars = "-1";
text = "For your convenience, we\'ve pre-populated the field with the name of the folder you\'d selected to import, but you can change it to whatever you want the module to be!"; text = "For your convenience, we\'ve pre-populated the field with the name of the folder you\'d selected to import, but you can change it to whatever you want the module to be!";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0"; position = "119 157";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 157";
extent = "325 42"; extent = "325 42";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "center";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -658,18 +440,19 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorBottom = "0"; anchorBottom = "0";
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "79 215"; position = "175 215";
extent = "209 18"; extent = "209 18";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiTextEditProfile"; profile = "GuiTextEditProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
internalName = "newModuleName"; internalName = "newModuleName";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -682,7 +465,7 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "1 1"; position = "1 1";
extent = "365 429"; extent = "539 429";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
@ -701,58 +484,8 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
lineSpacing = "2"; lineSpacing = "2";
allowColorChars = "0"; allowColorChars = "0";
maxChars = "-1"; maxChars = "-1";
text = "Before we run the actual import, we\'ll start by preprocessing the files so we know what we\'re working with. This may take a moment.";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 21";
extent = "328 14";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "fileCopyText";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiContainer(ProjectImportWizardPage5) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "1 1";
extent = "365 429";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "page5";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "Now we actually run the import of the files and content. This will process the original files into assets, and updating any references in scripts to utilize the new AssetIDs.";
useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 21"; position = "23 21";
extent = "328 42"; extent = "328 42";
minExtent = "8 2"; minExtent = "8 2";
@ -771,28 +504,26 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
lineSpacing = "2"; lineSpacing = "2";
allowColorChars = "0"; allowColorChars = "0";
maxChars = "-1"; maxChars = "-1";
text = "Processing..."; text = "Done!";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0"; position = "107 181";
typeOverTimeSpeedMS = "10"; extent = "328 14";
typeoutSoundRate = "-1";
position = "64 141";
extent = "245 14";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "center";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "processingText"; internalName = "preprocessCompleteText";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
}; };
new GuiContainer(ProjectImportWizardPage6) { new GuiContainer(ProjectImportWizardFinalPage) {
margin = "0 0 0 0"; margin = "0 0 0 0";
padding = "0 0 0 0"; padding = "0 0 0 0";
anchorTop = "1"; anchorTop = "1";
@ -800,9 +531,9 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "1 1"; position = "1 1";
extent = "365 429"; extent = "539 429";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "width";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "0"; visible = "0";
@ -810,7 +541,6 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
internalName = "page6";
hidden = "1"; hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
@ -819,97 +549,22 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
lineSpacing = "2"; lineSpacing = "2";
allowColorChars = "0"; allowColorChars = "0";
maxChars = "-1"; maxChars = "-1";
text = "We\'ll now go through and process any script files to ensure they use the currently designated extension."; text = "And with that, your legacy project content has been imported in as a Torque3D-ready module!";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
useTypeOverTime = "0"; position = "119 173";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 21";
extent = "328 28"; extent = "328 28";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "Processing...";
useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "64 141";
extent = "245 14";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "processingText";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiContainer(ProjectImportWizardPage7) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "1 1";
extent = "365 429";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0"; visible = "0";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "0";
internalName = "page7";
hidden = "1"; hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "And with that, your legacy project content has been imported in as a Torque3D 4.0 ready module!";
useURLMouseCursor = "0";
useTypeOverTime = "0";
typeOverTimeSpeedMS = "10";
typeoutSoundRate = "-1";
position = "23 141";
extent = "328 28";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
}; };
}; };
}; };
@ -956,32 +611,6 @@ $guiContent = new GuiControl(ProjectImportCtrl) {
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiBitmapButtonCtrl() {
bitmapAsset = "ToolsModule:iconInformation_image";
bitmapMode = "Centered";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
masked = "0";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "-187 555";
extent = "22 22";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "ImportAssetWindow.toggleLogWindow();";
tooltipProfile = "GuiToolTipProfile";
tooltip = "View Import Log";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
}; };
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---

View file

@ -0,0 +1,7 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="pre40ImporterGuis"
GUIFile="@assetFile=pre40ImporterGuis.gui"
ScriptFile="@assetFile=pre40ImporterGuis.tscript"
VersionId="1" />

View file

@ -0,0 +1,129 @@
//--- OBJECT WRITE BEGIN ---
new GuiContainer(Pre40ImporterPage0) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "1 1";
extent = "539 429";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "Next, we'll import in content files, such as image, models and sounds.";
useURLMouseCursor = "0";
position = "111 21";
extent = "328 28";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "Processing...";
useURLMouseCursor = "0";
position = "152 141";
extent = "245 14";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "processingText";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiContainer(Pre40ImporterPage1) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "1 1";
extent = "539 429";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "Now, we'll import in script-based files such as guis, levels and scripts.";
useURLMouseCursor = "0";
position = "111 21";
extent = "328 28";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiMLTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "Processing...";
useURLMouseCursor = "0";
position = "152 141";
extent = "245 14";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "processingText";
canSave = "1";
canSaveDynamicFields = "0";
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,99 @@
//==============================================================================
// We first copy over binary files(images, shapes, sounds, etc) to the destination
// module, then run the processing/import on them to generate the assets
//==============================================================================
function Pre40ImporterPage0::openPage(%this)
{
ProjectImportWindow-->nextButton.setActive(false);
%this-->processingText.setText("Processing...");
Canvas.repaint();
//copy binary files over
for(%i=0; %i < $ProjectImporter::FileList.count(); %i++)
{
%file = $ProjectImporter::FileList.getKey(%i);
%rootFileSectionObject = $ProjectImporter::FileList.getValue(%i);
if(%rootFileSectionObject.binaryFile == true)
{
%filePath = filePath(%file);
%fileName = %rootFileSectionObject.fileName;
%fileBase = %rootFileSectionObject.fileBase;
%fileExt = %rootFileSectionObject.fileExt;
//filter out some unneeded folders
%slashCount = getTokenCount(%filePath, "/");
%topFolder = getToken(%filePath, "/", %slashCount-1);
if(%topFolder $= "")
%topFolder = getToken(%filePath, "/", %slashCount-2);
if(%topFolder $= "creator" || %topFolder $= "tools" || %topFolder $= "web")
{
%file = findNextFileMultiExpr( $ProjectImporter::sourceContentFolder @ "/*.*" );
continue;
}
%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))
{
DirectoryHandler::createFolder(0, %targetFolder);
}
if(!pathCopy(%file, %targetFilePath, false))
{
$ProjectImporter::log.add("Legacy Project Importer, failed to copy file: " @ %file @ " to destination: " @ %targetFilePath);
continue;
}
%rootFileSectionObject.localPath = %targetFilePath;
//If it was an asset definition file, go ahead and register it
if(%rootFileSectionObject.isAssetFile)
{
%moduleName = AssetBrowser.dirHandler.getModuleFromAddress(%targetFilePath).ModuleId;
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
AssetDatabase.addDeclaredAsset(%moduleDef, %targetFilePath);
}
}
}
//Now, we need to do some initial importing processing
T3Dpre4ProjectImporter.doContentImport();
//Once that's done, update the text of the UI
%this-->processingText.setText("Done!");
ProjectImportWindow-->nextButton.setActive(true);
Canvas.repaint();
}
//==============================================================================
// This page actually invokes the processing of the script-based files and objects
//==============================================================================
function Pre40ImporterPage1::openPage(%this)
{
ProjectImportWindow-->nextButton.setActive(false);
%this-->processingText.setText("Processing...");
Canvas.repaint();
//Now, we need to do some initial importing processing
T3Dpre4ProjectImporter.doScriptImport();
//Once that's done, update the text of the UI
%this-->processingText.setText("Done!");
ProjectImportWindow-->nextButton.setActive(true);
Canvas.repaint();
}

View file

@ -24,11 +24,6 @@ function initializeProjectImporter()
echo(" % - Initializing Project Importer"); echo(" % - Initializing Project Importer");
exec("./scripts/projectImporter." @ $TorqueScriptFileExtension); exec("./scripts/projectImporter." @ $TorqueScriptFileExtension);
//Versioned actions
exec("./scripts/pre40/T3Dpre4ProjectImporter." @ $TorqueScriptFileExtension);
exec("./guis/projectImporter.gui"); exec("./guis/projectImporter.gui");
new ScriptObject( ProjectImporterPlugin ) new ScriptObject( ProjectImporterPlugin )