Removed unneeded deletion of asset definition in various asset deconstructors - was causing crash on shutdown when a new asset was made

Added ability to check if popup menu is currently Visible
Removed unwanted path debug/testing code from tsShapeConstructor
Made a number of default postFX's names more consistent and set up asset definitions for them. Began adding hooks to PostFX editor as well
Refactored Asset Import window with new layout, revamped import behavior to work with new layout concept and easier editing of import 'session'
Updated Asset Browser to utilize a common 'DirectoryHandler' object to standardize/centralize all folder navigation behavior for the asset tool ecosystem
Added new window to select path for assets
Refactored import config editor to be easier to utilize
Added field in editor settings to edit import configs without needing to first try and import assets
Updated a number of asset types' scripts to handle address-based system
Began standardizing a number of 'actions' for the asset browser, including drag-n-drop, renaming, deleting, moving, etc.
Made refreshing behavior of AB more consistent
When making new in AB folder, it will automatically navigate to the new folder
When making a new folder, prompts the folder name via new popup window
Refactored PostFX editor to use newer layout with side list for easier use
This commit is contained in:
Areloch 2019-12-03 00:09:18 -06:00
parent b2fcd5e7fb
commit b1e3706dd6
69 changed files with 2692 additions and 1443 deletions

View file

@ -105,10 +105,6 @@ ComponentAsset::ComponentAsset()
ComponentAsset::~ComponentAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -99,10 +99,6 @@ CppAsset::CppAsset() : AssetBase()
CppAsset::~CppAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -105,10 +105,6 @@ CubemapAsset::CubemapAsset()
CubemapAsset::~CubemapAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -98,10 +98,6 @@ ExampleAsset::ExampleAsset()
ExampleAsset::~ExampleAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------
@ -119,4 +115,4 @@ void ExampleAsset::copyTo(SimObject* object)
{
// Call to parent.
Parent::copyTo(object);
}
}

View file

@ -92,10 +92,6 @@ GUIAsset::GUIAsset()
GUIAsset::~GUIAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -103,10 +103,6 @@ GameObjectAsset::GameObjectAsset()
GameObjectAsset::~GameObjectAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -103,10 +103,6 @@ LevelAsset::LevelAsset() : AssetBase(), mIsSubLevel(false)
LevelAsset::~LevelAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -100,10 +100,6 @@ ParticleAsset::ParticleAsset()
ParticleAsset::~ParticleAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------
@ -202,4 +198,4 @@ bool GuiInspectorTypeParticleAssetPtr::updateRects()
}
return resized;
}
}

View file

@ -99,10 +99,6 @@ PostEffectAsset::PostEffectAsset()
PostEffectAsset::~PostEffectAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -98,10 +98,6 @@ ScriptAsset::ScriptAsset() : AssetBase(), mIsServerSide(true)
ScriptAsset::~ScriptAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -104,10 +104,6 @@ SoundAsset::SoundAsset()
SoundAsset::~SoundAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------

View file

@ -99,10 +99,6 @@ StateMachineAsset::StateMachineAsset()
StateMachineAsset::~StateMachineAsset()
{
// If the asset manager does not own the asset then we own the
// asset definition so delete it.
if (!getOwned())
delete mpAssetDefinition;
}
//-----------------------------------------------------------------------------
@ -225,4 +221,4 @@ bool GuiInspectorTypeStateMachineAssetPtr::updateRects()
}
return resized;
}
}

View file

@ -51,7 +51,7 @@ PopupMenu::PopupMenu()
mBarTitle = StringTable->EmptyString();
mBounds = RectI(0, 0, 64, 64);
mVisible = true;
mVisible = false;
mBitmapIndex = -1;
mDrawBitmapOnly = false;
@ -86,6 +86,7 @@ void PopupMenu::initPersistFields()
addField("barTitle", TypeCaseString, Offset(mBarTitle, PopupMenu), "");
addField("radioSelection", TypeBool, Offset(mRadioSelection, PopupMenu), "");
addField("visible", TypeBool, Offset(mVisible, PopupMenu), "");
}
//-----------------------------------------------------------------------------
@ -439,6 +440,8 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
mTextList->setHidden(false);
mVisible = true;
}
void PopupMenu::hidePopup()
@ -449,6 +452,8 @@ void PopupMenu::hidePopup()
}
hidePopupSubmenus();
mVisible = false;
}
void PopupMenu::hidePopupSubmenus()

View file

@ -402,12 +402,6 @@ bool TSShapeConstructor::onAdd()
if ( !Parent::onAdd() )
return false;
static const U32 bufSize = 512;
char* buf = Con::getReturnBuffer(bufSize);
Platform::makeFullPathName(mShapePath, buf, bufSize, NULL);
mShapePath = buf;
// Prevent multiple objects pointing at the same shape file
TSShapeConstructor* tss = findShapeConstructor( mShapePath );
if ( tss )

View file

@ -157,6 +157,6 @@ function configureCanvas()
// We need to parse the setting between AA modes, and then it's level
// It's formatted as AATypexAALevel
// So, FXAAx4 or MLAAx2
if ( isObject( FXAA_PostEffect ) )
FXAA_PostEffect.isEnabled = ( %aa > 0 ) ? true : false;
if ( isObject( FXAAPostFX ) )
FXAAPostFX.isEnabled = ( %aa > 0 ) ? true : false;
}

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="FXAAPostFX"
scriptFile="@assetFile=FXAAPostFX.cs"
VersionId="1" />

View file

@ -47,7 +47,7 @@ singleton ShaderData( FXAA_ShaderData )
pixVersion = 3.0;
};
singleton PostEffect( FXAA_PostEffect )
singleton PostEffect( FXAAPostFX )
{
isEnabled = false;

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="GlowPostFX"
scriptFile="@assetFile=GlowPostFX.cs"
VersionId="1" />

View file

@ -60,7 +60,7 @@ singleton GFXStateBlockData( PFX_GlowCombineStateBlock : PFX_DefaultStateBlock )
};
singleton PostEffect( GlowPostFx )
singleton PostEffect( GlowPostFX )
{
// Do not allow the glow effect to work in reflection
// passes by default so we don't do the extra drawing.

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="HDRPostFX"
scriptFile="@assetFile=HDRPostFX.cs"
VersionId="1" />

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="SSAOPostFx"
scriptFile="@assetFile=SSAOPostFx.cs"
VersionId="1" />

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="TurbulencePostFX"
scriptFile="@assetFile=TurbulencePostFX.cs"
VersionId="1" />

View file

@ -42,7 +42,7 @@ singleton ShaderData( PFX_TurbulenceShader )
pixVersion = 3.0;
};
singleton PostEffect( TurbulenceFx )
singleton PostEffect( TurbulencePostFX )
{
isEnabled = false;
allowReflectPass = true;

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="fogPostFX"
scriptFile="@assetFile=fogPostFX.cs"
VersionId="1" />

View file

@ -0,0 +1,67 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Fog
//------------------------------------------------------------------------------
singleton ShaderData( FogPassShader )
{
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/fogP.hlsl";
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/gl/fogP.glsl";
samplerNames[0] = "$deferredTex";
pixVersion = 2.0;
};
singleton GFXStateBlockData( FogPassStateBlock : PFX_DefaultStateBlock )
{
blendDefined = true;
blendEnable = true;
blendSrc = GFXBlendSrcAlpha;
blendDest = GFXBlendInvSrcAlpha;
};
singleton PostEffect( fogPostFX )
{
// We forward render the reflection pass
// so it does its own fogging.
allowReflectPass = false;
renderTime = "PFXBeforeBin";
renderBin = "ObjTranslucentBin";
shader = FogPassShader;
stateBlock = FogPassStateBlock;
texture[0] = "#deferred";
renderPriority = 5;
targetFormat = getBestHDRFormat();
isEnabled = true;
};

View file

@ -0,0 +1,8 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="LightRayPostFX"
scriptFile="@assetFile=lightRays.cs"
glslShader="NewPostEffectP.glsl"
hlslShader="NewPostEffectP.hlsl"
VersionId="1" />

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="reflectionProbeArrayPostFX"
scriptFile="@assetFile=reflectionProbeArrayPostFX.cs"
VersionId="1" />

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="underWaterFogPostFX"
scriptFile="@assetFile=underWaterFogPostFX.cs"
VersionId="1" />

View file

@ -20,53 +20,6 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Fog
//------------------------------------------------------------------------------
singleton ShaderData( FogPassShader )
{
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/fogP.hlsl";
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/gl/fogP.glsl";
samplerNames[0] = "$deferredTex";
pixVersion = 2.0;
};
singleton GFXStateBlockData( FogPassStateBlock : PFX_DefaultStateBlock )
{
blendDefined = true;
blendEnable = true;
blendSrc = GFXBlendSrcAlpha;
blendDest = GFXBlendInvSrcAlpha;
};
singleton PostEffect( FogPostFx )
{
// We forward render the reflection pass
// so it does its own fogging.
allowReflectPass = false;
renderTime = "PFXBeforeBin";
renderBin = "ObjTranslucentBin";
shader = FogPassShader;
stateBlock = FogPassStateBlock;
texture[0] = "#deferred";
renderPriority = 5;
targetFormat = getBestHDRFormat();
isEnabled = true;
};
//------------------------------------------------------------------------------
// UnderwaterFog
//------------------------------------------------------------------------------
@ -96,7 +49,7 @@ singleton GFXStateBlockData( UnderwaterFogPassStateBlock : PFX_DefaultStateBlock
};
singleton PostEffect( UnderwaterFogPostFx )
singleton PostEffect( underWaterFogPostFX )
{
oneFrameOnly = true;
onThisFrame = false;
@ -120,16 +73,16 @@ singleton PostEffect( UnderwaterFogPostFx )
isEnabled = true;
};
function UnderwaterFogPostFx::onEnabled( %this )
function underWaterFogPostFX::onEnabled( %this )
{
TurbulenceFx.enable();
TurbulencePostFX.enable();
CausticsPFX.enable();
return true;
}
function UnderwaterFogPostFx::onDisabled( %this )
function underWaterFogPostFX::onDisabled( %this )
{
TurbulenceFx.disable();
TurbulencePostFX.disable();
CausticsPFX.disable();
return false;
}

View file

@ -36,7 +36,12 @@ singleton ShaderData( VignetteShader )
pixVersion = 2.0;
};
singleton PostEffect( VignettePostEffect )
function vignettePostFX::onAdd( %this )
{
PostFXManager.registerPostEffect(%this);
}
singleton PostEffect( vignettePostFX )
{
isEnabled = false;
allowReflectPass = false;
@ -48,8 +53,45 @@ singleton PostEffect( VignettePostEffect )
renderPriority = 10;
};
function VignettePostEffect::setShaderConsts(%this)
function vignettePostFX::setShaderConsts(%this)
{
%this.setShaderConst("$Vmax", $VignettePostEffect::VMax);
%this.setShaderConst("$Vmin", $VignettePostEffect::VMin);
}
function vignettePostFX::populatePostFXSettings(%this)
{
PostEffectEditorInspector.startGroup("Vignette - General");
PostEffectEditorInspector.addField("$PostFXManager::Settings::EnableVignette", "Enabled", "bool", "", $PostFXManager::PostFX::EnableVignette, "");
PostEffectEditorInspector.addField("$PostFXManager::Settings::VignettePostEffect::VMin", "Vignette Min", "float", "", $VignettePostEffect::VMin, "");
PostEffectEditorInspector.addField("$PostFXManager::Settings::VignettePostEffect::VMax", "Vignette Max", "float", "", $VignettePostEffect::VMax, "");
PostEffectEditorInspector.endGroup();
}
function vignettePostFX::applyFromPreset(%this)
{
//Light rays settings
$PostFXManager::PostFX::EnableLightRays = $PostFXManager::Settings::EnableLightRays;
$LightRayPostFX::brightScalar = $PostFXManager::Settings::LightRays::brightScalar;
$LightRayPostFX::numSamples = $PostFXManager::Settings::LightRays::numSamples;
$LightRayPostFX::density = $PostFXManager::Settings::LightRays::density;
$LightRayPostFX::weight = $PostFXManager::Settings::LightRays::weight;
$LightRayPostFX::decay = $PostFXManager::Settings::LightRays::decay;
if($PostFXManager::PostFX::EnableVignette)
%this.enable();
else
%this.disable();
}
function vignettePostFX::settingsApply(%this)
{
$PostFXManager::Settings::EnableLightRays = $PostFXManager::PostFX::EnableLightRays;
$PostFXManager::Settings::LightRays::brightScalar = $LightRayPostFX::brightScalar;
$PostFXManager::Settings::LightRays::numSamples = $LightRayPostFX::numSamples;
$PostFXManager::Settings::LightRays::density = $LightRayPostFX::density;
$PostFXManager::Settings::LightRays::weight = $LightRayPostFX::weight;
$PostFXManager::Settings::LightRays::decay = $LightRayPostFX::decay;
}

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="vignettePostFX"
scriptFile="@assetFile=vignettePostFX.cs"
VersionId="1" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,64 +1,137 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<AssetImportSettings>
<Group name="TestConfig">
<Group name="Meshes">
<Setting name="invertNormals">0</Setting>
<Setting name="UpAxisOverride">Z_AXIS</Setting>
<Setting name="LODType">TrailingNumber</Setting>
<Setting name="ScaleOverride">0.01</Setting>
<Setting name="IgnoreNodeScale">0</Setting>
<Setting name="AdjustFloor">0</Setting>
<Setting name="reverseWindingOrder">0</Setting>
<Setting name="DoScaleOverride">1</Setting>
<Setting name="JoinIdenticalVerts">1</Setting>
<Setting name="DoUpAxisOverride">0</Setting>
<Setting name="AdjustCenter">0</Setting>
<Setting name="CollapseSubmeshes">0</Setting>
</Group>
<Group name="Collision">
<Setting name="CollisionMeshPrefix">Col</Setting>
<Setting name="GenCollisionType">CollisionMesh</Setting>
<Setting name="GenerateLOSCollisions">1</Setting>
<Setting name="LOSCollisionMeshPrefix">LOS</Setting>
<Setting name="GenLOSCollisionType">CollisionMesh</Setting>
<Setting name="GenerateCollisions">1</Setting>
</Group>
<Group name="Images">
<Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
<Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
<Setting name="Compressed">1</Setting>
<Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
<Setting name="SmoothnessTypeSuffixes">_SMOOTH,_SMOOTHNESS</Setting>
<Setting name="GenerateMaterialOnImport">1</Setting>
<Setting name="DiffuseTypeSuffixes">_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor,_a,</Setting>
<Setting name="IsHDR">0</Setting>
<Setting name="PopulateMaterialMaps">1</Setting>
<Setting name="ImageType">N/A</Setting>
<Setting name="UseMips">1</Setting>
<Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
<Setting name="Scaling">1.0</Setting>
<Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
<Setting name="TextureFilteringMode">Bilinear</Setting>
</Group>
<Group name="NewTest">
<Group name="Materials">
<Setting name="IgnoreMaterials">ColorEffect*,</Setting>
<Setting name="ImportMaterials">1</Setting>
<Setting name="UseExistingMaterials">1</Setting>
<Setting name="CreateComposites">1</Setting>
<Setting name="UseDiffuseSuffixOnOriginImage">1</Setting>
<Setting name="AlwaysPresentImageMaps">0</Setting>
<Setting name="ImportMaterials">1</Setting>
</Group>
<Group name="Meshes">
<Setting name="DoScaleOverride">0</Setting>
<Setting name="limitBoneWeights">0</Setting>
<Setting name="convertLeftHanded">0</Setting>
<Setting name="ScaleOverride">1</Setting>
<Setting name="JoinIdenticalVerts">0</Setting>
<Setting name="IgnoreNodeScale">0</Setting>
<Setting name="calcTangentSpace">0</Setting>
<Setting name="AdjustCenter">0</Setting>
<Setting name="AdjustFloor">0</Setting>
<Setting name="reverseWindingOrder">0</Setting>
<Setting name="removeRedundantMats">0</Setting>
<Setting name="ImportMesh">1</Setting>
<Setting name="CollapseSubmeshes">0</Setting>
<Setting name="DoUpAxisOverride">0</Setting>
<Setting name="genUVCoords">0</Setting>
<Setting name="LODType">TrailingNumber</Setting>
<Setting name="invertNormals">0</Setting>
<Setting name="TransformUVs">0</Setting>
<Setting name="flipUVCoords">0</Setting>
<Setting name="UpAxisOverride">Z_AXIS</Setting>
<Setting name="findInstances">0</Setting>
</Group>
<Group name="Images">
<Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
<Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
<Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
<Setting name="PopulateMaterialMaps">1</Setting>
<Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
<Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
<Setting name="ImageType">N/A</Setting>
<Setting name="Compressed">1</Setting>
<Setting name="Scaling">1.0</Setting>
<Setting name="TextureFilteringMode">Bilinear</Setting>
<Setting name="IsHDR">0</Setting>
<Setting name="DiffuseTypeSuffixes">_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL</Setting>
<Setting name="UseMips">1</Setting>
<Setting name="SmoothnessTypeSuffixes">_SMOOTH,_SMOOTHNESS</Setting>
<Setting name="GenerateMaterialOnImport">1</Setting>
</Group>
<Group name="General">
<Setting name="DuplicatAutoResolution">AutoPrune</Setting>
<Setting name="AutomaticallyPromptMissingFiles">0</Setting>
<Setting name="WarningsAsErrors">0</Setting>
<Setting name="PreventImportWithErrors">1</Setting>
</Group>
<Group name="Collision">
<Setting name="CollisionMeshPrefix">Col</Setting>
<Setting name="LOSCollisionMeshPrefix">LOS</Setting>
<Setting name="GenerateLOSCollisions">1</Setting>
<Setting name="GenerateCollisions">1</Setting>
<Setting name="GenCollisionType">CollisionMesh</Setting>
<Setting name="GenLOSCollisionType">CollisionMesh</Setting>
</Group>
<Group name="Animations">
<Setting name="ImportAnimations">1</Setting>
<Setting name="animTiming">Seconds</Setting>
<Setting name="animFPS">2</Setting>
<Setting name="SeparateAnimations">1</Setting>
</Group>
<Group name="Sounds">
<Setting name="VolumeAdjust">1.0</Setting>
<Setting name="PitchAdjust">1.0</Setting>
<Setting name="Compressed">0</Setting>
</Group>
</Group>
<Group name="TestConfig">
<Group name="Images">
<Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
<Setting name="IsHDR">0</Setting>
<Setting name="TextureFilteringMode">Bilinear</Setting>
<Setting name="SmoothnessTypeSuffixes">_SMOOTH,_SMOOTHNESS</Setting>
<Setting name="Compressed">1</Setting>
<Setting name="DiffuseTypeSuffixes">_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor,_a,</Setting>
<Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
<Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
<Setting name="Scaling">1.0</Setting>
<Setting name="PopulateMaterialMaps">1</Setting>
<Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
<Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
<Setting name="UseMips">1</Setting>
<Setting name="ImageType">N/A</Setting>
<Setting name="GenerateMaterialOnImport">1</Setting>
</Group>
<Group name="Collision">
<Setting name="GenLOSCollisionType">CollisionMesh</Setting>
<Setting name="LOSCollisionMeshPrefix">LOS</Setting>
<Setting name="CollisionMeshPrefix">Col</Setting>
<Setting name="GenCollisionType">CollisionMesh</Setting>
<Setting name="GenerateLOSCollisions">1</Setting>
<Setting name="GenerateCollisions">1</Setting>
</Group>
<Group name="Sounds">
<Setting name="Compressed">0</Setting>
<Setting name="PitchAdjust">1.0</Setting>
<Setting name="VolumeAdjust">1.0</Setting>
</Group>
<Group name="General">
<Setting name="DuplicatAutoResolution">AutoPrune</Setting>
</Group>
<Group name="Meshes">
<Setting name="JoinIdenticalVerts">1</Setting>
<Setting name="reverseWindingOrder">0</Setting>
<Setting name="DoUpAxisOverride">0</Setting>
<Setting name="IgnoreNodeScale">0</Setting>
<Setting name="AdjustCenter">0</Setting>
<Setting name="DoScaleOverride">1</Setting>
<Setting name="LODType">TrailingNumber</Setting>
<Setting name="AdjustFloor">0</Setting>
<Setting name="UpAxisOverride">Z_AXIS</Setting>
<Setting name="CollapseSubmeshes">0</Setting>
<Setting name="ScaleOverride">0.01</Setting>
<Setting name="invertNormals">0</Setting>
</Group>
<Group name="Materials">
<Setting name="IgnoreMaterials">ColorEffect*,</Setting>
<Setting name="UseExistingMaterials">1</Setting>
<Setting name="ImportMaterials">1</Setting>
<Setting name="CreateComposites">1</Setting>
<Setting name="AlwaysPresentImageMaps">0</Setting>
<Setting name="UseDiffuseSuffixOnOriginImage">1</Setting>
</Group>
<Group name="Animations">
<Setting name="SeparateAnimations">1</Setting>
<Setting name="ImportAnimations">1</Setting>
</Group>
</Group>
</AssetImportSettings>

View file

@ -0,0 +1,429 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(AssetImportConfigEditor) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
new GuiWindowCtrl(ImportAssetNewConfigEditorWindow) {
text = "Import Options Config";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
canCollapse = "0";
edgeSnap = "1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "324 349";
extent = "376 70";
minExtent = "48 70";
horizSizing = "center";
vertSizing = "center";
profile = "ToolsGuiWindowProfile";
visible = "0";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextCtrl() {
text = "Configuration Name:";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "10 26";
extent = "100 17";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl(AssetImportNewConfigName) {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "113 25";
extent = "250 18";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Done";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "301 45";
extent = "64 22";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "top";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "AssetImportConfigEditor.createNewImportConfig();";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiWindowCtrl() {
text = "Asset Import Config Editor";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
canCollapse = "0";
closeCommand = "Canvas.popDialog(AssetImportConfigEditor);";
edgeSnap = "0";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "191 76";
extent = "642 615";
minExtent = "8 8";
horizSizing = "center";
vertSizing = "center";
profile = "ToolsGuiWindowProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiSplitContainer() {
orientation = "Vertical";
splitterSize = "2";
splitPoint = "182 100";
fixedPanel = "None";
fixedSize = "100";
docking = "None";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 24";
extent = "642 562";
minExtent = "64 64";
horizSizing = "width";
vertSizing = "height";
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 = "180 562";
minExtent = "16 16";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiSolidDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "Panel1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapButtonCtrl() {
bitmap = "tools/gui/images/iconAdd.png";
bitmapMode = "Centered";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
masked = "0";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "145 4";
extent = "16 16";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
command = "AssetImportConfigEditor.addNewConfig();";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Add a new Import Config";
hovertime = "1000";
isContainer = "0";
internalName = "newImportConfig";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/gui/images/iconDelete.png";
bitmapMode = "Centered";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
masked = "0";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "163 4";
extent = "16 16";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
command = "AssetImportConfigEditor.deleteConfig();";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Delets the currently selected import config";
hovertime = "1000";
isContainer = "0";
internalName = "deleteImportConfig";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "alwaysOff";
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 = "3 24";
extent = "177 538";
minExtent = "100 50";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextListCtrl(AssetImportConfigList) {
columns = "0";
fitParentWidth = "0";
clipColumnText = "0";
rowHeightPadding = "2";
position = "1 1";
extent = "60 32";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiListBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
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 = "184 0";
extent = "458 562";
minExtent = "16 16";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiSolidDefaultProfile";
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 = "458 562";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiVariableInspector(AssetImportConfigEditorInspector) {
dividerMargin = "5";
showCustomFields = "1";
stackingType = "Vertical";
horizStacking = "Left to Right";
vertStacking = "Top to Bottom";
padding = "1";
dynamicSize = "1";
dynamicNonStackExtent = "0";
dynamicPos = "0";
changeChildSizeToFit = "1";
changeChildPosition = "1";
position = "1 1";
extent = "441 615";
minExtent = "16 16";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
};
new GuiButtonCtrl() {
text = "Apply";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "451 588";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "AssetImportConfigEditor.apply(); Canvas.popDialog(AssetImportConfigEditor);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Apply the settings and close this dialog";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Cancel";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "547 588";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog(AssetImprotConfigEditor);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Apply the settings and close this dialog";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -20,18 +20,12 @@
coreModulesFilter = "0";
currentPreviewPage = "0";
Enabled = "1";
importAssetFinalListArray = "20689";
ImportAssetResolutionsPopup = "18119";
importAssetUnprocessedListArray = "20688";
importingFilesArray = "20687";
isReImportingAsset = "0";
navigationHistoryIdx = "0";
onlyShowModulesWithAssets = "0";
previewData = "19953";
previewSize = "80";
templateFilesPath = "tools/assetBrowser/scripts/templateFiles/";
totalPages = "1";
treeFilterMode = "list";
new GuiWindowCtrl(AssetBrowser_addFilterWindow) {
text = "Create New Tag";

View file

@ -0,0 +1,118 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(AssetBrowser_newFolder) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultNonModalProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
new GuiWindowCtrl() {
text = "Name New Folder";
resizeWidth = "1";
resizeHeight = "0";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
canCollapse = "0";
edgeSnap = "1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "362 334";
extent = "355 99";
minExtent = "48 92";
horizSizing = "center";
vertSizing = "center";
profile = "ToolsGuiWindowProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog(AssetBrowser_newFolder);";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiButtonCtrl() {
text = "Select";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "207 68";
extent = "71 22";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "top";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog(AssetBrowser_newFolder); AssetBrowser.doCreateNewFolder();";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Cancel";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "284 68";
extent = "64 22";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "top";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog(AssetBrowser_newFolder);";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl(AssetBrowser_newFolderNameTxt) {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "8 38";
extent = "341 18";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,257 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(SelectAssetPath) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
new GuiWindowCtrl() {
text = "Select Path";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "1";
canMinimize = "1";
canMaximize = "1";
canCollapse = "0";
edgeSnap = "1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "329 147";
extent = "296 442";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiWindowProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiContainer() {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 24";
extent = "295 31";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "inspectorStyleRolloutDarkProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
text = "Search Folders...";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "296 18";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "AssetBrowserFolderSearchFilter";
class = "AssetBrowserSearchFilterTxt";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/gui/images/clear-icon";
bitmapMode = "Centered";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
masked = "0";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "280 0";
extent = "15 15";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "ClearFolderFilterBtn";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiContainer() {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 41";
extent = "297 369";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiSolidDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "1";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
docking = "Client";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "297 369";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiEditorScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiSolidDefaultProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTreeViewCtrl() {
class="selectAssetPathTree";
tabSize = "16";
textOffset = "2";
fullRowSelect = "0";
itemHeight = "21";
destroyTreeOnSleep = "1";
mouseDragging = "1";
multipleSelections = "1";
deleteObjectAllowed = "1";
dragToItemAllowed = "1";
clearAllOnSingleSelection = "1";
showRoot = "1";
useInspectorTooltips = "0";
tooltipOnWidthOnly = "0";
showObjectIds = "1";
showClassNames = "1";
showObjectNames = "1";
showInternalNames = "1";
showClassNameForUnnamedObjects = "0";
compareToObjectID = "1";
canRenameObjects = "1";
renameInternal = "0";
position = "1 1";
extent = "295 210";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTreeViewProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "folderTree";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
new GuiButtonCtrl() {
text = "Cancel";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "225 413";
extent = "69 24";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
command="Canvas.popDialog(SelectAssetPath);";
};
new GuiButtonCtrl() {
text = "Select";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "139 413";
extent = "85 24";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
command="SelectAssetPath.selectPath();";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -64,10 +64,13 @@ function initializeAssetBrowser()
exec("./guis/newComponentAsset.gui");
exec("./guis/editAsset.gui");
exec("./guis/assetImport.gui");
exec("./guis/assetImportConfigEditor.gui");
exec("./guis/selectModule.gui");
exec("./guis/selectPath.gui");
exec("./guis/editModule.gui");
exec("./guis/importTemplateModules.gui");
exec("./guis/assetPreviewButtonsTemplate.gui");
exec("./guis/newFolder.gui");
exec("./scripts/assetBrowser.cs");
exec("./scripts/popupMenus.cs");
@ -79,6 +82,9 @@ function initializeAssetBrowser()
exec("./scripts/editAsset.cs");
exec("./scripts/editModule.cs");
exec("./scripts/selectModule.cs");
exec("./scripts/assetImportConfigEditor.cs");
exec("./scripts/directoryHandling.cs");
exec("./scripts/selectPath.cs");
//Processing for the different asset types
exec("./scripts/assetTypes/component.cs");
@ -108,6 +114,20 @@ function initializeAssetBrowser()
Input::GetEventManager().subscribe( AssetBrowser, "DropFile" );
Input::GetEventManager().subscribe( AssetBrowser, "EndDropFiles" );
if(!isObject(AssetImportSettings))
{
new Settings(AssetImportSettings)
{
file = $AssetBrowser::importConfigsFile;
};
}
AssetImportSettings.read();
ImportAssetWindow.reloadImportOptionConfigs();
if(!isObject(ImportAssetTree))
new GuiTreeViewCtrl(ImportAssetTree);
AssetBrowser.buildPopupMenus();
}

View file

@ -41,27 +41,20 @@ function AssetBrowser::onWake(%this)
if(!isObject(AssetPreviewArray))
new ArrayObject(AssetPreviewArray);
if(!isObject(ImportAssetTree))
new GuiTreeViewCtrl(ImportAssetTree);
if(!isObject(%this.dirHandler))
%this.dirHandler = makedirectoryHandler(AssetBrowser-->filterTree, "cache,shaderCache", "");
if(!isObject(AssetBrowser_NavPrevHistoryList))
{
new ArrayObject(AssetBrowser_NavPrevHistoryList);
}
if(!isObject(AssetBrowser_NavForeHistoryList))
{
new ArrayObject(AssetBrowser_NavForeHistoryList);
}
AssetBrowser-->filterTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
":tools/classIcons/SimSet:tools/classIcons/SimSet");
%this.importingFilesArray = new ArrayObject();
%this.importAssetUnprocessedListArray = new ArrayObject();
%this.importAssetFinalListArray = new ArrayObject();
%this.isReImportingAsset = false;
%this.coreModulesFilter = false;
%this.toolsModulesFilter = false;
%this.onlyShowModulesWithAssets = false;
%this.treeFilterMode = "list";
%this.folderPanelState = true;
%this.folderPanelSplit = 0;
@ -109,7 +102,7 @@ function AssetBrowser::viewCoreModulesFilter(%this)
EditorSettings.setValue("Assets/Browser/showCoreModule", %newVal);
AssetBrowser.loadFilters();
AssetBrowser.refresh();
}
function AssetBrowser::viewToolsModulesFilter(%this)
@ -121,7 +114,7 @@ function AssetBrowser::viewToolsModulesFilter(%this)
EditorSettings.setValue("Assets/Browser/showToolsModule", %newVal);
AssetBrowser.loadFilters();
AssetBrowser.refresh();
}
function AssetBrowser::viewPopulatedModulesFilter(%this)
@ -133,7 +126,7 @@ function AssetBrowser::viewPopulatedModulesFilter(%this)
EditorSettings.setValue("Assets/Browser/showOnlyPopulatedModule", %newVal);
AssetBrowser.loadFilters();
AssetBrowser.refresh();
}
function AssetBrowser::toggleShowingFolders(%this)
@ -145,7 +138,7 @@ function AssetBrowser::toggleShowingFolders(%this)
EditorSettings.setValue("Assets/Browser/showFolders", %newVal);
AssetBrowser.loadFilters();
AssetBrowser.refresh();
}
function AssetBrowser::toggleShowingEmptyFolders(%this)
@ -157,19 +150,7 @@ function AssetBrowser::toggleShowingEmptyFolders(%this)
EditorSettings.setValue("Assets/Browser/showEmptyFolders", %newVal);
AssetBrowser.loadFilters();
}
function AssetBrowser::viewListFilter(%this)
{
%this.treeFilterMode = "list";
AssetBrowser.loadFilters();
}
function AssetBrowser::viewTagsFilter(%this)
{
%this.treeFilterMode = "tags";
AssetBrowser.loadFilters();
AssetBrowser.refresh();
}
function AssetBrowser::toggleAssetTypeFilter(%this, %assetTypeIdx)
@ -223,6 +204,7 @@ function AssetBrowser::toggleAssetTypeFilter(%this, %assetTypeIdx)
%this.rebuildAssetArray();
}
//
function AssetBrowser::selectAsset( %this, %asset )
{
if(AssetBrowser.selectCallback !$= "")
@ -280,10 +262,8 @@ function AssetBrowser::showDialog( %this, %AssetTypeFilter, %selectCallback, %ta
{
%this-->SelectButton.setHidden(false);
}
//AssetBrowser_importAssetWindow.setVisible(0);
//AssetBrowser_importAssetConfigWindow.setVisible(0);
AssetBrowser.loadFilters();
AssetBrowser.loadDirectories();
}
function AssetBrowser::hideDialog( %this )
@ -397,6 +377,10 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
AssetPreviewArray.add( %previewButton, %this.previewData.previewImage );
}
function AssetBrowser::refresh(%this)
{
%this.navigateTo(%this.dirHandler.currentAddress);
}
//
//
function AssetPreviewButton::onClick(%this)
@ -411,246 +395,31 @@ function AssetPreviewButton::onDoubleClick(%this)
//
//
function AssetBrowser::loadFolders(%this, %path, %parentId)
{
//utilize home dir project setting here
%paths = getDirectoryList(%path);
for(%i=0; %i < getFieldCount(%paths); %i++)
{
%childPath = getField(%paths, %i);
%folderCount = getTokenCount(%childPath, "/");
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%childPath, "/", %f);
//we don't need to display the shadercache folder
if(%parentId == 1 && (%folderName $= "shaderCache" || %folderName $= "cache"))
continue;
%iconIdx = 1;
if(ModuleDatabase.findModule(%folderName) !$= "")
%iconIdx = 0;
%searchFoldersText = AssetBrowserFolderSearchFilter.getText();
if(%searchFoldersText !$= "Search Folders...")
{
if(strstr(strlwr(%folderName), strlwr(%searchFoldersText)) != -1)
{
%folderID = AssetBrowser-->filterTree.insertItem(%parentId, %folderName, %path, "", %iconIdx, %iconIdx);
%this.loadFolders(%path @ "/" @ %folderName, %folderID);
}
}
else
{
%folderID = AssetBrowser-->filterTree.insertItem(%parentId, %folderName, %path, "", %iconIdx, %iconIdx);
%this.loadFolders(%path @ "/" @ %folderName, %folderID);
}
}
}
}
function AssetBrowser::loadFilters( %this )
function AssetBrowser::loadDirectories( %this )
{
AssetBrowser-->filterTree.clear();
AssetBrowser-->filterTree.buildIconTable( "tools/classIcons/Prefab" @
":tools/classIcons/SimSet");
%dataItem = AssetBrowser-->filterTree.insertItem(0, "Data");
%this.loadFolders("Data", %dataItem);
%this.dirHandler.loadFolders("Data", %dataItem);
//If set to, show core
if(%this.coreModulesFilter)
{
%coreItem = AssetBrowser-->filterTree.insertItem(0, "Core");
%this.loadFolders("Core", %coreItem);
%this.dirHandler.loadFolders("Core", %coreItem);
}
//If set to, show tools
if(%this.toolsModulesFilter)
{
%toolsItem = AssetBrowser-->filterTree.insertItem(0, "Tools");
%this.loadFolders("Tools", %toolsItem);
%this.dirHandler.loadFolders("Tools", %toolsItem);
}
//AssetBrowser-->filterTree.insertItem(0, "Data");
//get it alllll
/*%directoryDump = getDirectoryList("data", -1);
%dirs = getFieldCount(%directoryDump);
for(%i=0; %i < %dirs; %i++)
{
%folderName = getToken(%assetBasePath, "/", %f);
%folderID = AssetBrowser-->filterTree.findChildItemByName(%prevFolderID, %folderName);
if(%folderID == -1 || %folderID == 0)
{
%pathCache = "";
for(%c=0; %c < %f; %c++)
{
%pathCache = %c == 0 ? getToken(%assetBasePath, "/", %c) : %pathCache @ "/" @ getToken(%assetBasePath, "/", %c);
}
%folderID = AssetBrowser-->filterTree.insertItem(%prevFolderID, %folderName, %pathCache, "", 1, 1);
}
}*/
AssetPreviewArray.empty();
/*%assetQuery = new AssetQuery();
%numAssetsFound = AssetDatabase.findAllAssets(%assetQuery);
for( %i=0; %i < %numAssetsFound; %i++)
{
%assetId = %assetQuery.getAsset(%i);
%assetPath = makeRelativePath(AssetDatabase.getAssetFilePath(%assetId));
//clean up the path
%assetPath = strreplace(%assetPath, "\\\\", "\\");
%assetPath = strreplace(%assetPath, "\\", "\\");
%assetPath = strreplace(%assetPath, "//", "\\");
%assetBasePath = filePath(%assetPath);
%foldersCount = getTokenCount(%assetBasePath, "/");
//Build our directory structure
%prevFolderID = 0;
for(%f=0; %f < %foldersCount; %f++)
{
%folderName = getToken(%assetBasePath, "/", %f);
%folderID = AssetBrowser-->filterTree.findChildItemByName(%prevFolderID, %folderName);
if(%folderID == -1 || %folderID == 0)
{
%pathCache = "";
for(%c=0; %c < %f; %c++)
{
%pathCache = %c == 0 ? getToken(%assetBasePath, "/", %c) : %pathCache @ "/" @ getToken(%assetBasePath, "/", %c);
}
%folderID = AssetBrowser-->filterTree.insertItem(%prevFolderID, %folderName, %pathCache, "", 1, 1);
}
%prevFolderID = %folderID;
}
//first, get the asset's module, as our major categories
%module = AssetDatabase.getAssetModule(%assetId);
%moduleName = %module.moduleId;
%moduleGroup = %module.Group;
if((%moduleGroup $= "Core" || %moduleGroup $= "Tools") && !%this.coreModulesFilter)
continue;
//first, see if this module Module is listed already
/*%moduleItemId = AssetBrowser-->filterTree.findItemByName(%moduleName);
//if(%moduleItemId == 0)
// %moduleItemId = AssetBrowser-->filterTree.insertItem(1, %moduleName, "", "", 1, 1);
%assetType = AssetDatabase.getAssetCategory(%assetId);
if(%assetType $= "")
{
%assetType = AssetDatabase.getAssetType(%assetId);
if(%assetType $= "")
%assetType = "Misc";
}
if(AssetBrowser.assetTypeFilter !$= "" && AssetBrowser.assetTypeFilter !$= %assetType)
continue;
%assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%moduleItemId, %assetType);
if(%assetTypeId == 0)
%assetTypeId = AssetBrowser-->filterTree.insertItem(%moduleItemId, %assetType);*/
//}
AssetBrowser-->filterTree.buildVisibleTree(true);
/*if(%this.treeFilterMode $= "list")
{
//First, build our our list of active modules
%modulesList = ModuleDatabase.findModules(true);
for(%i=0; %i < getWordCount(%modulesList); %i++)
{
%moduleName = getWord(%modulesList, %i).ModuleId;
%moduleGroup = getWord(%modulesList, %i).Group;
if((%moduleGroup $= "Core" || %moduleGroup $= "Tools") && !%this.coreModulesFilter)
continue;
%moduleItemId = AssetBrowser-->filterTree.findItemByName(%moduleName);
if(%moduleItemId == 0)
%moduleItemId = AssetBrowser-->filterTree.insertItem(1, %moduleName, "", "", 1, 1);
}
//Next, go through and list the asset categories
%assetQuery = new AssetQuery();
%numAssetsFound = AssetDatabase.findAllAssets(%assetQuery);
for( %i=0; %i < %numAssetsFound; %i++)
{
%assetId = %assetQuery.getAsset(%i);
//first, get the asset's module, as our major categories
%module = AssetDatabase.getAssetModule(%assetId);
%moduleName = %module.moduleId;
%moduleGroup = %module.Group;
if((%moduleGroup $= "Core" || %moduleGroup $= "Tools") && !%this.coreModulesFilter)
continue;
//first, see if this module Module is listed already
%moduleItemId = AssetBrowser-->filterTree.findItemByName(%moduleName);
if(%moduleItemId == 0)
%moduleItemId = AssetBrowser-->filterTree.insertItem(1, %moduleName, "", "", 1, 1);
%assetType = AssetDatabase.getAssetCategory(%assetId);
if(%assetType $= "")
{
%assetType = AssetDatabase.getAssetType(%assetId);
if(%assetType $= "")
%assetType = "Misc";
}
if(AssetBrowser.assetTypeFilter !$= "" && AssetBrowser.assetTypeFilter !$= %assetType)
continue;
%assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%moduleItemId, %assetType);
if(%assetTypeId == 0)
%assetTypeId = AssetBrowser-->filterTree.insertItem(%moduleItemId, %assetType);
}
AssetBrowser-->filterTree.buildVisibleTree(true);
}
else if(%this.treeFilterMode $= "tags")
{
}*/
//%this.collapseTree();
//Remove any modules that have no assets if we have that filter on
if(%this.onlyShowModulesWithAssets)
{
@ -677,61 +446,14 @@ function AssetBrowser::loadFilters( %this )
%dataItem = AssetBrowser-->filterTree.findItemByName("Data");
AssetBrowser-->filterTree.expandItem(%dataItem);
AssetBrowser.expandTreeToAddress(AssetBrowser.currentAddress);
AssetBrowser.dirHandler.expandTreeToAddress(AssetBrowser.dirHandler.currentAddress);
%selectedItem = AssetBrowser.getFolderTreeItemFromAddress(AssetBrowser.currentAddress);
%selectedItem = AssetBrowser.dirHandler.getFolderTreeItemFromAddress(AssetBrowser.dirHandler.currentAddress);
AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem);
AssetBrowser-->filterTree.buildVisibleTree();
}
// create category and update current material if there is one
function AssetBrowser::createFilter( %this, %filter )
{
if( %filter $= %existingFilters )
{
MessageBoxOK( "Error", "Can not create blank filter.");
return;
}
for( %i = AssetBrowser.staticFilterObjects; %i < AssetBrowser-->filterArray.getCount() ; %i++ )
{
%existingFilters = AssetBrowser-->filterArray.getObject(%i).getObject(0).filter;
if( %filter $= %existingFilters )
{
MessageBoxOK( "Error", "Can not create two filters of the same name.");
return;
}
}
%container = new GuiControl(){
profile = "ToolsGuiDefaultProfile";
Position = "0 0";
Extent = "128 18";
HorizSizing = "right";
VertSizing = "bottom";
isContainer = "1";
new GuiCheckBoxCtrl(){
Profile = "ToolsGuiCheckBoxListProfile";
position = "5 1";
Extent = "118 18";
Command = "";
groupNum = "0";
buttonType = "ToggleButton";
text = %filter @ " ( " @ MaterialFilterAllArray.countKey(%filter) @ " )";
filter = %filter;
Command = "AssetBrowser.preloadFilter();";
};
};
AssetBrowser-->filterArray.add( %container );
// if selection exists, lets reselect it to refresh it
if( isObject(AssetBrowser.selectedMaterial) )
AssetBrowser.updateSelection( AssetBrowser.selectedMaterial, AssetBrowser.selectedPreviewImagePath );
// material category text field to blank
AssetBrowser_addFilterWindow-->tagName.setText("");
AssetBrowser.refresh();
}
function AssetBrowser::updateSelection( %this, %asset, %moduleName )
@ -765,26 +487,6 @@ function AssetBrowser::updateSelection( %this, %asset, %moduleName )
%this.prevSelectedMaterialHL = %asset;
}
function AssetBrowser::collapseTree(%this)
{
%modulesList = ModuleDatabase.findModules(true);
for(%i=0; %i < getWordCount(%modulesList); %i++)
{
%moduleName = getWord(%modulesList, %i).ModuleId;
%moduleGroup = getWord(%modulesList, %i).Group;
if((%moduleGroup $= "Core" || %moduleGroup $= "Tools") && !%this.coreModulesFilter)
continue;
%moduleItemId = AssetBrowser-->filterTree.findItemByName(%moduleName);
AssetBrowser-->filterTree.expandItem(%moduleItemId, false);
}
AssetBrowser-->filterTree.expandItem(1, true);
}
//
//needs to be deleted with the persistence manager and needs to be blanked out of the matmanager
//also need to update instances... i guess which is the tricky part....
@ -893,7 +595,7 @@ function AssetBrowser::toggleTagFilterPopup(%this)
%moduleItemId = AssetBrowser-->filterTree.findItemByName(%moduleName);
if(%moduleItemId == -1 || %moduleItemId == 0)
%moduleItemId = AssetBrowser-->filterTree.insertItem(1, %module.moduleId, "", "", 1, 1);
%moduleItemId = AssetBrowser-->filterTree.insertItem(1, %module.moduleId, "", "", 1, 2);
//now, add the asset's category
%assetType = AssetDatabase.getAssetCategory(%assetId);
@ -1015,7 +717,10 @@ function AssetPreviewButton::onRightClick(%this)
if(%assetType $= "LevelAsset")
EditLevelAssetPopup.showPopup(Canvas);
else if(%assetType $= "Folder")
{
EditFolderPopup.dirPath = %this.getParent().assetPath;
EditFolderPopup.showPopup(Canvas);
}
else
EditAssetPopup.showPopup(Canvas);
@ -1050,6 +755,7 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId)
else
{
EditFolderPopup.showPopup(Canvas);
EditFolderPopup.assetType = "Folder";
}
}
else if(%itemId == 1)
@ -1126,14 +832,14 @@ function AssetBrowserFilterTree::onSelect(%this, %itemId)
%breadcrumbPath = %this.getItemText(%itemId);
if(%breadcrumbPath $= "")
%breadcrumbPath = AssetBrowser.currentAddress;
%breadcrumbPath = AssetBrowser.dirHandler.currentAddress;
AssetBrowser.navigateTo(%breadcrumbPath);
}
function AssetBrowser::rebuildAssetArray(%this)
{
%breadcrumbPath = AssetBrowser.currentAddress;
%breadcrumbPath = AssetBrowser.dirHandler.currentAddress;
// we have to empty out the list; so when we create new guicontrols, these dont linger
AssetBrowser-->assetList.deleteAllObjects();
@ -1329,7 +1035,7 @@ function AssetBrowserFolderSearchFilter::onReturn( %this )
if( %text $= "" )
%this.reset();
AssetBrowser.loadFilters();
AssetBrowser.refresh();
}
function AssetBrowserSearchFilter::onReturn( %this )
@ -1345,7 +1051,7 @@ function AssetBrowserFolderSearchFilter::reset( %this )
{
%this.setText( "Search Folders..." );
AssetBrowser.loadFilters();
AssetBrowser.refresh();
}
function AssetBrowserSearchFilter::reset( %this )
@ -1364,15 +1070,64 @@ function AssetBrowser_ClearAssetFilterBtn::onClick( %this )
{
AssetBrowserSearchFilter.reset();
}
//
//
// Navigation
function AssetBrowser::navigateTo(%this, %address, %historyNav)
{
//Don't bother navigating if it's to the place we already are
if(AssetBrowser.currentAddress $= %address)
return;
if(AssetBrowser.dirHandler.currentAddress !$= %address)
{
AssetBrowser.dirHandler.navigateTo(%address, %historyNav);
%this.updateNavigationBreadcrumb(%address);
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
if(%module !$= "")
{
//legit module, so set it as current target
AssetBrowser.SelectedModule = %module.moduleId;
}
}
%this.rebuildAssetArray();
}
function AssetBrowser::navigateHistoryForward(%this)
{
%this.dirHandler.navigateHistoryForward();
%this.updateNavigationBreadcrumb();
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
if(%module !$= "")
{
//legit module, so set it as current target
AssetBrowser.SelectedModule = %module.moduleId;
}
%this.rebuildAssetArray();
}
function AssetBrowser::navigateHistoryBack(%this)
{
%this.dirHandler.navigateHistoryBack();
%this.updateNavigationBreadcrumb();
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
if(%module !$= "")
{
//legit module, so set it as current target
AssetBrowser.SelectedModule = %module.moduleId;
}
%this.rebuildAssetArray();
}
function AssetBrowser::updateNavigationBreadcrumb(%this, %address)
{
//clear the breadcrumb bar
AssetBrowser_BreadcrumbBar.clear();
@ -1411,80 +1166,24 @@ function AssetBrowser::navigateTo(%this, %address, %historyNav)
}
}
//find our folder tree and action on it tree
%folderId = AssetBrowser.getFolderTreeItemFromAddress(%address);
%oldAddress = AssetBrowser.currentAddress;
AssetBrowser.currentAddress = %address;
AssetBrowser.selectedItem = %folderId;
AssetBrowser-->filterTree.clearSelection();
AssetBrowser-->filterTree.selectItem(%folderId);
//remove any history records that are 'newer' than this one
if(%historyNav $= "")
{
AssetBrowser_NavForeHistoryList.empty();
if(%oldAddress !$= "")
AssetBrowser_NavPrevHistoryList.push_front(%oldAddress);
}
//refresh the nav buttons to display the history
%backButtonHistory = "";
for(%i=0; %i < AssetBrowser_NavPrevHistoryList.Count(); %i++)
for(%i=0; %i < AssetBrowser.dirHandler.prevHistoryList.Count(); %i++)
{
%prevAddress = AssetBrowser_NavPrevHistoryList.getKey(%i);
%prevAddress = AssetBrowser.dirHandler.prevHistoryList.getKey(%i);
%backButtonHistory = %i==0 ? %prevAddress @ "\n" : %backButtonHistory @ %prevAddress @ "\n";
}
AssetBrowser_NavigateBackBtn.tooltip = %backButtonHistory;
%foreButtonHistory = "";
for(%i=0; %i < AssetBrowser_NavForeHistoryList.Count(); %i++)
for(%i=0; %i < AssetBrowser.dirHandler.foreHistoryList.Count(); %i++)
{
%prevAddress = AssetBrowser_NavForeHistoryList.getKey(%i);
%prevAddress = AssetBrowser.dirHandler.foreHistoryList.getKey(%i);
%foreButtonHistory = %i==0 ? %prevAddress @ "\n" : %foreButtonHistory @ %prevAddress @ "\n";
}
AssetBrowser_NavigateForwardBtn.tooltip = %foreButtonHistory;
%module = AssetBrowser.getModuleFromAddress(%address);
if(%module !$= "")
{
//legit module, so set it as current target
AssetBrowser.SelectedModule = %module.moduleId;
}
%this.rebuildAssetArray();
}
function AssetBrowser::navigateHistoryForward(%this)
{
if(AssetBrowser_NavForeHistoryList.count() == 0)
return;
%newAddress = AssetBrowser_NavForeHistoryList.getKey(0);
%prevHistory = AssetBrowser.currentAddress;
AssetBrowser_NavPrevHistoryList.push_front(%prevHistory);
AssetBrowser_NavForeHistoryList.pop_front();
%this.navigateTo(%newAddress, true);
}
function AssetBrowser::navigateHistoryBack(%this)
{
if(AssetBrowser_NavPrevHistoryList.count() == 0)
return;
%newAddress = AssetBrowser_NavPrevHistoryList.getKey(0);
%foreHistory = AssetBrowser.currentAddress;
AssetBrowser_NavForeHistoryList.push_front(%foreHistory);
AssetBrowser_NavPrevHistoryList.pop_front();
%this.navigateTo(%newAddress, true);
}
//
@ -1519,88 +1218,6 @@ function AssetBrowser::reloadModules(%this)
//ModuleDatabase.loadGroup("Game");
}
function AssetBrowser::getModuleFromAddress(%this, %address)
{
//break down the address
%folderCount = getTokenCount(%address, "/");
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%module = ModuleDatabase.findModule(%folderName);
if(%module !$= "")
return %module;
}
return "";
}
//AssetBrowser.getFolderTreeItemFromAddress(AssetBrowser.currentAddress);
function AssetBrowser::getFolderTreeItemFromAddress(%this, %address)
{
//break down the address
%folderCount = getTokenCount(%address, "/");
%curItem = 0;
%rebuiltPath = "";
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%curItem = AssetBrowser-->filterTree.findChildItemByName(%curItem, %folderName);
}
return %curItem;
}
function AssetBrowser::expandTreeToAddress(%this, %address)
{
//break down the address
%folderCount = getTokenCount(%address, "/");
AssetBrowser-->filterTree.expandItem(0);
%curItem = 0;
%rebuiltPath = "";
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%curItem = AssetBrowser-->filterTree.findChildItemByName(%curItem, %folderName);
AssetBrowser-->filterTree.expandItem(%curItem);
}
}
//
//
//
function AssetBrowser::createNewFolder(%this)
{
%newFolderIdx = "";
%matched = true;
%newFolderPath = "";
while(%matched == true)
{
%newFolderPath = AssetBrowser.currentAddress @ "/NewFolder" @ %newFolderIdx;
if(!isDirectory(%newFolderPath))
{
%matched = false;
}
else
{
%newFolderIdx++;
}
}
//make a dummy file
%file = new FileObject();
%file.openForWrite(%newFolderPath @ "/test");
%file.close();
fileDelete(%newFolderPath @ "/test");
//refresh the directory
%this.loadFilters();
%this.rebuildAssetArray();
}
//
//
//
@ -1749,7 +1366,14 @@ function EWorldEditor::onControlDropped( %this, %payload, %position )
%module = %payload.dragSourceControl.parentGroup.moduleName;
%asset = %payload.dragSourceControl.parentGroup.assetName;
if(%assetType $= "ImageAsset")
if(AssetBrowser.isMethod("on" @ %assetType @ "EditorDropped"))
{
%assetDef = AssetDatabase.acquireAsset(%module @ ":" @ %asset);
%buildCommand = AssetBrowser @ ".on" @ %assetType @ "EditorDropped(" @ %assetDef @ ",\"" @ %position @ "\");";
eval(%buildCommand);
}
/*if(%assetType $= "ImageAsset")
{
echo("WorldEditor::onControlDropped - dropped an ImageAsset onto the editor window. Todo: Implement dropping image/material into scene");
}
@ -1766,7 +1390,7 @@ function EWorldEditor::onControlDropped( %this, %payload, %position )
%newEntity.dirtyGameObject = true; //because if we're specifically setting the mesh asset, it's dirty*/
%newEntity = new TSStatic()
/*%newEntity = new TSStatic()
{
position = %pos;
shapeAsset = %module @ ":" @ %asset;
@ -1820,7 +1444,7 @@ function EWorldEditor::onControlDropped( %this, %payload, %position )
EWorldEditor.clearSelection();
EWorldEditor.selectObject(%newEntity);
}
}*/
EWorldEditor.isDirty = true;
}
@ -1850,7 +1474,7 @@ function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
%path = %this.getItemValue(%item) @ "/" @ %this.getItemText(%item);
echo("DROPPED IT ON PATH " @ %path);
if(%path !$= AssetBrowser.CurrentAddress)
if(%path !$= AssetBrowser.dirHandler.CurrentAddress)
{
//we're trying to move the asset to a different module!
MessageBoxYesNo( "Move Asset", "Do you wish to move asset " @ %assetName @ " to " @ %path @ "?",

View file

@ -203,10 +203,10 @@ function AssetBrowser::onEndDropFiles( %this )
MessageBoxOK( "Warning", "No base import config. Please create an import configuration set to simplify asset importing.");
}
}
//
//
//
//
//
//
function AssetBrowser::reloadImportingFiles(%this)
{
//Effectively, we re-import the files we were trying to originally. We'd only usually do this in the event we change our import config
@ -423,6 +423,17 @@ function ImportAssetWindow::onWake(%this)
{
%this.assetValidationList = new ArrayObject();
}
AssetImportCtrl-->NewAssetsTree.buildIconTable( ":tools/classIcons/TSStatic:tools/classIcons/TSStatic" @
":tools/classIcons/material:tools/classIcons/material"@
":tools/classIcons/GuiBitmapCtrl:tools/classIcons/GuiBitmapCtrl"@
":tools/classIcons/SFXEmitter:tools/classIcons/SFXEmitter"@
":tools/gui/images/iconWarn:tools/gui/images/iconWarn"@
":tools/gui/images/iconError:tools/gui/images/iconError");
AssetImportTargetAddress.text = AssetBrowser.dirHandler.currentAddress;
AssetImportTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
ImportAssetConfigList.setSelected(0);
}
function ImportAssetWindow::reloadImportOptionConfigs(%this)
@ -466,69 +477,15 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this)
if(%importConfigIdx $= "")
%importConfigIdx = 0;
ImportAssetConfigList.setSelected(%importConfigIdx);
//ImportAssetConfigList.setSelected(%importConfigIdx);
}
function ImportAssetWindow::setImportOptions(%this, %configName)
//
function assetImportUpdatePath(%newPath)
{
//Todo, editor + load from files for preconfigs
//General
%optionsObj.treatWarningsAsErrors = false;
%optionsObj.ignoreDuplicateAssets = false;
//Meshes
%optionsObj.ImportMesh = true;
%optionsObj.UpAxisOverride = "Z_AXIS";
%optionsObj.OverrideScale = 1.0;
%optionsObj.IgnoreNodeScale = false;
%optionsObj.AdjustCenter = false;
%optionsObj.AdjustFloor = false;
%optionsObj.CollapseSubmeshes = false;
%optionsObj.LODType = "TrailingNumber";
%optionsObj.TrailingNumber = 2;
%optionsObj.ImportedNodes = "";
%optionsObj.IgnoreNodes = "";
%optionsObj.ImportMeshes = "";
%optionsObj.IgnoreMeshes = "";
//Materials
%optionsObj.ImportMaterials = true;
%optionsObj.CreateComposites = true;
//Animations
%optionsObj.ImportAnimations = true;
%optionsObj.SeparateAnimations = true;
%optionsObj.SeparateAnimationPrefix = "";
//Collision
%optionsObj.GenerateCollisions = true;
%optionsObj.GenCollisionType = "CollisionMesh";
%optionsObj.CollisionMeshPrefix = "Collision";
%optionsObj.GenerateLOSCollisions = true;
%optionsObj.GenLOSCollisionType = "CollisionMesh";
%optionsObj.LOSCollisionMeshPrefix = "LOS";
//Images
%optionsObj.ImageType = "Diffuse";
%optionsObj.DiffuseTypeSuffixes = "_ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL";
%optionsObj.NormalTypeSuffixes = "_NORMAL,_NORM";
%optionsObj.SpecularTypeSuffixes = "_SPECULAR,_SPEC";
%optionsObj.MetalnessTypeSuffixes = "_METAL,_MET,_METALNESS,_METALLIC";
%optionsObj.RoughnessTypeSuffixes = "_ROUGH,_ROUGHNESS";
%optionsObj.SmoothnessTypeSuffixes = "_SMOOTH,_SMOOTHNESS";
%optionsObj.AOTypeSuffixes = "_AO,_AMBIENT,_AMBIENTOCCLUSION";
%optionsObj.CompositeTypeSuffixes = "_COMP,_COMPOSITE";
%optionsObj.TextureFilteringMode = "Bilinear";
%optionsObj.UseMips = true;
%optionsObj.IsHDR = false;
%optionsObj.Scaling = 1.0;
%optionsObj.Compressed = true;
//Sounds
%optionsObj.VolumeAdjust = 1.0;
%optionsObj.PitchAdjust = 1.0;
%optionsObj.Compressed = false;
AssetBrowser.navigateTo(%newPath);
AssetImportTargetAddress.text = %newPath;
AssetImportTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
}
//
@ -818,11 +775,15 @@ function ImportAssetWindow::refresh(%this)
%this.processNewImportAssets(%id);
%this.indentCount = 0;
%this.ImportingAssets = 0;
%this.FetchedAssets = 0;
%this.prunedDuplicateAssets = 0;
%this.autoRenamedAssets = 0;
%this.validateAssets();
ImportingAssetList.clear();
AssetImportCtrl-->NewAssetsTree.clear();
AssetImportCtrl-->NewAssetsTree.insertItem(0, "Importing Assets");
if(AssetBrowser.importAssetUnprocessedListArray.count() == 0)
{
@ -838,6 +799,31 @@ function ImportAssetWindow::refresh(%this)
//Continue processing
%this.refresh();
}
AssetImportCtrl-->NewAssetsTree.buildVisibleTree(true);
%ImportActionSummary = "";
if(%this.ImportingAssets != 0)
{
%ImportActionSummary = %ImportActionSummary SPC %this.ImportingAssets @ " Imported|";
}
if(%this.FetchedAssets != 0)
{
%ImportActionSummary = %ImportActionSummary SPC %this.FetchedAssets @ " Fetched|";
}
if(%this.prunedDuplicateAssets != 0)
{
%ImportActionSummary = %ImportActionSummary SPC %this.prunedDuplicateAssets @ " Duplicates Pruned|";
}
if(%this.autoRenamedAssets != 0)
{
%ImportActionSummary = %ImportActionSummary SPC %this.autoRenamedAssets @ " Auto Renamed|";
}
warn(%ImportActionSummary);
AssetImportSummarization.Text = %ImportActionSummary;
}
function ImportAssetWindow::refreshChildItem(%this, %id)
@ -859,43 +845,35 @@ function ImportAssetWindow::refreshChildItem(%this, %id)
//Once validated, attempt any fixes for issues
%this.resolveIssue(%assetItem);
//Make sure we size correctly
ImportingAssetList.extent.x = ImportingAssetList.getParent().extent.x - 15;
//create!
%width = mRound(mRound(ImportingAssetList.extent.x) / 2);
%height = 20;
%indent = %this.indentCount * 16;
%toolTip = "";
%iconPath = "tools/gui/images/iconInformation";
%configCommand = "ImportAssetOptionsWindow.editImportSettings(" @ %assetItem @ ");";
if(%assetType $= "Model" || %assetType $= "Animation" || %assetType $= "Image" || %assetType $= "Sound")
{
if(%assetItem.status $= "Error")
{
%iconPath = "tools/gui/images/iconError";
%iconIdx = 11;
}
else if(%assetItem.status $= "Warning")
{
%iconPath = "tools/gui/images/iconWarn";
%iconIdx = 9;
}
%configCommand = "ImportAssetOptionsWindow.fixIssues(" @ %assetItem @ ");";
if(%assetItem.statusType $= "DuplicateAsset" || %assetItem.statusType $= "DuplicateImportAsset")
%assetName = %assetItem.assetName @ " <Duplicate Asset>";
if(%assetItem.statusType $= "DuplicateAsset" || %assetItem.statusType $= "DuplicateImportAsset")
%assetName = %assetItem.assetName @ " <Duplicate Asset>";
}
else
{
if(%assetItem.status $= "Error")
{
%iconPath = "tools/gui/images/iconError";
%iconIdx = 11;
}
else if(%assetItem.status $= "Warning")
{
%iconPath = "tools/gui/images/iconWarn";
%iconIdx = 9;
}
%configCommand = "";//"ImportAssetOptionsWindow.fixIssues(" @ %assetItem @ ");";
@ -905,128 +883,26 @@ function ImportAssetWindow::refreshChildItem(%this, %id)
}
%toolTip = %assetItem.statusInfo;
%parentItem = ImportAssetTree.getParentItem(%id);
%inputCellPos = %indent;
%inputCellWidth = (ImportingAssetList.extent.x * 0.3) - %indent;
%filePathBtnPos = %inputCellPos + %inputCellWidth - %height;
%assetNameCellPos = %inputCellPos + %inputCellWidth;
%assetNameCellWidth = ImportingAssetList.extent.x * 0.3;
%assetTypeCellPos = %assetNameCellPos + %assetNameCellWidth;
%assetTypeCellWidth = ImportingAssetList.extent.x * 0.3;
%configBtnPos = %assetTypeCellPos + %assetTypeCellWidth - (%height * 2);
%configBtnWidth = %height;
%delBtnPos = %assetTypeCellPos + %assetTypeCellWidth - %height;
%delBtnWidth = %height;
%inputField = %filePath;
//Check if it's a generated type, like materials
%inputPathProfile = ToolsGuiTextEditProfile;
%generatedField = false;
if(%assetItem.generatedAsset)
if(%assetItem.status $= "")
{
%generatedField = true;
%inputField = "(Generated)";
}
else
{
//nope, so check that it's a valid file path. If not, flag it as such
if(%assetItem.status $= "Error")
{
if(!isFile(%filePath))
{
%inputField = "File not found!";
%inputPathProfile = ToolsGuiTextEditErrorProfile;
}
}
if(%assetType $= "Model")
%iconIdx = 1;
else if(%assetType $= "Material")
%iconIdx = 3;
else if(%assetType $= "Image")
%iconIdx = 5;
else if(%assetType $= "Sound")
%iconIdx = 7;
}
AssetImportCtrl-->NewAssetsTree.insertItem(%parentItem, %assetName, %assetItem, "", %iconIdx, %iconIdx+1);
%importEntry = new GuiControl()
{
position = "0 0";
extent = ImportingAssetList.extent.x SPC %height;
horzSizing = "width";
vertSizing = "bottom";
new GuiTextEditCtrl()
{
Text = %inputField;
position = %inputCellPos SPC "0";
extent = %inputCellWidth SPC %height;
internalName = "InputPath";
active = false;
profile = %inputPathProfile;
horzSizing = "width";
vertSizing = "bottom";
};
new GuiButtonCtrl()
{
position = %filePathBtnPos SPC "0";
extent = %height SPC %height;
command = "ImportAssetWindow.findMissingFile(" @ %assetItem @ ");";
text = "...";
internalName = "InputPathButton";
tooltip = %toolTip;
visible = !%generatedField;
horzSizing = "width";
vertSizing = "bottom";
};
new GuiTextEditCtrl()
{
Text = %assetName;
position = %assetNameCellPos SPC "0";
extent = %assetNameCellWidth SPC %height;
internalName = "AssetName";
horzSizing = "width";
vertSizing = "bottom";
};
new GuiTextEditCtrl()
{
Text = %assetType;
position = %assetTypeCellPos SPC "0";
extent = %assetTypeCellWidth SPC %height;
active = false;
internalName = "AssetType";
horzSizing = "width";
vertSizing = "bottom";
};
new GuiBitmapButtonCtrl()
{
position = %configBtnPos SPC "0";
extent = %height SPC %height;
command = "ImportAssetWindow.importResolution(" @ %assetItem @ ");";
bitmap = %iconPath;
tooltip = %toolTip;
horzSizing = "width";
vertSizing = "bottom";
};
new GuiBitmapButtonCtrl()
{
position = %delBtnPos SPC "0";
extent = %height SPC %height;
command = "ImportAssetWindow.deleteImportingAsset(" @ %assetItem @ ");";
bitmap = "tools/gui/images/iconDelete";
horzSizing = "width";
vertSizing = "bottom";
};
};
ImportingAssetList.add(%importEntry);
AssetBrowser.importAssetFinalListArray.add(%assetItem);
if(ImportAssetTree.isParentItem(%id))
{
%this.indentCount++;
%childItem = ImportAssetTree.getChild(%id);
//recurse!
@ -1035,11 +911,123 @@ function ImportAssetWindow::refreshChildItem(%this, %id)
%id = ImportAssetTree.getNextSibling(%id);
}
%this.indentCount--;
}
//
//
function NewAssetsViewTree::onSelect(%this, %itemId)
{
if(%itemId == 1)
//can't select root
return;
%assetItem = %this.getItemValue(%itemId);
AssetImportCtrl-->NewAssetsInspector.clearFields();
AssetImportCtrl-->NewAssetsInspector.startGroup("General");
AssetImportCtrl-->NewAssetsInspector.addField("assetName", "Asset Name", "string", "", %assetItem.assetName, "", %assetItem);
AssetImportCtrl-->NewAssetsInspector.addField("assetType", "Asset Type", "string", "", %assetItem.assetType, "", %assetItem);
if(!%assetItem.generatedAsset)
AssetImportCtrl-->NewAssetsInspector.addField("filePath", "File Path", "fileName", "", %assetItem.filePath, "", %assetItem);
//AssetImportCtrl-->NewAssetsInspector.addField("assetName", "Asset Name", "string", "", %assetItem.assetName, "", %assetItem);
//AssetImportCtrl-->NewAssetsInspector.addField("assetName", "Asset Name", "string", "", %assetItem.assetName, "", %assetItem);
AssetImportCtrl-->NewAssetsInspector.addField("status", "Status", "string", "", %assetItem.status, "", %assetItem);
AssetImportCtrl-->NewAssetsInspector.endGroup();
AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("assetType", false);
//AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("status", false);
/*moduleName = %moduleName;
dirty = true;
parentAssetItem = %parentAssetItem;
status = "";
statusType = "";
statusInfo = "";
skip = false;
processed = false;
generatedAsset = false;*/
}
function NewAssetsViewTree::onRightMouseDown(%this, %itemId)
{
ImportAssetActions.enableItem(1, true);
if( %itemId != 1 && %itemId != -1)
{
ImportAssetActions.showPopup(Canvas);
ImportAssetActions.assetItem = %this.getItemValue(%itemId);
ImportAssetActions.itemId = %itemId;
}
else
{
ImportAssetActions.enableItem(1, false);
ImportAssetActions.showPopup(Canvas);
}
}
function NewAssetsPanelInputs::onRightMouseDown(%this)
{
NewAssetsViewTree::onRightMouseDown(0, -1);
}
//
function ImportAssetWindow::removeImportingAsset(%this)
{
ImportAssetTree.removeAllChildren(ImportAssetActions.itemId);
ImportAssetTree.removeItem(ImportAssetActions.itemId);
ImportAssetWindow.refresh();
}
function ImportAssetWindow::addNewImportingAsset(%this)
{
%dlg = new OpenFileDialog()
{
Filters = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts|Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds|Any Files (*.*)|*.*|";
DefaultFile = "";
ChangePath = false;
MustExist = true;
MultipleFiles = false;
forceRelativePath = false;
};
if ( %dlg.Execute() )
{
%filePath = %dlg.FileName;
}
%dlg.delete();
//AssetBrowser.onDropFile( %path );
%fileExt = fileExt( %filePath );
//add it to our array!
if(isImageFormat(%fileExt))
%type = "Image";
else if( isShapeFormat(%fileExt))
%type = "Model";
else if( isSoundFormat(%fileExt))
%type = "Sound";
else if( %fileExt $= ".cs" || %fileExt $= ".cs.dso" )
%type = "Script";
else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" )
%type = "GUI";
AssetBrowser.addImportingAsset(%type, %filePath, ImportAssetActions.assetItem);
//Used to keep tabs on what files we were trying to import, used mainly in the event of
//adjusting configs and needing to completely reprocess the import
//ensure we're not doubling-up on files by accident
if(%this.importingFilesArray.getIndexFromKey(%filePath) == -1)
%this.importingFilesArray.add(%filePath);
AssetBrowser.onEndDropFiles();
}
//
function ImportAssetWindow::importResolution(%this, %assetItem)
{
if(%assetItem.status !$= "Error" && %assetItem.status !$= "Warning")
@ -1086,8 +1074,7 @@ function ImportAssetWindow::validateAssets(%this)
function ImportAssetWindow::validateAsset(%this, %id)
{
%moduleName = ImportAssetModuleList.getText();
%moduleName = AssetImportTargetModule.getText();
while (%id > 0)
{
@ -1201,7 +1188,7 @@ function ImportAssetWindow::resetAssetsValidationStatus(%this)
function ImportAssetWindow::resetAssetValidationStatus(%this, %id)
{
%moduleName = ImportAssetModuleList.getText();
%moduleName = AssetImportTargetModule.getText();
%id = ImportAssetTree.getChild(%id);
while (%id > 0)
@ -1239,7 +1226,7 @@ function ImportAssetWindow::checkAssetsForCollision(%this, %assetItem)
function ImportAssetWindow::checkAssetForCollision(%this, %assetItem, %id)
{
%moduleName = ImportAssetModuleList.getText();
%moduleName = AssetImportTargetModule.getText();
%id = ImportAssetTree.getChild(%id);
while (%id > 0)
@ -1288,7 +1275,7 @@ function ImportAssetWindow::deleteImportingAsset(%this, %assetItem)
schedule(10, 0, "refreshImportAssetWindow");
//ImportAssetWindow.refresh();
ImportAssetOptionsWindow.setVisible(0);
//ImportAssetOptionsWindow.setVisible(0);
}
//
@ -1298,7 +1285,7 @@ function ImportAssetWindow::ImportAssets(%this)
%assetCount = AssetBrowser.importAssetFinalListArray.count();
//get the selected module data
%moduleName = ImportAssetModuleList.getText();
%moduleName = AssetImportTargetModule.getText();
%module = ModuleDatabase.findModule(%moduleName, 1);
@ -1313,8 +1300,7 @@ function ImportAssetWindow::ImportAssets(%this)
%this.doImportAssets(%id);
//force an update of any and all modules so we have an up-to-date asset list
AssetBrowser.loadFilters();
AssetBrowser.refreshPreviews();
AssetBrowser.refresh();
Canvas.popDialog(AssetImportCtrl);
AssetBrowser.isAssetReImport = false;
}
@ -1486,6 +1472,7 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem)
if(%resolutionAction $= "AutoPrune")
{
%this.deleteImportingAsset(%assetItem);
%this.prunedDuplicateAssets++;
}
else if(%resolutionAction $= "AutoRename")
{
@ -1501,6 +1488,8 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem)
%num++;
%assetItem.assetName = %noNum @ %num;
}
%this.autoRenamedAssets++;
}
}
else if(%assetItem.statusType $= "MissingFile")

View file

@ -0,0 +1,203 @@
function AssetImportConfigEditor::onWake(%this)
{
%this.refresh();
}
function AssetImportConfigEditor::refresh(%this)
{
AssetImportConfigList.clear();
ImportAssetWindow.reloadImportOptionConfigs();
setupImportConfigSettingsList();
for(%i=0; %i < ImportAssetWindow.importConfigsList.count(); %i++)
{
%configName = ImportAssetWindow.importConfigsList.getKey(%i);
AssetImportConfigList.addRow(%i, %configName);
}
if(ESettingsWindow.isAwake())
ESettingsWindow.refresh();
if(AssetImportCtrl.isAwake())
ImportAssetConfigList.setSelected(0);
}
function AssetImportConfigList::onSelect( %this, %id, %text )
{
ImportOptionsConfigList.clearFields();
ImportOptionsConfigList.setAutoUpdate(false); //we don't want to be updating every time we add a field in here
%this.currentConfig = %text;
%this.populateConfigListByGroup("General");
%this.populateConfigListByGroup("Meshes");
%this.populateConfigListByGroup("Materials");
//%this.populateConfigListByGroup("Animations");
//%this.populateConfigListByGroup("Images");
//%this.populateConfigListByGroup("Collision");
//%this.populateConfigListByGroup("Sound");
ImportOptionsConfigList.update();
}
function AssetImportConfigList::populateConfigListByGroup(%this, %groupName)
{
AssetImportConfigEditorInspector.startGroup(%groupName);
for(%i=0; %i < ImportAssetConfigSettingsList.count(); %i++)
{
%settingName = getField(ImportAssetConfigSettingsList.getKey(%i),0);
if(startsWith(%settingName, %groupName@"/"))
{
%labelName = getField(ImportAssetConfigSettingsList.getKey(%i), 1);
%type = getField(ImportAssetConfigSettingsList.getKey(%i), 2);
%tooltip = getField(ImportAssetConfigSettingsList.getKey(%i), 3);
%defaultValue = getField(ImportAssetConfigSettingsList.getValue(%i), 0);
%dataValues = getField(ImportAssetConfigSettingsList.getValue(%i), 1);
AssetImportConfigEditorInspector.addSettingsField(%settingName, %labelName, %type, %tooltip, %defaultValue, %dataValues);
}
}
AssetImportConfigEditorInspector.endGroup();
}
function AssetImportConfigEditorInspector::addSettingsField(%this, %settingsFieldName, %labelText, %fieldType, %tooltip, %fieldValue, %fieldData)
{
%moddedSettingsFieldName = strreplace(%settingsFieldName, "/", "-");
%configGroup = AssetImportConfigList.currentConfig;
%value = AssetImportSettings.value(%configGroup @ "/" @ %settingsFieldName);
if(%value $= "")
%value = %fieldValue;
//%this.addCallbackField(%moddedSettingsFieldName, %labelText, %fieldType, "", %value, %fieldData, %this @ ".changeEditorSetting");
%this.addCallbackField(%moddedSettingsFieldName, %labelText, %fieldType, "", %value, %fieldData, "changeEditorSetting");
}
function AssetImportConfigEditorInspector::changeEditorSetting(%this, %varName, %value)
{
%varName = strreplace(%varName, "-", "/");
echo("Set " @ %varName @ " to be " @ %value);
%configGroup = AssetImportConfigList.currentConfig;
%oldValue = AssetImportSettings.value(%configGroup @ "/" @ %varName, %value);
AssetImportSettings.setValue(%configGroup @ "/" @ %varName, %value);
if(%oldValue !$= %value)
{
%scollPos = ImportAssetConfigEditorScroll.getScrollPosition();
ImportAssetConfigEditorWindow.populateConfigList(ImportAssetWindow.activeImportConfig);
ImportAssetConfigEditorScroll.setScrollPosition(%scollPos.x, %scollPos.y);
}
}
function AssetImportConfigEditorInspector::setDefaultValuesByGroup(%this, %groupName)
{
%configList = ImportAssetConfigSettingsList;
for(%i=0; %i < %configList.count(); %i++)
{
%settingName = getField(%configList.getKey(%i),0);
if(startsWith(%settingName, %groupName @ "/"))
{
%defaultValue = getField(%configList.getValue(%i), 0);
AssetImportSettings.setValue(%settingName, %defaultValue);
}
}
}
function AssetImportConfigEditorInspector::ToggleImportMesh(%this, %fieldName, %newValue, %ownerObject)
{
%this.setFieldEnabled("DoUpAxisOverride", %newValue);
%this.setFieldEnabled("UpAxisOverride", %newValue);
%this.setFieldEnabled("DoScaleOverride", %newValue);
%this.setFieldEnabled("ScaleOverride", %newValue);
%this.setFieldEnabled("IgnoreNodeScale", %newValue);
%this.setFieldEnabled("AdjustCenter", %newValue);
%this.setFieldEnabled("AdjustFloor", %newValue);
%this.setFieldEnabled("CollapseSubmeshes", %newValue);
%this.setFieldEnabled("LODType", %newValue);
%this.setFieldEnabled("ImportedNodes", %newValue);
%this.setFieldEnabled("IgnoreNodes", %newValue);
%this.setFieldEnabled("ImportMeshes", %newValue);
%this.setFieldEnabled("IgnoreMeshes", %newValue);
}
function AssetImportConfigEditor::addNewConfig(%this)
{
//Ensure our list is set up
setupImportConfigSettingsList();
ImportAssetNewConfigEditorWindow.setVisible(1);
ImportAssetNewConfigEditorWindow.selectWindow();
}
function AssetImportConfigEditor::createNewImportConfig(%this)
{
%configName = AssetImportNewConfigName.getText();
%configList = ImportAssetConfigSettingsList;
AssetImportSettings.beginGroup(%configName);
AssetImportConfigEditorInspector.setDefaultValuesByGroup("General");
AssetImportConfigEditorInspector.setDefaultValuesByGroup("Meshes");
AssetImportConfigEditorInspector.setDefaultValuesByGroup("Materials");
AssetImportConfigEditorInspector.setDefaultValuesByGroup("Animations");
AssetImportConfigEditorInspector.setDefaultValuesByGroup("Collision");
AssetImportConfigEditorInspector.setDefaultValuesByGroup("Images");
AssetImportConfigEditorInspector.setDefaultValuesByGroup("Sounds");
AssetImportSettings.endGroup();
%success = AssetImportSettings.write();
ImportAssetNewConfigEditorWindow.setVisible(0);
%this.refresh();
}
function AssetImportConfigEditor::deleteConfig(%this)
{
%callback = "AssetImportConfigEditor.onDeleteConfig();";
MessageBoxOKCancel("Delete Import Config", "This will delete the " @ AssetImportConfigList.currentConfig @ " config. Continue?", %callback, "");
}
function AssetImportConfigEditor::onDeleteConfig(%this)
{
%configGroup = AssetImportConfigList.currentConfig;
AssetImportConfigEditorInspector.removeSettingsByGroup("General");
AssetImportConfigEditorInspector.removeSettingsByGroup("Meshes");
AssetImportConfigEditorInspector.removeSettingsByGroup("Materials");
AssetImportConfigEditorInspector.removeSettingsByGroup("Animations");
AssetImportConfigEditorInspector.removeSettingsByGroup("Collision");
AssetImportConfigEditorInspector.removeSettingsByGroup("Images");
AssetImportConfigEditorInspector.removeSettingsByGroup("Sounds");
}
function AssetImportConfigEditorInspector::removeSettingsByGroup(%this, %groupName)
{
%configList = ImportAssetConfigSettingsList;
%configGroup = AssetImportConfigList.currentConfig;
for(%i=0; %i < %configList.count(); %i++)
{
%settingName = getField(%configList.getKey(%i),0);
if(startsWith(%settingName, %groupName @ "/"))
{
%defaultValue = getField(%configList.getValue(%i), 0);
%targetSetting = %configGroup @ "/" @ %settingName;
AssetImportSettings.remove(%configGroup @ "/" @ %settingName);
}
}
%success = AssetImportSettings.write();
AssetImportConfigEditor.refresh();
}

View file

@ -3,11 +3,13 @@ function AssetBrowser::createCppAsset(%this)
%moduleName = AssetBrowser.newAssetSettings.moduleName;
%modulePath = "data/" @ %moduleName;
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetName = AssetBrowser.newAssetSettings.assetName;
%tamlpath = %modulePath @ "/source/" @ %assetName @ ".asset.taml";
%codePath = %modulePath @ "/source/" @ %assetName @ ".cpp";
%headerPath = %modulePath @ "/source/" @ %assetName @ ".h";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%codePath = %assetPath @ %assetName @ ".cpp";
%headerPath = %assetPath @ %assetName @ ".h";
//Do the work here
%assetType = AssetBrowser.newAssetSettings.assetType;
@ -95,7 +97,7 @@ function AssetBrowser::createCppAsset(%this)
}
//Last, check that we have a C++ Module definition. If not, make one so anything important can be initialized on startup there
%cppModuleFilePath = %modulePath @ "/source/" @ %moduleName @ ".cpp";
%cppModuleFilePath = %modulePath @ "/" @ %moduleName @ ".cpp";
if(!isFile(%cppModuleFilePath))
{
%file = new FileObject();

View file

@ -1,3 +1,45 @@
function AssetBrowser::createNewFolder(%this)
{
AssetBrowser_newFolderNameTxt.text = "NewFolder";
Canvas.pushDialog(AssetBrowser_newFolder);
}
function AssetBrowser::doCreateNewFolder(%this)
{
%newFolderName = AssetBrowser_newFolderNameTxt.getText();
if(%newFolderName $= "")
%newFolderName = "NewFolder";
%newFolderIdx = "";
%matched = true;
%newFolderPath = "";
while(%matched == true)
{
%newFolderPath = AssetBrowser.dirHandler.currentAddress @ "/" @ %newFolderName @ %newFolderIdx;
if(!isDirectory(%newFolderPath))
{
%matched = false;
}
else
{
%newFolderIdx++;
}
}
//make a dummy file
%file = new FileObject();
%file.openForWrite(%newFolderPath @ "/test");
%file.close();
fileDelete(%newFolderPath @ "/test");
//refresh the directory
AssetBrowser.loadDirectories();
%this.navigateTo(%newFolderPath);
}
function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData)
{
%previewData.assetName = %assetDef.assetName;
@ -26,7 +68,7 @@ function AssetBrowser::renameFolder(%this, %folderPath, %newFolderName)
//so, we nix any assets active for the module, do the delete action on the old folder, and then re-acquire our assets.
//This will have the added benefit of updating paths for asset items
%module = AssetBrowser.getModuleFromAddress(AssetBrowser.currentAddress);
%module = AssetBrowser.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress);
%moduleId = %module.ModuleId;
AssetDatabase.removeDeclaredAssets(%moduleId);
@ -41,7 +83,7 @@ function AssetBrowser::deleteFolder(%this, %folderPath)
{
doDeleteFolder(%folderPath);
%this.loadFilters();
%this.loadDirectories();
}
function doDeleteFolder(%folderPath)

View file

@ -5,7 +5,7 @@ function AssetBrowser::createGUIAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%guipath = %assetPath @ %assetName @ ".gui";

View file

@ -109,7 +109,7 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
function AssetBrowser::importImageAsset(%this, %assetItem)
{
%moduleName = ImportAssetModuleList.getText();
%moduleName = AssetImportTargetModule.getText();
%assetType = %assetItem.AssetType;
%filePath = %assetItem.filePath;
@ -117,7 +117,7 @@ function AssetBrowser::importImageAsset(%this, %assetItem)
%assetImportSuccessful = false;
%assetId = %moduleName@":"@%assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);

View file

@ -5,7 +5,7 @@ function AssetBrowser::createLevelAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%levelPath = %assetPath @ %assetName @ ".mis";

View file

@ -5,7 +5,7 @@ function AssetBrowser::createMaterialAsset(%this)
%moduleName = AssetBrowser.newAssetSettings.moduleName;
%modulePath = "data/" @ %moduleName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%sgfPath = %assetPath @ %assetName @ ".sgf";
@ -234,7 +234,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%assetItem.AOImageAsset.skip = true;
%assetItem.metalnessImageAsset.skip = true;
%compositeAssetPath = AssetBrowser.currentAddress @ "/";
%compositeAssetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%saveAsPath = %compositeAssetPath @ "/" @ %assetItem.assetName @ "_composite.png";
%compositeAsset = AssetBrowser.addImportingAsset("Image", "", %assetItem, %assetItem.assetName @ "_composite");
%compositeAsset.generatedAsset = true;
@ -279,7 +279,7 @@ function AssetBrowser::findMaterialMapFileWSuffix(%this, %fileDir, %filename, %f
function AssetBrowser::importMaterialAsset(%this, %assetItem)
{
%moduleName = ImportAssetModuleList.getText();
%moduleName = AssetImportTargetModule.getText();
%assetType = %assetItem.AssetType;
%filePath = %assetItem.filePath;
@ -287,7 +287,7 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
%assetImportSuccessful = false;
%assetId = %moduleName@":"@%assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%sgfPath = %assetPath @ %assetName @ ".sgf";
%scriptPath = %assetPath @ %assetName @ ".cs";

View file

@ -5,7 +5,7 @@ function AssetBrowser::createScriptAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%scriptPath = %assetPath @ %assetName @ ".cs";
@ -21,13 +21,6 @@ function AssetBrowser::createScriptAsset(%this)
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
AssetBrowser.loadFilters();
%treeItemId = AssetBrowserFilterTree.findItemByName(%moduleName);
%smItem = AssetBrowserFilterTree.findChildItemByName(%treeItemId, "ScriptAsset");
AssetBrowserFilterTree.onSelect(%smItem);
%file = new FileObject();

View file

@ -5,7 +5,7 @@ function AssetBrowser::createShapeAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%shapeFilePath = %assetPath @ %assetName @ ".dae";
@ -42,6 +42,11 @@ function AssetBrowser::editShapeAsset(%this, %assetDef)
ShapeEditorPlugin.openShapeAsset(%assetDef);
}
function AssetBrowser::deleteShapeAsset(%this, %assetDef)
{
}
function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
{
%fileExt = fileExt(%assetItem.filePath);
@ -166,7 +171,7 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
function AssetBrowser::importShapeAsset(%this, %assetItem)
{
%moduleName = ImportAssetModuleList.getText();
%moduleName = AssetImportTargetModule.getText();
%assetType = %assetItem.AssetType;
%filePath = %assetItem.filePath;
@ -174,7 +179,7 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
%assetImportSuccessful = false;
%assetId = %moduleName@":"@%assetName;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%assetFullPath = %assetPath @ fileName(%filePath);
%newAsset = new ShapeAsset()
@ -309,6 +314,28 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
%previewData.tooltip = %assetDef.friendlyName @ "\n" @ %assetDef;
}
function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
{
//echo("DROPPED A SHAPE ON THE EDITOR WINDOW!");
%assetId = %assetDef.getAssetId();
%pos = EWCreatorWindow.getCreateObjectPosition();
%newStatic = new TSStatic()
{
position = %pos;
shapeAsset = %assetId;
};
getScene(0).add(%newStatic);
EWorldEditor.clearSelection();
EWorldEditor.selectObject(%newStatic);
EWorldEditor.isDirty = true;
}
function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);

View file

@ -6,7 +6,7 @@ function AssetBrowser::createTerrainAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetType = AssetBrowser.newAssetSettings.assetType;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%terPath = %assetPath @ %assetName @ ".ter";

View file

@ -6,7 +6,7 @@ function AssetBrowser::createTerrainMaterialAsset(%this)
%assetName = AssetBrowser.newAssetSettings.assetName;
%assetType = AssetBrowser.newAssetSettings.assetType;
%assetPath = AssetBrowser.currentAddress @ "/";
%assetPath = AssetBrowser.dirHandler.currentAddress @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%scriptPath = %assetPath @ %assetName @ ".cs";

View file

@ -0,0 +1,207 @@
function makedirectoryHandler(%targetTree, %folderExclusionList, %searchFilter)
{
%newHandler = new ScriptObject()
{
class = "directoryHandler";
};
%newHandler.currentAddress = "";
%newHandler.treeCtrl = %targetTree;
%newHandler.folderExclusionList = %folderExclusionList;
%newHandler.searchFilter = %searchFilter;
%newHandler.prevHistoryList = new ArrayObject();
%newHandler.foreHistoryList = new ArrayObject();
return %newHandler;
}
function directoryHandler::loadFolders(%this, %path, %parentId)
{
//utilize home dir project setting here
%paths = getDirectoryList(%path);
for(%i=0; %i < getFieldCount(%paths); %i++)
{
%childPath = getField(%paths, %i);
%folderCount = getTokenCount(%childPath, "/");
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%childPath, "/", %f);
//we don't need to display the shadercache folder
if(%parentId == 1 && (%folderName $= "shaderCache" || %folderName $= "cache"))
continue;
%iconIdx = 3;
if(ModuleDatabase.findModule(%folderName) !$= "")
%iconIdx = 1;
%searchFoldersText = %this.searchFilter;
if(%searchFoldersText !$= "Search Folders...")
{
if(strstr(strlwr(%folderName), strlwr(%searchFoldersText)) != -1)
{
%folderID = %this.treeCtrl.insertItem(%parentId, %folderName, %path, "", %iconIdx, %iconIdx+1);
%this.loadFolders(%path @ "/" @ %folderName, %folderID);
}
}
else
{
%folderID = %this.treeCtrl.insertItem(%parentId, %folderName, %path, "", %iconIdx, %iconIdx);
%this.loadFolders(%path @ "/" @ %folderName, %folderID);
}
}
}
}
function directoryHandler::navigateTo(%this, %address, %historyNav, %selectionNav)
{
//Don't bother navigating if it's to the place we already are
if(%this.currentAddress $= %address)
return;
//clear the breadcrumb bar
AssetBrowser_BreadcrumbBar.clear();
//break down the address
%folderCount = getTokenCount(%address, "/");
/*%rebuiltPath = "";
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%rebuiltPath = %f == 0 ? %folderName : %rebuiltPath @ "/" @ %folderName;
%folderNavButton = new GuiButtonCtrl()
{
profile = ToolsGuiButtonProfile;
text = %folderName;
command = "AssetBrowser.navigateTo(\"" @ %rebuiltPath @ "\");";
extent = "100" SPC AssetBrowser_BreadcrumbBar.extent.y;
};
AssetBrowser_BreadcrumbBar.add(%folderNavButton);
if(%f != %folderCount-1)
{
%folderSpacerButton = new GuiBitmapButtonCtrl()
{
profile = ToolsGuiButtonProfile;
bitmap = "tools/gui/images/rightArrowWhite";
bitmapMode = "Centered";
extent = "25" SPC AssetBrowser_BreadcrumbBar.extent.y;
//command = "AssetBrowser.navigateTo(\"" @ %rebuiltPath @ "\");";
};
AssetBrowser_BreadcrumbBar.add(%folderSpacerButton);
}
}*/
//find our folder tree and action on it tree
%folderId = %this.getFolderTreeItemFromAddress(%address);
%this.oldAddress = %this.currentAddress;
%this.currentAddress = %address;
%this.selectedItem = %folderId;
//This lets us update the tree selection if we didn't get here because of that
if(%selectionNav $= "")
{
%this.treeCtrl.clearSelection();
%this.treeCtrl.selectItem(%folderId);
}
//remove any history records that are 'newer' than this one
if(%historyNav $= "")
{
%this.foreHistoryList.empty();
if(%oldAddress !$= "")
%this.prevHistoryList.push_front(%this.oldAddress);
}
%this.treeCtrl.buildVisibleTree(true);
}
function directoryHandler::navigateHistoryForward(%this)
{
if(%this.foreHistoryList.count() == 0)
return;
%newAddress = %this.foreHistoryList.getKey(0);
%prevHistory = %this.currentAddress;
%this.prevHistoryList.push_front(%prevHistory);
%this.foreHistoryList.pop_front();
%this.navigateTo(%newAddress, true);
}
function directoryHandler::navigateHistoryBack(%this)
{
if(%this.prevHistoryList.count() == 0)
return;
%newAddress = %this.prevHistoryList.getKey(0);
%foreHistory = %this.currentAddress;
%this.foreHistoryList.push_front(%foreHistory);
%this.prevHistoryList.pop_front();
%this.navigateTo(%newAddress, true);
}
function directoryHandler::getModuleFromAddress(%this, %address)
{
//break down the address
%folderCount = getTokenCount(%address, "/");
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%module = ModuleDatabase.findModule(%folderName);
if(%module !$= "")
return %module;
}
return "";
}
function directoryHandler::getFolderTreeItemFromAddress(%this, %address)
{
//break down the address
%folderCount = getTokenCount(%address, "/");
%curItem = 0;
%rebuiltPath = "";
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%curItem = %this.treeCtrl.findChildItemByName(%curItem, %folderName);
}
return %curItem;
}
function directoryHandler::expandTreeToAddress(%this, %address)
{
//break down the address
%folderCount = getTokenCount(%address, "/");
%this.treeCtrl.expandItem(0);
%curItem = 0;
%rebuiltPath = "";
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%address, "/", %f);
%curItem = %this.treeCtrl.findChildItemByName(%curItem, %folderName);
%this.treeCtrl.expandItem(%curItem);
}
}

View file

@ -68,7 +68,7 @@ function AssetBrowser::refreshAsset(%this, %assetId)
}
AssetDatabase.refreshAsset(%assetId);
AssetBrowser.refreshPreviews();
%this.refresh();
}
//------------------------------------------------------------
@ -129,7 +129,7 @@ function AssetBrowser::performRenameAsset(%this, %originalAssetName, %newName)
}
//Make sure everything is refreshed
AssetBrowser.loadFilters();
%this.refresh();
//Update the selection to immediately jump to the new asset
AssetBrowser-->filterTree.clearSelection();
@ -173,6 +173,8 @@ function AssetBrowser::moveAsset(%this, %assetId, %destination)
eval(%this @ ".move" @ %assetType @ "(" @ %assetDef @ ",\"" @ %destination @ "\");");
}
}
%this.refresh();
}
//------------------------------------------------------------
@ -212,30 +214,30 @@ function AssetBrowser::confirmDeleteAsset(%this)
%currentSelectedItem = AssetBrowserFilterTree.getSelectedItem();
%currentItemParent = AssetBrowserFilterTree.getParentItem(%currentSelectedItem);
if(EditAssetPopup.assetType $= "Folder")
if(EditFolderPopup.visible)
{
//Do any cleanup required given the type
if(EditFolderPopup.dirPath !$= "")
%folderPath = EditFolderPopup.dirPath;
else
%folderPath = AssetBrowserFilterTree.getItemValue(%currentSelectedItem) @ "/" @ AssetBrowserFilterTree.getItemText(%currentSelectedItem);
if(%this.isMethod("deleteFolder"))
eval(%this @ ".deleteFolder(\""@EditAssetPopup.assetId@"\");");
}
eval(%this @ ".deleteFolder(\""@%folderPath@"\");");
}
else
{
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
%assetType = AssetDatabase.getAssetType(EditAssetPopup.assetType);
if(!isObject(%assetDef))
return;
//Do any cleanup required given the type
if(%this.isMethod("delete"@%assetType))
eval(%this @ ".delete"@%assetType@"("@%assetDef@");");
AssetDatabase.deleteAsset(EditAssetPopup.assetId, false);
AssetDatabase.deleteAsset(EditAssetPopup.assetId, true, false);
}
%this.loadFilters();
if(!AssetBrowserFilterTree.selectItem(%currentSelectedItem))
{
//if it failed, that means we deleted the last item in that category, and we need to do the parent
AssetBrowserFilterTree.selectItem(%currentItemParent);
AssetBrowserFilterTree.expandItem(%currentItemParent);
}
%this.refresh();
}

View file

@ -184,8 +184,6 @@ function CreateNewAsset()
%moduleDef = ModuleDatabase.findModule(%moduleName,1);
AssetDatabase.addDeclaredAsset(%moduleDef, %assetFilePath);
AssetBrowser.loadFilters();
if(AssetBrowser_newAsset.callbackFunc !$= "")
{
%callbackCommand = "" @ AssetBrowser_newAsset.callbackFunc @ "(\"" @ %moduleName @ ":" @ %assetName @ "\");";
@ -193,7 +191,7 @@ function CreateNewAsset()
}
//Update the selection to immediately jump to the new asset
AssetBrowser-->filterTree.clearSelection();
/*AssetBrowser-->filterTree.clearSelection();
%ModuleItem = AssetBrowser-->filterTree.findItemByName(%moduleName);
%assetTypeId = AssetBrowser-->filterTree.findChildItemByName(%ModuleItem, %assetType);
@ -202,7 +200,8 @@ function CreateNewAsset()
%selectedItem = AssetBrowser-->filterTree.getSelectedItem();
AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem);
AssetBrowser-->filterTree.buildVisibleTree();
AssetBrowser-->filterTree.buildVisibleTree(); */
AssetBrowser.refresh();
}
function ParentComponentList::onWake(%this)

View file

@ -340,6 +340,19 @@ function AssetBrowser::buildPopupMenus(%this)
};
}
//
//
if( !isObject( ImportAssetActions ) )
{
%this.ImportAssetActions = new PopupMenu( ImportAssetActions )
{
superClass = "MenuBuilder";
class = "EditorWorldMenu";
item[0] = "Add asset" TAB "" TAB "ImportAssetWindow.addNewImportingAsset();";
item[1] = "Remove asset" TAB "" TAB "ImportAssetWindow.removeImportingAsset();";
};
}
}
function AddNewScriptAssetPopupMenu::onSelectItem(%this, %id, %text)

View file

@ -0,0 +1,47 @@
function SelectAssetPath::onWake(%this)
{
}
//SelectAssetPath.showDialog();
function SelectAssetPath::showDialog(%this, %startingPath, %callback)
{
if(!isObject(%this.dirHandler))
%this.dirHandler = makedirectoryHandler(SelectAssetPath-->folderTree, "Core,Tools,cache,shaderCache", "");
SelectAssetPath-->folderTree.clear();
SelectAssetPath-->folderTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
":tools/classIcons/SimSet:tools/classIcons/SimSet");
%this.dirHandler.currentPath = %startingPath;
%this.callback = %callback;
%dataItem = SelectAssetPath-->folderTree.insertItem(0, "Data");
%this.dirHandler.loadFolders("Data", %dataItem);
Canvas.pushDialog(SelectAssetPath);
}
function selectAssetPathTree::onSelect(%this, %itemId)
{
if(%itemId == 1)
//can't select root
return;
SelectAssetPath.selectedTreeItem = %itemId;
}
function SelectAssetPath::selectPath(%this)
{
//do callback
%selectedId = %this.selectedTreeItem;
%selectedPath = %this-->folderTree.getItemValue(%selectedId) @ "/" @ %this-->folderTree.getItemText(%selectedId);
if(%this.callback !$= "")
{
eval( "" @ %this.callback @ "(\"" @ %selectedPath @ "\");");
}
Canvas.popDialog(SelectAssetPath);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

View file

@ -459,6 +459,8 @@ function ESettingsWindow::getAssetEditingSettings(%this)
}
SettingsInspector.startGroup("Assets Importing");
SettingsInspector.addField("Edit Asset Configs", "Edit Asset Import Configs", "button", "Open Asset Import Config Editor", "", "Canvas.pushDialog(AssetImportConfigEditor);");
SettingsInspector.addSettingsField("Assets/AssetImporDefaultConfig", "Default Asset Import Config", "list", "", %formattedConfigList);
SettingsInspector.addSettingsField("Assets/AssetImporDefaultConfig", "Default Asset Import Config", "list", "", %formattedConfigList);
SettingsInspector.addSettingsField("Assets/AutoImport", "Automatically Import using default config", "bool", "If on, the asset importing process" @
"will attempt to automatically import any inbound assets"@

View file

@ -0,0 +1,46 @@
function GuiInspectorVariableGroup::buildButtonField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %callbackName, %ownerObj)
{
%extent = 200;
%fieldCtrl = %this.createInspectorField();
%extent = %this.stack.getExtent();
%width = mRound(%extent/2);
%height = 20;
%inset = 10;
%editControl = new GuiButtonCtrl() {
maxPopupHeight = "200";
sbUsesNAColor = "0";
reverseTextList = "0";
bitmapBounds = "16 16";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = %fieldCtrl.edit.position;
Extent = %fieldCtrl.edit.extent;
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
tooltip = %tooltip;
text = %fieldName;
hovertime = "1000";
command = %fieldDataVals;
};
%fieldCtrl.setCaption(%fieldLabel);
%fieldCtrl.setEditControl(%editControl);
%this.addInspectorField(%fieldCtrl);
}

View file

@ -41,3 +41,4 @@ exec("./fieldTypes/assetDependencies.cs");
exec("./fieldTypes/fieldTypes.cs");
exec("./fieldTypes/listField.cs");
exec("./fieldTypes/moduleDependencies.cs");
exec("./fieldTypes/buttonField.cs");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -3,31 +3,22 @@ function PostFXEditor::onDialogPush( %this )
//Apply the settings to the controls
postVerbose("% - PostFX Editor - Loading GUI.");
%this.initialOpen = true;
%this.refresh();
ESettingsWindowList.setSelectedById( 1 );
}
function PostFXEditor::refresh(%this)
{
PostEffectEditorInspector.clearFields();
PostEffectEditorList.clear();
%count = PostFXManager.Count();
for(%i=0; %i < %count; %i++)
{
%postEffect = PostFXManager.getKey(%i);
if(isObject(%postEffect) && %postEffect.isMethod("populatePostFXSettings"))
{
%postEffect.populatePostFXSettings();
}
PostEffectEditorList.addRow( %i, %postEffect.getName() );
}
//First time we open it this 'session', we'll go ahead and collapse the groups
//so it's not too visually busy
if(%this.initialOpen)
PostEffectEditorInspector.setGroupsExpanded(false);
%this.initialOpen = false;
}
function PostFXEditor::apply(%this)
@ -47,4 +38,16 @@ function PostFXEditor::apply(%this)
function PostFXEditor::revert(%this)
{
PostFXManager::loadPresetHandler($PostFXManager::currentPreset);
}
function PostEffectEditorList::onSelect( %this, %id, %text )
{
PostEffectEditorInspector.clearFields();
%postEffect = PostFXManager.getKey(%id);
if(isObject(%postEffect) && %postEffect.isMethod("populatePostFXSettings"))
{
%postEffect.populatePostFXSettings();
}
}

View file

@ -14,21 +14,6 @@
canSave = "1";
canSaveDynamicFields = "1";
new DbgFileView() {
position = "0 0";
extent = "8 2";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiWindowCtrl(ppOptionsWindow) {
text = "PostFX Editor";
resizeWidth = "1";
@ -46,8 +31,8 @@
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "306 54";
extent = "411 615";
position = "197 65";
extent = "642 615";
minExtent = "8 8";
horizSizing = "center";
vertSizing = "center";
@ -60,27 +45,25 @@
canSave = "1";
canSaveDynamicFields = "0";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "dynamic";
vScrollBar = "dynamic";
lockHorizScroll = "0";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
new GuiSplitContainer() {
orientation = "Vertical";
splitterSize = "2";
splitPoint = "182 100";
fixedPanel = "None";
fixedSize = "100";
docking = "None";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "3 23";
extent = "405 558";
minExtent = "8 2";
position = "0 24";
extent = "642 562";
minExtent = "64 64";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiScrollProfile";
profile = "ToolsGuiSolidDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
@ -89,31 +72,158 @@
canSave = "1";
canSaveDynamicFields = "0";
new GuiVariableInspector(PostEffectEditorInspector) {
dividerMargin = "5";
showCustomFields = "1";
stackingType = "Vertical";
horizStacking = "Left to Right";
vertStacking = "Top to Bottom";
padding = "1";
dynamicSize = "1";
dynamicNonStackExtent = "0";
dynamicPos = "0";
changeChildSizeToFit = "1";
changeChildPosition = "1";
position = "1 1";
extent = "388 416";
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 = "180 562";
minExtent = "16 16";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiSolidDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "Panel1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "alwaysOff";
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 = "3 3";
extent = "177 643";
minExtent = "100 50";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextListCtrl(PostEffectEditorList) {
columns = "0";
fitParentWidth = "0";
clipColumnText = "0";
rowHeightPadding = "2";
position = "1 1";
extent = "9 2";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiListBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
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 = "184 0";
extent = "458 562";
minExtent = "16 16";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiSolidDefaultProfile";
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 = "458 562";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiVariableInspector(PostEffectEditorInspector) {
dividerMargin = "5";
showCustomFields = "1";
stackingType = "Vertical";
horizStacking = "Left to Right";
vertStacking = "Top to Bottom";
padding = "1";
dynamicSize = "1";
dynamicNonStackExtent = "0";
dynamicPos = "0";
changeChildSizeToFit = "1";
changeChildPosition = "1";
position = "1 1";
extent = "441 615";
minExtent = "16 16";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
};
new GuiButtonCtrl(ppOptionsApply) {
@ -121,7 +231,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "309 587";
position = "547 588";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
@ -142,7 +252,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "111 587";
position = "349 588";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
@ -163,7 +273,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "12 587";
position = "250 588";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
@ -184,7 +294,7 @@
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "210 587";
position = "448 588";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";

View file

@ -350,7 +350,7 @@ function TerrainMaterialDlg::newMat( %this )
%module = AssetBrowser.getModuleFromAddress(%path);
AssetBrowser.selectedModule = %module.moduleID;
AssetBrowser.currentAddress = "data/" @ %module.moduleID;
AssetBrowser.dirHandler.currentAddress = "data/" @ %module.moduleID;
AssetBrowser.setupCreateNewAsset("TerrainMaterialAsset", AssetBrowser.selectedModule);
}