mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #308 from Areloch/MiscFixes20200831
Misc fixes for Asset Browser navigation, scene asset utilization and editor settings
This commit is contained in:
commit
c2bbab774a
17 changed files with 127 additions and 61 deletions
|
|
@ -253,14 +253,21 @@ bool Scene::saveScene(StringTableEntry fileName)
|
||||||
|
|
||||||
//Next, lets build out our
|
//Next, lets build out our
|
||||||
Vector<StringTableEntry> utilizedAssetsList;
|
Vector<StringTableEntry> utilizedAssetsList;
|
||||||
for (U32 i = 0; i < mPermanentObjects.size(); i++)
|
for (U32 i = 0; i < size(); i++)
|
||||||
{
|
{
|
||||||
mPermanentObjects[i]->getUtilizedAssets(&utilizedAssetsList);
|
getUtilizedAssetsFromSceneObject(getObject(i), &utilizedAssetsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (U32 i = 0; i < utilizedAssetsList.size(); i++)
|
for (U32 i = 0; i < utilizedAssetsList.size(); i++)
|
||||||
{
|
{
|
||||||
levelAssetDef->addAssetDependencyField("staticObjectAssetDependency", utilizedAssetsList[i]);
|
char depSlotName[50];
|
||||||
|
dSprintf(depSlotName, sizeof(depSlotName), "%s%d", "staticObjectAssetDependency", i);
|
||||||
|
|
||||||
|
char depValue[255];
|
||||||
|
dSprintf(depValue, sizeof(depValue), "@Asset=%s", utilizedAssetsList[i]);
|
||||||
|
|
||||||
|
levelAssetDef->setDataField(StringTable->insert(depSlotName), NULL, StringTable->insert(depValue));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
saveSuccess = levelAssetDef->saveAsset();
|
saveSuccess = levelAssetDef->saveAsset();
|
||||||
|
|
@ -268,6 +275,25 @@ bool Scene::saveScene(StringTableEntry fileName)
|
||||||
return saveSuccess;
|
return saveSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scene::getUtilizedAssetsFromSceneObject(SimObject* object, Vector<StringTableEntry>* usedAssetsList)
|
||||||
|
{
|
||||||
|
SceneObject* obj = dynamic_cast<SceneObject*>(object);
|
||||||
|
if(obj)
|
||||||
|
obj->getUtilizedAssets(usedAssetsList);
|
||||||
|
|
||||||
|
SimGroup* group = dynamic_cast<SimGroup*>(object);
|
||||||
|
if (group)
|
||||||
|
{
|
||||||
|
for (U32 c = 0; c < group->size(); c++)
|
||||||
|
{
|
||||||
|
SceneObject* childObj = dynamic_cast<SceneObject*>(group->getObject(c));
|
||||||
|
|
||||||
|
//Recurse down
|
||||||
|
getUtilizedAssetsFromSceneObject(childObj, usedAssetsList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
Vector<SceneObject*> Scene::getObjectsByClass(String className, bool checkSubscenes)
|
Vector<SceneObject*> Scene::getObjectsByClass(String className, bool checkSubscenes)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,8 @@ public:
|
||||||
//
|
//
|
||||||
Vector<SceneObject*> getObjectsByClass(String className, bool checkSubscenes);
|
Vector<SceneObject*> getObjectsByClass(String className, bool checkSubscenes);
|
||||||
|
|
||||||
|
void getUtilizedAssetsFromSceneObject(SimObject* object, Vector<StringTableEntry>* usedAssetsList);
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
Vector<T*> getObjectsByClass(bool checkSubscenes);
|
Vector<T*> getObjectsByClass(bool checkSubscenes);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -558,6 +558,19 @@ bool Prefab::buildExportPolyList(ColladaUtils::ExportData* exportData, const Box
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Prefab::getUtilizedAssets(Vector<StringTableEntry>* usedAssetsList)
|
||||||
|
{
|
||||||
|
Vector<SceneObject*> foundObjects;
|
||||||
|
mChildGroup->findObjectByType(foundObjects);
|
||||||
|
|
||||||
|
for (S32 i = 0; i < foundObjects.size(); i++)
|
||||||
|
{
|
||||||
|
SceneObject* child = foundObjects[i];
|
||||||
|
|
||||||
|
child->getUtilizedAssets(usedAssetsList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ExplodePrefabUndoAction::ExplodePrefabUndoAction( Prefab *prefab )
|
ExplodePrefabUndoAction::ExplodePrefabUndoAction( Prefab *prefab )
|
||||||
: UndoAction( "Explode Prefab" )
|
: UndoAction( "Explode Prefab" )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@ public:
|
||||||
|
|
||||||
bool buildExportPolyList(ColladaUtils::ExportData* exportData, const Box3F &box, const SphereF &);
|
bool buildExportPolyList(ColladaUtils::ExportData* exportData, const Box3F &box, const SphereF &);
|
||||||
|
|
||||||
|
virtual void getUtilizedAssets(Vector<StringTableEntry>* usedAssetsList);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void _closeFile( bool removeFileNotify );
|
void _closeFile( bool removeFileNotify );
|
||||||
|
|
|
||||||
|
|
@ -511,8 +511,9 @@ bool TSStatic::_createShape()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set up the material slot vars for easy manipulation
|
//Set up the material slot vars for easy manipulation
|
||||||
S32 materialCount = mShape->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
|
/*S32 materialCount = mShape->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
|
||||||
|
|
||||||
|
//Temporarily disabled until fixup of materialName->assetId lookup logic is sorted for easy persistance
|
||||||
if (isServerObject())
|
if (isServerObject())
|
||||||
{
|
{
|
||||||
char matFieldName[128];
|
char matFieldName[128];
|
||||||
|
|
@ -526,15 +527,13 @@ bool TSStatic::_createShape()
|
||||||
|
|
||||||
setDataField(matFld, NULL, materialname);
|
setDataField(matFld, NULL, materialname);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSStatic::onDynamicModified(const char* slotName, const char* newValue)
|
void TSStatic::onDynamicModified(const char* slotName, const char* newValue)
|
||||||
{
|
{
|
||||||
bool isSrv = isServerObject();
|
|
||||||
|
|
||||||
if (FindMatch::isMatch("materialslot*", slotName, false))
|
if (FindMatch::isMatch("materialslot*", slotName, false))
|
||||||
{
|
{
|
||||||
if (!getShape())
|
if (!getShape())
|
||||||
|
|
@ -1693,8 +1692,9 @@ void TSStatic::updateMaterials()
|
||||||
|
|
||||||
void TSStatic::getUtilizedAssets(Vector<StringTableEntry>* usedAssetsList)
|
void TSStatic::getUtilizedAssets(Vector<StringTableEntry>* usedAssetsList)
|
||||||
{
|
{
|
||||||
if(!mShapeAsset.isNull())
|
if(!mShapeAsset.isNull() && mShapeAsset->getAssetId() != StringTable->insert("Core_Rendering:noShape"))
|
||||||
usedAssetsList->push_back_unique(mShapeAssetId);
|
usedAssetsList->push_back_unique(mShapeAsset->getAssetId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -843,6 +843,17 @@ bool SimGroup::processArguments(S32, ConsoleValueRef *argv)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SimObject* SimGroup::getObject(const S32& index)
|
||||||
|
{
|
||||||
|
if (index < 0 || index >= size())
|
||||||
|
{
|
||||||
|
Con::errorf("Set::getObject - index out of range.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (*this)[index];
|
||||||
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
SimObject* SimGroupIterator::operator++()
|
SimObject* SimGroupIterator::operator++()
|
||||||
|
|
|
||||||
|
|
@ -465,6 +465,8 @@ class SimGroup: public SimSet
|
||||||
|
|
||||||
virtual bool processArguments( S32 argc, ConsoleValueRef *argv );
|
virtual bool processArguments( S32 argc, ConsoleValueRef *argv );
|
||||||
|
|
||||||
|
virtual SimObject* getObject(const S32& index);
|
||||||
|
|
||||||
DECLARE_CONOBJECT( SimGroup );
|
DECLARE_CONOBJECT( SimGroup );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1423,7 +1423,7 @@ void TerrainBlock::getMinMaxHeight( F32 *minHeight, F32 *maxHeight ) const
|
||||||
void TerrainBlock::getUtilizedAssets(Vector<StringTableEntry>* usedAssetsList)
|
void TerrainBlock::getUtilizedAssets(Vector<StringTableEntry>* usedAssetsList)
|
||||||
{
|
{
|
||||||
if (!mTerrainAsset.isNull())
|
if (!mTerrainAsset.isNull())
|
||||||
usedAssetsList->push_back_unique(mTerrainAssetId);
|
usedAssetsList->push_back_unique(mTerrainAsset->getAssetId());
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Console Methods
|
// Console Methods
|
||||||
|
|
|
||||||
|
|
@ -290,10 +290,12 @@ function AssetBrowser::showDialog( %this, %AssetTypeFilter, %selectCallback, %ta
|
||||||
{
|
{
|
||||||
//we're not in selection mode, so just hide the select button
|
//we're not in selection mode, so just hide the select button
|
||||||
%this-->SelectButton.setHidden(true);
|
%this-->SelectButton.setHidden(true);
|
||||||
|
%this.selectMode = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%this-->SelectButton.setHidden(false);
|
%this-->SelectButton.setHidden(false);
|
||||||
|
%this.selectMode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetBrowser.loadDirectories();
|
AssetBrowser.loadDirectories();
|
||||||
|
|
@ -486,38 +488,15 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
%previewButton.moduleName = %moduleName;
|
%previewButton.moduleName = %moduleName;
|
||||||
%previewButton.assetType = %assetType;
|
%previewButton.assetType = %assetType;
|
||||||
|
|
||||||
if(%assetType $= "ShapeAsset")
|
%previewButton.iconBitmap = %this.previewData.previewImage;
|
||||||
{
|
|
||||||
%previewButton.iconBitmap = "tools/assetBrowser/art/genericAssetIcon";
|
|
||||||
//%previewButton.profile = AssetBrowserPreviewShapeAsset;
|
|
||||||
//%previewButton-->shapeAssetView.setModel(%previewImage);
|
|
||||||
//%previewButton-->shapeAssetView.extent = %previewSize;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%previewButton.iconBitmap = %this.previewData.previewImage;
|
|
||||||
//%previewButton-->assetPreviewImage.extent = %previewSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
%previewButton.profile = "AssetBrowserPreview" @ %previewButton.assetType;
|
%previewButton.profile = "AssetBrowserPreview" @ %previewButton.assetType;
|
||||||
|
|
||||||
//%previewButton-->AssetPreviewBorderButton.extent = %previewSize;
|
|
||||||
|
|
||||||
//%previewButton-->AssetPreviewButton.internalName = %this.previewData.assetName@"Border";
|
|
||||||
//%previewButton-->Button.extent = %previewSize.x + %previewBounds SPC %previewSize.y + 24;
|
|
||||||
%previewButton.tooltip = %this.previewData.tooltip;
|
%previewButton.tooltip = %this.previewData.tooltip;
|
||||||
%previewButton.Command = "AssetBrowser.updateSelection( $ThisControl.assetName, $ThisControl.moduleName );";
|
%previewButton.Command = "AssetBrowser.updateSelection( $ThisControl.assetName, $ThisControl.moduleName );";
|
||||||
%previewButton.altCommand = %doubleClickCommand;
|
%previewButton.altCommand = %doubleClickCommand;
|
||||||
//%previewButton-->AssetPreviewButton.icon = %this.previewData.previewImage;
|
|
||||||
|
|
||||||
%previewButton.text = %this.previewData.assetName;
|
%previewButton.text = %this.previewData.assetName;
|
||||||
%previewButton.text.originalAssetName = %this.previewData.assetName;
|
%previewButton.text.originalAssetName = %this.previewData.assetName;
|
||||||
|
|
||||||
//%previewButton-->AssetNameLabel.position = 0 SPC %previewSize.y + %previewBounds - 16;
|
|
||||||
//%previewButton-->AssetNameLabel.extent = %previewSize.x + %previewBounds SPC 16;
|
|
||||||
//%previewButton-->AssetNameLabel.text = %this.previewData.assetName;
|
|
||||||
//%previewButton-->AssetNameLabel.originalAssetName = %this.previewData.assetName;
|
|
||||||
|
|
||||||
// add to the gui control array
|
// add to the gui control array
|
||||||
AssetBrowser-->assetList.add(%previewButton);
|
AssetBrowser-->assetList.add(%previewButton);
|
||||||
|
|
@ -690,14 +669,7 @@ function AssetBrowser::loadDirectories( %this )
|
||||||
|
|
||||||
function AssetBrowser::updateSelection( %this, %asset, %moduleName )
|
function AssetBrowser::updateSelection( %this, %asset, %moduleName )
|
||||||
{
|
{
|
||||||
//If we're navigating a folder, just nav to it and be done
|
/*%isAssetBorder = 0;
|
||||||
/*if(isDirectory(%moduleName))
|
|
||||||
{
|
|
||||||
AssetBrowser.navigateTo(%moduleName @ "/" @ %asset);
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
%isAssetBorder = 0;
|
|
||||||
eval("%isAssetBorder = isObject(AssetBrowser-->"@%asset@"Border);");
|
eval("%isAssetBorder = isObject(AssetBrowser-->"@%asset@"Border);");
|
||||||
if( %isAssetBorder )
|
if( %isAssetBorder )
|
||||||
{
|
{
|
||||||
|
|
@ -709,14 +681,24 @@ function AssetBrowser::updateSelection( %this, %asset, %moduleName )
|
||||||
if( %isAssetBorderPrevious )
|
if( %isAssetBorderPrevious )
|
||||||
{
|
{
|
||||||
eval( "AssetBrowser-->"@%this.prevSelectedMaterialHL@"Border.setStateOn(0);");
|
eval( "AssetBrowser-->"@%this.prevSelectedMaterialHL@"Border.setStateOn(0);");
|
||||||
}
|
}*/
|
||||||
|
|
||||||
AssetBrowser.selectedMaterial = %asset;
|
//If we had an existing selected assetDef, clear the reference
|
||||||
|
if(isObject(AssetBrowser.selectedAssetDef))
|
||||||
|
AssetDatabase.releaseAsset(AssetBrowser.selectedAssetDef.getAssetId());
|
||||||
|
|
||||||
|
//AssetBrowser.selectedMaterial = %asset;
|
||||||
AssetBrowser.selectedAsset = %moduleName@":"@%asset;
|
AssetBrowser.selectedAsset = %moduleName@":"@%asset;
|
||||||
|
|
||||||
|
//If it's got slashes, it's a path so it's actually a folder item, not an asset
|
||||||
|
if(strstr(%moduleName, "/") != -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Otherwise, it's an asset so we'll select the definition while we're at it
|
||||||
AssetBrowser.selectedAssetDef = AssetDatabase.acquireAsset(AssetBrowser.selectedAsset);
|
AssetBrowser.selectedAssetDef = AssetDatabase.acquireAsset(AssetBrowser.selectedAsset);
|
||||||
//AssetBrowser.selectedPreviewImagePath = %previewImagePath;
|
//AssetBrowser.selectedPreviewImagePath = %previewImagePath;
|
||||||
|
|
||||||
%this.prevSelectedMaterialHL = %asset;
|
//%this.prevSelectedMaterialHL = %asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::loadCollectionSets(%this)
|
function AssetBrowser::loadCollectionSets(%this)
|
||||||
|
|
@ -916,7 +898,7 @@ function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc)
|
||||||
//also need to update instances... i guess which is the tricky part....
|
//also need to update instances... i guess which is the tricky part....
|
||||||
function AssetBrowser::showDeleteDialog( %this )
|
function AssetBrowser::showDeleteDialog( %this )
|
||||||
{
|
{
|
||||||
%material = AssetBrowser.selectedMaterial;
|
%material = AssetBrowser.selectedAsset;
|
||||||
%secondFilter = "MaterialFilterMappedArray";
|
%secondFilter = "MaterialFilterMappedArray";
|
||||||
%secondFilterName = "Mapped";
|
%secondFilterName = "Mapped";
|
||||||
|
|
||||||
|
|
@ -1891,20 +1873,20 @@ function AssetBrowser::navigateTo(%this, %address, %historyNav)
|
||||||
%address = strreplace(%address, "/", "");
|
%address = strreplace(%address, "/", "");
|
||||||
|
|
||||||
//Don't bother navigating if it's to the place we already are
|
//Don't bother navigating if it's to the place we already are
|
||||||
if(AssetBrowser.dirHandler.currentAddress !$= %address)
|
if(%this.dirHandler.currentAddress !$= %address)
|
||||||
{
|
{
|
||||||
AssetBrowser.dirHandler.navigateTo(%address, %historyNav);
|
%this.dirHandler.navigateTo(%address, %historyNav);
|
||||||
|
|
||||||
//%this.updateNavigationBreadcrumb(%address);
|
//%this.updateNavigationBreadcrumb(%address);
|
||||||
|
|
||||||
AssetBrowser.lastValidNavPath = %address;
|
%this.lastValidNavPath = %address;
|
||||||
AssetBrowser-->navPath.setText(%address);
|
%this-->navPath.setText(%address);
|
||||||
|
|
||||||
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
|
%module = %this.dirHandler.getModuleFromAddress(%address);
|
||||||
if(%module !$= "")
|
if(%module !$= "")
|
||||||
{
|
{
|
||||||
//legit module, so set it as current target
|
//legit module, so set it as current target
|
||||||
AssetBrowser.SelectedModule = %module.moduleId;
|
%this.SelectedModule = %module.moduleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%this.hasLooseFilesInDir())
|
if(%this.hasLooseFilesInDir())
|
||||||
|
|
@ -1927,13 +1909,18 @@ function AssetBrowser::navigateHistoryForward(%this)
|
||||||
|
|
||||||
%this.updateNavigationBreadcrumb();
|
%this.updateNavigationBreadcrumb();
|
||||||
|
|
||||||
|
%address = %this.dirHandler.currentAddress;
|
||||||
|
|
||||||
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
|
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
|
||||||
if(%module !$= "")
|
if(%module !$= "")
|
||||||
{
|
{
|
||||||
//legit module, so set it as current target
|
//legit module, so set it as current target
|
||||||
AssetBrowser.SelectedModule = %module.moduleId;
|
%this.SelectedModule = %module.moduleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%this.lastValidNavPath = %address;
|
||||||
|
%this-->navPath.setText(%address);
|
||||||
|
|
||||||
%this.rebuildAssetArray();
|
%this.rebuildAssetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1943,13 +1930,18 @@ function AssetBrowser::navigateHistoryBack(%this)
|
||||||
|
|
||||||
%this.updateNavigationBreadcrumb();
|
%this.updateNavigationBreadcrumb();
|
||||||
|
|
||||||
%module = AssetBrowser.dirHandler.getModuleFromAddress(%address);
|
%address = %this.dirHandler.currentAddress;
|
||||||
|
|
||||||
|
%module = %this.dirHandler.getModuleFromAddress(%address);
|
||||||
if(%module !$= "")
|
if(%module !$= "")
|
||||||
{
|
{
|
||||||
//legit module, so set it as current target
|
//legit module, so set it as current target
|
||||||
AssetBrowser.SelectedModule = %module.moduleId;
|
%this.SelectedModule = %module.moduleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%this.lastValidNavPath = %address;
|
||||||
|
%this-->navPath.setText(%address);
|
||||||
|
|
||||||
%this.rebuildAssetArray();
|
%this.rebuildAssetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,10 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
|
||||||
@ "EditorGui.setEditor(MaterialEditorPlugin); "
|
@ "EditorGui.setEditor(MaterialEditorPlugin); "
|
||||||
@ "AssetBrowser.hideDialog();";*/
|
@ "AssetBrowser.hideDialog();";*/
|
||||||
|
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.editAsset(" @ %assetDef @ ");";
|
if(%this.selectMode)
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||||
|
else
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||||
|
|
||||||
%test = %assetDef.materialDefinitionName.diffuseMapAsset[0];
|
%test = %assetDef.materialDefinitionName.diffuseMapAsset[0];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
|
||||||
%previewData.assetName = %assetDef.assetName;
|
%previewData.assetName = %assetDef.assetName;
|
||||||
%previewData.assetPath = %assetDef.fileName;
|
%previewData.assetPath = %assetDef.fileName;
|
||||||
|
|
||||||
%previewData.previewImage = %assetDef.fileName;
|
%previewData.previewImage = "tools/assetBrowser/art/genericAssetIcon";//%assetDef.fileName;
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %assetDef.assetName;
|
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||||
%previewData.assetDesc = %assetDef.description;
|
%previewData.assetDesc = %assetDef.description;
|
||||||
|
|
@ -256,6 +256,10 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
|
||||||
"Asset Definition ID: " @ %assetDef @ "\n" @
|
"Asset Definition ID: " @ %assetDef @ "\n" @
|
||||||
"Shape File path: " @ %assetDef.getShapeFile();
|
"Shape File path: " @ %assetDef.getShapeFile();
|
||||||
|
|
||||||
|
if(%this.selectMode)
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||||
|
else
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
|
function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,11 @@ function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
|
||||||
%previewData.assetPath = %assetDef.soundFilePath;
|
%previewData.assetPath = %assetDef.soundFilePath;
|
||||||
//%previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
|
//%previewData.doubleClickCommand = "EditorOpenFileInTorsion( "@%previewData.assetPath@", 0 );";
|
||||||
|
|
||||||
|
if(%this.selectMode)
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||||
|
else
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||||
|
|
||||||
%previewData.previewImage = "tools/assetBrowser/art/soundIcon";
|
%previewData.previewImage = "tools/assetBrowser/art/soundIcon";
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %assetDef.assetName;
|
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ function directoryHandler::navigateTo(%this, %address, %historyNav, %selectionNa
|
||||||
{
|
{
|
||||||
%this.foreHistoryList.empty();
|
%this.foreHistoryList.empty();
|
||||||
|
|
||||||
if(%oldAddress !$= "")
|
if(%this.oldAddress !$= "")
|
||||||
%this.prevHistoryList.push_front(%this.oldAddress);
|
%this.prevHistoryList.push_front(%this.oldAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -359,8 +359,6 @@ function ESettingsWindow::getSceneEditorSettings(%this)
|
||||||
SettingsInspector.startGroup("Misc");
|
SettingsInspector.startGroup("Misc");
|
||||||
//SettingsInspector.addSettingsField("WorldEditor/forceLoadDAE", "Force Load DAE", "bool", "");
|
//SettingsInspector.addSettingsField("WorldEditor/forceLoadDAE", "Force Load DAE", "bool", "");
|
||||||
SettingsInspector.addSettingsField("WorldEditor/forceLoadDAE", "Force Load DAE", "bool", "");
|
SettingsInspector.addSettingsField("WorldEditor/forceLoadDAE", "Force Load DAE", "bool", "");
|
||||||
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterScalar", "Screen Center Scalar", "float", "");
|
|
||||||
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterMax", "Screen Center Max", "float", "");
|
|
||||||
SettingsInspector.endGroup();
|
SettingsInspector.endGroup();
|
||||||
|
|
||||||
SettingsInspector.startGroup("Layout");
|
SettingsInspector.startGroup("Layout");
|
||||||
|
|
@ -377,6 +375,7 @@ function ESettingsWindow::getSceneEditorSettings(%this)
|
||||||
SettingsInspector.addSettingsField("WorldEditor/Tools/objectsUseBoxCenter", "Objects Use Box Center", "bool", "1");
|
SettingsInspector.addSettingsField("WorldEditor/Tools/objectsUseBoxCenter", "Objects Use Box Center", "bool", "1");
|
||||||
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterScalar", "Drop at Sceen Center Scalar", "bool", "1");
|
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterScalar", "Drop at Sceen Center Scalar", "bool", "1");
|
||||||
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterMax", "Drop at Screen Center Max Dist.", "float", "100");
|
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterMax", "Drop at Screen Center Max Dist.", "float", "100");
|
||||||
|
SettingsInspector.addSettingsField("WorldEditor/Tools/UseGroupCenter", "Use Group Center when snapping", "bool", "0");
|
||||||
SettingsInspector.endGroup();
|
SettingsInspector.endGroup();
|
||||||
|
|
||||||
SettingsInspector.startGroup("Images");
|
SettingsInspector.startGroup("Images");
|
||||||
|
|
|
||||||
|
|
@ -1651,6 +1651,7 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
||||||
%popup.item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject(" @ %popup.object @ ");";
|
%popup.item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject(" @ %popup.object @ ");";
|
||||||
%popup.item[ 2 ] = "Inspect" TAB "" TAB "inspectObject(" @ %popup.object @ ");";
|
%popup.item[ 2 ] = "Inspect" TAB "" TAB "inspectObject(" @ %popup.object @ ");";
|
||||||
%popup.item[ 3 ] = "-";
|
%popup.item[ 3 ] = "-";
|
||||||
|
%popup.item[ 4 ] = "Add SimGroup" TAB "" TAB "EWorldEditor.addSimGroup( false );";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2067,6 +2068,9 @@ function EWorldEditor::syncGui( %this )
|
||||||
ESnapOptions-->GridSize.setText( EWorldEditor.getGridSize() );
|
ESnapOptions-->GridSize.setText( EWorldEditor.getGridSize() );
|
||||||
|
|
||||||
ESnapOptions-->GridSnapButton.setStateOn( %this.getGridSnap() );
|
ESnapOptions-->GridSnapButton.setStateOn( %this.getGridSnap() );
|
||||||
|
|
||||||
|
%this.UseGroupCenter = EditorSettings.value("WorldEditor/Tools/UseGroupCenter");
|
||||||
|
|
||||||
ESnapOptions-->GroupSnapButton.setStateOn( %this.UseGroupCenter );
|
ESnapOptions-->GroupSnapButton.setStateOn( %this.UseGroupCenter );
|
||||||
SnapToBar-->objectGridSnapBtn.setStateOn( %this.getGridSnap() );
|
SnapToBar-->objectGridSnapBtn.setStateOn( %this.getGridSnap() );
|
||||||
ESnapOptions-->NoSnapButton.setStateOn( !%this.stickToGround && !%this.getSoftSnap() && !%this.getGridSnap() );
|
ESnapOptions-->NoSnapButton.setStateOn( !%this.stickToGround && !%this.getSoftSnap() && !%this.getGridSnap() );
|
||||||
|
|
@ -2090,7 +2094,7 @@ function EWorldEditor::syncToolPalette( %this )
|
||||||
function EWorldEditor::addSimGroup( %this, %groupCurrentSelection )
|
function EWorldEditor::addSimGroup( %this, %groupCurrentSelection )
|
||||||
{
|
{
|
||||||
%activeSelection = %this.getActiveSelection();
|
%activeSelection = %this.getActiveSelection();
|
||||||
if ( %activeSelection.getObjectIndex( getScene(0) ) != -1 )
|
if ( %groupCurrentSelection && %activeSelection.getObjectIndex( getScene(0) ) != -1 )
|
||||||
{
|
{
|
||||||
toolsMessageBoxOK( "Error", "Cannot add Scene to a new SimGroup" );
|
toolsMessageBoxOK( "Error", "Cannot add Scene to a new SimGroup" );
|
||||||
return;
|
return;
|
||||||
|
|
@ -2324,6 +2328,7 @@ function toggleSnappingOptions( %var )
|
||||||
else if( %var $= "byGroup" )
|
else if( %var $= "byGroup" )
|
||||||
{
|
{
|
||||||
EWorldEditor.UseGroupCenter = !EWorldEditor.UseGroupCenter;
|
EWorldEditor.UseGroupCenter = !EWorldEditor.UseGroupCenter;
|
||||||
|
EditorSettings.setValue("WorldEditor/Tools/UseGroupCenter", EWorldEditor.UseGroupCenter );
|
||||||
ESnapOptions->GroupSnapButton.setStateOn(EWorldEditor.UseGroupCenter);
|
ESnapOptions->GroupSnapButton.setStateOn(EWorldEditor.UseGroupCenter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ EditorSettings.setDefaultValue( "boundingBoxCollision", "0" );
|
||||||
EditorSettings.setDefaultValue( "objectsUseBoxCenter", "1" );
|
EditorSettings.setDefaultValue( "objectsUseBoxCenter", "1" );
|
||||||
EditorSettings.setDefaultValue( "dropAtScreenCenterScalar","1.0" );
|
EditorSettings.setDefaultValue( "dropAtScreenCenterScalar","1.0" );
|
||||||
EditorSettings.setDefaultValue( "dropAtScreenCenterMax", "100.0" );
|
EditorSettings.setDefaultValue( "dropAtScreenCenterMax", "100.0" );
|
||||||
|
EditorSettings.setDefaultValue( "UseGroupCenter", "0" );
|
||||||
EditorSettings.endGroup();
|
EditorSettings.endGroup();
|
||||||
|
|
||||||
EditorSettings.beginGroup( "Render" );
|
EditorSettings.beginGroup( "Render" );
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ function ESnapOptions::ToggleVisibility()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
EWorldEditor.syncGui();
|
||||||
ESnapOptions.setVisible(true);
|
ESnapOptions.setVisible(true);
|
||||||
ESnapOptions.selectWindow();
|
ESnapOptions.selectWindow();
|
||||||
ESnapOptions.setCollapseGroup(false);
|
ESnapOptions.setCollapseGroup(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue