mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 00:05:40 +00:00
Removed unneeded default irradiance and prefilter cubemaps, and their convars
Added getGUIPath console function to guiAsset Corrected console function documentation for getScriptPath in MaterialAsset Added getter console functions to PostEffectAsset Added getAnimationPath console function to PostEffectAsset Fixes handling of mapto with the reskin usage when generating preview renders for ShapeAssets Standardizes getShapeFile to getShapePath on ShapeAsset to better match formatting of other getters on assets Adds sanity checking for getStringWidth to prevent crash if there's an issue with the font being ready at time of request(from Az) Earlies out on rendering of impostors if it's the deferred bin to prevent unneeded duplicate rendering messing up results(from Az) Fixed duplicate naming of quality levels on LightingQualityList Added check so if _makePrettyResString is handed a 'human formatted' resolution string(as in, has <width> x <height> it can handle that properly Shifted yes/no and on/off option lists to globals for ease and consistency of handling on options menu Improves check for unapplied graphics options on options menu and applies them all at once Add sanitizing of variable names so getVariable doesn't have issues when looking up array variables in optionsMenu logic Adds better tracking of what options menu category is shown so refreshes don't reset it Add better handling for changing resolution in options menu and getting it to apply properly Adds better utility functions for setting bools vs optionsLists vs quality lists and updates options fields to use the most appropriate Removes redundant setting of $pref::SFX::channelVolume vars in defaults.tscript Removed unneeded extra logging from asset browser drag-n-drop actions Adds item to RMB context menu in AB to regenerate preview images Fixes move command for asset types(needed to properly reference the full path of the associated files) and added it for shapes, animations and terrains Added logic so when the dropdown for selecting a target module on the Create New Asset window is changed, it forcefully updates the target path to point to the module to avoid erroneous paths being provided Adds proper clamping of values to Forest Editor's brush size in the editor bar. Could be set to below 1 even though it would visually clamp to 1. Temporarily disables fields and handling of 'open in Torsion'. Fixes bad pixel in gui/images/tab_border.png which was causing it to fail to generate bitmap array properly Makes the New GUI option from menubar in GUI Editor use same Create New Asset method as everything else Disables access to the CubemapDesc reflector field in the material editor as it's not nominally used now in favor of probes Adds proper loading of roughness and metalness fields in material editor Fixes the default ReflectProbePreviewMat to use a better base DiffuseMap (No Material) rather than the occluder Fixes disable display for some options in the advanced panel in the shape editor so they look more fitting to everything else Adds check to avoid spam of markItem errors in the event requested tree item is invalid Fixed remove material button and command in TerrainMaterial Editor
This commit is contained in:
parent
798dd6ca6b
commit
d044ae0702
47 changed files with 576 additions and 237 deletions
|
|
@ -1088,7 +1088,7 @@ function AssetBrowserPreviewButton::onRightClick(%this)
|
|||
|
||||
//Do some enabling/disabling of options depending on asset type
|
||||
EditAssetPopup.enableItem(0, true);
|
||||
EditAssetPopup.enableItem(7, true);
|
||||
EditAssetPopup.enableItem(9, true);
|
||||
|
||||
//Is it an editable type?
|
||||
if(%assetType $= "ImageAsset" /*|| %assetType $= "GameObjectAsset"*/ || %assetType $= "CppAsset")
|
||||
|
|
@ -1101,9 +1101,18 @@ function AssetBrowserPreviewButton::onRightClick(%this)
|
|||
|| %assetType $= "MaterialAsset" || %assetType $= "ParticleAsset" || %assetType $= "PostEffectAsset" || %assetType $= "ScriptAsset"
|
||||
|| %assetType $= "StateMachineAsset")
|
||||
{
|
||||
EditAssetPopup.enableItem(7, false);
|
||||
EditAssetPopup.enableItem(9, false);
|
||||
}
|
||||
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
if(%assetDef.originalFilePath $= "" || !isFile(%assetDef.originalFilePath))
|
||||
{
|
||||
//if we have no noted original import file path or it's invalid
|
||||
//we can't reimport either
|
||||
EditAssetPopup.enableItem(9, false);
|
||||
}
|
||||
AssetDatabase.releaseAsset(EditAssetPopup.assetId);
|
||||
|
||||
if(%assetType $= "LevelAsset")
|
||||
{
|
||||
EditLevelAssetPopup.showPopup(Canvas);
|
||||
|
|
@ -2403,19 +2412,14 @@ function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
|
|||
%assetName = %payload.assetName;
|
||||
%moduleName = %payload.moduleName;
|
||||
|
||||
echo("DROPPED A " @ %assetType @ " ON THE ASSET BROWSER NAVIGATION TREE!");
|
||||
|
||||
%item = %this.getItemAtPosition(%position);
|
||||
|
||||
echo("DROPPED IT ON ITEM " @ %item);
|
||||
|
||||
%parent = %this.getParentItem(%item);
|
||||
|
||||
if(%item != 1)
|
||||
{
|
||||
//we're a folder entry, cool
|
||||
%path = %this.getItemValue(%item) @ "/" @ %this.getItemText(%item);
|
||||
echo("DROPPED IT ON PATH " @ %path);
|
||||
|
||||
if(%path !$= AssetBrowser.dirHandler.CurrentAddress)
|
||||
{
|
||||
|
|
@ -2430,7 +2434,11 @@ function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
|
|||
|
||||
//Do any cleanup required given the type
|
||||
if(AssetBrowser.isMethod("moveFolder"))
|
||||
{
|
||||
eval(AssetBrowser @ ".moveFolder(\""@%originFolder@"\",\""@%path@"\");");
|
||||
|
||||
AssetBrowser.refresh();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2443,6 +2451,8 @@ function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
|
|||
{
|
||||
%command = AssetBrowser @ ".move" @ %assetType @ "(" @ %assetDef @ ",\"" @ %path @ "\");";
|
||||
eval(AssetBrowser @ ".move" @ %assetType @ "(" @ %assetDef @ ",\"" @ %path @ "\");");
|
||||
|
||||
AssetBrowser.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ function AssetBrowser::deleteCpp(%this, %assetDef)
|
|||
function AssetBrowser::moveCpp(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ function AssetBrowser::deleteCubemapAsset(%this, %assetDef)
|
|||
function AssetBrowser::moveCubemapAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
/*%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ function AssetBrowser::deleteGameObjectAsset(%this, %assetDef)
|
|||
function AssetBrowser::moveGameObjectAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
|
|
|
|||
|
|
@ -145,15 +145,15 @@ function AssetBrowser::deleteGUIAsset(%this, %assetDef)
|
|||
function AssetBrowser::moveGUIAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.guifile, %destination);
|
||||
moveAssetLooseFile(%assetDef.scriptFile, %destination);
|
||||
moveAssetLooseFile(%assetDef.getGUIPath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getScriptPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
|
|
|
|||
|
|
@ -175,8 +175,11 @@ function AssetBrowser::importImageAsset(%this, %assetItem)
|
|||
AssetDatabase.refreshAsset(%assetId);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
|
||||
function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
||||
{
|
||||
if(%forcePreviewRegenerate $= "")
|
||||
%forcePreviewRegenerate = false;
|
||||
|
||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getImagePath())));
|
||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
||||
|
||||
|
|
@ -195,7 +198,7 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
|
|||
|
||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||
|
||||
if(%generatePreview)
|
||||
if(%generatePreview || %forcePreviewRegenerate)
|
||||
{
|
||||
displayEditorLoadingGui("Generating Image Asset Preview...");
|
||||
|
||||
|
|
@ -203,20 +206,23 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
|
|||
|
||||
if(%success)
|
||||
{
|
||||
%previewAsset = new ImageAsset()
|
||||
if(!AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%previewAssetName = "ToolsModule:" @ %previewAssetName;
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
%previewAsset = new ImageAsset()
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
%previewAssetName = "ToolsModule:" @ %previewAssetName;
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -303,14 +309,14 @@ function AssetBrowser::deleteImageAsset(%this, %assetDef)
|
|||
function AssetBrowser::moveImageAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.imageFile, %destination);
|
||||
moveAssetLooseFile(%assetDef.getImagePath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
|
|
|
|||
|
|
@ -113,14 +113,18 @@ function AssetBrowser::deleteLevelAsset(%this, %assetDef)
|
|||
function AssetBrowser::moveLevelAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.LevelFile, %destination);
|
||||
moveAssetLooseFile(%assetDef.getLevelPath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getLevelPath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getPreviewImagePath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getPostFXPresetPath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getDecalsPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
|
|
|
|||
|
|
@ -69,14 +69,14 @@ function AssetBrowser::deleteMaterialAsset(%this, %assetDef)
|
|||
function AssetBrowser::moveMaterialAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.scriptPath, %destination);
|
||||
moveAssetLooseFile(%assetDef.getScriptPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
|
|
@ -424,8 +424,11 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
|
|||
AssetDatabase.refreshAsset(%assetId);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
|
||||
{
|
||||
function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
||||
{
|
||||
if(%forcePreviewRegenerate $= "")
|
||||
%forcePreviewRegenerate = false;
|
||||
|
||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()))));
|
||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
||||
|
||||
|
|
@ -447,14 +450,13 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
|
|||
{
|
||||
if(compareFileTimes(%assetDef.materialDefinitionName.getDiffuseMap(0), %previewFilePath) == 1 ||
|
||||
compareFileTimes(%assetDef.materialDefinitionName.getFilename(), %previewFilePath) == 1)
|
||||
%generatePreview = true;
|
||||
|
||||
%generatePreview = true;
|
||||
}
|
||||
}
|
||||
|
||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||
|
||||
if(%generatePreview)
|
||||
if(%generatePreview || %forcePreviewRegenerate)
|
||||
{
|
||||
displayEditorLoadingGui("Generating Material Asset Preview...");
|
||||
|
||||
|
|
@ -466,19 +468,26 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
|
|||
pathCopy(%generatedFilePath, %previewFilePath);
|
||||
fileDelete(%generatedFilePath);
|
||||
|
||||
%previewAsset = new ImageAsset()
|
||||
if(!AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
%previewAsset = new ImageAsset()
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error("Failed to generate preview for material: " @ %assetDef.materialDefinitionName);
|
||||
}
|
||||
|
||||
hideEditorLoadingGui();
|
||||
|
|
@ -504,11 +513,15 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
|
|||
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||
else
|
||||
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||
|
||||
%definitionPath = %assetDef.getScriptPath();
|
||||
if(%definitionPath $= "")
|
||||
%definitionPath = %assetDef.getFilename();
|
||||
|
||||
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @
|
||||
"\nAsset Type: Material Asset" @
|
||||
"\nAsset Definition ID: " @ %assetDef @
|
||||
"\nDefinition Path: " @ %assetDef.getScriptPath();
|
||||
"\nDefinition Path: " @ %definitionPath;
|
||||
|
||||
if(!%this.selectMode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -140,16 +140,16 @@ function AssetBrowser::deletePostEffectAsset(%this, %assetDef)
|
|||
function AssetBrowser::movePostEffectAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.scriptPath, %destination);
|
||||
moveAssetLooseFile(%assetDef.hlslShader, %destination);
|
||||
moveAssetLooseFile(%assetDef.glslShader, %destination);
|
||||
moveAssetLooseFile(%assetDef.getScriptPath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getHLSLShaderPath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getGLSLShaderPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function AssetBrowser::editScriptAsset(%this, %assetDef)
|
|||
{
|
||||
%scriptFile = %assetDef.scriptFile;
|
||||
|
||||
EditorOpenFileInTorsion(makeFullPath(%scriptFile), 0);
|
||||
//EditorOpenFileInTorsion(makeFullPath(%scriptFile), 0);
|
||||
}
|
||||
|
||||
function AssetBrowser::duplicateScriptAsset(%this, %assetDef, %targetModule)
|
||||
|
|
@ -76,14 +76,14 @@ function AssetBrowser::deleteScriptAsset(%this, %assetDef)
|
|||
function AssetBrowser::moveScriptAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.scriptFile, %destination);
|
||||
moveAssetLooseFile(%assetDef.getScriptPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
|
|
@ -93,7 +93,7 @@ function AssetBrowser::buildScriptAssetPreview(%this, %assetDef, %previewData)
|
|||
{
|
||||
%previewData.assetName = %assetDef.assetName;
|
||||
%previewData.assetPath = %assetDef.scriptFile;
|
||||
%previewData.doubleClickCommand = "EditorOpenFileInTorsion( \""@%previewData.assetPath@"\", 0 );";
|
||||
//%previewData.doubleClickCommand = "EditorOpenFileInTorsion( \""@%previewData.assetPath@"\", 0 );";
|
||||
|
||||
if(%assetDef.isServerSide)
|
||||
%previewData.previewImage = "ToolsModule:serverScriptIcon_image";
|
||||
|
|
@ -109,7 +109,7 @@ function AssetBrowser::buildTScriptPreview(%this, %assetDef, %previewData)
|
|||
{
|
||||
%previewData.assetName = %assetDef.assetName;
|
||||
%previewData.assetPath = %assetDef.scriptFile;
|
||||
%previewData.doubleClickCommand = "EditorOpenFileInTorsion( \""@%previewData.assetPath@"\", 0 );";
|
||||
//%previewData.doubleClickCommand = "EditorOpenFileInTorsion( \""@%previewData.assetPath@"\", 0 );";
|
||||
|
||||
if(%assetDef.isServerSide)
|
||||
%previewData.previewImage = "ToolsModule:serverScriptIcon_image";
|
||||
|
|
|
|||
|
|
@ -46,6 +46,23 @@ function AssetBrowser::deleteShapeAsset(%this, %assetDef)
|
|||
|
||||
}
|
||||
|
||||
function AssetBrowser::moveShapeAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.getShapePath(), %destination);
|
||||
moveAssetLooseFile(%assetDef.getShapeConstructorFilePath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
}
|
||||
|
||||
function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
|
||||
{
|
||||
ImportActivityLog.add("Preparing Shape for Import: " @ %assetItem.assetName);
|
||||
|
|
@ -246,9 +263,12 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
|
|||
AssetDatabase.refreshAsset(%assetId);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
|
||||
function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
||||
{
|
||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getShapeFile())));
|
||||
if(%forcePreviewRegenerate $= "")
|
||||
%forcePreviewRegenerate = false;
|
||||
|
||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getShapePath())));
|
||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
||||
|
||||
if(!IsDirectory(%previewPath))
|
||||
|
|
@ -259,14 +279,14 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
|
|||
%generatePreview = false;
|
||||
|
||||
%previewFilePath = %previewPath @ %assetDef.assetName @ "_Preview.dds";
|
||||
if(!isFile(%previewFilePath) || (compareFileTimes(%assetDef.getShapeFile(), %previewFilePath) == 1))
|
||||
if(!isFile(%previewFilePath) || (compareFileTimes(%assetDef.getShapePath(), %previewFilePath) == 1))
|
||||
{
|
||||
%generatePreview = true;
|
||||
}
|
||||
|
||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||
|
||||
if(%generatePreview)
|
||||
if(%generatePreview || %forcePreviewRegenerate)
|
||||
{
|
||||
displayEditorLoadingGui("Generating Shape Asset Preview...");
|
||||
|
||||
|
|
@ -278,19 +298,22 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
|
|||
pathCopy(%filePath, %previewFilePath);
|
||||
fileDelete(%filePath); //cleanup
|
||||
|
||||
%previewAsset = new ImageAsset()
|
||||
if(!AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
%previewAsset = new ImageAsset()
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
}
|
||||
|
||||
hideEditorLoadingGui();
|
||||
}
|
||||
|
|
@ -313,7 +336,7 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
|
|||
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @ "\n" @
|
||||
"Asset Type: Shape Asset\n" @
|
||||
"Asset Definition ID: " @ %assetDef @ "\n" @
|
||||
"Shape File path: " @ %assetDef.getShapeFile();
|
||||
"Shape File path: " @ %assetDef.getShapePath();
|
||||
|
||||
if(%this.selectMode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,6 +31,22 @@ function AssetBrowser::editShapeAnimationAsset(%this, %assetDef)
|
|||
ShapeEditorPlugin.openShapeAsset(%assetDef);
|
||||
}
|
||||
|
||||
function AssetBrowser::moveShapeAnimationAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.getAnimationPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildShapeAnimationAssetPreview(%this, %assetDef, %previewData)
|
||||
{
|
||||
%previewData.assetName = %assetDef.animationName;
|
||||
|
|
@ -51,5 +67,5 @@ function AssetBrowser::buildShapeAnimationAssetPreview(%this, %assetDef, %previe
|
|||
|
||||
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||
%previewData.assetDesc = %assetDef.description;
|
||||
%previewData.tooltip = %assetDef.friendlyName @ "\n" @ %assetDef @ "\nShape File path: " @ %assetDef.getShapeFile();
|
||||
%previewData.tooltip = %assetDef.friendlyName @ "\n" @ %assetDef @ "\nShape File path: " @ %assetDef.getShapePath();
|
||||
}
|
||||
|
|
@ -11,6 +11,22 @@ function AssetBrowser::onSoundAssetChanged(%this, %assetDef)
|
|||
sfxStop($PreviewSoundSource);
|
||||
}
|
||||
|
||||
function AssetBrowser::moveSoundAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.getSoundPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
|
||||
{
|
||||
%previewData.assetName = %assetDef.assetName;
|
||||
|
|
|
|||
|
|
@ -161,6 +161,22 @@ function AssetBrowser::deleteTerrainAsset(%this, %assetDef)
|
|||
{
|
||||
}
|
||||
|
||||
function AssetBrowser::moveTerrainAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.getTerrainFilePath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildTerrainAssetPreview(%this, %assetDef, %previewData)
|
||||
{
|
||||
%previewData.assetName = %assetDef.assetName;
|
||||
|
|
|
|||
|
|
@ -93,8 +93,27 @@ function AssetBrowser::deleteTerrainMaterialAsset(%this, %assetDef)
|
|||
{
|
||||
}
|
||||
|
||||
function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previewData)
|
||||
function AssetBrowser::moveTerrainMaterialAsset(%this, %assetDef, %destination)
|
||||
{
|
||||
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
|
||||
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(%destination);
|
||||
|
||||
%newAssetPath = moveAssetFile(%assetDef, %destination);
|
||||
|
||||
if(%newAssetPath $= "")
|
||||
return false;
|
||||
|
||||
moveAssetLooseFile(%assetDef.getScriptPath(), %destination);
|
||||
|
||||
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
|
||||
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
||||
{
|
||||
if(%forcePreviewRegenerate $= "")
|
||||
%forcePreviewRegenerate = false;
|
||||
|
||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()))));
|
||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
||||
|
||||
|
|
@ -122,31 +141,35 @@ function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previ
|
|||
|
||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||
|
||||
if(%generatePreview)
|
||||
if(%generatePreview || %forcePreviewRegenerate)
|
||||
{
|
||||
displayEditorLoadingGui("Generating Material Asset Preview...");
|
||||
|
||||
if(isObject(%assetDef.materialDefinitionName))
|
||||
{
|
||||
%previewShapeDef = AssetDatabase.acquireAsset("ToolsModule:previewSphereShape");
|
||||
%generatedFilePath = %previewShapeDef.generateCachedPreviewImage(256, %assetDef.materialDefinitionName);
|
||||
%generatedFilePath = %previewShapeDef.generateCachedPreviewImage(256, DummyTerrMatPreview);
|
||||
|
||||
pathCopy(%generatedFilePath, %previewFilePath);
|
||||
fileDelete(%generatedFilePath);
|
||||
|
||||
%previewAsset = new ImageAsset()
|
||||
|
||||
if(!AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
%previewAsset = new ImageAsset()
|
||||
{
|
||||
assetName = %previewAssetName;
|
||||
versionId = 1;
|
||||
imageFile = fileName(%previewFilePath);
|
||||
};
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||
|
||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||
|
||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||
}
|
||||
}
|
||||
|
||||
hideEditorLoadingGui();
|
||||
|
|
@ -170,10 +193,14 @@ function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previ
|
|||
%previewData.assetDesc = %assetDef.description;
|
||||
%previewData.tooltip = %assetDef.gameObjectName;
|
||||
|
||||
%definitionPath = %assetDef.getScriptPath();
|
||||
if(%definitionPath $= "")
|
||||
%definitionPath = %assetDef.getFilename();
|
||||
|
||||
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @
|
||||
"\nAsset Type: Terrain Material Asset" @
|
||||
"\nAsset Definition ID: " @ %assetDef @
|
||||
"\nDefinition Path: " @ %assetDef.getScriptPath();
|
||||
"\nDefinition Path: " @ %definitionPath;
|
||||
}
|
||||
|
||||
function GuiInspectorTypeTerrainMaterialAssetPtr::onClick( %this, %fieldName )
|
||||
|
|
|
|||
|
|
@ -111,7 +111,19 @@ function AssetBrowser::refreshAsset(%this, %assetId)
|
|||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
function AssetBrowser::regeneratePreviewImage(%this)
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
|
||||
%dummyObj = new ScriptObject();
|
||||
%regenCommand = "AssetBrowser.build" @ EditAssetPopup.assetType @
|
||||
"Preview(" @%assetDef @ "," @ %dummyObj @ ", true);";
|
||||
eval(%regenCommand);
|
||||
|
||||
%dummyObj.delete();
|
||||
AssetDatabase.releaseAsset(EditAssetPopup.assetId);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
function AssetBrowser::renameAsset(%this)
|
||||
{
|
||||
//Find out what type it is
|
||||
|
|
|
|||
|
|
@ -139,6 +139,19 @@ function newAssetUpdatePath(%newPath)
|
|||
NewAssetTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
|
||||
}
|
||||
|
||||
//
|
||||
function NewAssetTargetModule::onSelect(%this, %idx, %idy)
|
||||
{
|
||||
%newModuleName = %this.getText();
|
||||
|
||||
%currentTargetPath = NewAssetTargetAddress.getText();
|
||||
if(!startsWith(%currentTargetPath, "data/" @ %newModuleName @ "/"))
|
||||
{
|
||||
NewAssetTargetAddress.setText("data/" @ %newModuleName @ "/");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//We do a quick validation that mandatory fields are filled in before passing along to the asset-type specific function
|
||||
function CreateNewAsset()
|
||||
{
|
||||
|
|
@ -172,9 +185,41 @@ function CreateNewAsset()
|
|||
return;
|
||||
}
|
||||
|
||||
//First, we need to make sure we're not creating a conflicting asset
|
||||
if(AssetDatabase.isDeclaredAsset(%moduleName @ ":" @ %assetName))
|
||||
{
|
||||
toolsMessageBoxOK( "Error", "An asset with the ID: " @ %moduleName @ ":" @ %assetName
|
||||
@ " already exists! Please review and rename.");
|
||||
return;
|
||||
}
|
||||
|
||||
%assetType = AssetBrowser.newAssetSettings.assetType;
|
||||
|
||||
if(%assetType $= "MaterialAsset" || %assetType $= "TerrainMaterialAsset" ||
|
||||
%assetType $= "GUIAsset")
|
||||
{
|
||||
if(isObject(%assetName))
|
||||
{
|
||||
toolsMessageBoxOK( "Error", "Attempted to create a new asset that requires " @
|
||||
"a unique name, as the object definition must be unique. " @
|
||||
"Please use a new name.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
%currentTargetPath = NewAssetTargetAddress.getText();
|
||||
%modulePath = makeRelativePath(ModuleDatabase.findModule(%moduleName).ModulePath);
|
||||
|
||||
if(!startsWith(%currentTargetPath, %modulePath))
|
||||
{
|
||||
toolsMessageBoxOK( "Error", "Attempting to create a new asset in an invalid path. " @
|
||||
"Please set the target path to be within the target module folder.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
AssetBrowser.newAssetSettings.moduleName = %moduleName;
|
||||
|
||||
%assetType = AssetBrowser.newAssetSettings.assetType;
|
||||
if(%assetType $= "")
|
||||
{
|
||||
toolsMessageBoxOK( "Error", "Attempted to make a new asset with no type!");
|
||||
|
|
|
|||
|
|
@ -28,11 +28,13 @@ function AssetBrowser::buildPopupMenus(%this)
|
|||
item[ 2 ] = "Reload Asset" TAB "" TAB "AssetBrowser.refreshAsset();";
|
||||
item[ 3 ] = "Asset Properties" TAB "" TAB "AssetBrowser.editAssetInfo();";
|
||||
item[ 4 ] = "-";
|
||||
Item[ 5 ] = "Duplicate Asset" TAB "" TAB "AssetBrowser.duplicateAsset();";
|
||||
item[ 5 ] = "Duplicate Asset" TAB "" TAB "AssetBrowser.duplicateAsset();";
|
||||
item[ 6 ] = "-";
|
||||
item[ 7 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();";
|
||||
item[ 7 ] = "Regenerate Preview Image" TAB "" TAB "AssetBrowser.regeneratePreviewImage();";
|
||||
item[ 8 ] = "-";
|
||||
item[ 9 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();";
|
||||
item[ 9 ] = "Re-Import Asset" TAB "" TAB "AssetBrowser.reImportAsset();";
|
||||
item[ 10 ] = "-";
|
||||
item[ 11 ] = "Delete Asset" TAB "" TAB "AssetBrowser.deleteAsset();";
|
||||
|
||||
jumpFileName = "";
|
||||
jumpLineNumber = "";
|
||||
|
|
@ -182,7 +184,7 @@ function AssetBrowser::buildPopupMenus(%this)
|
|||
item[9] = "-";
|
||||
item[10] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();";
|
||||
item[11] = "-";
|
||||
item[12] = "Import Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();";
|
||||
item[12] = "View Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();";
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ $guiContent = new GuiControl(ForestEditToolbar,EditorGuiGroup) {
|
|||
MinExtent = "8 16";
|
||||
canSave = "1";
|
||||
Visible = "1";
|
||||
AltCommand = "ForestTools->BrushTool.size = $ThisControl.getValue();";
|
||||
AltCommand = "ForestTools->BrushTool.size = mClamp($ThisControl.getValue(), 1, getWord(ETerrainEditor.maxBrushSize, 0));";
|
||||
validate = "ForestEditorGui.validateBrushSize();";
|
||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ function selectNewForestMesh(%selectedShapeAssetId)
|
|||
//%str = "datablock TSForestItemData( " @ %name @ " ) { shapeFile = \"" @ %fullPath @ "\"; };";
|
||||
//eval( %str );
|
||||
|
||||
//%fullPath = AssetDatabase.acquireAsset(%selectedShapeAssetId).getShapeFile();
|
||||
//%fullPath = AssetDatabase.acquireAsset(%selectedShapeAssetId).getShapePath();
|
||||
|
||||
new TSForestItemData(%name) {
|
||||
shapeAsset = %selectedShapeAssetId;
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ function ESettingsWindow::getGeneralSettings(%this)
|
|||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Paths");
|
||||
SettingsInspector.addSettingsField("WorldEditor/torsionPath", "Torsion Path", "filename", "");
|
||||
//SettingsInspector.addSettingsField("WorldEditor/torsionPath", "Torsion Path", "filename", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Theme");
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 8.7 KiB |
|
|
@ -254,9 +254,13 @@ function GuiEditCanvas::onWindowClose(%this)
|
|||
|
||||
function GuiEditCanvas::create( %this )
|
||||
{
|
||||
GuiEditorNewGuiDialog.init( "NewGui", "GuiControl" );
|
||||
AssetBrowser.setupCreateNewAsset("GUIAsset", AssetBrowser.selectedModule, "GuiEditCanvas.finishCreateNewGUI");
|
||||
}
|
||||
|
||||
Canvas.pushDialog( GuiEditorNewGuiDialog );
|
||||
function GuiEditCanvas::finishCreateNewGUI(%this, %newGUIAssetId)
|
||||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(%newGUIAssetId);
|
||||
AssetBrowser.editAsset(%assetDef);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -4445,6 +4445,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
|
|||
VertSizing = "bottom";
|
||||
Position = "0 95";
|
||||
Extent = "212 25";
|
||||
visible = "0";
|
||||
|
||||
new GuiBitmapCtrl(){
|
||||
position="2 2";
|
||||
|
|
|
|||
|
|
@ -38,25 +38,34 @@ function MaterialEditorGui::establishMaterials(%this)
|
|||
};
|
||||
|
||||
//Material used to preview other materials in the editor.
|
||||
singleton Material(materialEd_previewMaterial)
|
||||
if(!isObject(materialEd_previewMaterial))
|
||||
{
|
||||
mapTo = "matEd_mappedMat";
|
||||
diffuseMapAsset[0] = "ToolsModule:matEd_mappedMat_image";
|
||||
};
|
||||
singleton Material(materialEd_previewMaterial)
|
||||
{
|
||||
mapTo = "matEd_mappedMat";
|
||||
diffuseMapAsset[0] = "ToolsModule:matEd_mappedMat_image";
|
||||
};
|
||||
}
|
||||
|
||||
singleton CustomMaterial( materialEd_justAlphaMaterial )
|
||||
if(!isObject(materialEd_previewMaterial))
|
||||
{
|
||||
mapTo = "matEd_mappedMatB";
|
||||
texture[0] = materialEd_previewMaterial.getdiffuseMap(0);
|
||||
};
|
||||
singleton CustomMaterial( materialEd_justAlphaMaterial )
|
||||
{
|
||||
mapTo = "matEd_mappedMatB";
|
||||
texture[0] = materialEd_previewMaterial.getdiffuseMap(0);
|
||||
};
|
||||
}
|
||||
|
||||
//Custom shader to allow the display of just the alpha channel.
|
||||
singleton ShaderData( materialEd_justAlphaShader )
|
||||
if(!isObject(materialEd_previewMaterial))
|
||||
{
|
||||
DXVertexShaderFile = "shaders/alphaOnlyV.hlsl";
|
||||
DXPixelShaderFile = "shaders/alphaOnlyP.hlsl";
|
||||
pixVersion = 1.0;
|
||||
};
|
||||
//Custom shader to allow the display of just the alpha channel.
|
||||
singleton ShaderData( materialEd_justAlphaShader )
|
||||
{
|
||||
DXVertexShaderFile = "shaders/alphaOnlyV.hlsl";
|
||||
DXPixelShaderFile = "shaders/alphaOnlyP.hlsl";
|
||||
pixVersion = 1.0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function MaterialEditorGui::open(%this)
|
||||
|
|
@ -843,6 +852,11 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|||
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
|
||||
MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialEditorPropertiesWindow-->RoughnessSlider.setValue((%material).roughness, true);
|
||||
MaterialEditorPropertiesWindow-->MetalnessSlider.setValue((%material).metalness, true);
|
||||
}
|
||||
|
||||
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setVisible(%hasOrmMap);
|
||||
MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setVisible(%hasOrmMap);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
mapTo="ReflectProbePreviewMat">
|
||||
<Material.Stages>
|
||||
<Stages_beginarray
|
||||
DiffuseMapAsset="ToolsModule:occluderProxyImage_image"
|
||||
DiffuseMapAsset="Core_Rendering:NoMaterial"
|
||||
diffuseColor="1 1 1 1"
|
||||
roughness="0"
|
||||
metalness="1"/>
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ $guiContent = new GuiWindowCollapseCtrl(ShapeEdAdvancedWindow, EditorGuiGroup) {
|
|||
hovertime = "500";
|
||||
isContainer = true;
|
||||
internalName = "levelsInactive";
|
||||
color = "128 128 128 255";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
text = "0";
|
||||
|
|
@ -691,6 +692,7 @@ $guiContent = new GuiWindowCollapseCtrl(ShapeEdAdvancedWindow, EditorGuiGroup) {
|
|||
};
|
||||
new GuiBitmapCtrl(){
|
||||
bitmapAsset = "ToolsModule:inactive_overlay_image";
|
||||
color = "128 128 128 255";
|
||||
position = "4 18";
|
||||
Extent = "193 64";
|
||||
tooltip = "Imposters must be enabled, and an imposter detail level selected to edit these properties";
|
||||
|
|
|
|||
|
|
@ -1784,7 +1784,7 @@ function ShapeEdSeqFromMenu::onBrowseSelect( %this, %assetId )
|
|||
%this.setText( %assetId );
|
||||
|
||||
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||
%shapePath = %assetDef.getShapeFile();
|
||||
%shapePath = %assetDef.getShapePath();
|
||||
AssetDatabase.releaseAsset(%assetId);
|
||||
|
||||
ShapeEdSequences.onEditSequenceSource( %shapePath );
|
||||
|
|
@ -3010,7 +3010,7 @@ function ShapeEditor::autoAddDetails( %this, %dest )
|
|||
// Determine the base name of the input file (MyShape_LOD in the example above)
|
||||
// and use that to find any other shapes in the set.
|
||||
%assetDef = AssetDatabase.acquireAsset(%dest.baseShapeAsset);
|
||||
%shapeFile = %assetDef.getShapeFile();
|
||||
%shapeFile = %assetDef.getShapePath();
|
||||
AssetDatabase.releaseAsset(%dest.baseShapeAsset);
|
||||
|
||||
%base = fileBase( %shapeFile );
|
||||
|
|
@ -3058,7 +3058,7 @@ function ShapeEditor::addLODFromFile( %this, %dest, %assetId, %size, %allowUnmat
|
|||
{
|
||||
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||
%csPath = %assetDef.getShapeConstructorFilePath();
|
||||
%filename = %assetDef.getShapeFile();
|
||||
%filename = %assetDef.getShapePath();
|
||||
AssetDatabase.releaseAsset(%assetId);
|
||||
|
||||
// Get (or create) a TSShapeConstructor object for the source shape. Need to
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ function ObjectCreator::setNewObjectGroup( %this, %group )
|
|||
%group = %group.getID();
|
||||
%this.objectGroup = %group;
|
||||
%itemId = EditorTree.findItemByObjectId( %group );
|
||||
if(%itemId != -1)
|
||||
EditorTree.markItem( %itemId );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ function EPainter::updateLayers( %this, %matIndex )
|
|||
VertSizing = "bottom";
|
||||
position = ( %listwidth - 20 ) SPC "26";
|
||||
Extent = "17 17";
|
||||
command = "EPainter.showMaterialDeleteDlg( " @ %matInternalName @ " );";
|
||||
command = "EPainter.showMaterialDeleteDlg( \"" @ %matInternalName @ "\" );";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ function EPainter::showMaterialDeleteDlg( %this, %matInternalName )
|
|||
{
|
||||
toolsMessageBoxYesNo( "Confirmation",
|
||||
"Really remove material '" @ %matInternalName @ "' from the terrain?",
|
||||
%this @ ".removeMaterial( " @ %matInternalName @ " );", "" );
|
||||
%this @ ".removeMaterial( \"" @ %matInternalName @ "\" );", "" );
|
||||
}
|
||||
|
||||
function EPainter::removeMaterial( %this, %matInternalName )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue