Added ImageAsset type mode for cubemaps.

Added new inspector type TypeShapeAssetId which is processed as a assetId string instead of an AssetPtr.
Added utility function to ShapeAsset to getAssetIdByFilename, which lets you find - if any exist - the asset that utilizes a given loose file. If it doesn't find one, it can attempt to run an auto-import if the editor settings allow, then proceed.
Fixed callback of the shapeAsset inspector fields so the Open in Shape Editor correctly binds the asset's shape to the editor for modification.
Added function to open a shapeAssetId in the shape editor to facilitate the above.
Added additional check to findShapeConstructor to look up the full path of the shape in the cases where a full path is provided instead of a local path. This prevents the shapeConstructor from not finding shapes that absolutely exist.
Added beginnings of Datablock representation in Asset Browser.
Fixed a few minor issues with asset auto import causing false positive errors, preventing Import or erroneous logging.
Fixed issue where editing of asset import configs didn't save.
Fixed logic of materials in asset browser so they will open in the material editor as expected.
Re-enabled AutoImport of assets editor setting by default.
This commit is contained in:
Areloch 2020-04-15 12:15:12 -05:00
parent 72b489fe25
commit 157b114ec7
15 changed files with 1057 additions and 686 deletions

View file

@ -97,6 +97,7 @@ ImplementEnumType(ImageAssetType,
{ ImageAsset::Glow, "Glow", "" }, { ImageAsset::Glow, "Glow", "" },
{ ImageAsset::Particle, "Particle", "" }, { ImageAsset::Particle, "Particle", "" },
{ ImageAsset::Decal, "Decal", "" }, { ImageAsset::Decal, "Decal", "" },
{ ImageAsset::Cubemap, "Cubemap", "" },
EndImplementEnumType; EndImplementEnumType;

View file

@ -64,6 +64,7 @@ public:
Glow = 7, Glow = 7,
Particle = 8, Particle = 8,
Decal = 9, Decal = 9,
Cubemap = 10,
}; };
protected: protected:

View file

@ -51,8 +51,6 @@ IMPLEMENT_CONOBJECT(ShapeAsset);
ConsoleType(assetIdString, TypeShapeAssetPtr, String, ASSET_ID_FIELD_PREFIX) ConsoleType(assetIdString, TypeShapeAssetPtr, String, ASSET_ID_FIELD_PREFIX)
//-----------------------------------------------------------------------------
ConsoleGetType(TypeShapeAssetPtr) ConsoleGetType(TypeShapeAssetPtr)
{ {
// Fetch asset Id. // Fetch asset Id.
@ -60,9 +58,38 @@ ConsoleGetType(TypeShapeAssetPtr)
return (*((AssetPtr<ShapeAsset>*)dptr)).getAssetId(); return (*((AssetPtr<ShapeAsset>*)dptr)).getAssetId();
} }
ConsoleSetType(TypeShapeAssetPtr)
{
// Was a single argument specified?
if (argc == 1)
{
// Yes, so fetch field value.
const char* pFieldValue = argv[0];
// Fetch asset Id.
StringTableEntry* assetId = (StringTableEntry*)(dptr);
// Update asset value.
*assetId = StringTable->insert(pFieldValue);
return;
}
// Warn.
Con::warnf("(TypeAssetId) - Cannot set multiple args to a single asset.");
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
ConsoleSetType(TypeShapeAssetPtr) ConsoleType(assetIdString, TypeShapeAssetId, String, ASSET_ID_FIELD_PREFIX)
ConsoleGetType(TypeShapeAssetId)
{
// Fetch asset Id.
return *((const char**)(dptr));
}
ConsoleSetType(TypeShapeAssetId)
{ {
// Was a single argument specified? // Was a single argument specified?
if (argc == 1) if (argc == 1)
@ -334,14 +361,55 @@ bool ShapeAsset::getAssetByFilename(StringTableEntry fileName, AssetPtr<ShapeAss
} }
} }
StringTableEntry ShapeAsset::getAssetIdByFilename(StringTableEntry fileName)
{
StringTableEntry shapeAssetId = StringTable->EmptyString();
AssetQuery query;
S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, fileName);
if (foundAssetcount == 0)
{
//Didn't find any assets
//If possible, see if we can run an in-place import and the get the asset from that
#if TORQUE_DEBUG
Con::warnf("ShapeAsset::getAssetByFilename - Attempted to in-place import a shapefile(%s) that had no associated asset", fileName);
#endif
ConsoleValueRef result = Con::executef("importLooseFile", fileName, true);
if (result.getBoolValue())
{
StringTableEntry resultingAssetId = StringTable->insert(Con::getVariable("$importedLooseFileAsset"));
if (resultingAssetId != StringTable->EmptyString())
{
shapeAssetId = resultingAssetId;
return shapeAssetId;
}
}
//Didn't work, so have us fall back to a placeholder asset
shapeAssetId = StringTable->insert("Core_Rendering:noshape");
}
else
{
//acquire and bind the asset, and return it out
shapeAssetId = query.mAssetList[0];
}
return shapeAssetId;
}
bool ShapeAsset::getAssetById(StringTableEntry assetId, AssetPtr<ShapeAsset>* shapeAsset) bool ShapeAsset::getAssetById(StringTableEntry assetId, AssetPtr<ShapeAsset>* shapeAsset)
{ {
shapeAsset->setAssetId(assetId); (*shapeAsset) = assetId;
if (!shapeAsset->isNull()) if (!shapeAsset->isNull())
return true; return true;
//Didn't work, so have us fall back to a placeholder asset //Didn't work, so have us fall back to a placeholder asset
shapeAsset->setAssetId(StringTable->insert("Core_Rendering:noshape")); StringTableEntry noShapeId = StringTable->insert("Core_Rendering:noshape");
shapeAsset->setAssetId(noShapeId);
if (!shapeAsset->isNull()) if (!shapeAsset->isNull())
return true; return true;
@ -460,7 +528,7 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
// Create "Open in ShapeEditor" button // Create "Open in ShapeEditor" button
mShapeEdButton = new GuiBitmapButtonCtrl(); mShapeEdButton = new GuiBitmapButtonCtrl();
dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAsset(%d.getText());", retCtrl->getId()); dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
mShapeEdButton->setField("Command", szBuffer); mShapeEdButton->setField("Command", szBuffer);
char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor"; char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
@ -502,3 +570,18 @@ bool GuiInspectorTypeShapeAssetPtr::updateRects()
return resized; return resized;
} }
IMPLEMENT_CONOBJECT(GuiInspectorTypeShapeAssetId);
ConsoleDocClass(GuiInspectorTypeShapeAssetId,
"@brief Inspector field type for Shapes\n\n"
"Editor use only.\n\n"
"@internal"
);
void GuiInspectorTypeShapeAssetId::consoleInit()
{
Parent::consoleInit();
ConsoleBaseType::getType(TypeShapeAssetId)->setInspectorFieldType("GuiInspectorTypeShapeAssetId");
}

View file

@ -129,8 +129,11 @@ public:
inline StringTableEntry getShapeConstructorFile(void) const { return mConstructorFileName; }; inline StringTableEntry getShapeConstructorFile(void) const { return mConstructorFileName; };
static bool getAssetByFilename(StringTableEntry fileName, AssetPtr<ShapeAsset>* shapeAsset); static bool getAssetByFilename(StringTableEntry fileName, AssetPtr<ShapeAsset>* shapeAsset);
static StringTableEntry getAssetIdByFilename(StringTableEntry fileName);
static bool getAssetById(StringTableEntry assetId, AssetPtr<ShapeAsset>* shapeAsset); static bool getAssetById(StringTableEntry assetId, AssetPtr<ShapeAsset>* shapeAsset);
static StringTableEntry getNoShapeAssetId() { return StringTable->insert("Core_Rendering:noshape"); }
protected: protected:
virtual void onAssetRefresh(void); virtual void onAssetRefresh(void);
@ -143,6 +146,7 @@ protected:
}; };
DefineConsoleType(TypeShapeAssetPtr, S32) DefineConsoleType(TypeShapeAssetPtr, S32)
DefineConsoleType(TypeShapeAssetId, String)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// TypeAssetId GuiInspectorField Class // TypeAssetId GuiInspectorField Class
@ -161,5 +165,14 @@ public:
virtual bool updateRects(); virtual bool updateRects();
}; };
class GuiInspectorTypeShapeAssetId : public GuiInspectorTypeShapeAssetPtr
{
typedef GuiInspectorTypeShapeAssetPtr Parent;
public:
DECLARE_CONOBJECT(GuiInspectorTypeShapeAssetId);
static void consoleInit();
};
#endif #endif

File diff suppressed because it is too large Load diff

View file

@ -38,11 +38,16 @@
#include "core/resource.h" #include "core/resource.h"
#endif #endif
#ifndef _NETSTRINGTABLE_H_ #ifndef _NETSTRINGTABLE_H_
#include "sim/netStringTable.h" #include "sim/netStringTable.h"
#endif #endif
#ifndef _TSSHAPE_H_ #ifndef _TSSHAPE_H_
#include "ts/tsShape.h" #include "ts/tsShape.h"
#endif #endif
#ifndef _REFLECTOR_H_
#include "scene/reflector.h"
#endif
#ifndef _ASSET_PTR_H_ #ifndef _ASSET_PTR_H_
#include "assets/assetPtr.h" #include "assets/assetPtr.h"
#endif #endif
@ -71,7 +76,7 @@ public:
Point3F verts[4]; Point3F verts[4];
PlaneF normal; PlaneF normal;
S32 idx; S32 idx;
TSMesh *mesh; TSMesh* mesh;
static SceneObject* smCurObject; static SceneObject* smCurObject;
@ -81,7 +86,7 @@ public:
Box3F getBoundingBox() const; Box3F getBoundingBox() const;
Box3F getBoundingBox(const MatrixF& mat, const Point3F& scale) const; Box3F getBoundingBox(const MatrixF& mat, const Point3F& scale) const;
void getFeatures(const MatrixF& mat,const VectorF& n, ConvexFeature* cf); void getFeatures(const MatrixF& mat, const VectorF& n, ConvexFeature* cf);
// This returns a list of convex faces to collide against // This returns a list of convex faces to collide against
void getPolyList(AbstractPolyList* list); void getPolyList(AbstractPolyList* list);
@ -100,21 +105,21 @@ class TSStatic : public SceneObject
enum MaskBits enum MaskBits
{ {
TransformMask = Parent::NextFreeMask << 0, TransformMask = Parent::NextFreeMask << 0,
AdvancedStaticOptionsMask = Parent::NextFreeMask << 1, AdvancedStaticOptionsMask = Parent::NextFreeMask << 1,
UpdateCollisionMask = Parent::NextFreeMask << 2, UpdateCollisionMask = Parent::NextFreeMask << 2,
SkinMask = Parent::NextFreeMask << 3, SkinMask = Parent::NextFreeMask << 3,
MaterialMask = Parent::NextFreeMask << 4, MaterialMask = Parent::NextFreeMask << 4,
NextFreeMask = Parent::NextFreeMask << 5 NextFreeMask = Parent::NextFreeMask << 5
}; };
public: public:
void setAlphaFade(bool enable, F32 start, F32 end, bool inverse) void setAlphaFade(bool enable, F32 start, F32 end, bool inverse)
{ {
mUseAlphaFade = enable; mUseAlphaFade = enable;
mAlphaFadeStart = start; mAlphaFadeStart = start;
mAlphaFadeEnd = end; mAlphaFadeEnd = end;
mInvertAlphaFade = inverse; mInvertAlphaFade = inverse;
} }
/// The different types of mesh data types /// The different types of mesh data types
@ -148,10 +153,10 @@ protected:
// Collision // Collision
void prepCollision(); void prepCollision();
bool castRay(const Point3F &start, const Point3F &end, RayInfo* info); bool castRay(const Point3F& start, const Point3F& end, RayInfo* info);
bool castRayRendered(const Point3F &start, const Point3F &end, RayInfo* info); bool castRayRendered(const Point3F& start, const Point3F& end, RayInfo* info);
bool buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F &box, const SphereF& sphere); bool buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& sphere);
bool buildExportPolyList(ColladaUtils::ExportData* exportData, const Box3F &box, const SphereF &); bool buildExportPolyList(ColladaUtils::ExportData* exportData, const Box3F& box, const SphereF&);
void buildConvex(const Box3F& box, Convex* convex); void buildConvex(const Box3F& box, Convex* convex);
bool setShapeAsset(const StringTableEntry shapeAssetId); bool setShapeAsset(const StringTableEntry shapeAssetId);
@ -160,29 +165,35 @@ protected:
void _updatePhysics(); void _updatePhysics();
void _renderNormals( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat ); void _renderNormals(ObjectRenderInst* ri, SceneRenderState* state, BaseMatInstance* overrideMat);
void _onResourceChanged( const Torque::Path &path ); void _onResourceChanged(const Torque::Path& path);
// ProcessObject // ProcessObject
virtual void processTick( const Move *move ); virtual void processTick(const Move* move);
virtual void interpolateTick( F32 delta ); virtual void interpolateTick(F32 delta);
virtual void advanceTime( F32 dt ); virtual void advanceTime(F32 dt);
virtual void onDynamicModified(const char* slotName, const char* newValue); virtual void onDynamicModified(const char* slotName, const char* newValue);
/// Start or stop processing ticks depending on our state. /// Start or stop processing ticks depending on our state.
void _updateShouldTick(); void _updateShouldTick();
String cubeDescName;
U32 cubeDescId;
ReflectorDesc* reflectorDesc;
CubeReflector mCubeReflector;
protected: protected:
Convex *mConvexList; Convex* mConvexList;
StringTableEntry mShapeName; StringTableEntry mShapeName;
U32 mShapeHash; U32 mShapeHash;
Resource<TSShape> mShape;
Vector<S32> mCollisionDetails; Vector<S32> mCollisionDetails;
Vector<S32> mLOSDetails; Vector<S32> mLOSDetails;
TSShapeInstance *mShapeInstance; TSShapeInstance* mShapeInstance;
AssetPtr<ShapeAsset> mShapeAsset; AssetPtr<ShapeAsset> mShapeAsset;
StringTableEntry mShapeAssetId; StringTableEntry mShapeAssetId;
@ -191,7 +202,7 @@ protected:
String mAppliedSkinName; String mAppliedSkinName;
bool mPlayAmbient; bool mPlayAmbient;
TSThread* mAmbientThread; TSThread* mAmbientThread;
/// The type of mesh data to return for collision queries. /// The type of mesh data to return for collision queries.
MeshType mCollisionType; MeshType mCollisionType;
@ -209,7 +220,7 @@ protected:
/// model instead of the nearest point of the bounds. /// model instead of the nearest point of the bounds.
bool mUseOriginSort; bool mUseOriginSort;
PhysicsBody *mPhysicsRep; PhysicsBody* mPhysicsRep;
LinearColorF mOverrideColor; LinearColorF mOverrideColor;
@ -224,34 +235,34 @@ public:
DECLARE_CONOBJECT(TSStatic); DECLARE_CONOBJECT(TSStatic);
static void initPersistFields(); static void initPersistFields();
static bool _setShape(void* obj, const char* index, const char* data);
static bool _setShapeAsset(void* obj, const char* index, const char* data); static bool _setShapeAsset(void* obj, const char* index, const char* data);
static bool _setFieldSkin( void *object, const char* index, const char* data ); static bool _setShapeName(void* obj, const char* index, const char* data);
static const char *_getFieldSkin( void *object, const char *data ); static bool _setFieldSkin(void* object, const char* index, const char* data);
static const char* _getFieldSkin(void* object, const char* data);
// Skinning // Skinning
void setSkinName( const char *name ); void setSkinName(const char* name);
void reSkin(); void reSkin();
// NetObject // NetObject
U32 packUpdate( NetConnection *conn, U32 mask, BitStream *stream ); U32 packUpdate(NetConnection* conn, U32 mask, BitStream* stream);
void unpackUpdate( NetConnection *conn, BitStream *stream ); void unpackUpdate(NetConnection* conn, BitStream* stream);
// SceneObject // SceneObject
void setTransform( const MatrixF &mat ); void setTransform(const MatrixF& mat);
void onScaleChanged(); void onScaleChanged();
void prepRenderImage( SceneRenderState *state ); void prepRenderImage(SceneRenderState* state);
void inspectPostApply(); void inspectPostApply();
virtual void onMount( SceneObject *obj, S32 node ); virtual void onMount(SceneObject* obj, S32 node);
virtual void onUnmount( SceneObject *obj, S32 node ); virtual void onUnmount(SceneObject* obj, S32 node);
/// The type of mesh data use for collision queries. /// The type of mesh data use for collision queries.
MeshType getCollisionType() const { return mCollisionType; } MeshType getCollisionType() const { return mCollisionType; }
bool allowPlayerStep() const { return mAllowPlayerStep; } bool allowPlayerStep() const { return mAllowPlayerStep; }
Resource<TSShape> getShape() const; Resource<TSShape> getShape() const { return mShape; }
StringTableEntry getShapeFileName() { return mShapeName; } StringTableEntry getShapeFileName() { return mShapeName; }
void setShapeFileName(StringTableEntry shapeName) { mShapeName = shapeName; } void setShapeFileName(StringTableEntry shapeName) { mShapeName = shapeName; }
TSShapeInstance* getShapeInstance() const { return mShapeInstance; } TSShapeInstance* getShapeInstance() const { return mShapeInstance; }
@ -267,10 +278,10 @@ public:
void updateMaterials(); void updateMaterials();
private: private:
virtual void onStaticModified(const char* slotName, const char*newValue = NULL); virtual void onStaticModified(const char* slotName, const char* newValue = NULL);
protected: protected:
Vector<S32> mDecalDetails; Vector<S32> mDecalDetails;
Vector<S32>* mDecalDetailsPtr; Vector<S32>* mDecalDetailsPtr;
public: public:
bool mIgnoreZodiacs; bool mIgnoreZodiacs;
bool mHasGradients; bool mHasGradients;
@ -283,7 +294,7 @@ private:
}; };
typedef TSStatic::MeshType TSMeshType; typedef TSStatic::MeshType TSMeshType;
DefineEnumType( TSMeshType ); DefineEnumType(TSMeshType);
#endif // _H_TSSTATIC #endif // _H_TSSTATIC

View file

@ -390,7 +390,11 @@ TSShapeConstructor* TSShapeConstructor::findShapeConstructor(const FileName& pat
for (S32 i = 0; i < group->size(); i++) for (S32 i = 0; i < group->size(); i++)
{ {
TSShapeConstructor* tss = dynamic_cast<TSShapeConstructor*>( group->at(i) ); TSShapeConstructor* tss = dynamic_cast<TSShapeConstructor*>( group->at(i) );
if ( tss->mShapePath.equal( path, String::NoCase ) ) FileName shapePath = tss->mShapePath;
char buf[1024];
FileName fullShapePath = Platform::makeFullPathName(shapePath, buf, sizeof(buf));
if (shapePath.equal( path, String::NoCase ) || fullShapePath.equal(path, String::NoCase))
return tss; return tss;
} }
} }

View file

@ -101,6 +101,7 @@ function initializeAssetBrowser()
exec("./scripts/assetTypes/folder.cs"); exec("./scripts/assetTypes/folder.cs");
exec("./scripts/assetTypes/terrain.cs"); exec("./scripts/assetTypes/terrain.cs");
exec("./scripts/assetTypes/terrainMaterial.cs"); exec("./scripts/assetTypes/terrainMaterial.cs");
exec("./scripts/assetTypes/datablockObjects.cs");
new ScriptObject( AssetBrowserPlugin ) new ScriptObject( AssetBrowserPlugin )
{ {

View file

@ -278,7 +278,45 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
} }
else else
{ {
%fullPath = %moduleName !$= "" ? %moduleName @ "/" @ %asset : %asset; //special-case entry
if(getFieldCount(%asset) > 1)
{
%specialType = getField(%asset,0);
/*if(%specialType $= "Folder")
{
}
else if(%specialType $= "Datablock")
{
%sdfasdgah = true;
}*/
%assetType = %specialType;
%assetName = getField(%asset, 1);
%sdfasdgah = true;
if(%assetType $= "Folder")
{
%fullPath = %moduleName !$= "" ? %moduleName @ "/" @ %assetName : %assetName;
%fullPath = strreplace(%fullPath, "/", "_");
if(isObject(%fullPath))
%assetDesc = %fullPath;
else
%assetDesc = new ScriptObject(%fullPath);
%assetDesc.dirPath = %moduleName;
%assetDesc.assetName = %assetName;
%assetDesc.description = %moduleName @ "/" @ %assetName;
%assetDesc.assetType = %assetType;
}
else if(%assetType $= "Datablock")
{
%assetDesc = %assetName;
%assetDesc.assetType = %assetType;
}
}
/*%fullPath = %moduleName !$= "" ? %moduleName @ "/" @ %assetName : %assetName;
%fullPath = strreplace(%fullPath, "/", "_"); %fullPath = strreplace(%fullPath, "/", "_");
if(isObject(%fullPath)) if(isObject(%fullPath))
@ -287,12 +325,12 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
%assetDesc = new ScriptObject(%fullPath); %assetDesc = new ScriptObject(%fullPath);
%assetDesc.dirPath = %moduleName; %assetDesc.dirPath = %moduleName;
%assetDesc.assetName = %asset; %assetDesc.assetName = %assetName;
%assetDesc.description = %moduleName @ "/" @ %asset; %assetDesc.description = %moduleName @ "/" @ %assetName;
%assetDesc.assetType = "Folder"; %assetDesc.assetType = %assetType;*/
%assetName = %asset; //%assetName = %asset;
%assetType = "Folder"; //%assetType = "Folder";
} }
%previewSize = %this.previewSize SPC %this.previewSize; %previewSize = %this.previewSize SPC %this.previewSize;
@ -425,7 +463,7 @@ function AssetBrowser::loadDirectories( %this )
} }
//Add Non-Asset Scripted Objects. Datablock, etc based //Add Non-Asset Scripted Objects. Datablock, etc based
%category = getWord( %breadcrumbPath, 1 ); /*%category = getWord( %breadcrumbPath, 1 );
%dataGroup = "DataBlockGroup"; %dataGroup = "DataBlockGroup";
if(%dataGroup.getCount() != 0) if(%dataGroup.getCount() != 0)
@ -437,8 +475,14 @@ function AssetBrowser::loadDirectories( %this )
%obj = %dataGroup.getObject(%i); %obj = %dataGroup.getObject(%i);
// echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category ); // echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category );
if ( %obj.category $= "" && %obj.category == 0 ) //if ( %obj.category $= "" && %obj.category == 0 )
continue; // continue;
%dbFilename = %obj.getFileName();
%dbFilePath = filePath(%dbFilename);
if(%breadcrumbPath $= %dbFilePath)
{
//if ( %breadcrumbPath $= "" ) //if ( %breadcrumbPath $= "" )
//{ //{
@ -456,8 +500,9 @@ function AssetBrowser::loadDirectories( %this )
{ {
AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.getName()); AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.getName());
}*/ }*/
} //}
} //}
// }
AssetPreviewArray.empty(); AssetPreviewArray.empty();
@ -916,6 +961,9 @@ function AssetBrowser::doRebuildAssetArray(%this)
AssetBrowser-->assetList.deleteAllObjects(); AssetBrowser-->assetList.deleteAllObjects();
AssetPreviewArray.empty(); AssetPreviewArray.empty();
if(isObject(%assetArray))
%assetArray.delete();
%assetArray = new ArrayObject(); %assetArray = new ArrayObject();
//First, Query for our assets //First, Query for our assets
@ -1032,12 +1080,12 @@ function AssetBrowser::doRebuildAssetArray(%this)
if(%searchText !$= "Search Assets...") if(%searchText !$= "Search Assets...")
{ {
if(strstr(strlwr(%folderName), strlwr(%searchText)) != -1) if(strstr(strlwr(%folderName), strlwr(%searchText)) != -1)
%assetArray.add( %breadcrumbPath, %folderName ); %assetArray.add( %breadcrumbPath, "Folder" TAB %folderName );
} }
else else
{ {
//got it. //got it.
%assetArray.add( %breadcrumbPath, %folderName ); %assetArray.add( %breadcrumbPath, "Folder" TAB %folderName );
} }
} }
} }
@ -1046,32 +1094,36 @@ function AssetBrowser::doRebuildAssetArray(%this)
%category = getWord( %breadcrumbPath, 1 ); %category = getWord( %breadcrumbPath, 1 );
%dataGroup = "DataBlockGroup"; %dataGroup = "DataBlockGroup";
if(%dataGroup.getCount() != 0) for ( %i = 0; %i < %dataGroup.getCount(); %i++ )
{ {
%scriptedItem = AssetBrowser-->filterTree.findItemByName("Scripted"); %obj = %dataGroup.getObject(%i);
// echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category );
for ( %i = 0; %i < %dataGroup.getCount(); %i++ ) //if ( %obj.category $= "" && %obj.category == 0 )
// continue;
%dbFilename = %obj.getFileName();
%dbFilePath = filePath(%dbFilename);
if(%breadcrumbPath $= %dbFilePath)
{ {
%obj = %dataGroup.getObject(%i); %dbName = %obj.getName();
// echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category ); %assetArray.add( %breadcrumbPath, "Datablock" TAB %dbName );
if ( %obj.category $= "" && %obj.category == 0 ) /*%catItem = AssetBrowser-->filterTree.findItemByName(%obj.category);
continue;
/*if ( %breadcrumbPath $= "" ) if(%catItem == 0)
AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.category, "scripted");*/
/*%ctrl = %this.findIconCtrl( %obj.category );
if ( %ctrl == -1 )
{ {
%ctrl = %this.findIconCtrl( %obj.category ); %this.addFolderIcon( %obj.category );
if ( %ctrl == -1 ) }*/
{
%this.addFolderIcon( %obj.category );
}
}
else */
if ( %breadcrumbPath $= %obj.category )
{
AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.getName());
}
} }
/*else if ( %breadcrumbPath $= %obj.category )
{
AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.getName());
}*/
} }
AssetBrowser.currentPreviewPage = 0; AssetBrowser.currentPreviewPage = 0;

View file

@ -464,11 +464,15 @@ function importLooseFile(%filePath, %forceAutoImport)
%assetItem.moduleName = %targetModule; %assetItem.moduleName = %targetModule;
%assetName = %assetItem.assetName;
AssetBrowser.dirHandler.currentAddress = filePath(%filePath); AssetBrowser.dirHandler.currentAddress = filePath(%filePath);
//skip the refresh delay, we'll force it here //skip the refresh delay, we'll force it here
ImportAssetWindow.doRefresh(); ImportAssetWindow.doRefresh();
ImportAssetItems.empty();
if(ImportAssetWindow.hasImportIssues) if(ImportAssetWindow.hasImportIssues)
return false; return false;
} }
@ -673,7 +677,8 @@ function ImportAssetWindow::doRefresh(%this)
%ImportActionSummary = %ImportActionSummary SPC %this.autoRenamedAssets @ " Auto Renamed|"; %ImportActionSummary = %ImportActionSummary SPC %this.autoRenamedAssets @ " Auto Renamed|";
} }
warn(%ImportActionSummary); if(%ImportActionSummary !$= "")
warn(%ImportActionSummary);
AssetImportSummarization.Text = %ImportActionSummary; AssetImportSummarization.Text = %ImportActionSummary;
@ -1222,7 +1227,7 @@ function ImportAssetWindow::checkAssetsForCollision(%this, %assetItemToCheck, %a
} }
} }
return result; return %result;
} }
// //

View file

@ -23,6 +23,11 @@ function AssetImportConfigEditor::refresh(%this)
ImportAssetConfigList.setSelected(0); ImportAssetConfigList.setSelected(0);
} }
function AssetImportConfigEditor::apply(%this)
{
AssetImportSettings.write();
}
function AssetImportConfigList::onSelect( %this, %id, %text ) function AssetImportConfigList::onSelect( %this, %id, %text )
{ {
ImportOptionsConfigList.clearFields(); ImportOptionsConfigList.clearFields();

View file

@ -0,0 +1,127 @@
function AssetBrowser::createNewDatablock(%this)
{
AssetBrowser_newFolderNameTxt.text = "NewFolder";
Canvas.pushDialog(AssetBrowser_newFolder);
}
function AssetBrowser::doCreateNewDatablock(%this)
{
%newFolderName = AssetBrowser_newFolderNameTxt.getText();
if(%newFolderName $= "")
%newFolderName = "NewFolder";
%newFolderIdx = "";
%matched = true;
%newFolderPath = "";
while(%matched == true)
{
%newFolderPath = AssetBrowser.dirHandler.currentAddress @ "/" @ %newFolderName @ %newFolderIdx;
if(!isDirectory(%newFolderPath))
{
%matched = false;
}
else
{
%newFolderIdx++;
}
}
//make a dummy file
%file = new FileObject();
%file.openForWrite(%newFolderPath @ "/test");
%file.close();
fileDelete(%newFolderPath @ "/test");
//refresh the directory
AssetBrowser.loadDirectories();
%this.navigateTo(%newFolderPath);
}
function AssetBrowser::buildDatablockPreview(%this, %assetDef, %previewData)
{
%previewData.assetName = %assetDef.assetName;
%previewData.assetPath = %assetDef.dirPath;
%previewData.previewImage = "tools/assetBrowser/art/scriptIcon";
//%previewData.assetFriendlyName = %assetDef.assetName;
%previewData.assetDesc = %assetDef.description;
%previewData.tooltip = %assetDef.dirPath;
%previewData.doubleClickCommand = "AssetBrowser.schedule(10, \"navigateTo\",\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\");";//browseTo %assetDef.dirPath / %assetDef.assetName
}
function AssetBrowser::renameDatablock(%this, %folderPath, %newFolderName)
{
%fullPath = makeFullPath(%folderPath);
%newFullPath = makeFullPath(%folderPath);
%fullPath = strreplace(%fullPath, "//", "/");
%count = getTokenCount(%fullPath, "/");
%basePath = getTokens(%fullPath, "/", 0, %count-2);
%oldName = getToken(%fullPath, "/", %count-1);
//We need to ensure that no files are 'active' while we try and clean up behind ourselves with the delete action
//so, we nix any assets active for the module, do the delete action on the old folder, and then re-acquire our assets.
//This will have the added benefit of updating paths for asset items
%module = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress);
%moduleId = %module.ModuleId;
AssetDatabase.removeDeclaredAssets(%moduleId);
%copiedSuccess = %this.dirHandler.copyDatablock(%fullPath, %basePath @ "/" @ %newFolderName);
%this.dirHandler.deleteDatablock(%fullPath);
%this.loadDirectories();
AssetDatabase.addModuleDeclaredAssets(%moduleId);
}
function AssetBrowser::moveDatablock(%this, %folderPath, %newFolderPath)
{
%fullPath = makeFullPath(%folderPath);
%newFullPath = makeFullPath(%newFolderPath);
%fullPath = strreplace(%fullPath, "//", "/");
%newFullPath = strreplace(%newFullPath, "//", "/");
%count = getTokenCount(%fullPath, "/");
%basePath = getTokens(%fullPath, "/", 0, %count-2);
%oldName = getToken(%fullPath, "/", %count-1);
%copiedSuccess = %this.dirHandler.copyDatablock(%fullPath, %newFullPath);
%this.dirHandler.deleteDatablock(%fullPath);
%this.loadDirectories();
//thrash the modules and reload them
%oldModule = %this.dirHandler.getModuleFromAddress(%folderPath);
%newModule = %this.dirHandler.getModuleFromAddress(%newFolderPath);
//if we didn't move modules, then we don't need to do anything other than refresh the assets within it
if(%oldModule == %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(%oldModule.getModuleId());
ModuleDatabase.loadExplicit(%oldModule.getModuleId());
ModuleDatabase.unloadExplicit(%newModule.getModuleId());
ModuleDatabase.loadExplicit(%newModule.getModuleId());
}
}
function AssetBrowser::deleteDatablock(%this, %folderPath)
{
%this.dirHandler.deleteDatablock(%folderPath);
%this.refresh();
}

View file

@ -43,6 +43,18 @@ function AssetBrowser::editMaterialAsset(%this, %assetDef)
MaterialEditorGui.setActiveMaterial( %assetDef.materialDefinitionName ); MaterialEditorGui.setActiveMaterial( %assetDef.materialDefinitionName );
AssetBrowser.hideDialog(); AssetBrowser.hideDialog();
//
//
/*%assetDef.materialDefinitionName.reload();
$Tools::materialEditorList = "";
EWorldEditor.clearSelection();
MaterialEditorGui.currentObject = 0;
MaterialEditorGui.currentMode = "asset";
MaterialEditorGui.currentMaterial = %assetDef.materialDefinitionName;
MaterialEditorGui.setActiveMaterial( %assetDef.materialDefinitionName);
EditorGui.setEditor(MaterialEditorPlugin);
AssetBrowser.hideDialog();*/
} }
//Renames the asset //Renames the asset
@ -424,7 +436,7 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
%previewData.assetPath = %assetDef.scriptFile; %previewData.assetPath = %assetDef.scriptFile;
//Lotta prepwork //Lotta prepwork
%previewData.doubleClickCommand = %assetDef@".materialDefinitionName.reload(); " /*%previewData.doubleClickCommand = %assetDef@".materialDefinitionName.reload(); "
@ "$Tools::materialEditorList = \"\";" @ "$Tools::materialEditorList = \"\";"
@ "EWorldEditor.clearSelection();" @ "EWorldEditor.clearSelection();"
@ "MaterialEditorGui.currentObject = 0;" @ "MaterialEditorGui.currentObject = 0;"
@ -432,7 +444,9 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
@ "MaterialEditorGui.currentMaterial = "@%assetDef@".materialDefinitionName;" @ "MaterialEditorGui.currentMaterial = "@%assetDef@".materialDefinitionName;"
@ "MaterialEditorGui.setActiveMaterial( "@%assetDef@".materialDefinitionName );" @ "MaterialEditorGui.setActiveMaterial( "@%assetDef@".materialDefinitionName );"
@ "EditorGui.setEditor(MaterialEditorPlugin); " @ "EditorGui.setEditor(MaterialEditorPlugin); "
@ "AssetBrowser.hideDialog();"; @ "AssetBrowser.hideDialog();";*/
%previewData.doubleClickCommand = "AssetBrowser.editAsset(" @ %assetDef @ ");";
%test = %assetDef.materialDefinitionName.diffuseMapAsset[0]; %test = %assetDef.materialDefinitionName.diffuseMapAsset[0];

View file

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

View file

@ -151,6 +151,13 @@ function ShapeEditorPlugin::openShapeAsset(%this, %assetDef)
%this.open(%this.selectedAssetDef.fileName); %this.open(%this.selectedAssetDef.fileName);
} }
function ShapeEditorPlugin::openShapeAssetId(%this, %assetId)
{
%this.selectedAssetDef = AssetDatabase.acquireAsset(%assetId);
//%this.selectedAssetDef = %assetDef;
%this.open(%this.selectedAssetDef.fileName);
}
function ShapeEditorPlugin::open(%this, %filename) function ShapeEditorPlugin::open(%this, %filename)
{ {
if ( !%this.isActivated ) if ( !%this.isActivated )