Adjusted callback handling of asset inspector fields when invoking AB to select asset for more consistent behavior and better handling of updating the objects and inspector

Added logic to forcefully acquire newly imported asset definition to better try and ensure it's loaded immediately after import
Added logic to asset importer so if a file is not found for an importing material asset, if populate maps is on, then it will try and find a matching image asset in the destination module
Added logic to tsStatic to better handle fields being updated via the editor, forcing updates and refreshes of the shape and materialSlots
Fixed handling of guiBitmapButtonCtrl so it will update the bitmap used when edited via the Gui Editor
Updated image ref to the hudFill image asset for the console GUI
Cleaned up names for the default camera model/material
Defaulted import config to utilize the Prune action instead of rename for more predictable default behavior
Added icons next to AB's preview slider bar for additional visual feedback of slider intent
Added missing checkbox to asset import window and cleaned up scaling behavior
Fixed handling of drag-n-drop behavior in GUI editor so it doesn't block further interaction
Added logic for drag-n-drop of image assets to GUI Editor so it will create a GuiBitmapCtrl with the image
Added handling for drag-n-drop import of folders of assets to AB/Asset Import
Added missing asset import config option to indicate if config supported import of sound assets
Added logic when opening asset import config editor, where if there is a default import config set in the settings, it will open that one by default
Hid the collision section of the import config editor, as those options are currently unutilized
Improved behavior for Create New Folder window in the AB, now always pushing to the front, and also selecting the text by default, so the user can just start typing the new name
Also added return and escape key accelerators to Create New Folder window for better UX
Fixed display of editor windows, adding a distinct blue color to highlighted windows' title bar and fixing display of minimize/maximize/window/close buttons
Moved GUIEditor's onControlDropped function to the AB script to match placement of sibling world editor function
Fixed issue with material editor where the ORM Config map slot was getting the normal map instead of the correct ORM map
This commit is contained in:
Areloch 2021-11-26 16:40:15 -06:00
parent 13cd3de2ad
commit a5944aff19
38 changed files with 979 additions and 607 deletions

View file

@ -199,7 +199,7 @@ GuiControl* GuiInspectorTypeCubemapAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"CubemapAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
mInspector->getInspectObject(), mCaption);
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("object"), NULL, String::ToString(mInspector->getInspectObject()).c_str());

View file

@ -257,7 +257,7 @@ GuiControl* GuiInspectorTypeGUIAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"GUIAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
mInspector->getComponentGroupTargetId(), mCaption);
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
// Create "Open in ShapeEditor" button

View file

@ -480,7 +480,7 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getInspectObject()->getIdString(), mCaption);
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
@ -488,11 +488,9 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
// Create "Open in ShapeEditor" button
mImageEdButton = new GuiBitmapButtonCtrl();
dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
mImageEdButton->setField("Command", szBuffer);
char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
mImageEdButton->setBitmap(StringTable->insert(bitmapName));
mImageEdButton->setHidden(true);
mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
mImageEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");

View file

@ -432,8 +432,8 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, \"\");",
getIdString());
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());

View file

@ -151,7 +151,7 @@ GuiControl* GuiInspectorTypeParticleAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ParticleAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
mInspector->getComponentGroupTargetId(), mCaption);
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
// Create "Open in ShapeEditor" button

View file

@ -49,6 +49,7 @@
#ifdef TORQUE_TOOLS
#include "ts/tsLastDetail.h"
#endif
#include "util/imposterCapture.h"
StringTableEntry ShapeAsset::smNoShapeAssetFallback = NULL;
@ -599,8 +600,8 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getInspectObject()->getIdString(), mCaption);
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());

View file

@ -465,7 +465,7 @@ GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getInspectObject()->getIdString(), mCaption);
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());

View file

@ -264,7 +264,7 @@ GuiControl* GuiInspectorTypeTerrainMaterialAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainMaterialAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
mInspector->getComponentGroupTargetId(), mCaption);
mInspector->getIdString(), mCaption);
mMatPreviewButton->setField("Command", szBuffer);
mMatPreviewButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");

View file

@ -1820,6 +1820,32 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
}
else
{
//Check to see if our target module has a matching assetId for this slot already
String testAssetId = targetModuleId + ":" + assetItem->cleanAssetName + StringUnit::getUnit(suffixList.c_str(), i, ",;\t");
bool localAssetFound = false;
if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
localAssetFound = true;
if (localAssetFound == false)
//Didn't work, try checking the common default type suffix
testAssetId = targetModuleId + ":" + assetItem->cleanAssetName + StringUnit::getUnit(suffixList.c_str(), i, ",;\t") + activeImportConfig->AddedImageSuffix;
if (localAssetFound)
{
//got a match!
ImageAsset* foundImageAsset = AssetDatabase.acquireAsset<ImageAsset>(testAssetId.c_str());
imagePath = foundImageAsset->getImagePath();
AssetImportObject* newImageAssetObj = addImportingAsset("ImageAsset", imagePath, assetItem, "");
newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)t);
newImageAssetObj->importStatus = AssetImportObject::UseForDependencies; //we aren't going to actually IMPORT an already imported asset,
//so mark it as dependency use only
matchedImageTypes[t] = newImageAssetObj;
break;
}
if (materialImageNoSuffix.isNotEmpty())
{
testPath = assetItem->filePath.getRootAndPath();
@ -1837,6 +1863,32 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
matchedImageTypes[t] = newImageAssetObj;
break;
}
//Check to see if our target module has a matching assetId for this slot already based on our trimmed mat name
testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t");
bool localAssetFound = false;
if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
localAssetFound = true;
if (localAssetFound == false)
//Didn't work, try checking the common default type suffix
testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t") + activeImportConfig->AddedImageSuffix;
if (localAssetFound)
{
//got a match!
ImageAsset* foundImageAsset = AssetDatabase.acquireAsset<ImageAsset>(testAssetId.c_str());
imagePath = foundImageAsset->getImagePath();
AssetImportObject* newImageAssetObj = addImportingAsset("ImageAsset", imagePath, assetItem, "");
newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)t);
newImageAssetObj->importStatus = AssetImportObject::UseForDependencies; //we aren't going to actually IMPORT an already imported asset,
//so mark it as dependency use only
matchedImageTypes[t] = newImageAssetObj;
break;
}
}
}
}
@ -2538,6 +2590,9 @@ void AssetImporter::importAssets(AssetImportObject* assetItem)
{
bool registerSuccess = AssetDatabase.addDeclaredAsset(moduleDef, assetPath.getFullPath().c_str());
String assetIdStr = item->moduleName + ":" + item->assetName;
StringTableEntry assetId = StringTable->insert(assetIdStr.c_str());
if (!registerSuccess)
{
dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to successfully register new asset at path %s to moduleId %s", assetPath.getFullPath().c_str(), targetModuleId.c_str());
@ -2548,9 +2603,6 @@ void AssetImporter::importAssets(AssetImportObject* assetItem)
//Any special-case post-reg stuff here
if (item->assetType == String("ShapeAsset"))
{
String assetIdStr = item->moduleName + ":" + item->assetName;
StringTableEntry assetId = StringTable->insert(assetIdStr.c_str());
//forcefully update it's shape constructor
TSShapeConstructor* tss = TSShapeConstructor::findShapeConstructorByAssetId(assetId);
@ -2558,6 +2610,10 @@ void AssetImporter::importAssets(AssetImportObject* assetItem)
tss->setShapeAssetId(assetId);
}
}
//Go ahead and force the asset to load now just to kick it for immediate use
AssetBase* assetDef = AssetDatabase.acquireAsset<AssetBase>(assetId);
AssetDatabase.releaseAsset(assetId);
}
else
{

View file

@ -185,7 +185,7 @@ GuiControl* GuiInspectorTypeStateMachineAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"StateMachineAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
mInspector->getComponentGroupTargetId(), mCaption);
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
// Create "Open in ShapeEditor" button

View file

@ -1086,15 +1086,16 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
stream->read(&mForceDetail);
if (stream->readFlag())
mAnimOffset = stream->readFloat(7);
if (stream->readFlag())
mAnimOffset = stream->readFloat(7);
if (stream->readFlag())
mAnimSpeed = stream->readSignedFloat(7) * AnimSpeedMax;
if (stream->readFlag())
mAnimSpeed = stream->readSignedFloat(7) * AnimSpeedMax;
mPlayAmbient = stream->readFlag();
//update our shape, figuring that it likely changed
_createShape();
}
mUseAlphaFade = stream->readFlag();

View file

@ -232,32 +232,7 @@ void GuiBitmapButtonCtrl::inspectPostApply()
{
Parent::inspectPostApply();
Torque::Path path( mBitmapName );
const String& fileName = path.getFileName();
if( mUseStates )
{
// If the filename points to a single state, automatically
// cut off the state part. Makes it easy to select files in
// the editor without having to go in and manually cut off the
// state parts all the time.
static String s_n = "_n";
static String s_d = "_d";
static String s_h = "_h";
static String s_i = "_i";
if( fileName.endsWith( s_n )
|| fileName.endsWith( s_d )
|| fileName.endsWith( s_h )
|| fileName.endsWith( s_i ) )
{
path.setFileName( fileName.substr( 0, fileName.length() - 2 ) );
path.setExtension( String::EmptyString );
}
}
setBitmap( StringTable->insert(path.getFullPath().c_str()) );
setBitmap(getBitmap());
// if the extent is set to (0,0) in the gui editor and appy hit, this control will
// set it's extent to be exactly the size of the normal bitmap (if present)

View file

@ -157,7 +157,10 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl
/// @}
void onBitmapChange() {}
void onBitmapChange()
{
setBitmap(getBitmap());
}
public:

View file

@ -66,7 +66,7 @@ $guiContent = new GuiControl(ConsoleDlg) {
canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "data/ui/art/hudfill.png";
bitmapAsset = "Core_GUI:hudFill";
color = "255 255 255 255";
wrap = "0";
position = "0 0";

View file

@ -50,11 +50,13 @@ new GuiControlProfile(GuiConsoleTextProfile)
category = "Core";
};
$ConsoleDefaultFillColor = "0 0 0 175";
if(!isObject(ConsoleScrollProfile))
new GuiControlProfile(ConsoleScrollProfile : GuiScrollProfile)
{
opaque = true;
fillColor = "0 0 0 175";
fillColor = $ConsoleDefaultFillColor;
border = 1;
//borderThickness = 0;
borderColor = "0 0 0";

View file

@ -1,6 +1 @@
<ShapeAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="Camera"
fileName="@assetFile=camera.dts"
constuctorFileName="@assetFile=camera.tscript" />

View file

@ -0,0 +1,7 @@
<MaterialAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="Green"
scriptFile="@assetFile=green"
materialDefinitionName="Green"
originalFilePath="D:/Gamedev/Projects/Catographer/GameBuild/Templates/BaseGame/game/core/gameObjects/shapes/green" />

View file

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 142 B

View file

@ -1,5 +1,5 @@
singleton TSShapeConstructor(cameradts)
singleton TSShapeConstructor(cameradts2)
{
baseShapeAsset = "Core_GameObjects:Camera";
singleDetailSize = "0";

View file

@ -0,0 +1,196 @@
//--- OBJECT WRITE BEGIN ---
new Material(OctahedronMat) {
mapTo = "green";
diffuseColor[0] = "0 1 0 1";
diffuseColor[1] = "1 1 1 1";
diffuseColor[2] = "1 1 1 1";
diffuseColor[3] = "1 1 1 1";
DiffuseMap[0] = "core/gameObjects/images/camera";
diffuseMapSRGB[0] = "1";
diffuseMapSRGB[1] = "1";
diffuseMapSRGB[2] = "1";
diffuseMapSRGB[3] = "1";
detailScale[0] = "2 2";
detailScale[1] = "2 2";
detailScale[2] = "2 2";
detailScale[3] = "2 2";
detailNormalMapStrength[0] = "1";
detailNormalMapStrength[1] = "1";
detailNormalMapStrength[2] = "1";
detailNormalMapStrength[3] = "1";
roughness[0] = "1";
roughness[1] = "1";
roughness[2] = "1";
roughness[3] = "1";
metalness[0] = "0";
metalness[1] = "0";
metalness[2] = "0";
metalness[3] = "0";
glowMul[0] = "0";
glowMul[1] = "0";
glowMul[2] = "0";
glowMul[3] = "0";
accuEnabled[0] = "0";
accuEnabled[1] = "0";
accuEnabled[2] = "0";
accuEnabled[3] = "0";
accuScale[0] = "1";
accuScale[1] = "1";
accuScale[2] = "1";
accuScale[3] = "1";
accuDirection[0] = "1";
accuDirection[1] = "1";
accuDirection[2] = "1";
accuDirection[3] = "1";
accuStrength[0] = "0.6";
accuStrength[1] = "0.6";
accuStrength[2] = "0.6";
accuStrength[3] = "0.6";
accuCoverage[0] = "0.9";
accuCoverage[1] = "0.9";
accuCoverage[2] = "0.9";
accuCoverage[3] = "0.9";
accuSpecular[0] = "16";
accuSpecular[1] = "16";
accuSpecular[2] = "16";
accuSpecular[3] = "16";
isSRGB[0] = "0";
isSRGB[1] = "0";
isSRGB[2] = "0";
isSRGB[3] = "0";
invertRoughness[0] = "0";
invertRoughness[1] = "0";
invertRoughness[2] = "0";
invertRoughness[3] = "0";
roughnessChan[0] = "0";
roughnessChan[1] = "0";
roughnessChan[2] = "0";
roughnessChan[3] = "0";
AOChan[0] = "1";
AOChan[1] = "1";
AOChan[2] = "1";
AOChan[3] = "1";
metalChan[0] = "2";
metalChan[1] = "2";
metalChan[2] = "2";
metalChan[3] = "2";
glow[0] = "0";
glow[1] = "0";
glow[2] = "0";
glow[3] = "0";
parallaxScale[0] = "0";
parallaxScale[1] = "0";
parallaxScale[2] = "0";
parallaxScale[3] = "0";
useAnisotropic[0] = "1";
useAnisotropic[1] = "1";
useAnisotropic[2] = "1";
useAnisotropic[3] = "1";
vertLit[0] = "0";
vertLit[1] = "0";
vertLit[2] = "0";
vertLit[3] = "0";
vertColor[0] = "0";
vertColor[1] = "0";
vertColor[2] = "0";
vertColor[3] = "0";
minnaertConstant[0] = "-1";
minnaertConstant[1] = "-1";
minnaertConstant[2] = "-1";
minnaertConstant[3] = "-1";
subSurface[0] = "0";
subSurface[1] = "0";
subSurface[2] = "0";
subSurface[3] = "0";
subSurfaceColor[0] = "1 0.2 0.2 1";
subSurfaceColor[1] = "1 0.2 0.2 1";
subSurfaceColor[2] = "1 0.2 0.2 1";
subSurfaceColor[3] = "1 0.2 0.2 1";
subSurfaceRolloff[0] = "0.2";
subSurfaceRolloff[1] = "0.2";
subSurfaceRolloff[2] = "0.2";
subSurfaceRolloff[3] = "0.2";
emissive[0] = "0";
emissive[1] = "0";
emissive[2] = "0";
emissive[3] = "0";
foreground[0] = "0";
foreground[1] = "0";
foreground[2] = "0";
foreground[3] = "0";
doubleSided = "0";
animFlags[0] = "0x00000000";
animFlags[1] = "0x00000000";
animFlags[2] = "0x00000000";
animFlags[3] = "0x00000000";
scrollDir[0] = "0 0";
scrollDir[1] = "0 0";
scrollDir[2] = "0 0";
scrollDir[3] = "0 0";
scrollSpeed[0] = "0";
scrollSpeed[1] = "0";
scrollSpeed[2] = "0";
scrollSpeed[3] = "0";
rotSpeed[0] = "0";
rotSpeed[1] = "0";
rotSpeed[2] = "0";
rotSpeed[3] = "0";
rotPivotOffset[0] = "0 0";
rotPivotOffset[1] = "0 0";
rotPivotOffset[2] = "0 0";
rotPivotOffset[3] = "0 0";
waveType[0] = "Sin";
waveType[1] = "Sin";
waveType[2] = "Sin";
waveType[3] = "Sin";
waveFreq[0] = "0";
waveFreq[1] = "0";
waveFreq[2] = "0";
waveFreq[3] = "0";
waveAmp[0] = "0";
waveAmp[1] = "0";
waveAmp[2] = "0";
waveAmp[3] = "0";
sequenceFramePerSec[0] = "0";
sequenceFramePerSec[1] = "0";
sequenceFramePerSec[2] = "0";
sequenceFramePerSec[3] = "0";
sequenceSegmentSize[0] = "0";
sequenceSegmentSize[1] = "0";
sequenceSegmentSize[2] = "0";
sequenceSegmentSize[3] = "0";
cellIndex[0] = "0 0";
cellIndex[1] = "0 0";
cellIndex[2] = "0 0";
cellIndex[3] = "0 0";
cellLayout[0] = "0 0";
cellLayout[1] = "0 0";
cellLayout[2] = "0 0";
cellLayout[3] = "0 0";
cellSize[0] = "0";
cellSize[1] = "0";
cellSize[2] = "0";
cellSize[3] = "0";
bumpAtlas[0] = "0";
bumpAtlas[1] = "0";
bumpAtlas[2] = "0";
bumpAtlas[3] = "0";
castShadows = "0";
planarReflection = "0";
translucent = "1";
translucentBlendOp = "PreMul";
translucentZWrite = "0";
alphaTest = "0";
alphaRef = "1";
dynamicCubemap = "0";
showFootprints = "1";
showDust = "0";
effectColor[0] = "0 0 0 0";
effectColor[1] = "0 0 0 0";
footstepSoundId = "-1";
impactSoundId = "-1";
ImpactFXIndex = "-1";
canSave = "1";
canSaveDynamicFields = "1";
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,9 @@
//--- OBJECT WRITE BEGIN ---
singleton Material(moon_noglow) {
mapTo="moon_noglow";
DiffuseMapAsset = "Core_Rendering:moon_noglow_image";
emissive = true;
translucent = true;
vertColor[ 0 ] = true;
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,9 @@
//--- OBJECT WRITE BEGIN ---
singleton Material(moon_wglow) {
mapTo="moon_wglow";
DiffuseMapAsset = "Core_Rendering:moon_wglow_image";
emissive = true;
translucent = true;
vertColor[ 0 ] = true;
};
//--- OBJECT WRITE END ---

View file

@ -19,6 +19,7 @@
<Setting name="AddDirectoryPrefixToAssetName">0</Setting>
<Setting name="AutomaticallyPromptMissingFiles">0</Setting>
<Setting name="DuplicatAutoResolution">AutoPrune</Setting>
<Setting name="DuplicateAutoResolution">AutoPrune</Setting>
<Setting name="PreventImportWithErrors">1</Setting>
<Setting name="WarningsAsErrors">0</Setting>
</Group>

View file

@ -1084,6 +1084,22 @@ $guiContent = new GuiControl(AssetBrowser) {
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl() {
bitmapAsset = "ToolsModule:smaller_image";
position = "5 588";
extent = "20 20";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "top";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiSliderCtrl() {
range = "0 2";
ticks = "5";
@ -1092,7 +1108,7 @@ $guiContent = new GuiControl(AssetBrowser) {
useFillBar = "0";
fillBarColor = "255 255 255 255";
renderTicks = "0";
position = "8 588";
position = "28 590";
extent = "75 20";
minExtent = "8 2";
horizSizing = "right";
@ -1109,6 +1125,22 @@ $guiContent = new GuiControl(AssetBrowser) {
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl() {
bitmapAsset = "ToolsModule:larger_image";
position = "103 588";
extent = "20 20";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "top";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

File diff suppressed because it is too large Load diff

View file

@ -47,7 +47,7 @@ $guiContent = new GuiControl(AssetBrowser_newFolder) {
canSaveDynamicFields = "0";
new GuiButtonCtrl() {
text = "Select";
text = "OK";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
@ -65,6 +65,7 @@ $guiContent = new GuiControl(AssetBrowser_newFolder) {
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
accelerator = "return";
};
new GuiButtonCtrl() {
text = "Cancel";
@ -85,6 +86,7 @@ $guiContent = new GuiControl(AssetBrowser_newFolder) {
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
accelerator = "escape";
};
new GuiTextEditCtrl(AssetBrowser_newFolderNameTxt) {
historySize = "0";

View file

@ -279,6 +279,7 @@ function AssetBrowser::selectAsset( %this, %asset )
%this.changeAsset();
}
if(isObject(Inspector))
Inspector.refresh();
AssetBrowser.hideDialog();
@ -985,14 +986,31 @@ function AssetBrowser::toggleTagFilterPopup(%this)
function AssetBrowser::changeAsset(%this)
{
%targetObject = %this.fieldTargetObject;
%inspectorObject = "";
if(%this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
{
%inspectorObject = %this.fieldTargetObject;
%targetObject = %inspectorObject.getInspectObject();
}
//alright, we've selectd an asset for a field, so time to set it!
if(%this.fieldTargetName $= "")
%cmd = %this.fieldTargetObject @ ".apply(\""@ %this.selectedAsset @ "\");";
%cmd = %targetObject @ ".apply(\""@ %this.selectedAsset @ "\");";
else
%cmd = %this.fieldTargetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
echo("Changing asset via the " @ %cmd @ " command");
%cmd = %targetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
//echo("Changing asset via the " @ %cmd @ " command");
eval(%cmd);
//Force update our object with the field change
%targetObject.inspectPostApply();
if(isObject(%inspectorObject))
{
%inspectorObject.refresh();
}
//Flag us as dirty for editing purposes
EWorldEditor.setSceneAsDirty();
}
@ -2317,6 +2335,53 @@ function EWorldEditor::onControlDropped( %this, %payload, %position )
EWorldEditor.isDirty = true;
}
function GuiEditor::onControlDropped(%this, %payload, %position)
{
Canvas.popDialog(EditorDragAndDropLayer);
// Make sure we have the right kind of D&D.
if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) &&
!%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ))
return;
if( %payload.dragSourceControl == %this )
return;
%pos = %payload.getGlobalPosition();
%x = getWord(%pos, 0);
%y = getWord(%pos, 1);
if(%payload.assetType !$= "Creator")
{
//dealing with an actual asset, so build the assetName
%assetId = %payload.moduleName @ ":" @ %payload.assetName;
%assetType = AssetDatabase.getAssetType(%assetId);
if(%assetType $= "ImageAsset")
{
%cmd = "return new guiBitmapCtrl();";
%ctrl = eval( %cmd );
%ctrl.bitmap = %assetId;
}
}
else
{
%className = %payload.assetName;
%cmd = "return new " @ %className @ "();";
%ctrl = eval( %cmd );
}
%this.addNewCtrl(%ctrl);
%ctrl.setPositionGlobal(%x, %y);
%this.setFirstResponder();
if(EditorSettings.value("AssetManagement/Assets/closeBrowserOnDragAction", false))
{
AssetBrowser.hideDialog();
}
}
function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);

View file

@ -181,6 +181,20 @@ function AssetBrowser::onBeginDropFiles( %this )
function AssetBrowser::onDropFile( %this, %filePath )
{
if(fileExt(%filePath) $= "")
{
//we're dealing with a folder, so we gotta parse through it
%file = findFirstFile( %filePath @ "/*" );
while( %file !$= "" )
{
%this.onDropFile(%file);
%file = findNextFile( %filePath @ "/*" );
}
return;
}
if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible())
{
if(GuiEditorIsActive())
@ -501,7 +515,7 @@ function ImportAssetWindow::doRefresh(%this)
}
if(%this.autoRenamedAssets != 0)
{
%ImportActionSummary = %ImportActionSummary SPC %this.autoRenamedAssets @ " Auto Renamed|";
%ImportActionSummary = %ImportActionSummary SPC %this.autoRenamedAssets @ " Automatically Renamed|";
}
if(%ImportActionSummary !$= "")

View file

@ -109,6 +109,7 @@ function setupImportConfigSettingsList()
ImportAssetConfigSettingsList.addNewConfigSetting("Images/GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "");
//Sounds
ImportAssetConfigSettingsList.addNewConfigSetting("Images/ImportSounds", "Import Sounds", "bool", "", "1", "");
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "");
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/PitchAdjust", "Pitch Adjustment", "float", "", "1.0", "");
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/Compressed", "Is Compressed", "bool", "", "0", "");

View file

@ -1,6 +1,9 @@
function AssetImportConfigEditor::onWake(%this)
{
%this.refresh();
%index = AssetImportConfigList.findTextIndex(EditorSettings.value("Assets/AssetImporDefaultConfig", ""));
AssetImportConfigList.setSelectedRow(%index);
}
function AssetImportConfigEditor::refresh(%this)
@ -41,7 +44,7 @@ function AssetImportConfigList::onSelect( %this, %id, %text )
%this.populateConfigListByGroup("Images");
%this.populateConfigListByGroup("Sounds");
%this.populateConfigListByGroup("Animations");
%this.populateConfigListByGroup("Collision");
//%this.populateConfigListByGroup("Collision");
ImportOptionsConfigList.update();
}

View file

@ -6,6 +6,7 @@ function AssetBrowser::buildCreatorPreview(%this, %assetDef, %previewData)
%previewData.assetName = %name;
%previewData.assetPath = "";
%previewData.moduleName = "";
%previewData.previewImage = "ToolsModule:" @ %class @ "_image";

View file

@ -1,7 +1,9 @@
function AssetBrowser::createNewFolder(%this)
{
AssetBrowser_newFolderNameTxt.text = "NewFolder";
Canvas.pushDialog(AssetBrowser_newFolder);
Canvas.pushDialog(AssetBrowser_newFolder, 99, true);
AssetBrowser_newFolderNameTxt.selectAllText();
}
function AssetBrowser::doCreateNewFolder(%this)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

@ -668,30 +668,6 @@ function GuiEditor::onControlDragged( %this, %payload, %position )
//---------------------------------------------------------------------------------------------
function GuiEditor::onControlDropped(%this, %payload, %position)
{
// Make sure we have the right kind of D&D.
if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) &&
!%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ))
return;
%pos = %payload.getGlobalPosition();
%x = getWord(%pos, 0);
%y = getWord(%pos, 1);
%asset = %payload.assetName;
%cmd = "return new " @ %asset @ "();";
%ctrl = eval( %cmd );
%this.addNewCtrl(%ctrl);
%ctrl.setPositionGlobal(%x, %y);
%this.setFirstResponder();
}
//---------------------------------------------------------------------------------------------
function GuiEditor::onGainFirstResponder(%this)
{
%this.enableMenuItems(true);

View file

@ -816,9 +816,9 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( getAssetPreviewImage(%normalMap) );
//ORM Config
%ormMap = (%material).getNormalMap(%layer);
%ormMap = (%material).getORMConfigMap(%layer);
%hasOrmMap = (%ormMap !$= "" && %ormMap !$=$MaterialEditor::emptyMaterialImage);
%ormMapText = %hasOrmMap ? (%material).getNormalMapAsset(%layer) : "None";
%ormMapText = %hasOrmMap ? (%material).getORMConfigMapAsset(%layer) : "None";
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText(%ormMapText );
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( getAssetPreviewImage(%ormMap) );