Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path

Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
This commit is contained in:
Areloch 2020-02-04 01:47:28 -06:00
parent 9735b1180d
commit f7b891442a
92 changed files with 1735 additions and 536 deletions

View file

@ -137,7 +137,7 @@ void CppAsset::setCppFile(const char* pCppFile)
return;
// Update.
mCodeFile = getOwned() ? expandAssetFilePath(pCppFile) : StringTable->insert(pCppFile);
mCodeFile = /*getOwned() ? expandAssetFilePath(pCppFile) : */StringTable->insert(pCppFile);
// Refresh the asset.
refreshAsset();
@ -156,8 +156,15 @@ void CppAsset::setHeaderFile(const char* pHeaderFile)
return;
// Update.
mHeaderFile = getOwned() ? expandAssetFilePath(pHeaderFile) : StringTable->insert(pHeaderFile);
mHeaderFile = /*getOwned() ? expandAssetFilePath(pHeaderFile) :*/ StringTable->insert(pHeaderFile);
// Refresh the asset.
refreshAsset();
}
void CppAsset::initializeAsset()
{
mCodeFile = expandAssetFilePath(mCodeFile);
mHeaderFile = expandAssetFilePath(mHeaderFile);
}

View file

@ -65,7 +65,7 @@ public:
inline StringTableEntry getHeaderFile(void) const { return mHeaderFile; };
protected:
virtual void initializeAsset(void) {};
virtual void initializeAsset(void);
virtual void onAssetRefresh(void) {};
static bool setCppFile(void *obj, const char *index, const char *data) { static_cast<CppAsset*>(obj)->setCppFile(data); return false; }

View file

@ -141,7 +141,9 @@ void ImageAsset::loadImage()
void ImageAsset::initializeAsset()
{
setImageFileName(mImageFileName);
mImageFileName = expandAssetFilePath(mImageFileName);
loadImage();
}
void ImageAsset::onAssetRefresh()
@ -155,10 +157,7 @@ void ImageAsset::setImageFileName(const char* pScriptFile)
AssertFatal(pScriptFile != NULL, "Cannot use a NULL image file.");
// Update.
mImageFileName = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
// Refresh the asset.
loadImage();
mImageFileName = StringTable->insert(pScriptFile);
}
DefineEngineMethod(ImageAsset, getImageFilename, const char*, (), ,

View file

@ -119,13 +119,13 @@ void LevelAsset::initPersistFields()
&setPreviewImageFile, &getPreviewImageFile, "Path to the image used for selection preview.");
addProtectedField("PostFXPresetFile", TypeAssetLooseFilePath, Offset(mPostFXPresetFile, LevelAsset),
&setLevelFile, &getLevelFile, "Path to the level's postFXPreset.");
&setPostFXPresetFile, &getPostFXPresetFile, "Path to the level's postFXPreset.");
addProtectedField("DecalsFile", TypeAssetLooseFilePath, Offset(mDecalsFile, LevelAsset),
&setLevelFile, &getLevelFile, "Path to the decals cache file.");
&setDecalsFile, &getDecalsFile, "Path to the decals cache file.");
addProtectedField("ForestFile", TypeAssetLooseFilePath, Offset(mForestFile, LevelAsset),
&setLevelFile, &getLevelFile, "Path to the Forest cache file.");
&setForestFile, &getForestFile, "Path to the Forest cache file.");
addProtectedField("NavmeshFile", TypeAssetLooseFilePath, Offset(mNavmeshFile, LevelAsset),
&setLevelFile, &getLevelFile, "Path to the navmesh file.");
&setNavmeshFile, &getNavmeshFile, "Path to the navmesh file.");
addProtectedField("EditorFile", TypeAssetLooseFilePath, Offset(mEditorFile, LevelAsset),
&setEditorFile, &getEditorFile, "Path to the level file with objects that were removed as part of the baking process. Loaded when the editor is loaded for ease of editing.");
@ -153,6 +153,10 @@ void LevelAsset::initializeAsset()
// Ensure the image-file is expanded.
mPreviewImage = expandAssetFilePath(mPreviewImage);
mLevelFile = expandAssetFilePath(mLevelFile);
mPostFXPresetFile = expandAssetFilePath(mPostFXPresetFile);
mDecalsFile = expandAssetFilePath(mDecalsFile);
mForestFile = expandAssetFilePath(mForestFile);
mNavmeshFile = expandAssetFilePath(mNavmeshFile);
}
//
@ -169,7 +173,7 @@ void LevelAsset::setLevelFile(const char* pLevelFile)
return;
// Update.
mLevelFile = getOwned() ? expandAssetFilePath(pLevelFile) : StringTable->insert(pLevelFile);
mLevelFile = pLevelFile;
// Refresh the asset.
refreshAsset();
@ -188,7 +192,7 @@ void LevelAsset::setImageFile(const char* pImageFile)
return;
// Update.
mPreviewImage = getOwned() ? expandAssetFilePath(pImageFile) : StringTable->insert(pImageFile);
mPreviewImage = pImageFile;
// Refresh the asset.
refreshAsset();
@ -207,7 +211,7 @@ void LevelAsset::setEditorFile(const char* pEditorFile)
return;
// Update.
mEditorFile = getOwned() ? expandAssetFilePath(pEditorFile) : StringTable->insert(pEditorFile);
mEditorFile = pEditorFile;
// Refresh the asset.
refreshAsset();
@ -226,7 +230,83 @@ void LevelAsset::setBakedSceneFile(const char* pBakedSceneFile)
return;
// Update.
mBakedSceneFile = getOwned() ? expandAssetFilePath(pBakedSceneFile) : StringTable->insert(pBakedSceneFile);
mBakedSceneFile = pBakedSceneFile;
// Refresh the asset.
refreshAsset();
}
void LevelAsset::setPostFXPresetFile(const char* pPostFXPresetFile)
{
// Sanity!
AssertFatal(pPostFXPresetFile != NULL, "Cannot use a NULL postFX preset file.");
// Fetch file.
pPostFXPresetFile = StringTable->insert(pPostFXPresetFile);
// Ignore no change,
if (pPostFXPresetFile == mPostFXPresetFile)
return;
// Update.
mPostFXPresetFile = pPostFXPresetFile;
// Refresh the asset.
refreshAsset();
}
void LevelAsset::setDecalsFile(const char* pDecalsFile)
{
// Sanity!
AssertFatal(pDecalsFile != NULL, "Cannot use a NULL decals file.");
// Fetch file.
pDecalsFile = StringTable->insert(pDecalsFile);
// Ignore no change,
if (pDecalsFile == mDecalsFile)
return;
// Update.
mDecalsFile = pDecalsFile;
// Refresh the asset.
refreshAsset();
}
void LevelAsset::setForestFile(const char* pForestFile)
{
// Sanity!
AssertFatal(pForestFile != NULL, "Cannot use a NULL decals file.");
// Fetch file.
pForestFile = StringTable->insert(pForestFile);
// Ignore no change,
if (pForestFile == mForestFile)
return;
// Update.
mForestFile = pForestFile;
// Refresh the asset.
refreshAsset();
}
void LevelAsset::setNavmeshFile(const char* pNavmeshFile)
{
// Sanity!
AssertFatal(pNavmeshFile != NULL, "Cannot use a NULL Navmesh file.");
// Fetch file.
pNavmeshFile = StringTable->insert(pNavmeshFile);
// Ignore no change,
if (pNavmeshFile == mNavmeshFile)
return;
// Update.
mNavmeshFile = pNavmeshFile;
// Refresh the asset.
refreshAsset();

View file

@ -102,6 +102,16 @@ protected:
static bool setBakedSceneFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setBakedSceneFile(data); return false; }
static const char* getBakedSceneFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getBakedSceneFile(); }
static bool setPostFXPresetFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setPostFXPresetFile(data); return false; }
static const char* getPostFXPresetFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getPostFXPresetFile(); }
static bool setDecalsFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setDecalsFile(data); return false; }
static const char* getDecalsFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getDecalsFile(); }
static bool setForestFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setForestFile(data); return false; }
static const char* getForestFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getForestFile(); }
static bool setNavmeshFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setNavmeshFile(data); return false; }
static const char* getNavmeshFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getNavmeshFile(); }
virtual void initializeAsset(void);
virtual void onAssetRefresh(void) {}

View file

@ -221,7 +221,9 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
if (!Sim::findObject(matAsset->getMaterialDefinitionName(), materialDef))
StringTableEntry matDefName = matAsset ? matAsset->getMaterialDefinitionName() : matAssetId;
if (!Sim::findObject(matDefName, materialDef))
{
Con::errorf("GuiInspectorTypeMaterialAssetPtr::constructEditControl() - unable to find material in asset");
}
@ -244,7 +246,7 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
mMatPreviewButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
StringBuilder strbld;
strbld.append(matAsset->getMaterialDefinitionName());
strbld.append(matDefName);
strbld.append("\n");
strbld.append("Open this file in the Material Editor");

View file

@ -149,7 +149,7 @@ void PostEffectAsset::setScriptFile(const char* pScriptFile)
return;
// Update.
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
mScriptFile = pScriptFile;
// Refresh the asset.
refreshAsset();

View file

@ -88,6 +88,7 @@ ConsoleSetType(TypeShapeAssetPtr)
ShapeAsset::ShapeAsset()
{
mFileName = StringTable->EmptyString();
mConstructorFileName = StringTable->EmptyString();
}
//-----------------------------------------------------------------------------
@ -105,6 +106,8 @@ void ShapeAsset::initPersistFields()
addProtectedField("fileName", TypeAssetLooseFilePath, Offset(mFileName, ShapeAsset),
&setShapeFile, &getShapeFile, "Path to the shape file we want to render");
addProtectedField("constuctorFileName", TypeAssetLooseFilePath, Offset(mConstructorFileName, ShapeAsset),
&setShapeConstructorFile, &getShapeConstructorFile, "Path to the shape file we want to render");
}
void ShapeAsset::setDataField(StringTableEntry slotName, const char *array, const char *value)
@ -135,6 +138,8 @@ void ShapeAsset::initializeAsset()
if (!Platform::isFullPath(mFileName))
mFileName = getOwned() ? expandAssetFilePath(mFileName) : mFileName;
mConstructorFileName = expandAssetFilePath(mConstructorFileName);
loadShape();
}
@ -156,6 +161,24 @@ void ShapeAsset::setShapeFile(const char* pShapeFile)
refreshAsset();
}
void ShapeAsset::setShapeConstructorFile(const char* pShapeConstructorFile)
{
// Sanity!
AssertFatal(pShapeConstructorFile != NULL, "Cannot use a NULL shape constructor file.");
// Fetch image file.
pShapeConstructorFile = StringTable->insert(pShapeConstructorFile);
// Ignore no change,
if (pShapeConstructorFile == mConstructorFileName)
return;
mConstructorFileName = pShapeConstructorFile;
// Refresh the asset.
refreshAsset();
}
void ShapeAsset::_onResourceChanged(const Torque::Path &path)
{
if (path != Torque::Path(mFileName) )

View file

@ -63,6 +63,7 @@ class ShapeAsset : public AssetBase
protected:
StringTableEntry mFileName;
StringTableEntry mConstructorFileName;
Resource<TSShape> mShape;
//Material assets we're dependent on and use
@ -124,11 +125,18 @@ public:
void setShapeFile(const char* pScriptFile);
inline StringTableEntry getShapeFile(void) const { return mFileName; };
void setShapeConstructorFile(const char* pScriptFile);
inline StringTableEntry getShapeConstructorFile(void) const { return mConstructorFileName; };
protected:
virtual void onAssetRefresh(void);
static bool setShapeFile(void *obj, const char *index, const char *data) { static_cast<ShapeAsset*>(obj)->setShapeFile(data); return false; }
static const char* getShapeFile(void* obj, const char* data) { return static_cast<ShapeAsset*>(obj)->getShapeFile(); }
static bool setShapeConstructorFile(void* obj, const char* index, const char* data) { static_cast<ShapeAsset*>(obj)->setShapeConstructorFile(data); return false; }
static const char* getShapeConstructorFile(void* obj, const char* data) { return static_cast<ShapeAsset*>(obj)->getShapeConstructorFile(); }
};
DefineConsoleType(TypeShapeAssetPtr, S32)

View file

@ -131,8 +131,7 @@ void TerrainAsset::initializeAsset()
// Call parent.
Parent::initializeAsset();
if (!Platform::isFullPath(mTerrainFilePath))
mTerrainFilePath = getOwned() ? expandAssetFilePath(mTerrainFilePath) : mTerrainFilePath;
mTerrainFilePath = expandAssetFilePath(mTerrainFilePath);
loadTerrain();
}
@ -153,7 +152,7 @@ void TerrainAsset::setTerrainFilePath(const char* pScriptFile)
pScriptFile = StringTable->insert(pScriptFile);
// Update.
mTerrainFilePath = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
mTerrainFilePath = pScriptFile;
// Refresh the asset.
refreshAsset();
@ -161,6 +160,9 @@ void TerrainAsset::setTerrainFilePath(const char* pScriptFile)
bool TerrainAsset::loadTerrain()
{
if (!Platform::isFile(mTerrainFilePath))
return false;
mTerrMaterialAssets.clear();
mTerrMaterialAssetIds.clear();

View file

@ -120,8 +120,7 @@ void TerrainMaterialAsset::initializeAsset()
compileShader();
if (!Platform::isFullPath(mScriptFile))
mScriptFile = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptFile;
mScriptFile = expandAssetFilePath(mScriptFile);
if (Platform::isFile(mScriptFile))
Con::executeFile(mScriptFile, false, false);
@ -156,7 +155,7 @@ void TerrainMaterialAsset::setScriptFile(const char* pScriptFile)
pScriptFile = StringTable->insert(pScriptFile);
// Update.
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
mScriptFile = pScriptFile;
// Refresh the asset.
refreshAsset();

View file

@ -139,6 +139,11 @@ void StateMachineAsset::setStateMachineFile(const char* pStateMachineFile)
refreshAsset();
}
void StateMachineAsset::initializeAsset()
{
mStateMachineFile = expandAssetFilePath(mStateMachineFile);
}
DefineEngineMethod(StateMachineAsset, notifyAssetChanged, void, (),,"")
{

View file

@ -63,7 +63,7 @@ public:
inline StringTableEntry getStateMachineFile(void) const { return mStateMachineFile; };
protected:
virtual void initializeAsset(void) {}
virtual void initializeAsset(void);
virtual void onAssetRefresh(void) {}
static bool setStateMachineFile(void *obj, const char *index, const char *data) { static_cast<StateMachineAsset*>(obj)->setStateMachineFile(data); return false; }

View file

@ -165,7 +165,7 @@ EndImplementEnumType;
void TSStatic::initPersistFields()
{
addGroup("Media");
addGroup("Shape");
addProtectedField("shapeAsset", TypeShapeAssetPtr, Offset(mShapeAsset, TSStatic),
&TSStatic::_setShapeAsset, &defaultProtectedGetFn,
@ -174,6 +174,9 @@ void TSStatic::initPersistFields()
addField("shapeName", TypeShapeFilename, Offset( mShapeName, TSStatic ),
"%Path and filename of the model file (.DTS, .DAE) to use for this TSStatic.", AbstractClassRep::FieldFlags::FIELD_HideInInspectors );
endGroup("Shape");
addGroup("Materials");
addProtectedField( "skin", TypeRealString, Offset( mAppliedSkinName, TSStatic ), &_setFieldSkin, &_getFieldSkin,
"@brief The skin applied to the shape.\n\n"
@ -199,9 +202,8 @@ void TSStatic::initPersistFields()
"Material targets are only renamed if an existing Material maps to that "
"name, or if there is a diffuse texture in the model folder with the same "
"name as the new target.\n\n" );
endGroup("Media");
endGroup("Materials");
addGroup("Rendering");
addField( "playAmbient", TypeBool, Offset( mPlayAmbient, TSStatic ),
@ -1606,20 +1608,20 @@ void TSStatic::updateMaterials()
void TSStatic::onInspect(GuiInspector* inspector)
{
if (mShapeAsset == nullptr)
return;
//Put the GameObject group before everything that'd be gameobject-effecting, for orginazational purposes
GuiInspectorGroup* tsStaticInspGroup = new GuiInspectorGroup("Shape", inspector);
tsStaticInspGroup->registerObject();
inspector->addInspectorGroup(tsStaticInspGroup);
inspector->addObject(tsStaticInspGroup);
GuiInspectorGroup* materialGroup = inspector->findExistentGroup(StringTable->insert("Materials"));
GuiControl* stack = dynamic_cast<GuiControl*>(materialGroup->findObjectByInternalName(StringTable->insert("Stack")));
//Do this on both the server and client
/*S32 materialCount = mShapeAsset->getShape()->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
S32 materialCount = mShapeAsset->getShape()->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
if (isServerObject())
{
//we need to update the editor
for (U32 i = 0; i < mFields.size(); i++)
/*for (U32 i = 0; i < mFields.size(); i++)
{
//find any with the materialslot title and clear them out
if (FindMatch::isMatch("MaterialSlot*", mFields[i].mFieldName, false))
@ -1628,36 +1630,66 @@ void TSStatic::onInspect(GuiInspector* inspector)
mFields.erase(i);
continue;
}
}
}*/
//next, get a listing of our materials in the shape, and build our field list for them
char matFieldName[128];
if (materialCount > 0)
mComponentGroup = StringTable->insert("Materials");
for (U32 i = 0; i < materialCount; i++)
{
StringTableEntry materialname = StringTable->insert(mMeshAsset->getShape()->materialList->getMaterialName(i).c_str());
StringTableEntry materialname = StringTable->insert(mShapeAsset->getShape()->materialList->getMaterialName(i).c_str());
//Iterate through our assetList to find the compliant entry in our matList
for (U32 m = 0; m < mMeshAsset->getMaterialCount(); m++)
for (U32 m = 0; m < mShapeAsset->getMaterialCount(); m++)
{
AssetPtr<MaterialAsset> matAsset = mMeshAsset->getMaterialAsset(m);
AssetPtr<MaterialAsset> matAsset = mShapeAsset->getMaterialAsset(m);
if (matAsset->getMaterialDefinitionName() == materialname)
{
dSprintf(matFieldName, 128, "MaterialSlot%d", i);
addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), "");
//addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), "");
//Con::executef(this, "onConstructComponentField", mTargetComponent, field->mFieldName);
Con::printf("Added material field for MaterialSlot %d", i);
GuiInspectorField* fieldGui = materialGroup->constructField(TypeMaterialAssetPtr);
fieldGui->init(inspector, materialGroup);
fieldGui->setSpecialEditField(true);
fieldGui->setTargetObject(this);
StringTableEntry fldnm = StringTable->insert(matFieldName);
fieldGui->setSpecialEditVariableName(fldnm);
fieldGui->setInspectorField(NULL, fldnm);
fieldGui->setDocs("");
if (fieldGui->registerObject())
{
fieldGui->setValue(materialname);
stack->addObject(fieldGui);
}
else
{
SAFE_DELETE(fieldGui);
}
/*if (materialGroup->isMethod("onConstructField"))
{
//ensure our stack variable is bound if we need it
//Con::evaluatef("%d.stack = %d;", materialGroup->getId(), materialGroup->at(0)->getId());
Con::executef(materialGroup, "onConstructField", matFieldName,
matFieldName, "material", matFieldName,
materialname, "", "", this);
}*/
break;
}
}
}
if (materialCount > 0)
mComponentGroup = "";
}*/
}
}
DefineEngineMethod( TSStatic, getTargetName, const char*, ( S32 index ),(0),

View file

@ -2435,15 +2435,17 @@ bool GuiTreeViewCtrl::setItemExpanded(S32 itemId, bool expand)
if(item->isExpanded() == expand)
return(true);
item->setExpanded(expand);
// expand parents
if(expand)
{
while(item)
while (item)
{
if(item->mState.test(Item::VirtualParent))
if (!item->isInspectorData() && item->mState.test(Item::VirtualParent))
onVirtualParentExpand(item);
item->setExpanded(true);
scrollVisible(item);
item = item->mParent;
}
}
@ -2454,6 +2456,12 @@ bool GuiTreeViewCtrl::setItemExpanded(S32 itemId, bool expand)
item->setExpanded(false);
}
//if (!item->isInspectorData() && item->mState.test(Item::VirtualParent))
// onVirtualParentExpand(item);
mFlags.set(RebuildVisible);
return(true);
}

View file

@ -584,8 +584,6 @@ void GuiInspector::refresh()
mGroups.push_back(general);
addObject(general);
mTargets.first()->onInspect(this);
// Create the inspector groups for static fields.
for( TargetVector::iterator iter = mTargets.begin(); iter != mTargets.end(); ++ iter )
@ -624,6 +622,8 @@ void GuiInspector::refresh()
}
}
mTargets.first()->onInspect(this);
// Deal with dynamic fields
if ( !isGroupFiltered( "Dynamic Fields" ) )
{

View file

@ -107,6 +107,7 @@ bool GuiInspectorGroup::createContent()
// Prefer GuiTransperantProfile for the stack.
mStack->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorStackProfile" );
mStack->setInternalName(StringTable->insert("stack"));
if( !mStack->registerObject() )
{
SAFE_DELETE( mStack );

View file

@ -86,8 +86,7 @@ ImplementEnumType( MaterialBlendOp,
{ Material::Add, "Add", "Adds the color of the material to the frame buffer with full alpha for each pixel." },
{ Material::AddAlpha, "AddAlpha", "The color is modulated by the alpha channel before being added to the frame buffer." },
{ Material::Sub, "Sub", "Subtractive Blending. Reverses the color model, causing dark colors to have a stronger visual effect." },
{ Material::LerpAlpha, "LerpAlpha", "Linearly interpolates between Material color and frame buffer color based on alpha." },
{ Material::PreMult, "PreMult", "" }
{ Material::LerpAlpha, "LerpAlpha", "Linearly interpolates between Material color and frame buffer color based on alpha." }
EndImplementEnumType;
ImplementEnumType( MaterialWaveType,

View file

@ -111,7 +111,6 @@ public:
Sub,
LerpAlpha, // linear interpolation modulated with alpha channel
ToneMap,
PreMult,
NumBlendTypes
};

View file

@ -148,13 +148,6 @@ void ProcessedMaterial::_setBlendState(Material::BlendOp blendOp, GFXStateBlockD
break;
}
case Material::PreMult:
{
desc.blendSrc = GFXBlendOne;
desc.blendDest = GFXBlendInvSrcAlpha;
break;
}
default:
{
// default to LerpAlpha

View file

@ -336,8 +336,11 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
// TODO: This sort of sucks... BL should somehow force this
// feature on from the outside and not this way.
if ( dStrcmp( LIGHTMGR->getId(), "BLM" ) == 0 )
fd.features.addFeature( MFT_ForwardShading );
if (dStrcmp(LIGHTMGR->getId(), "BLM") == 0)
{
fd.features.addFeature(MFT_ForwardShading);
fd.features.addFeature(MFT_ReflectionProbes);
}
// Disabling the InterlacedDeferred feature for now. It is not ready for prime-time
// and it should not be triggered off of the DoubleSided parameter. [2/5/2010 Pat]

View file

@ -111,11 +111,6 @@ LangElement* ShaderFeatureHLSL::assignColor( LangElement *elem,
assign = new GenOp( "@ -= @", color, elem );
break;
case Material::PreMult:
//result = src.rgb + (dst.rgb * (1 - src.A))
assign = new GenOp("@.rgb = @.rgb + (@.rgb * (1 - @.a))", color, color, elem, color);
break;
case Material::Mul:
assign = new GenOp( "@ *= @", color, elem );
break;

View file

@ -906,4 +906,4 @@ DefineEngineMethod(SQLiteObject, numResultSets, S32, (),, "numResultSets()")
DefineEngineMethod(SQLiteObject, getLastRowId, S32, (), , "getLastRowId()")
{
return object->getLastRowId();
}
}

View file

@ -62,8 +62,13 @@ function GameConnection::onControlObjectChange(%this)
// Reset the current FOV to match the new object
// and turn off any current zoom.
resetCurrentFOV();
turnOffZoom();
$Player::CurrentFOV = ServerConnection.getControlCameraDefaultFov() / 2;
ServerConnection.zoomed = false;
setFov(ServerConnection.getControlCameraDefaultFov());
//resetCurrentFOV();
//turnOffZoom();
}
function GameConnection::onConnectionError(%this, %msg)

View file

@ -211,7 +211,7 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
// If we have a camera then set up some properties
if (isObject(%client.camera))
{
MissionCleanup.add( %this.camera );
MissionCleanup.add( %client.camera );
%client.camera.scopeToClient(%client);
%client.setControlObject(%client.camera);

View file

@ -27,11 +27,11 @@ singleton Material(OctahedronMat)
diffuseMap[0] = "core/gameObjects/images/camera";
translucent = "1";
translucentBlendOp = "LerpAlpha";
translucentBlendOp = "PreMul";
emissive = "0";
castShadows = "0";
colorMultiply[0] = "0 1 0 1";
diffuseColor[0] = "0 1 0 1";
};
//--- camera.dts MATERIALS BEGIN ---

View file

@ -40,7 +40,14 @@ function initLightingSystems(%manager)
exec( %file );
%file = findNextFile( %pattern );
}*/
%mode = ProjectSettings.value("General/LightingMode", "Deferred");
if(%mode $= "Deferred")
%manager = "Advanced Lighting";
else if(%mode $= "Forward")
%manager = "Basic Lighting";
// Try the perfered one first.
%success = setLightManager(%manager);

View file

@ -20,6 +20,9 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
$MotionBlurPostFX::samples = 15;
$MotionBlurPostFX::velocityMultiplier = 3000;
singleton ShaderData( PFX_MotionBlurShader )
{
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; //we use the bare-bones postFxV.hlsl
@ -34,6 +37,11 @@ singleton ShaderData( PFX_MotionBlurShader )
pixVersion = 3.0;
};
function MotionBlurFX::onAdd( %this )
{
PostFXManager.registerPostEffect(%this);
}
singleton PostEffect(MotionBlurFX)
{
isEnabled = false;
@ -47,7 +55,17 @@ singleton PostEffect(MotionBlurFX)
target = "$backBuffer";
};
function MotionBlurFX::populatePostFXSettings(%this)
{
PostEffectEditorInspector.startGroup("General");
PostEffectEditorInspector.addField("isEnabled", "Enabled", "bool", "", MotionBlurFX.isEnabled, "", MotionBlurFX);
PostEffectEditorInspector.addField("$MotionBlurPostFX::velocityMultiplier", "Velocity Multiplier", "float", "", $MotionBlurPostFX::velocityMultiplier, "");
PostEffectEditorInspector.addField("$MotionBlurPostFX::samples", "Sample Count", "float", "", $MotionBlurPostFX::samples, "");
PostEffectEditorInspector.endGroup();
}
function MotionBlurFX::setShaderConsts(%this)
{
%this.setShaderConst( "$velocityMultiplier", 3000 );
%this.setShaderConst( "$velocityMultiplier", $MotionBlurPostFX::velocityMultiplier );
%this.setShaderConst( "$samples", $MotionBlurPostFX::samples );
}

View file

@ -413,6 +413,8 @@ function DOFPostEffect::onAdd( %this )
%this.maxRange = 500;
%this.nearSlope = -5.0;
%this.farSlope = 5.0;
PostFXManager.registerPostEffect(%this);
}
function DOFPostEffect::setLerpDist( %this, %d0, %d1, %d2 )
@ -495,6 +497,12 @@ DOFPostEffect.add( DOFFinalPFX );
//-----------------------------------------------------------------------------
// Scripts
//-----------------------------------------------------------------------------
function DOFPostEffect::populatePostFXSettings(%this)
{
PostEffectEditorInspector.startGroup("Depth of Field");
PostEffectEditorInspector.addField("isEnabled", "Enabled", "bool", "", DOFPostEffect.isEnabled, "", DOFPostEffect);
PostEffectEditorInspector.endGroup();
}
function DOFPostEffect::setShaderConsts( %this )
{

View file

@ -61,7 +61,7 @@ function vignettePostFX::setShaderConsts(%this)
function vignettePostFX::populatePostFXSettings(%this)
{
PostEffectEditorInspector.startGroup("Vignette - General");
PostEffectEditorInspector.startGroup("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, "");

View file

@ -29,13 +29,13 @@ uniform float4x4 matWorldToScreen;
// Passed in from setShaderConsts()
uniform float velocityMultiplier;
uniform float samples;
TORQUE_UNIFORM_SAMPLER2D(backBuffer, 0);
TORQUE_UNIFORM_SAMPLER2D(deferredTex, 1);
float4 main(PFXVertToPix IN) : TORQUE_TARGET0
{
float samples = 5;
// First get the deferred texture for uv channel 0
float4 deferred = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 );

View file

@ -9,4 +9,7 @@
<Setting name="coreModulePath">core/</Setting>
</Group>
</Group>
<Group name="General">
<Setting name="LightingMode">Deferred</Setting>
</Group>
</ProjectSettings>

View file

@ -69,7 +69,7 @@ $pref::Video::autoDetect = 1;
// This is the path used by ShaderGen to cache procedural shaders. If left
// blank ShaderGen will only cache shaders to memory and not to disk.
$shaderGen::cachePath = "data/shaderCache";
$shaderGen::cachePath = "data/cache/shaderCache";
// Uncomment to disable ShaderGen, useful when debugging
//$ShaderGen::GenNewShaders = false;

View file

@ -319,6 +319,35 @@ function shareValueSafeDelay(%source, %dest, %delayMs)
schedule(%delayMs, 0, shareValueSafe, %source, %dest);
}
//------------------------------------------------------------------------------
function replaceInFile(%fileName, %fromWord, %toWord)
{
//Go through our scriptfile and replace the old namespace with the new
%editedFileContents = "";
%file = new FileObject();
if ( %file.openForRead( %fileName ) )
{
while ( !%file.isEOF() )
{
%line = %file.readLine();
%line = trim( %line );
%editedFileContents = %editedFileContents @ strreplace(%line, %fromWord, %toWord) @ "\n";
}
%file.close();
}
if(%editedFileContents !$= "")
{
%file.openForWrite(%fileName);
%file.writeline(%editedFileContents);
%file.close();
}
}
//------------------------------------------------------------------------------
// An Aggregate Control is a plain GuiControl that contains other controls,

View file

@ -2,6 +2,6 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="ExampleCppObject"
codeFile="@assetFile=data/ExampleModule/source/ExampleCppObject.cpp"
headerFile="@assetFile=data/ExampleModule/source/ExampleCppObject.h"
codeFile="@assetFile=ExampleCppObject.cpp"
headerFile="@assetFile=ExampleCppObject.h"
VersionId="1" />

View file

@ -73,9 +73,7 @@ function ChooseLevelDlg::onWake( %this )
// if we are choosing a level to launch in the editor.
if ( %this.launchInEditor )
{
%file = EditorSettings.value( "WorldEditor/newLevelFile" );
if ( %file !$= "" )
%this.addMissionFile( %file );
%this.addMissionFile( "tools/levels/DefaultEditorLevel.mis" );
}
// Sort our list

View file

@ -355,7 +355,7 @@ function VerveEditorGroupBuilderFieldStack::CreateObjectList( %this, %objectType
%listObject.add( "", 0 );
// Populate List.
%listObject.CheckGroup( MissionGroup, %objectType );
%listObject.CheckGroup( getRootScene(), %objectType );
// Sort the List.
%listObject.sort();

View file

@ -106,7 +106,6 @@
visible = "1";
active = "1";
command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
altCommand = "AssetBrowser.editAsset( 20540 );";
tooltipProfile = "GuiToolTipProfile";
tooltip = "\n20540";
hovertime = "1000";
@ -227,7 +226,6 @@
visible = "1";
active = "1";
command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
altCommand = "20550.materialDefinitionName.reload(); $Tools::materialEditorList = \"\";EWorldEditor.clearSelection();MaterialEditorGui.currentObject = 0;MaterialEditorGui.currentMode = \"asset\";MaterialEditorGui.currentMaterial = 20550.materialDefinitionName;MaterialEditorGui.setActiveMaterial( 20550.materialDefinitionName );EditorGui.setEditor(MaterialEditorPlugin); AssetBrowser.hideDialog();";
tooltipProfile = "GuiToolTipProfile";
tooltip = "\n20550";
hovertime = "1000";

View file

@ -19,13 +19,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
if( !isObject( ToolsGuiDefaultNonModalProfile ) )
new GuiControlProfile (ToolsGuiDefaultNonModalProfile : ToolsGuiDefaultProfile)
{
opaque = false;
modal = false;
};
function initializeAssetBrowser()
{
echo(" % - Initializing Asset Browser");
@ -147,4 +140,12 @@ function AssetBrowserPlugin::onWorldEditorStartup( %this )
{
// Add ourselves to the toolbar.
AssetBrowser.addToolbarButton();
}
function TSStatic::onConstructField(%this, %fieldName, %fieldLabel, %fieldTypeName, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %callbackName, %ownerObj)
{
%inspector = %this.getParent();
%makeCommand = %this @ ".build" @ %fieldTypeName @ "Field(\""@ %fieldName @ "\",\"" @ %fieldLabel @ "\",\"" @ %fieldDesc @ "\",\"" @
%fieldDefaultVal @ "\",\"" @ %fieldDataVals @ "\",\"" @ %inspector @ "." @ %callbackName @ "\",\"" @ %ownerObj @"\");";
eval(%makeCommand);
}

View file

@ -68,7 +68,7 @@ function AssetBrowser::onWake(%this)
%moduleName = getWord(%modulesList, %i).ModuleId;
%moduleGroup = getWord(%modulesList, %i).Group;
if((%moduleGroup $= "Core" || %moduleGroup $= "Tools") && !%this.coreModulesFilter)
if((%moduleGroup $= "Core" && !%this.coreModulesFilter) || (%moduleGroup $= "Tools" && !%this.toolsModulesFilter))
continue;
%nonDefaultModuleCount++;
@ -82,6 +82,8 @@ function AssetBrowser::onWake(%this)
}
%this.setPreviewSize(EditorSettings.value("Assets/Browser/previewTileSize", "small"));
AssetBrowser.toggleAssetTypeFilter(0);
}
//Filters
@ -95,11 +97,13 @@ function AssetBrowser::viewCoreModulesFilter(%this)
%oldVal = EditorSettings.value("Assets/Browser/showCoreModule", false);
%newVal = !%oldVal;
%this.coreModulesFilter = %newVal;
BrowserVisibilityPopup.checkItem(0,%newVal);
EditorSettings.setValue("Assets/Browser/showCoreModule", %newVal);
AssetBrowser.refresh();
AssetBrowser.loadDirectories();
}
function AssetBrowser::viewToolsModulesFilter(%this)
@ -107,11 +111,13 @@ function AssetBrowser::viewToolsModulesFilter(%this)
%oldVal = EditorSettings.value("Assets/Browser/showToolsModule", false);
%newVal = !%oldVal;
%this.toolsModulesFilter = %newVal;
BrowserVisibilityPopup.checkItem(1,%newVal);
EditorSettings.setValue("Assets/Browser/showToolsModule", %newVal);
AssetBrowser.refresh();
AssetBrowser.loadDirectories();
}
function AssetBrowser::viewPopulatedModulesFilter(%this)
@ -123,7 +129,7 @@ function AssetBrowser::viewPopulatedModulesFilter(%this)
EditorSettings.setValue("Assets/Browser/showOnlyPopulatedModule", %newVal);
AssetBrowser.refresh();
AssetBrowser.loadDirectories();
}
function AssetBrowser::toggleShowingFolders(%this)
@ -135,7 +141,7 @@ function AssetBrowser::toggleShowingFolders(%this)
EditorSettings.setValue("Assets/Browser/showFolders", %newVal);
AssetBrowser.refresh();
AssetBrowser.loadDirectories();
}
function AssetBrowser::toggleShowingEmptyFolders(%this)
@ -273,7 +279,7 @@ function AssetBrowser::hideDialog( %this )
Canvas.popDialog(AssetBrowser);
}
function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
{
if(!isObject(%this.previewData))
{
@ -284,7 +290,7 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
%previewImage = "core/art/warnmat";
if(ModuleDatabase.findModule(%moduleName, 1) !$= "")
if(/*%moduleName !$= "" && */ModuleDatabase.findModule(%moduleName, 1) !$= "")
{
%assetDesc = AssetDatabase.acquireAsset(%asset);
%assetName = AssetDatabase.getAssetName(%asset);
@ -296,7 +302,6 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
%fullPath = strreplace(%fullPath, "/", "_");
if(isObject(%fullPath))
%assetDesc = %fullPath;
else
%assetDesc = new ScriptObject(%fullPath);
@ -359,10 +364,10 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
%previewButton-->AssetPreviewBorderButton.extent = %previewSize;
//%previewButton-->AssetPreviewButton.internalName = %this.previewData.assetName@"Border";
%previewButton-->AssetPreviewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + 24;
%previewButton-->AssetPreviewButton.tooltip = %this.previewData.tooltip;
%previewButton-->AssetPreviewButton.Command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
%previewButton-->AssetPreviewButton.altCommand = %this.previewData.doubleClickCommand;
%previewButton-->Button.extent = %previewSize.x + %previewBounds SPC %previewSize.y + 24;
%previewButton-->Button.tooltip = %this.previewData.tooltip;
%previewButton-->Button.Command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );";
%previewButton-->Button.altCommand = %doubleClickCommand;
//%previewButton-->AssetPreviewButton.icon = %this.previewData.previewImage;
%previewButton-->AssetNameLabel.position = 0 SPC %previewSize.y + %previewBounds - 16;
@ -379,11 +384,32 @@ function AssetBrowser::buildPreviewArray( %this, %asset, %moduleName )
function AssetBrowser::refresh(%this)
{
%this.navigateTo(%this.dirHandler.currentAddress);
if(!%this.dirty)
{
%this.dirty = true;
%this.schedule(1, "doRefresh");
}
}
function AssetBrowser::doRefresh(%this)
{
if(%this.dirty)
{
%this.navigateTo(%this.dirHandler.currentAddress);
//Forces a clean collapse of the tree for any not-really-exposed items
%dataItem = AssetBrowser-->filterTree.findItemByName("Data");
AssetBrowser-->filterTree.expandItem(%dataItem, false);
AssetBrowser-->filterTree.expandItem(%dataItem);
%this.dirty = false;
}
}
//
//
function AssetPreviewButton::onClick(%this)
/*function AssetPreviewButton::onClick(%this)
{
echo("CLICKED AN ASSET PREVIEW BUTTON");
}
@ -391,7 +417,7 @@ function AssetPreviewButton::onClick(%this)
function AssetPreviewButton::onDoubleClick(%this)
{
echo("DOUBLE CLICKED AN ASSET PREVIEW BUTTON");
}
}*/
//
//
@ -399,23 +425,60 @@ function AssetBrowser::loadDirectories( %this )
{
AssetBrowser-->filterTree.clear();
%dataItem = AssetBrowser-->filterTree.insertItem(0, "Data");
%dataItem = AssetBrowser-->filterTree.insertItem(0, "Content");
%dataItem = AssetBrowser-->filterTree.insertItem(1, "Data");
%this.dirHandler.loadFolders("Data", %dataItem);
//If set to, show core
if(%this.coreModulesFilter)
{
%coreItem = AssetBrowser-->filterTree.insertItem(0, "Core");
%coreItem = AssetBrowser-->filterTree.insertItem(1, "Core");
%this.dirHandler.loadFolders("Core", %coreItem);
}
//If set to, show tools
if(%this.toolsModulesFilter)
{
%toolsItem = AssetBrowser-->filterTree.insertItem(0, "Tools");
%toolsItem = AssetBrowser-->filterTree.insertItem(1, "Tools");
%this.dirHandler.loadFolders("Tools", %toolsItem);
}
//Add Non-Asset Scripted Objects. Datablock, etc based
%category = getWord( %breadcrumbPath, 1 );
%dataGroup = "DataBlockGroup";
if(%dataGroup.getCount() != 0)
{
%scriptedItem = AssetBrowser-->filterTree.insertItem(1, "Scripted");
for ( %i = 0; %i < %dataGroup.getCount(); %i++ )
{
%obj = %dataGroup.getObject(%i);
// echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category );
if ( %obj.category $= "" && %obj.category == 0 )
continue;
//if ( %breadcrumbPath $= "" )
//{
%catItem = AssetBrowser-->filterTree.findItemByName(%obj.category);
if(%catItem == 0)
AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.category, "scripted");
/*%ctrl = %this.findIconCtrl( %obj.category );
if ( %ctrl == -1 )
{
%this.addFolderIcon( %obj.category );
}*/
//}
/*else if ( %breadcrumbPath $= %obj.category )
{
AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.getName());
}*/
}
}
AssetPreviewArray.empty();
AssetBrowser-->filterTree.buildVisibleTree(true);
@ -443,15 +506,15 @@ function AssetBrowser::loadDirectories( %this )
AssetBrowser.newModuleId = "";
}
%dataItem = AssetBrowser-->filterTree.findItemByName("Data");
AssetBrowser-->filterTree.expandItem(%dataItem);
//%dataItem = AssetBrowser-->filterTree.findItemByName("Data");
//AssetBrowser-->filterTree.expandItem(%dataItem);
AssetBrowser.dirHandler.expandTreeToAddress(AssetBrowser.dirHandler.currentAddress);
%selectedItem = AssetBrowser.dirHandler.getFolderTreeItemFromAddress(AssetBrowser.dirHandler.currentAddress);
AssetBrowser-->filterTree.scrollVisibleByObjectId(%selectedItem);
AssetBrowser-->filterTree.buildVisibleTree();
AssetBrowser-->filterTree.buildVisibleTree(true);
AssetBrowser.refresh();
}
@ -739,18 +802,30 @@ function AssetListPanelInputs::onRightMouseDown(%this)
function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId)
{
%count = %this.getSelectedItemsCount();
if( %this.getSelectedItemsCount() > 0 && %itemId != 1)
%itemText = %this.getItemText(%itemId);
if( %this.getSelectedItemsCount() > 0 && (%itemText !$= "Data" && %itemText !$= "Core" && %itemText !$= "Tools"))
{
//AddNewAssetPopup.showPopup(Canvas);
//We have something clicked, so figure out if it's a sub-filter or a module filter, then push the correct
//popup menu
if(%this.getParentItem(%itemId) == 1)
%parentItem = %this.getParentItem(%itemId);
if(%this.getItemText(%parentItem) $= "Data") //if it's a data module, continue
{
//yep, module, push the all-inclusive popup
EditModulePopup.showPopup(Canvas);
//also set the module value for creation info
AssetBrowser.selectedModule = %this.getItemText(%itemId);
//find out if it's a folder or a module!
if(ModuleDatabase.findModule(%itemText))
{
//yep, module, push the all-inclusive popup
EditModulePopup.showPopup(Canvas);
//also set the module value for creation info
AssetBrowser.selectedModule = %itemText;
}
else
{
EditNonModulePopup.showPopup(Canvas);
EditNonModulePopup.targetFolder = %itemText;
}
}
else
{
@ -758,10 +833,14 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId)
EditFolderPopup.assetType = "Folder";
}
}
else if(%itemId == 1)
else if(%itemText $= "Data")
{
AddNewModulePopup.showPopup(Canvas);
}
else if(%itemText $= "Tools")
{
AddNewToolPopup.showPopup(Canvas);
}
}
//
@ -839,6 +918,18 @@ function AssetBrowserFilterTree::onSelect(%this, %itemId)
function AssetBrowser::rebuildAssetArray(%this)
{
if(!%this.previewArrayDirty)
{
%this.previewArrayDirty = true;
%this.schedule(16, "doRebuildAssetArray");
}
}
function AssetBrowser::doRebuildAssetArray(%this)
{
if(!%this.previewArrayDirty)
return;
%breadcrumbPath = AssetBrowser.dirHandler.currentAddress;
// we have to empty out the list; so when we create new guicontrols, these dont linger
@ -852,6 +943,9 @@ function AssetBrowser::rebuildAssetArray(%this)
%numAssetsFound = AssetDatabase.findAllAssets(%assetQuery);
%finalAssetCount = 0;
%searchText = AssetBrowserSearchFilter.getText();
%searchFilterActive = %searchText !$= "Search Assets...";
//now, we'll iterate through, and find the assets that are in this module, and this category
for( %i=0; %i < %numAssetsFound; %i++)
@ -864,7 +958,7 @@ function AssetBrowser::rebuildAssetArray(%this)
//clean up the path
%assetBasePath = strreplace(%assetBasePath, "//", "/");
if(%assetBasePath $= %breadcrumbPath)
if(%assetBasePath $= %breadcrumbPath || (%searchFilterActive && startsWith(%assetBasePath,%breadcrumbPath)))
{
//first, get the asset's module, as our major categories
%module = AssetDatabase.getAssetModule(%assetId);
@ -924,8 +1018,7 @@ function AssetBrowser::rebuildAssetArray(%this)
//stop adding after previewsPerPage is hit
%assetName = AssetDatabase.getAssetName(%assetId);
%searchText = AssetBrowserSearchFilter.getText();
if(%searchText !$= "Search Assets...")
if(%searchFilterActive)
{
if(strstr(strlwr(%assetName), strlwr(%searchText)) != -1)
{
@ -969,11 +1062,43 @@ function AssetBrowser::rebuildAssetArray(%this)
}
}
//Add Non-Asset Scripted Objects. Datablock, etc based
%category = getWord( %breadcrumbPath, 1 );
%dataGroup = "DataBlockGroup";
if(%dataGroup.getCount() != 0)
{
%scriptedItem = AssetBrowser-->filterTree.findItemByName("Scripted");
for ( %i = 0; %i < %dataGroup.getCount(); %i++ )
{
%obj = %dataGroup.getObject(%i);
// echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category );
if ( %obj.category $= "" && %obj.category == 0 )
continue;
/*if ( %breadcrumbPath $= "" )
{
%ctrl = %this.findIconCtrl( %obj.category );
if ( %ctrl == -1 )
{
%this.addFolderIcon( %obj.category );
}
}
else */
if ( %breadcrumbPath $= %obj.category )
{
AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.getName());
}
}
}
AssetBrowser.currentPreviewPage = 0;
AssetBrowser.totalPages = 1;
for(%i=0; %i < %assetArray.count(); %i++)
AssetBrowser.buildPreviewArray( %assetArray.getValue(%i), %assetArray.getKey(%i) );
AssetBrowser.buildAssetPreview( %assetArray.getValue(%i), %assetArray.getKey(%i) );
AssetBrowser_FooterText.text = %finalAssetCount @ " Assets";
@ -998,8 +1123,8 @@ function AssetBrowser::rebuildAssetArray(%this)
}
}
if(!%validType)
continue;
//if(!%validType)
// continue;
}
else
{
@ -1008,6 +1133,8 @@ function AssetBrowser::rebuildAssetArray(%this)
if(%activeTypeFilterList !$= "")
AssetBrowser_FooterText.text = AssetBrowser_FooterText.text @ " | Active Type Filters: " @ %activeTypeFilterList;
%this.previewArrayDirty = false;
}
//
@ -1092,6 +1219,7 @@ function AssetBrowser::navigateTo(%this, %address, %historyNav)
}
%this.rebuildAssetArray();
%this.refresh();
}
function AssetBrowser::navigateHistoryForward(%this)

View file

@ -110,6 +110,8 @@ function AssetBrowser::onDropFile( %this, %filePath )
%this.addImportingAsset("GUIAsset", %filePath);
else if (%fileExt $= ".zip")
%this.onDropZipFile(%filePath);
else if( %fileExt $= "")
%this.onDropFolder(%filePath);
//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
@ -129,6 +131,53 @@ function AssetBrowser::onDropZipFile(%this, %filePath)
echo("Dropped in a zip file with" SPC %count SPC "files inside!");
for (%i = 0; %i < %count; %i++)
{
%fileEntry = %zip.getFileEntry(%i);
%fileFrom = getField(%fileEntry, 0);
//First, we wanna scan to see if we have modules to contend with. If we do, we'll just plunk them in wholesale
//and not process their contents.
//If not modules, it's likely an art pack or other mixed files, so we'll import them as normal
/*if( (%fileExt $= ".png") || (%fileExt $= ".jpg") || (%fileExt $= ".bmp") || (%fileExt $= ".dds") )
%this.importAssetListArray.add("ImageAsset", %filePath);
else if( (%fileExt $= ".dae") || (%fileExt $= ".dts"))
%this.importAssetListArray.add("ShapeAsset", %filePath);
else if( (%fileExt $= ".ogg") || (%fileExt $= ".wav") || (%fileExt $= ".mp3"))
%this.importAssetListArray.add("SoundAsset", %filePath);
else if( (%fileExt $= ".gui") || (%fileExt $= ".gui.dso"))
%this.importAssetListArray.add("GUIAsset", %filePath);
//else if( (%fileExt $= ".cs") || (%fileExt $= ".dso"))
// %this.importAssetListArray.add("Script", %filePath);
else if( (%fileExt $= ".mis"))
%this.importAssetListArray.add("LevelAsset", %filePath);*/
// For now, if it's a .cs file, we'll assume it's a behavior.
//if (fileExt(%fileFrom) !$= ".cs")
// continue;
%fileTo = expandFilename("^tools/assetBrowser/importTemp/") @ %fileFrom;
%zip.extractFile(%fileFrom, %fileTo);
//exec(%fileTo);
}
%zip.delete();
//Next, we loop over the files and import them
}
function AssetBrowser::onDropFolder(%this, %filePath)
{
if(!%this.isVisible())
return;
%zip = new ZipObject();
%zip.openArchive(%filePath);
%count = %zip.getFileEntryCount();
echo("Dropped in a zip file with" SPC %count SPC "files inside!");
return;
for (%i = 0; %i < %count; %i++)
{
@ -391,7 +440,10 @@ function ImportAssetWindow::onWake(%this)
//Lets refresh our list
if(!ImportAssetWindow.isVisible())
return;
if(!isObject(%this.importTempDirHandler))
%this.importTempDirHandler = makedirectoryHandler(0, "", "");
if(!isObject(AssetImportSettings))
{
new Settings(AssetImportSettings)
@ -420,6 +472,8 @@ function ImportAssetWindow::onWake(%this)
ImportAssetConfigList.setSelected(0);
ImportActivityLog.empty();
%this.refresh();
}
function ImportAssetWindow::reloadImportOptionConfigs(%this)
@ -973,7 +1027,6 @@ function NewAssetsViewTree::onRightMouseDown(%this, %itemId)
}
else
{
ImportAssetActions.enableItem(1, false);
ImportAssetActions.showPopup(Canvas);
}
}
@ -1510,6 +1563,8 @@ function ImportAssetWindow::Close(%this)
//Some cleanup
ImportAssetWindow.importingFilesArray.empty();
%this.importTempDirHandler.deleteFolder("tools/assetBrowser/importTemp/*/");
Canvas.popDialog();
}

View file

@ -67,8 +67,6 @@ function setupImportConfigSettingsList()
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/UseDiffuseSuffixOnOriginImage", "Use Diffuse Suffix for Origin Image", "bool", "", "1", "");
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/UseExistingMaterials", "Use Existing Materials", "bool", "", "1", "");
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/IgnoreMaterials", "Ignore Materials", "command", "", "", "");
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/AlwaysPresentImageMaps", "Always Present Image Maps", "bool",
"Wether to always display all normal material map fields, even if an image isn't detected.", "", "");
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", "");
//Animations
@ -321,7 +319,6 @@ function ImportAssetConfigEditorWindow::addNewConfig(%this)
AssetImportSettings.setValue("Materials/CreateComposites", "1");
AssetImportSettings.setValue("Materials/UseDiffuseSuffixOnOriginImage", "1");
AssetImportSettings.setValue("Materials/UseExistingMaterials", "1");
AssetImportSettings.setValue("Materials/AlwaysPresentImageMaps", "0");
AssetImportSettings.setValue("Materials/PopulateMaterialMaps", "1");
//Animations

View file

@ -1,3 +1,5 @@
//Builds the preview data of the asset for the Asset Browser
function AssetBrowser::build_AssetPreview(%this, %assetDef, %previewData)
{
%previewData.assetName = %assetDef.assetName;
@ -11,59 +13,73 @@ function AssetBrowser::build_AssetPreview(%this, %assetDef, %previewData)
%previewData.tooltip = %assetDef.gameObjectName;
}
//Some last-step setup for the creation of the new asset before we do the actual making
//This is generally intended to just set up any type-specific fields for creation
function AssetBrowser::setupCreateNew_Asset(%this)
{
}
//Performs the actual creation of the asset, including loose file copy or generation
function AssetBrowser::create_Asset(%this)
{
}
//This is a pre-process step to prepare the asset item for import
function AssetBrowser::prepareImport_Asset(%this, %assetItem)
{
}
function AssetBrowser::setupCreateNew_Asset(%this)
{
}
function AssetBrowser::create_Asset(%this)
{
}
//Performs the action of actually importing the asset item
function AssetBrowser::import_Asset(%this, %assetDef)
{
}
//Editing the asset
function AssetBrowser::edit_Asset(%this, %assetDef)
{
}
//Duplicates the asset
function AssetBrowser::duplicate_Asset(%this, %assetDef, %targetModule)
{
}
//Renames the asset
function AssetBrowser::rename_Asset(%this, %assetDef, %newAssetName)
{
}
//Deletes the asset
function AssetBrowser::delete_Asset(%this, %assetDef)
{
}
//Moves the asset to a new path/module
function AssetBrowser::move_Asset(%this, %assetDef, %destinationFolder)
{
}
//Drag and drop action onto a GUI control
function AssetBrowser::dragAndDrop_Asset(%this, %assetDef, %dropTarget)
{
if(!isObject(%dropTarget))
return;
}
//Even for when
function AssetBrowser::on_AssetEditorDropped(%this, %assetDef, %position)
{
}
//Clicking of the button for the asset type inspector field
function GuiInspectorType_AssetPtr::onClick( %this, %fieldName )
{
//Get our data
%obj = %this.getInspector().getInspectObject(0);
}
//Drag and droppin onto the asset type inspector field
function GuiInspectorType_AssetPtr::onControlDropped( %this, %payload, %position )
{

View file

@ -1,3 +1,16 @@
function AssetBrowser::buildCppAssetPreview(%this, %assetDef, %previewData)
{
%previewData.assetName = %assetDef.assetName;
%previewData.assetPath = %assetDef.codeFilePath;
%previewData.doubleClickCommand = "echo(\"Not yet implemented to edit C++ files from the editor\");";//"EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
%previewData.previewImage = "tools/assetBrowser/art/cppIcon";
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
%previewData.tooltip = %assetDef.assetName;
}
function AssetBrowser::createCppAsset(%this)
{
%moduleName = AssetBrowser.newAssetSettings.moduleName;
@ -129,15 +142,50 @@ function AssetBrowser::createCppAsset(%this)
return %tamlpath;
}
function AssetBrowser::buildCppAssetPreview(%this, %assetDef, %previewData)
function AssetBrowser::editCppAsset(%this, %assetDef)
{
%previewData.assetName = %assetDef.assetName;
%previewData.assetPath = %assetDef.codeFilePath;
%previewData.doubleClickCommand = "echo(\"Not yet implemented to edit C++ files from the editor\");";//"EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
}
//Renames the asset
function AssetBrowser::renameCppAsset(%this, %assetDef, %newAssetName)
{
%newCodeLooseFilename = renameAssetLooseFile(%assetDef.codefile, %newAssetName);
%previewData.previewImage = "tools/assetBrowser/art/cppIcon";
if(!%newCodeLooseFilename $= "")
return;
%newHeaderLooseFilename = renameAssetLooseFile(%assetDef.headerFile, %newAssetName);
%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
%previewData.tooltip = %assetDef.assetName;
}
if(!%newHeaderLooseFilename $= "")
return;
%assetDef.codefile = %newCodeLooseFilename;
%assetDef.headerFile = %newHeaderLooseFilename;
%assetDef.saveAsset();
renameAssetFile(%assetDef, %newAssetName);
}
//Deletes the asset
function AssetBrowser::deleteCppAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveCppAsset(%this, %assetDef, %destination)
{
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.codeFile, %destination);
moveAssetLooseFile(%assetDef.headerFile, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
}

View file

@ -43,6 +43,50 @@ function AssetBrowser::editCubemapAsset(%this, %assetDef)
CubemapEditor.openCubemapAsset(%assetDef);
}
//Renames the asset
function AssetBrowser::renameCubemapAsset(%this, %assetDef, %newAssetName)
{
/*%newCodeLooseFilename = renameAssetLooseFile(%assetDef.codefile, %newAssetName);
if(!%newCodeLooseFilename $= "")
return;
%newHeaderLooseFilename = renameAssetLooseFile(%assetDef.headerFile, %newAssetName);
if(!%newHeaderLooseFilename $= "")
return;
%assetDef.codefile = %newCodeLooseFilename;
%assetDef.headerFile = %newHeaderLooseFilename;
%assetDef.saveAsset();
renameAssetFile(%assetDef, %newAssetName);*/
}
//Deletes the asset
function AssetBrowser::deleteCubemapAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveCubemapAsset(%this, %assetDef, %destination)
{
/*%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.codeFile, %destination);
moveAssetLooseFile(%assetDef.headerFile, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);*/
}
function GuiInspectorTypeCubemapAssetPtr::onControlDropped( %this, %payload, %position )
{
Canvas.popDialog(EditorDragAndDropLayer);

View file

@ -50,7 +50,7 @@ function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData)
//%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
%previewData.tooltip = %assetDef.dirPath;
%previewData.doubleClickCommand = "AssetBrowser.navigateTo(\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\")";//browseTo %assetDef.dirPath / %assetDef.assetName
%previewData.doubleClickCommand = "AssetBrowser.schedule(10, \"navigateTo\",\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\");";//browseTo %assetDef.dirPath / %assetDef.assetName
}
function AssetBrowser::renameFolder(%this, %folderPath, %newFolderName)

View file

@ -234,6 +234,31 @@ function AssetBrowser::renameGameObjectAsset(%this, %assetDef, %newAssetId, %ori
TAMLWrite(%gameObj, %newGOFile);
}
//Deletes the asset
function AssetBrowser::deleteGameObjectAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveGameObjectAsset(%this, %assetDef, %destination)
{
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.scriptFile, %destination);
moveAssetLooseFile(%assetDef.TAMLFile, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
}
function AssetBrowser::buildGameObjectAssetPreview(%this, %assetDef, %previewData)
{
%previewData.assetName = %assetDef.assetName;

View file

@ -100,6 +100,51 @@ function AssetBrowser::editGUIAsset(%this, %assetDef)
GuiEditContent(%assetDef.assetName);
}
//Renames the asset
function AssetBrowser::renameGUIAsset(%this, %assetDef, %newAssetName)
{
%newScriptLooseFilename = renameAssetLooseFile(%assetDef.scriptFile, %newAssetName);
if(!%newScriptLooseFilename $= "")
return;
%newGUILooseFilename = renameAssetLooseFile(%assetDef.guiFile, %newAssetName);
if(!%newGUILooseFilename $= "")
return;
%assetDef.scriptFile = %newScriptLooseFilename;
%assetDef.guiFile = %newGUILooseFilename;
%assetDef.saveAsset();
renameAssetFile(%assetDef, %newAssetName);
}
//Deletes the asset
function AssetBrowser::deleteGUIAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveGUIAsset(%this, %assetDef, %destination)
{
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.guifile, %destination);
moveAssetLooseFile(%assetDef.scriptFile, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
}
function AssetBrowser::buildGUIAssetPreview(%this, %assetDef, %previewData)
{
%previewData.assetName = %assetDef.assetName;

View file

@ -81,9 +81,11 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
{
if(%foundSuffixType $= "diffuse")
%materialAsset.diffuseImageAsset = %assetItem;
%assetItem.ImageType = "Diffuse";
//%materialAsset.diffuseImageAsset = %assetItem;
else if(%foundSuffixType $= "normal")
%materialAsset.normalImageAsset = %assetItem;
%assetItem.ImageType = "Normal";
//%materialAsset.normalImageAsset = %assetItem;
else if(%foundSuffixType $= "metalness")
%materialAsset.metalnessImageAsset = %assetItem;
else if(%foundSuffixType $= "roughness")
@ -173,28 +175,38 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
%previewData.tooltip = %assetDef.friendlyName @ "\n" @ %assetDef;
}
//Renames the asset
function AssetBrowser::renameImageAsset(%this, %assetDef, %newAssetName)
{
%newFilename = renameAssetLooseFile(%assetDef.imageFile, %newAssetName);
if(!%newFilename $= "")
return;
%assetDef.imageFile = %newFilename;
%assetDef.saveAsset();
renameAssetFile(%assetDef, %newAssetName);
}
//Deletes the asset
function AssetBrowser::deleteImageAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveImageAsset(%this, %assetDef, %destination)
{
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
if(%currentModule $= %targetModule)
{
//just move the files
%assetPath = makeFullPath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()));
%assetFilename = fileName(%assetPath);
%newAssetPath = %destination @ "/" @ %assetFilename;
%copiedSuccess = pathCopy(%assetPath, %destination @ "/" @ %assetFilename);
%deleteSuccess = fileDelete(%assetPath);
%imagePath = %assetDef.imageFile;
%imageFilename = fileName(%imagePath);
%copiedSuccess = pathCopy(%imagePath, %destination @ "/" @ %imageFilename);
%deleteSuccess = fileDelete(%imagePath);
}
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.imageFile, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);

View file

@ -35,11 +35,19 @@ function AssetBrowser::createLevelAsset(%this)
TamlWrite(%asset, %tamlpath);
if(!pathCopy("tools/levels/BlankRoom.mis", %levelPath, false))
//Special-case where if we're doing a save-as action, it'll base on the current scene.
//Otherwise we're doing a basic create action, so just base it off our editor's default
if(EditorGui.saveAs)
{
getRootScene().save(%levelPath);
}
else if(!pathCopy("tools/levels/DefaultEditorLevel.mis", %levelPath, false))
{
echo("Unable to copy template level file!");
}
replaceInFile(%levelPath, "EditorTemplateLevel", %assetName);
//Generate the associated files
DecalManagerSave( %assetPath @ %asset.DecalsFile );
PostFXManager::savePresetHandler( %assetPath @ %asset.PostFXPresetFile );
@ -61,6 +69,45 @@ function AssetBrowser::editLevelAsset(%this, %assetDef)
{
schedule( 1, 0, "EditorOpenMission", %assetDef);
}
//Renames the asset
function AssetBrowser::renameLevelAsset(%this, %assetDef, %newAssetName)
{
%newFilename = renameAssetLooseFile(%assetDef.LevelFile, %newAssetName);
if(!%newFilename $= "")
return;
//TODO the other loose files
%assetDef.LevelFile = %newFilename;
%assetDef.saveAsset();
renameAssetFile(%assetDef, %newAssetName);
}
//Deletes the asset
function AssetBrowser::deleteLevelAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveLevelAsset(%this, %assetDef, %destination)
{
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.LevelFile, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
}
function AssetBrowser::buildLevelAssetPreview(%this, %assetDef, %previewData)
{

View file

@ -45,6 +45,43 @@ function AssetBrowser::editMaterialAsset(%this, %assetDef)
AssetBrowser.hideDialog();
}
//Renames the asset
function AssetBrowser::renameMaterialAsset(%this, %assetDef, %newAssetName)
{
%newFilename = renameAssetLooseFile(%assetDef.scriptPath, %newAssetName);
if(!%newFilename $= "")
return;
%assetDef.scriptPath = %newFilename;
%assetDef.saveAsset();
renameAssetFile(%assetDef, %newAssetName);
}
//Deletes the asset
function AssetBrowser::deleteMaterialAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveMaterialAsset(%this, %assetDef, %destination)
{
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.scriptPath, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
}
function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
{
ImportActivityLog.add("Preparing Shape for Import: " @ %assetItem.assetName);
@ -95,14 +132,6 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%diffuseAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
%assetItem.diffuseImageAsset = %diffuseAsset;
}
else if(getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 1)
{
//In the event we don't have this image asset, but we DO wish to always display the field(affording when names don't aline with
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%diffuseTypeSuffixes, ",;") == 0 ? "_albedo" : getToken(%diffuseTypeSuffixes, ",;", 0);
%diffuseAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
%assetItem.diffuseImageAsset = %diffuseAsset;
}
}
//Now, iterate over our comma-delimited suffixes to see if we have any matches. We'll use the first match in each case, if any.
@ -120,14 +149,6 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
%assetItem.normalImageAsset = %normalAsset;
}
else if(getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 1)
{
//In the event we don't have this image asset, but we DO wish to always display the field(affording when names don't aline with
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%normalTypeSuffixes, ",;") == 0 ? "_normal" : getToken(%normalTypeSuffixes, ",;", 0);
%normalAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
%assetItem.normalImageAsset = %normalAsset;
}
}
if(%assetItem.metalImageAsset $= "")
@ -143,14 +164,6 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
%assetItem.metalImageAsset = %metalAsset;
}
else if(getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 1)
{
//In the event we don't have this image asset, but we DO wish to always display the field(affording when names don't aline with
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%metalnessTypeSuffixes, ",;") == 0 ? "_metalness" : getToken(%metalnessTypeSuffixes, ",;", 0);
%metalAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
%assetItem.metalImageAsset = %metalAsset;
}
}
if(%assetItem.roughnessImageAsset $= "")
@ -166,14 +179,6 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
%assetItem.roughnessImageAsset = %roughnessAsset;
}
else if(getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 1)
{
//In the event we don't have this image asset, but we DO wish to always display the field(affording when names don't aline with
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%roughnessTypeSuffixes, ",;") == 0 ? "_roughness" : getToken(%roughnessTypeSuffixes, ",;", 0);
%roughnessAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
%assetItem.roughnessImageAsset = %roughnessAsset;
}
}
if(%assetItem.smoothnessImageAsset $= "")
@ -189,14 +194,6 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
%assetItem.SmoothnessImageAsset = %smoothnessAsset;
}
else if(getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 1)
{
//In the event we don't have this image asset, but we DO wish to always display the field(affording when names don't aline with
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%smoothnessTypeSuffixes, ",;") == 0 ? "_smoothness" : getToken(%smoothnessTypeSuffixes, ",;", 0);
%smoothnessAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
%assetItem.SmoothnessImageAsset = %smoothnessAsset;
}
}
if(%assetItem.AOImageAsset $= "")
@ -212,14 +209,6 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
%assetItem.AOImageAsset = %AOAsset;
}
else if(getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 1)
{
//In the event we don't have this image asset, but we DO wish to always display the field(affording when names don't aline with
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%aoTypeSuffixes, ",;") == 0 ? "_AO" : getToken(%aoTypeSuffixes, ",;", 0);
%AOAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
%assetItem.AOImageAsset = %AOAsset;
}
}
if(%assetItem.compositeImageAsset $= "")
@ -235,21 +224,12 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
%compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
%assetItem.compositeImageAsset = %compositeAsset;
}
else if(getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 1)
{
//In the event we don't have this image asset, but we DO wish to always display the field(affording when names don't aline with
//the material name), then we go ahead and create a blank entry
%suff = getTokenCount(%compositeTypeSuffixes, ",;") == 0 ? "_composite" : getToken(%compositeTypeSuffixes, ",;", 0);
%compositeAsset = AssetBrowser.addImportingAsset("Image", %assetItem.AssetName @ %suff, %assetItem);
%assetItem.compositeImageAsset = %compositeAsset;
}
}
//If after the above we didn't find any, check to see if we should be generating one
if(%assetItem.compositeImageAsset $= "" &&
(%assetItem.roughnessImageAsset !$= "" || %assetItem.AOImageAsset !$= "" || %assetItem.metalnessImageAsset !$= "") &&
getAssetImportConfigValue("Materials/CreateComposites", "1") == 1 &&
getAssetImportConfigValue("Materials/AlwaysPresentImageMaps", "0") == 0)
getAssetImportConfigValue("Materials/CreateComposites", "1") == 1)
{
%assetItem.roughnessImageAsset.skip = true;
%assetItem.AOImageAsset.skip = true;

View file

@ -111,6 +111,57 @@ function AssetBrowser::createPostEffectAsset(%this)
return %tamlpath;
}
//Renames the asset
function AssetBrowser::renamePostEffectAsset(%this, %assetDef, %newAssetName)
{
%newScriptFilename = renameAssetLooseFile(%assetDef.scriptPath, %newAssetName);
if(!%newScriptFilename $= "")
return;
%newHLSLFilename = renameAssetLooseFile(%assetDef.hlslShader, %newAssetName);
if(!%newHLSLFilename $= "")
return;
%newGLSLFilename = renameAssetLooseFile(%assetDef.glslShader, %newAssetName);
if(!%newGLSLFilename $= "")
return;
%assetDef.scriptPath = %newScriptFilename;
%assetDef.hlslShader = %newHLSLFilename;
%assetDef.glslShader = %newGLSLFilename;
%assetDef.saveAsset();
renameAssetFile(%assetDef, %newAssetName);
}
//Deletes the asset
function AssetBrowser::deletePostEffectAsset(%this, %assetDef)
{
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::movePostEffectAsset(%this, %assetDef, %destination)
{
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%newAssetPath = moveAssetFile(%assetDef, %destination);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.scriptPath, %destination);
moveAssetLooseFile(%assetDef.hlslShader, %destination);
moveAssetLooseFile(%assetDef.glslShader, %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
}
function AssetBrowser::buildPostEffectAssetPreview(%this, %assetDef, %previewData)
{
%previewData.assetName = %assetDef.assetName;

View file

@ -53,87 +53,41 @@ function AssetBrowser::onScriptAssetEditorDropped(%this, %assetDef, %position)
return;
}
//Renames the asset
function AssetBrowser::renameScriptAsset(%this, %assetDef, %newAssetName)
{
%assetId = %assetDef.getAssetID();
%newFilename = renameAssetLooseFile(%assetDef.scriptFile, %newAssetName);
%module = AssetDatabase.getAssetModule(%assetId);
%scriptPath = %assetDef.scriptFile;
%newScriptPath = filePath(%scriptPath) @ "/" @ %newAssetName @ fileExt(%scriptPath);
%copiedSuccess = pathCopy(%scriptPath, %newScriptPath);
%looseFilepath = fileName(%newScriptPath);
%assetDef.scriptFile = "\"@AssetFile=" @ %looseFilepath @ "\"";
if(!%newFilename $= "")
return;
%assetDef.scriptFile = %newFilename;
%assetDef.saveAsset();
AssetDatabase.renameDeclaredAsset("\"" @ %module @ ":" @ %newAssetName @ "\"");
//%assetFilePath = makeFullPath(AssetDatabase.getAssetFilePath(%assetId));
//%newAssetFilePath = %newFullPath @ "/" @ fileName(%assetFilePath);
//%copiedSuccess = pathCopy(%assetFilePath, %newAssetFilePath);
fileDelete(%scriptPath);
//ModuleDatabase.unloadExplicit(%module.getModuleId());
//ModuleDatabase.loadExplicit(%module.getModuleId());
renameAssetFile(%assetDef, %newAssetName);
}
//Deletes the asset
function AssetBrowser::deleteScriptAsset(%this, %assetDef)
{
%assetId = %assetDef.getAssetID();
%module = AssetDatabase.getAssetModule(%assetId);
%assetFilePath = makeFullPath(AssetDatabase.getAssetFilePath(%assetId));
%scriptPath = %assetDef.scriptFile;
fileDelete(%assetFilePath);
fileDelete(%scriptPath);
//they're different moduels now, so we gotta unload/reload both
ModuleDatabase.unloadExplicit(%module.getModuleId());
ModuleDatabase.unloadExplicit(%newModule.getModuleId());
AssetDatabase.deleteAsset(%assetDef.getAssetId(), true);
}
//Moves the asset to a new path/module
function AssetBrowser::moveScriptAsset(%this, %assetDef, %destination)
{
%newFullPath = makeFullPath(%destination);
%currentModule = AssetDatabase.getAssetModule(%assetDef.getAssetId());
%targetModule = AssetBrowser.getModuleFromAddress(%destination);
%assetId = %assetDef.getAssetID();
%newAssetPath = moveAssetFile(%assetDef, %destination);
%module = AssetDatabase.getAssetModule(%assetId);
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.scriptFile, %destination);
%assetFilePath = makeFullPath(AssetDatabase.getAssetFilePath(%assetId));
%newAssetFilePath = %newFullPath @ "/" @ fileName(%assetFilePath);
%copiedSuccess = pathCopy(%assetFilePath, %newAssetFilePath);
%scriptPath = %assetDef.scriptFile;
%newScriptPath = %newFullPath @ "/" @ fileName(%scriptPath);
%copiedSuccess = pathCopy(%scriptPath, %newScriptPath);
fileDelete(%assetFilePath);
fileDelete(%scriptPath);
//thrash the modules and reload them
%newModule = %this.dirHandler.getModuleFromAddress(%newFullPath);
//if we didn't move modules, then we don't need to do anything other than refresh the assets within it
if(%module == %newModule)
{
//only do a refresh to update asset loose file paths
AssetDatabase.refreshAllAssets();
}
else
{
//they're different moduels now, so we gotta unload/reload both
ModuleDatabase.unloadExplicit(%module.getModuleId());
ModuleDatabase.loadExplicit(%module.getModuleId());
ModuleDatabase.unloadExplicit(%newModule.getModuleId());
ModuleDatabase.loadExplicit(%newModule.getModuleId());
}
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);
}
function AssetBrowser::buildScriptAssetPreview(%this, %assetDef, %previewData)

View file

@ -18,26 +18,44 @@ function makedirectoryHandler(%targetTree, %folderExclusionList, %searchFilter)
function directoryHandler::loadFolders(%this, %path, %parentId)
{
%modulesList = ModuleDatabase.findModules();
//utilize home dir project setting here
%paths = getDirectoryList(%path);
for(%i=0; %i < getFieldCount(%paths); %i++)
{
%childPath = getField(%paths, %i);
%fullChildPath = makeFullPath(%path @ "/" @ %childPath);
%folderCount = getTokenCount(%childPath, "/");
for(%f=0; %f < %folderCount; %f++)
{
%folderName = getToken(%childPath, "/", %f);
%parentName = %this.treeCtrl.getItemText(%parentId);
//we don't need to display the shadercache folder
if(%parentId == 1 && (%folderName $= "shaderCache" || %folderName $= "cache"))
if(%parentName $= "Data" && (%folderName $= "shaderCache" || %folderName $= "cache"))
continue;
%iconIdx = 3;
if(ModuleDatabase.findModule(%folderName) !$= "")
%iconIdx = 1;
//Lets see if any modules match our current path)
for(%m=0; %m < getWordCount(%modulesList); %m++)
{
%moduleDef = getWord(%modulesList, %m);
if(%moduleDef.modulePath $= %fullChildPath)
{
%iconIdx = 1;
break;
}
}
//if(ModuleDatabase.findModule(%folderName) !$= "")
// %iconIdx = 1;
%searchFoldersText = %this.searchFilter;
if(%searchFoldersText !$= "Search Folders...")
@ -204,6 +222,8 @@ function directoryHandler::expandTreeToAddress(%this, %address)
%curItem = %this.treeCtrl.findChildItemByName(%curItem, %folderName);
%this.treeCtrl.expandItem(%curItem);
}
%this.treeCtrl.expandItem(0);
}
function directoryHandler::createFolder(%this, %folderPath)

View file

@ -13,7 +13,22 @@ function AssetBrowser::editAsset(%this, %assetDef)
//Find out what type it is
//If the passed-in definition param is blank, then we're likely called via a popup
if(%assetDef $= "")
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
{
if(AssetDatabase.isDeclaredAsset(EditAssetPopup.assetId))
{
%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
}
else
{
//if it's not a valid asset at all, then it's probably a folder
%folder = strreplace(EditAssetPopup.assetId, ":", "/");
if(isDirectory(%folder))
{
AssetBrowser.navigateTo(%folder);
}
}
}
%assetType = %assetDef.getClassName();
@ -132,6 +147,51 @@ function AssetBrowser::performRenameAsset(%this, %originalAssetName, %newName)
AssetBrowser-->filterTree.buildVisibleTree();
}
function renameAssetFile(%assetDef, %newName)
{
%assetId = %assetDef.getAssetID();
%module = AssetDatabase.getAssetModule(%assetId);
%moduleId = %module.moduleId;
%assetPath = AssetDatabase.getAssetFilePath(%assetId);
%newPath = filePath(%assetPath) @ "/" @ %newName @ ".asset.taml";
%copiedSuccess = pathCopy(%assetPath, %newPath);
if(!%copiedSuccess)
return "";
%deleteSuccess = fileDelete(%assetPath);
if(!%deleteSuccess)
return "";
//Remove the old declaration
AssetDatabase.removeDeclaredAsset(%assetId);
//Add with the new file
AssetDatabase.addDeclaredAsset(%module, %newPath);
//Perform the rename in the file/system itself
AssetDatabase.renameDeclaredAsset(%assetId, %moduleId @ ":" @ %newName);
}
function renameAssetLooseFile(%file, %newName)
{
%newPath = filePath(%file) @ "/" @ %newName @ fileExt(%file);
%copiedSuccess = pathCopy(%file, %newPath);
if(!%copiedSuccess)
return "";
%deleteSuccess = fileDelete(%file);
if(!%deleteSuccess)
return "";
return fileName(%newPath);
}
function AssetNameField::onReturn(%this)
{
%this.clearFirstResponder();
@ -165,6 +225,39 @@ function AssetBrowser::moveAsset(%this, %assetId, %destination)
%this.refresh();
}
function moveAssetFile(%assetDef, %destinationPath)
{
%assetPath = makeFullPath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()));
%assetFilename = fileName(%assetPath);
%newAssetPath = %destination @ "/" @ %assetFilename;
%copiedSuccess = pathCopy(%assetPath, %destination @ "/" @ %assetFilename);
if(!%copiedSuccess)
return "";
%deleteSuccess = fileDelete(%assetPath);
if(!%deleteSuccess)
return "";
return %newAssetPath;
}
function moveAssetLooseFile(%file, %destinationPath)
{
%filename = fileName(%file);
%copiedSuccess = pathCopy(%file, %destinationPath @ "/" @ %filename);
if(!%copiedSuccess)
return false;
%deleteSuccess = fileDelete(%file);
return %deleteSuccess;
}
//------------------------------------------------------------
function AssetBrowser::duplicateAsset(%this, %targetModule)

View file

@ -1,10 +1,31 @@
//
function AssetBrowser::ConvertFolderIntoModule(%this, %folderName)
{
if(!isDirectory("data/" @ %folderName))
return;
AssetBrowser_AddModule-->moduleName.text = %folderName;
AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.loadDirectories();";
AssetBrowser_addModuleWindow.CreateNewModule();
}
function AssetBrowser::CreateNewModule(%this)
{
Canvas.pushDialog(AssetBrowser_AddModule);
AssetBrowser_addModuleWindow.selectWindow();
AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.loadFilters();";
AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.loadDirectories();";
}
function AssetBrowser::createNewEditorTool(%this)
{
Canvas.pushDialog(AssetBrowser_AddModule);
AssetBrowser_addModuleWindow.selectWindow();
AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.loadDirectories();";
AssetBrowser_addModuleWindow.CreateNewModule();
}
function AssetBrowser_editModule::saveModule(%this)

View file

@ -185,6 +185,18 @@ function AssetBrowser::buildPopupMenus(%this)
};
}
if( !isObject( EditNonModulePopup ) )
{
new PopupMenu( EditNonModulePopup )
{
superClass = "MenuBuilder";
class = "EditorWorldMenu";
//isPopup = true;
item[ 0 ] = "Turn Folder into Module" TAB "" TAB "AssetBrowser.ConvertFolderIntoModule();";
};
}
//Some assets are not yet ready/implemented, so disable their creation here
AddNewArtAssetPopup.enableItem(6, false); //shape
AddNewArtAssetPopup.enableItem(7, false); //shape animation
@ -257,8 +269,6 @@ function AssetBrowser::buildPopupMenus(%this)
}
}
AssetBrowser.toggleAssetTypeFilter(0);
//Browser visibility menu
if( !isObject( BrowserVisibilityPopup ) )
{
@ -370,10 +380,27 @@ function AssetBrowser::buildPopupMenus(%this)
class = "EditorWorldMenu";
item[0] = "Add New Asset" TAB "" TAB "ImportAssetWindow.addNewImportingAsset();";
item[0] = "Add Reference to Existing Asset" TAB "" TAB "ImportAssetWindow.addRefExistingAsset();";
item[1] = "Remove asset" TAB "" TAB "ImportAssetWindow.removeImportingAsset();";
item[1] = "Import Existing File as Asset" TAB "" TAB "ImportAssetWindow.importExistingFile();";
item[2] = "-";
item[3] = "Add Reference to Existing Asset" TAB "" TAB "ImportAssetWindow.addRefExistingAsset();";
item[4] = "-";
item[5] = "Remove asset" TAB "" TAB "ImportAssetWindow.removeImportingAsset();";
};
}
if( !isObject( AddNewToolPopup ) )
{
new PopupMenu( AddNewToolPopup )
{
superClass = "MenuBuilder";
class = "EditorWorldMenu";
isPopup = true;
item[ 0 ] = "Create New Editor Tool" TAB "" TAB "AssetBrowser.createNewEditorTool(AddNewToolPopup.targetFolder);";
};
AddNewModulePopup.enableItem(1, false);
}
}
function AddNewScriptAssetPopupMenu::onSelectItem(%this, %id, %text)

View file

@ -66,6 +66,8 @@ singleton Material(Grid_512_Grey_Base)
singleton Material(Grid_512_Orange)
{
diffuseMap[0] = "./512_orange.png";
translucent = "1";
translucentBlendOp = "PreMul";
};
singleton Material(Grid_512_Orange_Lines)

View file

@ -1,12 +1,13 @@
function GuiInspectorComponentGroup::buildMaterialField(%this, %component, %fieldName)
function GuiInspectorGroup::buildMaterialField(%this, %fieldName, %fieldLabel, %fieldDesc,
%fieldDefaultVal, %fieldDataVals, %callback, %ownerObj)
{
%extent = 200;
%currentMaterial = %component.getFieldValue(%fieldName);
%currentMaterial = %ownerObj.getFieldValue(%fieldName);
//if we don't have a new material set on this slot, just use the default
if(%currentMaterial $= "" || %currentMaterial == 0)
%currentMaterial = %material;
%currentMaterial = %fieldDefaultVal;
%container = new GuiControl() {
canSaveDynamicFields = "0";
@ -25,7 +26,7 @@ function GuiInspectorComponentGroup::buildMaterialField(%this, %component, %fiel
%labelControl = new GuiTextCtrl() {
canSaveDynamicFields = "0";
Profile = "EditorFontHLBold";
Profile = "ToolsGuiTextBoldProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "16 3";
@ -53,7 +54,7 @@ function GuiInspectorComponentGroup::buildMaterialField(%this, %component, %fiel
position = "7 71";
profile = "ToolsGuiTextCenterProfile";
extent = "64 16";
text = %matName;
text = %currentMaterial;
};
};
@ -96,7 +97,7 @@ function GuiInspectorComponentGroup::buildMaterialField(%this, %component, %fiel
extent = "72 88";
Variable = "";
buttonType = "toggleButton";
tooltip = %matName;
tooltip = %currentMaterial;
groupNum = "0";
text = "";
Object = %component;
@ -111,7 +112,7 @@ function GuiInspectorComponentGroup::buildMaterialField(%this, %component, %fiel
%mapToLabel = new GuiTextCtrl() {
canSaveDynamicFields = "0";
Profile = "EditorFontHLBold";
Profile = "ToolsGuiTextBoldProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "100 26";
@ -130,7 +131,7 @@ function GuiInspectorComponentGroup::buildMaterialField(%this, %component, %fiel
class = "BehaviorEdTextField";
internalName = %accessor @ "File";
canSaveDynamicFields = "0";
Profile = "EditorTextEdit";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "100 50";
@ -262,7 +263,7 @@ function GuiInspectorComponentGroup::buildMaterialField(%this, %component, %fiel
%previewButton.setBitmap(%previewImage);
%previewButton.setText("");
%this.stack.add(%container);
%this-->stack.add(%container);
}
function materialFieldBtn::onClick(%this)

View file

@ -145,19 +145,31 @@ function ConvexEditorMaterialBtn::onClick(%this)
function ConvexEditorMaterialBtn::getMaterialName(%this)
{
materialSelector.showDialog(%this @ ".gotMaterialName", "name");
AssetBrowser.showDialog("MaterialAsset", %this @ ".gotMaterialName", "", "", "");
//materialSelector.showDialog(%this @ ".gotMaterialName", "name");
}
function ConvexEditorMaterialBtn::gotMaterialName(%this, %name)
{
%materialAsset = AssetDatabase.acquireAsset(%name);
//eval(%this.object @ "." @ %this.targetField @ " = " @ %name @ ";");
//%this.object.changeMaterial(getTrailingNumber(%this.targetField), %name);
//%this.object.inspectorApply();
%diffusemap = %name.diffuseMap[0];
%diffusemap = %materialAsset.materialDefinitionName.diffuseMap[0];
if(%diffusemap $= "")
{
%diffuseAsset = %materialAsset.materialDefinitionName.diffuseMapAsset[0];
if(%diffuseAsset !$= "")
{
%diffuseAssetDef = AssetDatabase.acquireAsset(%diffuseAsset);
%diffusemap = %diffuseAssetDef.imageFile;
}
}
ConvexEditorOptionsWindow-->matPreviewBtn.setBitmap(%diffusemap);
ConvexEditorOptionsWindow.activeMaterial = %name;
ConvexEditorOptionsWindow.activeMaterial = %materialAsset.materialDefinitionName;
}
function ConvexEditorMaterialApplyBtn::onClick(%this)
@ -198,19 +210,31 @@ function ConvexEditorDefaultMaterialBtn::onClick(%this)
function ConvexEditorDefaultMaterialBtn::getMaterialName(%this)
{
materialSelector.showDialog(%this @ ".gotMaterialName", "name");
//materialSelector.showDialog(%this @ ".gotMaterialName", "name");
AssetBrowser.showDialog("MaterialAsset", %this @ ".gotMaterialName", "", "", "");
}
function ConvexEditorDefaultMaterialBtn::gotMaterialName(%this, %name)
{
%materialAsset = AssetDatabase.acquireAsset(%name);
//eval(%this.object @ "." @ %this.targetField @ " = " @ %name @ ";");
//%this.object.changeMaterial(getTrailingNumber(%this.targetField), %name);
//%this.object.inspectorApply();
%diffusemap = %name.diffuseMap[0];
%diffusemap = %materialAsset.materialDefinitionName.diffuseMap[0];
if(%diffusemap $= "")
{
%diffuseAsset = %materialAsset.materialDefinitionName.diffuseMapAsset[0];
if(%diffuseAsset !$= "")
{
%diffuseAssetDef = AssetDatabase.acquireAsset(%diffuseAsset);
%diffusemap = %diffuseAssetDef.imageFile;
}
}
ConvexEditorOptionsWindow-->defMatPreviewBtn.setBitmap(%diffusemap);
ConvexEditorOptionsWindow.activeShape.material = %name;
ConvexEditorOptionsWindow.activeShape.material = %materialAsset.materialDefinitionName;
ConvexEditorGui.updateShape();
}

View file

@ -92,7 +92,7 @@ function ConvexEditorPlugin::onWorldEditorStartup( %this )
%this.popupMenu = ConvexActionsMenu;
exec( "./convexEditorSettingsTab.ed.gui" );
ESettingsWindow.addTabPage( EConvexEditorSettingsPage );
//ESettingsWindow.addTabPage( EConvexEditorSettingsPage );
}
function ConvexEditorPlugin::onActivated( %this )

View file

@ -289,7 +289,6 @@ function ESettingsWindow::getAxisSettings(%this)
function ESettingsWindow::getGeneralSettings(%this)
{
SettingsInspector.startGroup("Paths");
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "New Level", "filename", "");
SettingsInspector.addSettingsField("WorldEditor/torsionPath", "Torsion Path", "filename", "");
SettingsInspector.endGroup();
@ -416,6 +415,7 @@ function ESettingsWindow::getGameGeneralSettings(%this)
{
SettingsInspector.startGroup("General");
SettingsInspector.addSettingsField("General/ProjectName", "Project Name", "string", "");
SettingsInspector.addSettingsField("General/LightingMode", "Lighting Mode", "list", "Dictates the lighting mode the project uses", "Deferred,Forward");
SettingsInspector.endGroup();
}

View file

@ -9,4 +9,12 @@ function GuiInspectorVariableGroup::onConstructField(%this, %fieldName, %fieldLa
%makeCommand = %this @ ".build" @ %fieldTypeName @ "Field(\""@ %fieldName @ "\",\"" @ %fieldLabel @ "\",\"" @ %fieldDesc @ "\",\"" @
%fieldDefaultVal @ "\",\"" @ %fieldDataVals @ "\",\"" @ %inspector @ "." @ %callbackName @ "\",\"" @ %ownerObj @"\");";
eval(%makeCommand);
}
}
function GuiInspectorGroup::onConstructField(%this, %fieldName, %fieldLabel, %fieldTypeName, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %callbackName, %ownerObj)
{
%inspector = %this.getParent();
%makeCommand = %this @ ".build" @ %fieldTypeName @ "Field(\""@ %fieldName @ "\",\"" @ %fieldLabel @ "\",\"" @ %fieldDesc @ "\",\"" @
%fieldDefaultVal @ "\",\"" @ %fieldDataVals @ "\",\"" @ %inspector @ "." @ %callbackName @ "\",\"" @ %ownerObj @"\");";
eval(%makeCommand);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 928 B

View file

@ -5,7 +5,7 @@
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
profile = "ToolsGuiDefaultNonModalProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";

View file

@ -86,6 +86,14 @@ new GuiControlProfile (ToolsGuiSolidDefaultProfile : ToolsGuiDefaultProfile)
category = "Tools";
};
if( !isObject( ToolsGuiDefaultNonModalProfile ) )
new GuiControlProfile (ToolsGuiDefaultNonModalProfile : ToolsGuiDefaultProfile)
{
opaque = false;
modal = false;
category = "Tools";
};
if( !isObject( ToolsGuiTransparentProfile ) )
new GuiControlProfile (ToolsGuiTransparentProfile)
{
@ -192,6 +200,12 @@ new GuiControlProfile (ToolsGuiTextProfile)
category = "Tools";
};
if( !isObject( ToolsGuiTextBoldProfile ) )
new GuiControlProfile (ToolsGuiTextBoldProfile : ToolsGuiTextProfile)
{
fontType = "Noto Sans Bold";
};
if( !isObject( ToolsGuiTextBoldCenterProfile ) )
new GuiControlProfile (ToolsGuiTextBoldCenterProfile : ToolsGuiTextProfile)
{
@ -209,6 +223,13 @@ new GuiControlProfile (ToolsGuiTextRightProfile : ToolsGuiTextProfile)
category = "Tools";
};
if( !isObject( ToolsGuiTextBoldRightProfile ) )
new GuiControlProfile (ToolsGuiTextBoldRightProfile : ToolsGuiTextRightProfile)
{
fontType = "Noto Sans Bold";
fontSize = 16;
};
if( !isObject( ToolsGuiTextCenterProfile ) )
new GuiControlProfile (ToolsGuiTextCenterProfile : ToolsGuiTextProfile)
{

View file

@ -0,0 +1,141 @@
//--- OBJECT WRITE BEGIN ---
new Scene(EditorTemplateLevel) {
canSave = "1";
canSaveDynamicFields = "1";
isSubScene = "0";
isEditing = "0";
isDirty = "0";
cdTrack = "2";
CTF_scoreLimit = "5";
Enabled = "1";
musicTrack = "lush";
new LevelInfo(theLevelInfo) {
nearClip = "0.1";
visibleDistance = "1000";
visibleGhostDistance = "0";
decalBias = "0.0015";
fogColor = "0.6 0.6 0.7 1";
fogDensity = "0";
fogDensityOffset = "700";
fogAtmosphereHeight = "0";
canvasClearColor = "0 0 0 255";
ambientLightBlendPhase = "1";
ambientLightBlendCurve = "0 0 -1 -1";
soundAmbience = "AudioAmbienceDefault";
soundDistanceModel = "Linear";
canSave = "1";
canSaveDynamicFields = "1";
advancedLightmapSupport = "0";
desc0 = "A blank room template that acts as a starting point.";
Enabled = "1";
LevelName = "Blank Room Template";
};
new SkyBox(theSky) {
Material = "BlankSkyMat";
drawBottom = "0";
fogBandHeight = "0";
dirtyGameObject = "0";
position = "0 0 0";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new Sun(theSun) {
azimuth = "230.396";
elevation = "45";
color = "0.968628 0.901961 0.901961 1";
ambient = "0.337255 0.533333 0.619608 1";
brightness = "1";
castShadows = "1";
staticRefreshFreq = "250";
dynamicRefreshFreq = "8";
coronaEnabled = "1";
coronaScale = "0.5";
coronaTint = "1 1 1 1";
coronaUseLightColor = "1";
flareScale = "1";
attenuationRatio = "0 1 1";
shadowType = "PSSM";
texSize = "2048";
overDarkFactor = "3000 1500 750 250";
shadowDistance = "200";
shadowSoftness = "0.25";
numSplits = "4";
logWeight = "0.9";
fadeStartDistance = "0";
lastSplitTerrainOnly = "0";
representedInLightmap = "0";
shadowDarkenColor = "0 0 0 -1";
includeLightmappedGeometryInShadow = "0";
dirtyGameObject = "0";
position = "0 0 0";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
bias = "0.1";
Blur = "1";
Enabled = "1";
height = "1024";
lightBleedFactor = "0.8";
minVariance = "0";
pointShadowType = "PointShadowType_Paraboloid";
shadowBox = "-100 -100 -100 100 100 100";
splitFadeDistances = "1 1 1 1";
width = "3072";
};
new GroundPlane() {
squareSize = "128";
scaleU = "25";
scaleV = "25";
Material = "Grid_512_Grey";
dirtyGameObject = "0";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
position = "0 0 0";
rotation = "1 0 0 0";
scale = "1 1 1";
};
new Skylight() {
Enabled = "1";
ReflectionMode = "Baked Cubemap";
dirtyGameObject = "0";
position = "1.37009 -5.23561 46.5817";
rotation = "1 0 0 0";
canSave = "1";
canSaveDynamicFields = "1";
persistentId = "d5eb3afb-dced-11e9-a423-bb0e346e3870";
reflectionPath = "tools/levels/BlankRoom/probes/";
};
new TSStatic() {
ShapeAsset = "pbr:material_ball";
playAmbient = "1";
meshCulling = "0";
originSort = "0";
overrideColor = "0 0 0 0";
collisionType = "Collision Mesh";
decalType = "Collision Mesh";
allowPlayerStep = "0";
alphaFadeEnable = "0";
alphaFadeStart = "100";
alphaFadeEnd = "150";
alphaFadeInverse = "0";
renderNormals = "0";
forceDetail = "-1";
ignoreZodiacs = "0";
useGradientRange = "0";
gradientRange = "0 180";
invertGradientRange = "0";
dirtyGameObject = "0";
position = "-0.000554562 -0.0734091 1.05277";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
materialSlot0 = "base_material_ball";
};
};
//--- OBJECT WRITE END ---

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1,111 @@
//--- OBJECT WRITE BEGIN ---
new Scene(EditorTemplateLevel) {
canSave = "1";
canSaveDynamicFields = "1";
isSubScene = "0";
isEditing = "0";
isDirty = "0";
cdTrack = "2";
CTF_scoreLimit = "5";
Enabled = "1";
musicTrack = "lush";
new LevelInfo(theLevelInfo) {
nearClip = "0.1";
visibleDistance = "1000";
visibleGhostDistance = "0";
decalBias = "0.0015";
fogColor = "0.6 0.6 0.7 1";
fogDensity = "0";
fogDensityOffset = "700";
fogAtmosphereHeight = "0";
canvasClearColor = "0 0 0 255";
ambientLightBlendPhase = "1";
ambientLightBlendCurve = "0 0 -1 -1";
soundAmbience = "AudioAmbienceDefault";
soundDistanceModel = "Linear";
canSave = "1";
canSaveDynamicFields = "1";
advancedLightmapSupport = "0";
desc0 = "A blank room template that acts as a starting point.";
Enabled = "1";
LevelName = "Blank Room Template";
};
new SkyBox(theSky) {
Material = "BlankSkyMat";
drawBottom = "0";
fogBandHeight = "0";
position = "0 0 0";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
new Sun(theSun) {
azimuth = "230.396";
elevation = "45";
color = "0.968628 0.901961 0.901961 1";
ambient = "0.337255 0.533333 0.619608 1";
brightness = "1";
castShadows = "1";
staticRefreshFreq = "250";
dynamicRefreshFreq = "8";
coronaEnabled = "1";
coronaScale = "0.5";
coronaTint = "1 1 1 1";
coronaUseLightColor = "1";
flareScale = "1";
attenuationRatio = "0 1 1";
shadowType = "PSSM";
texSize = "2048";
overDarkFactor = "3000 1500 750 250";
shadowDistance = "200";
shadowSoftness = "0.25";
numSplits = "4";
logWeight = "0.9";
fadeStartDistance = "0";
lastSplitTerrainOnly = "0";
representedInLightmap = "0";
shadowDarkenColor = "0 0 0 -1";
includeLightmappedGeometryInShadow = "0";
position = "0 0 0";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
bias = "0.1";
Blur = "1";
Enabled = "1";
height = "1024";
lightBleedFactor = "0.8";
minVariance = "0";
pointShadowType = "PointShadowType_Paraboloid";
shadowBox = "-100 -100 -100 100 100 100";
splitFadeDistances = "1 1 1 1";
width = "3072";
};
new GroundPlane() {
squareSize = "128";
scaleU = "25";
scaleV = "25";
Material = "Grid_512_Grey";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
position = "0 0 0";
rotation = "1 0 0 0";
scale = "1 1 1";
};
new Skylight() {
Enabled = "1";
ReflectionMode = "Baked Cubemap";
position = "1.37009 -5.23561 46.5817";
rotation = "1 0 0 0";
canSave = "1";
canSaveDynamicFields = "1";
persistentId = "d5eb3afb-dced-11e9-a423-bb0e346e3870";
reflectionPath = "tools/levels/BlankRoom/probes/";
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,53 @@
$PostFXManager::Settings::ColorCorrectionRamp = "core/postFX/images/null_color_ramp.png";
$PostFXManager::Settings::DOF::BlurCurveFar = "";
$PostFXManager::Settings::DOF::BlurCurveNear = "";
$PostFXManager::Settings::DOF::BlurMax = "";
$PostFXManager::Settings::DOF::BlurMin = "";
$PostFXManager::Settings::DOF::EnableAutoFocus = "";
$PostFXManager::Settings::DOF::EnableDOF = "";
$PostFXManager::Settings::DOF::FocusRangeMax = "";
$PostFXManager::Settings::DOF::FocusRangeMin = "";
$PostFXManager::Settings::EnableDOF = "1";
$PostFXManager::Settings::EnabledSSAO = "1";
$PostFXManager::Settings::EnableHDR = "1";
$PostFXManager::Settings::EnableLightRays = "1";
$PostFXManager::Settings::EnablePostFX = "1";
$PostFXManager::Settings::EnableSSAO = "1";
$PostFXManager::Settings::EnableVignette = "1";
$PostFXManager::Settings::HDR::adaptRate = "2";
$PostFXManager::Settings::HDR::blueShiftColor = "1.05 0.97 1.27";
$PostFXManager::Settings::HDR::brightPassThreshold = "1";
$PostFXManager::Settings::HDR::enableBloom = "1";
$PostFXManager::Settings::HDR::enableBlueShift = "0";
$PostFXManager::Settings::HDR::enableToneMapping = "0.5";
$PostFXManager::Settings::HDR::gaussMean = "0";
$PostFXManager::Settings::HDR::gaussMultiplier = "0.3";
$PostFXManager::Settings::HDR::gaussStdDev = "0.8";
$PostFXManager::Settings::HDR::keyValue = "0.117347";
$PostFXManager::Settings::HDR::minLuminace = "0.0459184";
$PostFXManager::Settings::HDR::whiteCutoff = "1";
$PostFXManager::Settings::LightRays::brightScalar = "0.75";
$PostFXManager::Settings::LightRays::decay = "1.0";
$PostFXManager::Settings::LightRays::density = "0.94";
$PostFXManager::Settings::LightRays::numSamples = "40";
$PostFXManager::Settings::LightRays::weight = "5.65";
$PostFXManager::Settings::SSAO::blurDepthTol = "0.001";
$PostFXManager::Settings::SSAO::blurNormalTol = "0.95";
$PostFXManager::Settings::SSAO::lDepthMax = "2";
$PostFXManager::Settings::SSAO::lDepthMin = "0.2";
$PostFXManager::Settings::SSAO::lDepthPow = "0.2";
$PostFXManager::Settings::SSAO::lNormalPow = "2";
$PostFXManager::Settings::SSAO::lNormalTol = "-0.5";
$PostFXManager::Settings::SSAO::lRadius = "1";
$PostFXManager::Settings::SSAO::lStrength = "10";
$PostFXManager::Settings::SSAO::overallStrength = "2";
$PostFXManager::Settings::SSAO::quality = "0";
$PostFXManager::Settings::SSAO::sDepthMax = "1";
$PostFXManager::Settings::SSAO::sDepthMin = "0.1";
$PostFXManager::Settings::SSAO::sDepthPow = "1";
$PostFXManager::Settings::SSAO::sNormalPow = "1";
$PostFXManager::Settings::SSAO::sNormalTol = "0";
$PostFXManager::Settings::SSAO::sRadius = "0.1";
$PostFXManager::Settings::SSAO::sStrength = "6";
$PostFXManager::Settings::Vignette::VMax = 0.830218;
$PostFXManager::Settings::Vignette::VMin = 0.2;

View file

@ -272,10 +272,7 @@ function fastLoadWorldEdit(%val)
if( !$missionRunning )
{
// Flag saying, when level is chosen, launch it with the editor open.
%defaultLevelFile = EditorSettings.value( "WorldEditor/newLevelFile" );
EditorNewLevel(%defaultLevelFile);
EditorNewLevel("tools/levels/DefaultEditorLevel.mis");
}
else
{

View file

@ -82,7 +82,7 @@ function MeshRoadEditorPlugin::onWorldEditorStartup( %this )
// Add ourselves to the Editor Settings window
exec( "./meshRoadEditorSettingsTab.gui" );
ESettingsWindow.addTabPage( EMeshRoadEditorSettingsPage );
//ESettingsWindow.addTabPage( EMeshRoadEditorSettingsPage );
}
function MeshRoadEditorPlugin::onActivated( %this )

View file

@ -89,7 +89,7 @@ function NavEditorPlugin::onWorldEditorStartup(%this)
// Add ourselves to the Editor Settings window.
exec("./NavEditorSettingsTab.gui");
ESettingsWindow.addTabPage(ENavEditorSettingsPage);
//ESettingsWindow.addTabPage(ENavEditorSettingsPage);
ENavEditorSettingsPage.init();
// Add items to World Editor Creator

View file

@ -83,7 +83,7 @@ function RiverEditorPlugin::onWorldEditorStartup( %this )
// Add ourselves to the Editor Settings window
exec( "./RiverEditorSettingsTab.gui" );
ESettingsWindow.addTabPage( ERiverEditorSettingsPage );
//ESettingsWindow.addTabPage( ERiverEditorSettingsPage );
}
function RiverEditorPlugin::onActivated( %this )

View file

@ -82,7 +82,7 @@ function RoadEditorPlugin::onWorldEditorStartup( %this )
// Add ourselves to the Editor Settings window
exec( "./RoadEditorSettingsTab.gui" );
ESettingsWindow.addTabPage( ERoadEditorSettingsPage );
//ESettingsWindow.addTabPage( ERoadEditorSettingsPage );
}
function RoadEditorPlugin::onActivated( %this )

View file

@ -1,259 +1,265 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<EditorSettings>
<Group name="RoadEditor">
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
<Setting name="DefaultWidth">10</Setting>
<Setting name="materialName">DefaultDecalRoadMaterial</Setting>
<Setting name="HoverNodeColor">255 255 255 255</Setting>
</Group>
<Group name="AssetCreation">
<Setting name="TerrainAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="GUIAssetSubdirectoryFormat">&lt;AssetType&gt;/OtherFolder/</Setting>
<Setting name="CubemapAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="StatemachineAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="PostFXAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="LevelAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;AssetName&gt;/</Setting>
<Setting name="TerrainMatAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="AssetImporDefaultConfig">TestConfig</Setting>
<Setting name="AutoImport">1</Setting>
<Setting name="CppAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
<Setting name="ScriptAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
</Group>
<Group name="ShapeEditor">
<Setting name="ShowGrid">1</Setting>
<Setting name="SunAngleZ">135</Setting>
<Setting name="showBounds">0</Setting>
<Setting name="gridSize">0.1</Setting>
<Setting name="RenderCollision">0</Setting>
<Setting name="showNodes">1</Setting>
<Setting name="backgroundColor">0 0 0 100</Setting>
<Setting name="SunDiffuseColor">255 255 255 255</Setting>
<Setting name="SunAmbientColor">180 180 180 255</Setting>
<Setting name="showObjBox">1</Setting>
<Setting name="highlightMaterial">1</Setting>
<Setting name="AdvancedWndVisible">1</Setting>
<Setting name="SunAngleX">45</Setting>
<Setting name="gridDimension">40 40</Setting>
<Setting name="renderMounts">1</Setting>
</Group>
<Group name="TerrainEditor">
<Setting name="currentAction">lowerHeight</Setting>
<Group name="Brush">
<Setting name="maxBrushSize">40 40</Setting>
<Setting name="brushSize">40 40</Setting>
<Setting name="brushType">ellipse</Setting>
<Setting name="brushSoftness">1</Setting>
<Setting name="brushPressure">1</Setting>
</Group>
<Group name="ActionValues">
<Setting name="smoothFactor">0.1</Setting>
<Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="scaleVal">1</Setting>
<Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="setHeightVal">100</Setting>
<Setting name="SlopeMaxAngle">90</Setting>
<Setting name="SlopeMinAngle">0</Setting>
<Setting name="noiseFactor">1</Setting>
<Setting name="adjustHeightVal">10</Setting>
<Setting name="softSelectRadius">50</Setting>
</Group>
<Group name="Theme">
<Setting name="tabsHLColor">50 49 48 255</Setting>
<Setting name="tooltipTextColor">255 255 255 255</Setting>
<Setting name="dividerMidColor">50 49 48 255</Setting>
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
<Setting name="fieldBGColor">59 58 57 255</Setting>
<Setting name="tabsColor">37 36 35 255</Setting>
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
<Setting name="dividerDarkColor">17 16 15 255</Setting>
<Setting name="dividerLightColor">96 94 92 255</Setting>
<Setting name="headerColor">50 49 48 255</Setting>
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
<Setting name="tabsSELColor">59 58 57 255</Setting>
<Setting name="headerTextColor">236 234 232 255</Setting>
<Setting name="fieldTextNAColor">77 77 77 255</Setting>
<Setting name="fieldBGSELColor">100 98 96 255</Setting>
<Setting name="fieldTextColor">178 175 172 255</Setting>
<Setting name="fieldTextSELColor">255 255 255 255</Setting>
<Setting name="tooltipBGColor">43 43 43 255</Setting>
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
</Group>
<Group name="GuiEditor">
<Setting name="lastPath">tools/gui</Setting>
<Setting name="lastPath">tools/RPGDialogEditor/gui</Setting>
<Setting name="previewResolution">1024 768</Setting>
<Group name="Help">
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
</Group>
<Group name="EngineDevelopment">
<Setting name="showEditorProfiles">0</Setting>
<Setting name="toggleIntoEditor">0</Setting>
<Setting name="showEditorGuis">0</Setting>
</Group>
<Group name="Snapping">
<Setting name="snapToCanvas">1</Setting>
<Setting name="snapToCenters">1</Setting>
<Setting name="sensitivity">2</Setting>
<Setting name="snap2Grid">0</Setting>
<Setting name="snap2GridSize">8</Setting>
<Setting name="snapToControls">1</Setting>
<Setting name="snapToEdges">1</Setting>
<Setting name="snapToGuides">1</Setting>
</Group>
<Group name="Rendering">
<Setting name="drawGuides">1</Setting>
<Setting name="drawBorderLines">1</Setting>
</Group>
<Group name="Snapping">
<Setting name="sensitivity">2</Setting>
<Setting name="snapToControls">1</Setting>
<Setting name="snapToEdges">1</Setting>
<Setting name="snap2Grid">0</Setting>
<Setting name="snap2GridSize">8</Setting>
<Setting name="snapToGuides">1</Setting>
<Setting name="snapToCanvas">1</Setting>
<Setting name="snapToCenters">1</Setting>
</Group>
<Group name="Help">
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
</Group>
<Group name="Library">
<Setting name="viewType">Categorized</Setting>
</Group>
<Group name="Selection">
<Setting name="fullBox">0</Setting>
</Group>
<Group name="EngineDevelopment">
<Setting name="showEditorGuis">0</Setting>
<Setting name="showEditorProfiles">0</Setting>
<Setting name="toggleIntoEditor">0</Setting>
</Group>
</Group>
<Group name="WorldEditor">
<Setting name="undoLimit">40</Setting>
<Setting name="forceSidebarToSide">1</Setting>
<Setting name="recentLevelsList">pbr:PbrMatTestLevel,TTR:DasBootLevel</Setting>
<Setting name="orthoFOV">50</Setting>
<Setting name="recentLevelsList">FPSGameplay:EmptyLevel,pbr:PbrMatTestLevel,FPSGameplay:EmptyTerrain,TTR:DasBootLevel</Setting>
<Setting name="orthoShowGrid">1</Setting>
<Setting name="lastEditedLevel">pbr:PbrMatTestLevel</Setting>
<Setting name="startupMode">Blank Level</Setting>
<Setting name="dropType">screenCenter</Setting>
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
<Setting name="displayType">6</Setting>
<Setting name="orthoFOV">50</Setting>
<Setting name="dropType">screenCenter</Setting>
<Setting name="torsionPath">AssetWork_Debug.exe</Setting>
<Setting name="lastEditedLevel">FPSGameplay:EmptyLevel</Setting>
<Setting name="forceSidebarToSide">1</Setting>
<Setting name="startupMode">Blank Level</Setting>
<Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
<Setting name="EditorLayoutMode">Modern</Setting>
<Setting name="undoLimit">40</Setting>
<Setting name="forceLoadDAE">0</Setting>
<Group name="Grid">
<Setting name="gridSnap">1</Setting>
<Setting name="gridColor">102 102 102 100</Setting>
<Setting name="gridOriginColor">255 255 255 100</Setting>
<Setting name="gridMinorColor">51 51 51 100</Setting>
<Setting name="gridSize">1</Setting>
</Group>
<Group name="Color">
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
<Setting name="selectionBoxColor">255 255 0 255</Setting>
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
<Setting name="objectTextColor">255 255 255 255</Setting>
<Setting name="objSelectColor">255 0 0 255</Setting>
<Setting name="dragRectColor">255 255 0 255</Setting>
<Setting name="objMouseOverColor">0 255 0 255</Setting>
</Group>
<Group name="Theme">
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
</Group>
<Group name="Docs">
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
</Group>
<Group name="Tools">
<Setting name="boundingBoxCollision">0</Setting>
<Setting name="snapSoftSize">2</Setting>
<Setting name="TerrainSnapOffsetZ">0</Setting>
<Setting name="snapSoft">0</Setting>
<Setting name="OffsetZValue">0.01</Setting>
<Setting name="snapGround">0</Setting>
<Setting name="dropAtScreenCenterMax">100</Setting>
<Setting name="objectsUseBoxCenter">1</Setting>
<Setting name="dropAtScreenCenterScalar">1</Setting>
</Group>
<Group name="Images">
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
</Group>
<Group name="Render">
<Setting name="renderObjHandle">1</Setting>
<Setting name="renderObjText">1</Setting>
<Setting name="renderPopupBackground">1</Setting>
<Setting name="showMousePopupInfo">1</Setting>
<Setting name="renderSelectionBox">1</Setting>
</Group>
<Group name="ObjectIcons">
<Setting name="fadeIconsStartDist">8</Setting>
<Setting name="fadeIconsEndDist">20</Setting>
<Setting name="fadeIconsEndAlpha">0</Setting>
<Setting name="fadeIconsStartAlpha">255</Setting>
<Setting name="fadeIcons">1</Setting>
<Setting name="fadeIconsStartDist">8</Setting>
</Group>
<Group name="Docs">
<Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
<Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
<Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
<Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
</Group>
<Group name="Color">
<Setting name="popupBackgroundColor">100 100 100 255</Setting>
<Setting name="dragRectColor">255 255 0 255</Setting>
<Setting name="selectionBoxColor">255 255 0 255</Setting>
<Setting name="objSelectColor">255 0 0 255</Setting>
<Setting name="objectTextColor">255 255 255 255</Setting>
<Setting name="objMouseOverColor">0 255 0 255</Setting>
<Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
</Group>
<Group name="Images">
<Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
<Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
<Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
</Group>
<Group name="Grid">
<Setting name="gridSnap">1</Setting>
<Setting name="gridColor">102 102 102 100</Setting>
<Setting name="gridSize">1</Setting>
<Setting name="gridMinorColor">51 51 51 100</Setting>
<Setting name="gridOriginColor">255 255 255 100</Setting>
</Group>
<Group name="Tools">
<Setting name="dropAtScreenCenterScalar">1</Setting>
<Setting name="boundingBoxCollision">0</Setting>
<Setting name="snapSoft">0</Setting>
<Setting name="dropAtScreenCenterMax">100</Setting>
<Setting name="TerrainSnapOffsetZ">0</Setting>
<Setting name="snapGround">0</Setting>
<Setting name="objectsUseBoxCenter">1</Setting>
<Setting name="snapSoftSize">2</Setting>
<Setting name="OffsetZValue">0.01</Setting>
</Group>
<Group name="Theme">
<Setting name="windowTitleFontColor">215 215 215 255</Setting>
<Setting name="windowTitleBGColor">50 50 50 255</Setting>
<Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
<Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
<Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
</Group>
<Group name="Render">
<Setting name="renderSelectionBox">1</Setting>
<Setting name="showMousePopupInfo">1</Setting>
<Setting name="renderPopupBackground">1</Setting>
<Setting name="renderObjText">1</Setting>
<Setting name="renderObjHandle">1</Setting>
</Group>
<Group name="Layout">
<Setting name="LayoutMode">Classic</Setting>
</Group>
</Group>
<Group name="MeshRoadEditor">
<Setting name="DefaultWidth">10</Setting>
<Setting name="topMaterialName">DefaultRoadMaterialTop</Setting>
<Setting name="DefaultNormal">0 0 1</Setting>
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
<Setting name="HoverSplineColor">255 0 0 255</Setting>
<Setting name="sideMaterialName">DefaultRoadMaterialOther</Setting>
</Group>
<Group name="AxisGizmo">
<Setting name="axisGizmoMaxScreenLen">100</Setting>
<Setting name="rotationSnap">15</Setting>
<Setting name="mouseScaleScalar">0.8</Setting>
<Setting name="renderWhenUsed">0</Setting>
<Setting name="renderInfoText">1</Setting>
<Setting name="snapRotations">0</Setting>
<Setting name="mouseRotateScalar">0.8</Setting>
<Setting name="axisGizmoMaxScreenLen">100</Setting>
<Setting name="rotationSnap">15</Setting>
<Setting name="mouseScaleScalar">0.8</Setting>
<Group name="Grid">
<Setting name="renderPlaneHashes">0</Setting>
<Setting name="forceSnapRotations">1</Setting>
<Setting name="gridSize">1 1 1</Setting>
<Setting name="planeDim">500</Setting>
<Setting name="renderPlane">0</Setting>
<Setting name="renderPlaneHashes">0</Setting>
<Setting name="gridColor">255 255 255 20</Setting>
<Setting name="snapToGrid">1</Setting>
<Setting name="forceSnapRotations">1</Setting>
<Setting name="planeDim">500</Setting>
<Setting name="gridSize">1 1 1</Setting>
</Group>
</Group>
<Group name="RiverEditor">
<Setting name="DefaultDepth">5</Setting>
<Setting name="HoverSplineColor">255 0 0 255</Setting>
<Setting name="HoverNodeColor">255 255 255 255</Setting>
<Setting name="DefaultDepth">5</Setting>
<Setting name="DefaultNormal">0 0 1</Setting>
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
<Setting name="DefaultWidth">10</Setting>
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
<Setting name="HoverNodeColor">255 255 255 255</Setting>
</Group>
<Group name="NavEditor">
<Setting name="spawnDatablock">DefaultPlayerData</Setting>
<Setting name="SpawnClass">AIPlayer</Setting>
<Setting name="backgroundBuild">1</Setting>
<Group name="DatablockEditor">
<Setting name="libraryTab">1</Setting>
</Group>
<Group name="AssetBrowser">
<Setting name="previewSize">Small</Setting>
<Group name="ShapeEditor">
<Setting name="showObjBox">1</Setting>
<Setting name="showNodes">1</Setting>
<Setting name="gridSize">0.1</Setting>
<Setting name="SunAngleZ">135</Setting>
<Setting name="SunAmbientColor">180 180 180 255</Setting>
<Setting name="SunAngleX">45</Setting>
<Setting name="ShowGrid">1</Setting>
<Setting name="gridDimension">40 40</Setting>
<Setting name="AdvancedWndVisible">1</Setting>
<Setting name="renderMounts">1</Setting>
<Setting name="showBounds">0</Setting>
<Setting name="SunDiffuseColor">255 255 255 255</Setting>
<Setting name="RenderCollision">0</Setting>
<Setting name="highlightMaterial">1</Setting>
<Setting name="backgroundColor">0 0 0 100</Setting>
</Group>
<Group name="Theme">
<Setting name="fieldBGSELColor">100 98 96 255</Setting>
<Setting name="dividerMidColor">50 49 48 255</Setting>
<Setting name="headerColor">50 49 48 255</Setting>
<Setting name="windowBackgroundColor">32 31 30 255</Setting>
<Setting name="tooltipDividerColor">72 70 68 255</Setting>
<Setting name="fieldTextHLColor">234 232 230 255</Setting>
<Setting name="dividerDarkColor">17 16 15 255</Setting>
<Setting name="fieldBGHLColor">72 70 68 255</Setting>
<Setting name="headerTextColor">236 234 232 255</Setting>
<Setting name="tooltipBGColor">43 43 43 255</Setting>
<Setting name="fieldTextNAColor">77 77 77 255</Setting>
<Setting name="tooltipTextColor">255 255 255 255</Setting>
<Setting name="fieldTextColor">178 175 172 255</Setting>
<Setting name="fieldBGColor">59 58 57 255</Setting>
<Setting name="dividerLightColor">96 94 92 255</Setting>
<Setting name="tabsHLColor">50 49 48 255</Setting>
<Setting name="fieldTextSELColor">255 255 255 255</Setting>
<Setting name="tabsColor">37 36 35 255</Setting>
<Setting name="tabsSELColor">59 58 57 255</Setting>
</Group>
<Group name="Assets">
<Group name="AssetCreation">
<Setting name="TerrainAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="PostFXAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="AutoImport">1</Setting>
<Setting name="ScriptAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
<Setting name="CubemapAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="GUIAssetSubdirectoryFormat">&lt;AssetType&gt;/OtherFolder/</Setting>
<Setting name="AssetImporDefaultConfig">TestConfig</Setting>
<Setting name="AutoImport">0</Setting>
<Group name="Browser">
<Setting name="previewTileSize">small</Setting>
<Setting name="LevelAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;AssetName&gt;/</Setting>
<Setting name="CppAssetSubdirectoryFormat">&lt;AssetType&gt;/&lt;SpecialAssetTag&gt;/</Setting>
<Setting name="TerrainMatAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
<Setting name="StatemachineAssetSubdirectoryFormat">&lt;AssetType&gt;/</Setting>
</Group>
<Group name="TerrainEditor">
<Setting name="currentAction">lowerHeight</Setting>
<Group name="Brush">
<Setting name="brushSize">40 40</Setting>
<Setting name="maxBrushSize">40 40</Setting>
<Setting name="brushType">ellipse</Setting>
<Setting name="brushPressure">1</Setting>
<Setting name="brushSoftness">1</Setting>
</Group>
<Group name="ActionValues">
<Setting name="smoothFactor">0.1</Setting>
<Setting name="setHeightVal">100</Setting>
<Setting name="softSelectDefaultFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="SlopeMinAngle">0</Setting>
<Setting name="softSelectFilter">1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000</Setting>
<Setting name="softSelectRadius">50</Setting>
<Setting name="scaleVal">1</Setting>
<Setting name="adjustHeightVal">10</Setting>
<Setting name="SlopeMaxAngle">90</Setting>
<Setting name="noiseFactor">1</Setting>
</Group>
</Group>
<Group name="LevelInformation">
<Setting name="levelsDirectory">data/FPSGameplay/levels</Setting>
<Group name="levels">
<Group name="BlankRoom.mis">
<Setting name="cameraSpeed">25</Setting>
</Group>
<Group name="PbrMatTest.mis">
<Setting name="cameraSpeed">5</Setting>
</Group>
<Group name="BlankRoom.mis">
<Setting name="cameraSpeed">25</Setting>
</Group>
<Group name="Empty Terrain.mis">
<Setting name="cameraSpeed">25</Setting>
</Group>
<Group name="EmptyLevel.mis">
<Setting name="cameraSpeed">25</Setting>
</Group>
</Group>
</Group>
<Group name="MeshRoadEditor">
<Setting name="HoverSplineColor">255 0 0 255</Setting>
<Setting name="topMaterialName">DefaultRoadMaterialTop</Setting>
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
<Setting name="DefaultWidth">10</Setting>
<Setting name="DefaultNormal">0 0 1</Setting>
<Setting name="sideMaterialName">DefaultRoadMaterialOther</Setting>
</Group>
<Group name="RoadEditor">
<Setting name="materialName">DefaultDecalRoadMaterial</Setting>
<Setting name="HoverNodeColor">255 255 255 255</Setting>
<Setting name="DefaultWidth">10</Setting>
<Setting name="SelectedSplineColor">0 255 0 255</Setting>
</Group>
<Group name="NavEditor">
<Setting name="SpawnClass">AIPlayer</Setting>
<Setting name="backgroundBuild">1</Setting>
<Setting name="spawnDatablock">DefaultPlayerData</Setting>
</Group>
<Group name="ConvexEditor">
<Setting name="materialName">Grid_512_Orange</Setting>
</Group>
<Group name="DatablockEditor">
<Setting name="libraryTab">1</Setting>
<Group name="Assets">
<Setting name="AutoImport">0</Setting>
<Setting name="AssetImporDefaultConfig">TestConfig</Setting>
<Group name="Browser">
<Setting name="previewTileSize">small</Setting>
</Group>
</Group>
<Group name="AssetBrowser">
<Setting name="previewSize">Small</Setting>
</Group>
</EditorSettings>

View file

@ -121,7 +121,7 @@ function ShapeEditorPlugin::onWorldEditorStartup(%this)
// Add ourselves to the Editor Settings window
exec( "./gui/ShapeEditorSettingsTab.gui" );
ESettingsWindow.addTabPage( EShapeEditorSettingsPage );
//ESettingsWindow.addTabPage( EShapeEditorSettingsPage );
GuiWindowCtrl::attach(ShapeEdPropWindow, ShapeEdSelectWindow);
ShapeEdAnimWindow.resize( -1, 526, 593, 53 );

View file

@ -200,7 +200,7 @@
canSaveDynamicFields = "1";
class = "ESettingsWindowTextEdit";
editorSettingsRead = "EditorGui.readWorldEditorSettings();";
editorSettingsValue = "WorldEditor/newLevelFile";
editorSettingsValue = "";
editorSettingsWrite = "EditorGui.writeWorldEditorSettings();";
};
};

View file

@ -264,6 +264,8 @@ function EditorGui::init(%this)
%obj = EditorPluginSet.getObject( %i );
%obj.onWorldEditorStartup();
}
callOnModules("onWorldEditorStartup", "Tools");
// With everything loaded, start up the settings window
ESettingsWindow.startup();
@ -610,7 +612,7 @@ function EditorGui::onNewLevelLoaded( %this, %levelName )
{
%this.levelName = %levelName;
%this.setupDefaultCameraSettings();
ECameraSettingsPage.init();
//ECameraSettingsPage.init();
EditorCameraSpeedOptions.setupDefaultState();
new ScriptObject( EditorMissionCleanup )

View file

@ -33,7 +33,6 @@ EditorSettings.setDefaultValue( "displayType", $EditTsCtrl::Display
EditorSettings.setDefaultValue( "orthoFOV", "50" );
EditorSettings.setDefaultValue( "orthoShowGrid", "1" );
EditorSettings.setDefaultValue( "currentEditor", "WorldEditorInspectorPlugin" );
EditorSettings.setDefaultValue( "newLevelFile", "tools/levels/BlankRoom.mis" );
if( isFile( "C:/Program Files/Torsion/Torsion.exe" ) )
EditorSettings.setDefaultValue( "torsionPath", "C:/Program Files/Torsion/Torsion.exe" );

View file

@ -220,7 +220,9 @@ function EditorNewLevel( %file )
}
if( %file $= "" )
%file = EditorSettings.value( "WorldEditor/newLevelFile" );
{
%file = "tools/levels/DefaultEditorLevel.mis";
}
if( !$missionRunning )
{
@ -235,6 +237,33 @@ function EditorNewLevel( %file )
EditorGui.saveAs = true;
}
function EditorSaveAsDefaultLevel()
{
MessageBoxYesNo("Save as Default?", "This will save the currently active root scene as the default level the editor loads when it is opened. Continue?",
"doEditorSaveAsDefaultLevel();", "");
}
function doEditorSaveAsDefaultLevel()
{
%success = getScene(0).save("tools/levels/DefaultEditorLevel.mis");
}
function EditorResetDefaultLevel()
{
MessageBoxYesNo("Reset Default?", "This will reset the default level for the editor back to the original. Continue?",
"doEditorResetDefaultLevel();", "");
}
function doEditorResetDefaultLevel()
{
%templatePath = makeFullPath("tools/levels/EditorTemplateLevel.mis");
%defaultPath = makeFullPath("tools/levels/DefaultEditorLevel.mis");
%fileCopy = -1;
if(isFile(%templatePath) && isFile(%defaultPath))
%fileCopy = pathCopy(%templatePath, %defaultPath, false);
}
function EditorSaveMissionMenu()
{
if(EditorGui.saveAs)

View file

@ -141,6 +141,9 @@ function EditorGui::buildMenus(%this)
%fileMenu.appendItem("Save Level" TAB %cmdCtrl SPC "S" TAB "EditorSaveMissionMenu();");
%fileMenu.appendItem("Save Level As..." TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"LevelAsset\", AssetBrowser.selectedModule, \"EditorSaveMissionAs\");");
%fileMenu.appendItem("-");
%fileMenu.appendItem("Save Current Scene as Editor Default" TAB "" TAB "EditorSaveAsDefaultLevel();");
%fileMenu.appendItem("Reset Editor Default" TAB "" TAB "EditorResetDefaultLevel();");
%fileMenu.appendItem("-");
if( $platform $= "windows" )
{

View file

@ -135,7 +135,7 @@ function toggleDebugVizMode( %mode )
}
else
{
if($Viz_SurfacePropertiesModeVar != "" && $Viz_SurfacePropertiesModeVar != -1)
if($Viz_SurfacePropertiesModeVar !$= "" && $Viz_SurfacePropertiesModeVar != -1)
Viz_SurfacePropertiesPFX.enable();
}

View file

@ -105,8 +105,8 @@ function setupEditorVisibilityMenu()
item[ 6 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();";
};
%probespopup.enableItem(5, false);
%probespopup.enableItem(6, false);
%debugRenderpopup.enableItem(5, false);
%debugRenderpopup.enableItem(6, false);
//
//Lighting stuff

View file

@ -359,6 +359,12 @@ if(EXISTS ${TORQUE_APP_DIR}/game/data)
addInclude("${TORQUE_APP_DIR}/game/data")
addPathRec("${TORQUE_APP_DIR}/game/data")
endif()
if(EXISTS ${TORQUE_APP_DIR}/game/tools)
message("Reading modules in ${TORQUE_APP_DIR}/game/tools path...")
addInclude("${TORQUE_APP_DIR}/game/tools")
addPathRec("${TORQUE_APP_DIR}/game/tools")
endif()
###############################################################################
# modular paths
@ -664,6 +670,7 @@ if (TORQUE_OPENGL)
addLib(glad)
endif()
addLib(assimp)
addLib(meshOptimizer)
if(WIN32)
# copy pasted from T3D build system, some might not be needed