diff options
| author | Anton Novoselov <[email protected]> | 2017-08-01 12:53:38 +0300 |
|---|---|---|
| committer | Anton Novoselov <[email protected]> | 2017-08-01 12:53:38 +0300 |
| commit | 236f03c0b9a4982328ed1201978f7f69d192d9b2 (patch) | |
| tree | e486f2fa39dba203563895541e92c60ed3e25759 /tools/ArtistTools/source/CoreLib | |
| parent | Added screens to welcome page (diff) | |
| download | blast-236f03c0b9a4982328ed1201978f7f69d192d9b2.tar.xz blast-236f03c0b9a4982328ed1201978f7f69d192d9b2.zip | |
Blast 1.1 release (windows / linux)
see docs/release_notes.txt for details
Diffstat (limited to 'tools/ArtistTools/source/CoreLib')
69 files changed, 3888 insertions, 212 deletions
diff --git a/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.cpp b/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.cpp index 5ab1563..f070f42 100644 --- a/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.cpp +++ b/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.cpp @@ -58,7 +58,7 @@ void AnimationCache::Initialize(int numBones, NvInt32 frameStart, NvInt32 frameE void AnimationCache::Allocate() { m_pBoneMatrices = new atcore_float4x4[m_numFrames * m_numBones]; -// m_pBoneNames = new char[NV_HAIR_MAX_STRING * m_numBones]; + m_pBoneNames = new char[NV_HAIR_MAX_STRING * m_numBones]; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -104,14 +104,12 @@ int AnimationCache::FindBone(const char *toFind) const { if (!toFind) return -1; - /* for (int i = 0; i < m_numBones; i++) { const char* boneName = GetBoneName(i); if (!strcmp(boneName, toFind)) return i; } - */ return -1; } @@ -122,7 +120,7 @@ bool AnimationCache::FindBoneMapping( int numBones, const NvChar* boneNames, int for (int i = 0; i < numBones; i++) { - //mappedBoneId[i] = FindBone(boneNames + i * NV_HAIR_MAX_STRING); + mappedBoneId[i] = FindBone(boneNames + i * NV_HAIR_MAX_STRING); } return true; @@ -140,7 +138,7 @@ void BoneData::Allocate(NvUInt32 numBones) m_pBoneMatrices = new atcore_float4x4[numBones]; m_pSkinDQs = new atcore_dualquaternion[numBones]; - //m_pBoneNames = new char[NV_HAIR_MAX_STRING * m_numBones]; + m_pBoneNames = new char[NV_HAIR_MAX_STRING * m_numBones]; m_pMappedBoneId = new int[numBones]; for (int i = 0; i < numBones; i++) diff --git a/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.h b/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.h index 8de718c..5fd239b 100644 --- a/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.h +++ b/tools/ArtistTools/source/CoreLib/Anim/AnimUtil.h @@ -29,8 +29,7 @@ #include "MathUtil.h" #include <string.h> - -//#include <Nv/Blast/NvHairSdk.h> +#define NV_HAIR_MAX_STRING 128 //////////////////////////////////////////////////////////////////////////////////////// // cache for animated bone data @@ -67,7 +66,7 @@ struct CORELIB_EXPORT AnimationCache const atcore_float4x4* GetNodeMatrices(int index) const { return m_pBoneMatrices + index * m_numBones; } atcore_float4x4* GetNodeMatrices(int index) { return m_pBoneMatrices + index * m_numBones; } - /* + const char* GetBoneName(int index) const { return m_pBoneNames + index * NV_HAIR_MAX_STRING; @@ -78,7 +77,7 @@ struct CORELIB_EXPORT AnimationCache char* str = m_pBoneNames + index * NV_HAIR_MAX_STRING; strcpy_s(str, NV_HAIR_MAX_STRING, boneName); } - */ + int FindBone(const char *boneName) const; bool FindBoneMapping( int numBones, const NvChar* boneNames, int* mappedBoneId) const; @@ -117,7 +116,7 @@ public: void Allocate(NvUInt32 numBones); void Release(); - /* + const char* getBoneName(int index) { return m_pBoneNames + index * NV_HAIR_MAX_STRING; @@ -128,7 +127,7 @@ public: char* str = m_pBoneNames + index * NV_HAIR_MAX_STRING; strcpy_s(str, NV_HAIR_MAX_STRING, boneName); } - */ + void InitializeAnimationCache(AnimationCache* pGlobalCache, const char* nodeName); bool Update(float frameTime, const char* rootBoneName, bool bindPose, bool zup); @@ -164,6 +163,7 @@ struct CORELIB_EXPORT MeshDesc atcore_float3* m_pVertexNormals; atcore_float3* m_pFaceNormals; atcore_float3* m_pTangents; + atcore_float3 m_ColorRGB; NvUInt32* m_pIndices; atcore_float2* m_pTexCoords; @@ -180,7 +180,9 @@ public: m_pIndices(nullptr), m_pTexCoords(nullptr) - {} + { + m_ColorRGB = gfsdk_makeFloat3(0, 0, 0); + } void Allocate(NvUInt32 numVertices, NvUInt32 numTriangles); void Release(); diff --git a/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.cpp b/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.cpp index 97ba7d8..1d78d5c 100644 --- a/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.cpp +++ b/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.cpp @@ -35,8 +35,7 @@ #include "FbxUtil.h" #include "MathUtil.h" - -//#include <Nv/Blast/NvHairSdk.h> +#include "GlobalSettings.h" // local functions used only in this file namespace { @@ -138,7 +137,8 @@ FbxUtil::Release(void) } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -bool FbxUtil::Initialize(const char* fbxFileName, float sceneUnit) +//// if fbx uses one unit which is not supported, we will also convert its unit. +bool FbxUtil::Initialize(const char* fbxFileName, nvidia::Float& fbxSceneUnit, nvidia::Float toScneUnit, bool bConvertUnit) { if (fbxFileName) { @@ -162,12 +162,15 @@ bool FbxUtil::Initialize(const char* fbxFileName, float sceneUnit) FbxGlobalSettings& settings = s_FbxScene->GetGlobalSettings(); FbxSystemUnit fbxUnit = settings.GetSystemUnit(); - - if ((sceneUnit > 0.0f) && (sceneUnit != fbxUnit.GetScaleFactor())) - { - FbxSystemUnit convertUnit(sceneUnit); - convertUnit.ConvertScene(s_FbxScene); - } + fbxSceneUnit = fbxUnit.GetScaleFactor(); + bool bSupported = GlobalSettings::Inst().isSupportedUnitByUnitInCm(fbxSceneUnit); + bool bNeedConvert = ((toScneUnit > 0.0f) && bConvertUnit && (fabs(toScneUnit - fbxSceneUnit) > 0.001f)); + if (bNeedConvert || !bSupported) + { + // if FBX has a non-supported unit, we still convert its unit + FbxSystemUnit convertUnit(toScneUnit); + convertUnit.ConvertScene(s_FbxScene); + } s_FbxImporter->Destroy(); @@ -186,9 +189,6 @@ bool FbxUtil::Initialize(const char* fbxFileName, float sceneUnit) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool FbxUtil::GetGlobalSettings(float* pStartFrame, float* pEndFrame, float *pFps, int *upAxis, char* rootBoneName) { - return false; - - /* if ( !s_FbxScene) return false; @@ -237,7 +237,6 @@ bool FbxUtil::GetGlobalSettings(float* pStartFrame, float* pEndFrame, float *pFp } return true; - */ } ///////////////////////////////////////////////////////////////////////////// @@ -245,9 +244,6 @@ bool FbxUtil::GetGlobalSettings(float* pStartFrame, float* pEndFrame, float *pFp bool FbxUtil::InitializeAnimationCache(AnimationCache& animCache) { - return false; - - /* if (!s_FbxScene) return false; @@ -284,7 +280,6 @@ FbxUtil::InitializeAnimationCache(AnimationCache& animCache) } return true; - */ } //////////////////////////////////////////////////////////////////////////////////////// @@ -326,9 +321,6 @@ static int GetNumMeshPoints( FbxNode* pFbxNode) //////////////////////////////////////////////////////////////////////////////////////// static bool GetBoneData(FbxSkin *pFbxSkin, FbxNode* pFbxNode, NvChar* pBoneNames, atcore_float4x4 *pBindPoses) { - return false; - - /* if (!pFbxSkin || !pFbxNode) return false; @@ -361,7 +353,6 @@ static bool GetBoneData(FbxSkin *pFbxSkin, FbxNode* pFbxNode, NvChar* pBoneNames } } return true; - */ } //////////////////////////////////////////////////////////////////////////////////////// @@ -455,9 +446,6 @@ static bool GetSkinningWeights(FbxSkin* pFbxSkin, atcore_float4* boneIndices, at //////////////////////////////////////////////////////////////////////////////////////// bool FbxUtil::InitializeSkinData( const char* meshName, SkinData& skinData) { - return false; - - /* FbxNode* pFbxNode = FindNodeByName(s_FbxScene, meshName); if (!pFbxNode) return false; @@ -506,11 +494,10 @@ bool FbxUtil::InitializeSkinData( const char* meshName, SkinData& skinData) } return true; - */ } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -bool FbxUtil::GetMeshInfo(int* numMeshes, char** meshNames, char** skinned) +bool FbxUtil::GetMeshInfo(int* numMeshes, char** meshNames, char** parents, char** skinned) { int cnt = 0; @@ -524,6 +511,9 @@ bool FbxUtil::GetMeshInfo(int* numMeshes, char** meshNames, char** skinned) char *pNameBuffer = new char[cnt * 128]; char *pSkinnedBuffer = new char[cnt]; + char *pParentBuffer = new char[cnt * 128]; + memset(pParentBuffer, 0, cnt * 128); + cnt = 0; for (int i = 0; i < s_FbxScene->GetNodeCount(); i++) { @@ -534,6 +524,12 @@ bool FbxUtil::GetMeshInfo(int* numMeshes, char** meshNames, char** skinned) strcpy(pNameBuffer + cnt * 128, pNode->GetName()); + FbxNode* pParentNode = pNode->GetParent(); + if (pParentNode != nullptr) + { + strcpy(pParentBuffer + cnt * 128, pParentNode->GetName()); + } + pSkinnedBuffer[cnt] = checkSkinned(pNode); cnt++; @@ -548,6 +544,7 @@ bool FbxUtil::GetMeshInfo(int* numMeshes, char** meshNames, char** skinned) delete []pSkinnedBuffer; *meshNames = pNameBuffer; + *parents = pParentBuffer; return true; } @@ -563,6 +560,8 @@ bool FbxUtil::GetMeshMaterials( const NvChar* meshName, int *numMaterials, MeshM return false; int numMats = pNode->GetMaterialCount(); + if (numMats == 0) + return false; *materials = new MeshMaterial[numMats]; @@ -663,6 +662,9 @@ bool FbxUtil::CreateMeshDescriptor(const char* meshName, MeshDesc &desc) if (!pMesh) return false; + FbxDouble3 meshColor = pMesh->Color.Get(); + desc.m_ColorRGB = gfsdk_makeFloat3(meshColor[0], meshColor[1], meshColor[2]); + int cpCount = pMesh->GetControlPointsCount(); int triCount = 0; @@ -677,8 +679,12 @@ bool FbxUtil::CreateMeshDescriptor(const char* meshName, MeshDesc &desc) // read positions FbxVector4* points = pMesh->GetControlPoints(); + FbxAMatrix matrixGeo = pNode->EvaluateGlobalTransform(); for (int i = 0; i < desc.m_NumVertices; i++) - desc.m_pVertices[i] = gfsdk_makeFloat3(float(points[i].mData[0]), float(points[i].mData[1]), float(points[i].mData[2])); + { + FbxVector4 v = matrixGeo.MultT(points[i]); + desc.m_pVertices[i] = gfsdk_makeFloat3(v.mData[0], v.mData[1], v.mData[2]); + } memset(desc.m_pTexCoords, 0, sizeof(atcore_float2) * desc.m_NumTriangles * 3); diff --git a/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.h b/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.h index 26e61a9..5cbf18c 100644 --- a/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.h +++ b/tools/ArtistTools/source/CoreLib/Anim/FbxUtil.h @@ -29,7 +29,6 @@ #include "AnimUtil.h" -//#include <Nv/Blast/NvHairSdk.h> //////////////////////////////////////////////////////////////////////////////////////// // Helper for fbx file load @@ -38,7 +37,7 @@ class CORELIB_EXPORT FbxUtil public: /// initialize fbx loader. - static bool Initialize(const nvidia::Char* fbxFileName, nvidia::Float sceneUnit = 0.0f); + static bool Initialize(const nvidia::Char* fbxFileName, nvidia::Float& fbxSceneUnit, float toScneUnit = 0.0f, bool bConvertUnit = true); static bool Release(void); static bool InitializeAnimationCache(AnimationCache& cache); @@ -53,7 +52,7 @@ public: static bool CreateMeshDescriptor(const nvidia::Char* meshName, MeshDesc &meshDesc); /// get all the renderable meshes from the fbx scene - static bool GetMeshInfo(int* numMeshes, char** meshNames, char** skinned = 0); + static bool GetMeshInfo(int* numMeshes, char** meshNames, char** parents, char** skinned); /// get mesh material info from fbx scene static bool GetMeshMaterials(const nvidia::Char* meshName, int *numMaterials, MeshMaterial** materials); diff --git a/tools/ArtistTools/source/CoreLib/CoreLib.cpp b/tools/ArtistTools/source/CoreLib/CoreLib.cpp index b94b1d9..057439c 100644 --- a/tools/ArtistTools/source/CoreLib/CoreLib.cpp +++ b/tools/ArtistTools/source/CoreLib/CoreLib.cpp @@ -259,7 +259,7 @@ static void ShowUsage() "FurViewer Command-line Options:\n\n" "Usage: FurViewer.[win64|win32].exe [file] [options]...\n\n" "[file]: \n" - "\t: File to load. .furproj, .apx or .apb are supported.\n\t ex) media/HairBall/Hairball.furproj\n\n" + "\t: File to load. .blastProj, .apx or .apb are supported.\n\t ex) media/Ball/ball.blastProj\n\n" "[options]:\n" "-size <width>x<height>\n\t: Window resolution\t ex) -size 1024x768\n" "-aa <1|2|4|8>\n\t: MSAA anti-aliasing options. 1 for off.\t ex) -aa 4 or -aa 1\n" @@ -421,20 +421,20 @@ bool ParseCommandLineOptions(int argc, char* argv[]) char* extension = strrchr(argv[idx], '.'); if (extension) { - if (!_stricmp(extension, ".furproj")) + if (!_stricmp(extension, ".blastProj")) { oaValue value; value.String = argv[idx]; settings.SetOptionValue("User/ProjectPath", OA_TYPE_STRING, &value); isValid = true; } - else if (!_stricmp(extension, ".apx") || !_stricmp(extension, ".apb")) - { - oaValue value; - value.String = argv[idx]; - settings.SetOptionValue("User/FurAssetPath", OA_TYPE_STRING, &value); - isValid = true; - } + //else if (!_stricmp(extension, ".apx") || !_stricmp(extension, ".apb")) + //{ + // oaValue value; + // value.String = argv[idx]; + // settings.SetOptionValue("User/FurAssetPath", OA_TYPE_STRING, &value); + // isValid = true; + //} } if (!isValid) { @@ -880,12 +880,12 @@ bool CoreLib::Gamepad_ResetScene() return true; } -bool CoreLib::Gamepad_StartAnimation() +bool CoreLib::Gamepad_PlaySample() { std::map<QString, PluginInterface*>::iterator it; for (it = m_PluginInterfaces.begin(); it != m_PluginInterfaces.end(); it++) { - if (!(it->second)->Gamepad_StartAnimation()) + if (!(it->second)->Gamepad_PlaySample()) break; } return true; @@ -997,10 +997,24 @@ bool CoreLib::SimpleScene_Draw_DX11() } bool CoreLib::SimpleScene_FitCamera(atcore_float3& center, atcore_float3& extents) { + bool valid = true; std::map<QString, PluginInterface*>::iterator it; for (it = m_PluginInterfaces.begin(); it != m_PluginInterfaces.end(); it++) { if (!(it->second)->SimpleScene_FitCamera(center, extents)) + { + valid = false; + break; + } + } + return valid; +} +bool CoreLib::SimpleScene_UpdateCamera() +{ + std::map<QString, PluginInterface*>::iterator it; + for (it = m_PluginInterfaces.begin(); it != m_PluginInterfaces.end(); it++) + { + if (!(it->second)->SimpleScene_UpdateCamera()) break; } return true; @@ -1035,6 +1049,14 @@ bool CoreLib::SimpleScene_DrawAxis() } return true; } +void CoreLib::SimpleScene_OpenFilesByDrop(const QStringList& fileNames) +{ + std::map<QString, PluginInterface*>::iterator it; + for (it = m_PluginInterfaces.begin(); it != m_PluginInterfaces.end(); it++) + { + (it->second)->SimpleScene_OpenFilesByDrop(fileNames); + } +} bool CoreLib::SimpleScene_LoadSceneFromFbx(const char* dir, const char* fbxName) { std::map<QString, PluginInterface*>::iterator it; @@ -1347,6 +1369,18 @@ bool CoreLib::AppMainWindow_closeEvent(QCloseEvent *event) return true; } + +bool CoreLib::menu_item_triggered(QAction* action) +{ + std::map<QString, PluginInterface*>::iterator it; + for (it = m_PluginInterfaces.begin(); it != m_PluginInterfaces.end(); it++) + { + if (!(it->second)->AppMainWindow_menu_item_triggered(action)) + break; + } + return true; +} + bool CoreLib::AppMainWindow_menu_about() { std::map<QString, PluginInterface*>::iterator it; diff --git a/tools/ArtistTools/source/CoreLib/CoreLib.h b/tools/ArtistTools/source/CoreLib/CoreLib.h index 3d86bcf..385ac73 100644 --- a/tools/ArtistTools/source/CoreLib/CoreLib.h +++ b/tools/ArtistTools/source/CoreLib/CoreLib.h @@ -51,12 +51,13 @@ public: bool Gamepad_ToggleSimulation(); bool Gamepad_LoadSamples(QString fn); bool Gamepad_ResetScene(); - bool Gamepad_StartAnimation(); + bool Gamepad_PlaySample(); bool GamepadHandler_ShowHair(); bool GamepadHandler_SpinWindStrength(float windStrength); bool Gamepad_ResetAnimation(); bool Gamepad_PlayPauseAnimation(); - + + void SimpleScene_OpenFilesByDrop(const QStringList& fileNames); bool SimpleScene_SimpleScene(); bool SimpleScene_Initialize(int backdoor); bool SimpleScene_Shutdown(); @@ -64,6 +65,7 @@ public: bool SimpleScene_Draw_DX12(); bool SimpleScene_Draw_DX11(); bool SimpleScene_FitCamera(atcore_float3& center, atcore_float3& extents); + bool SimpleScene_UpdateCamera(); bool SimpleScene_DrawGround(); bool SimpleScene_DrawWind(); bool SimpleScene_DrawAxis(); @@ -104,6 +106,7 @@ public: bool AppMainWindow_shortcut_expert(bool mode); bool AppMainWindow_updateMainToolbar(); + bool menu_item_triggered(QAction* action); bool AppMainWindow_menu_about(); bool AppMainWindow_menu_opendoc(); #if USE_CURVE_EDITOR diff --git a/tools/ArtistTools/source/CoreLib/Parameters/HackNvParamBug.cpp b/tools/ArtistTools/source/CoreLib/Parameters/HackNvParamBug.cpp new file mode 100644 index 0000000..2ee7769 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Parameters/HackNvParamBug.cpp @@ -0,0 +1,6 @@ +#include <string.h> + +int GetHackElementSize(const char* data) +{ + return 0; +}
\ No newline at end of file diff --git a/tools/ArtistTools/source/CoreLib/Parameters/PlaylistParams.pl b/tools/ArtistTools/source/CoreLib/Parameters/PlaylistParams.pl new file mode 100644 index 0000000..a4618aa --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Parameters/PlaylistParams.pl @@ -0,0 +1,33 @@ +{ + header => + { + className => 'PlaylistParams', + implementStorage => 1, + + # Version history + # 0.0 Initial Version + classVersion => '0.0', + + hints => + { + }, + }, + + structs => + [ + ], + + parameters => + [ + { + name => 'blastProjFilePaths', + type => 'STRING', + isArray => 1, + arraySize => '-1', + hints => + { + shortDescription => "BlastProj file paths", + }, + }, + ] +} diff --git a/tools/ArtistTools/source/CoreLib/Parameters/go.bat b/tools/ArtistTools/source/CoreLib/Parameters/go.bat new file mode 100644 index 0000000..600bf18 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Parameters/go.bat @@ -0,0 +1,6 @@ +SET SRC_ROOT=..\..\..\..\.. +SET EXTERNAL_ROOT=%SRC_ROOT%\..\..\external +SET BUILDTOOL_ROOT=%SRC_ROOT%\..\..\external + +@if "%PERL%"=="" set PERL=%BUILDTOOL_ROOT%\perl\5.8.8_822\bin\perl +@%PERL% %EXTERNAL_ROOT%\NvParameterized\1.1\trunk\build\scripts\GenParameterized.pl -force PlaylistParams.pl . .
\ No newline at end of file diff --git a/tools/ArtistTools/source/CoreLib/PluginInterface.h b/tools/ArtistTools/source/CoreLib/PluginInterface.h index aae8da8..0fc531c 100644 --- a/tools/ArtistTools/source/CoreLib/PluginInterface.h +++ b/tools/ArtistTools/source/CoreLib/PluginInterface.h @@ -34,6 +34,7 @@ class QDragMoveEvent; class QDragLeaveEvent; class QDropEvent; class QContextMenuEvent; +class QAction; class PluginInterface { @@ -62,7 +63,7 @@ public: virtual bool Gamepad_ToggleSimulation() = 0; virtual bool Gamepad_ResetScene() = 0; NV_AT_UNUSED virtual bool Gamepad_LoadSamples(QString fn) = 0; - virtual bool Gamepad_StartAnimation() = 0; + virtual bool Gamepad_PlaySample() = 0; virtual bool GamepadHandler_ShowHair() = 0; virtual bool GamepadHandler_SpinWindStrength(float windStrength) = 0; virtual bool Gamepad_ResetAnimation() = 0; @@ -71,6 +72,7 @@ public: virtual bool Light_loadParameters(NvParameterized::Handle& handle, Light* pLight) = 0; virtual bool Light_saveParameters(NvParameterized::Handle& handle, Light* pLight) = 0; + virtual void SimpleScene_OpenFilesByDrop(const QStringList& fileNames) = 0; virtual bool SimpleScene_SimpleScene() = 0; virtual bool SimpleScene_Initialize(int backdoor) = 0; virtual bool SimpleScene_Shutdown() = 0; @@ -78,6 +80,7 @@ public: virtual bool SimpleScene_Draw_DX12() = 0; virtual bool SimpleScene_Draw_DX11() = 0; virtual bool SimpleScene_FitCamera(atcore_float3& center, atcore_float3& extents) = 0; + virtual bool SimpleScene_UpdateCamera() = 0; virtual bool SimpleScene_LoadSceneFromFbx(const char* dir, const char* fbxName) = 0; virtual bool SimpleScene_LoadProject(const char* dir, const char* file) = 0; virtual bool SimpleScene_SaveProject(const char* dir, const char* file) = 0; @@ -118,6 +121,7 @@ public: virtual bool AppMainWindow_shortcut_expert(bool mode) = 0; virtual bool AppMainWindow_updateMainToolbar() = 0; + virtual bool AppMainWindow_menu_item_triggered(QAction* action) = 0; virtual bool AppMainWindow_menu_about() = 0; virtual bool AppMainWindow_menu_opendoc() = 0; #if USE_CURVE_EDITOR diff --git a/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11RenderInterface.cpp b/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11RenderInterface.cpp index 71d1b7d..292de1a 100644 --- a/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11RenderInterface.cpp +++ b/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11RenderInterface.cpp @@ -225,11 +225,26 @@ HRESULT UseGoodGPUDevice() std::wstring adapterName = adapterDesc.Description; #endif - D3D_FEATURE_LEVEL fl; - HRESULT hr = D3D11CreateDevice(g_pAdapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, + D3D_FEATURE_LEVEL fl = D3D_FEATURE_LEVEL_9_1; + HRESULT hr = 0; + + hr = D3D11CreateDevice(g_pAdapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, createDeviceFlags, 0, 0, D3D11_SDK_VERSION, &g_d3dDevice, &fl, &g_d3dDeviceContext); + if (g_d3dDevice == nullptr) + { + // here is the codes to make it run on a WARP device(Windows DirectX CPU - based emulation). + if (g_pAdapter) + { + g_pAdapter->Release(); + g_pAdapter = nullptr; + } + hr = D3D11CreateDevice(g_pAdapter, D3D_DRIVER_TYPE_WARP, nullptr, + createDeviceFlags, 0, 0, + D3D11_SDK_VERSION, &g_d3dDevice, &fl, &g_d3dDeviceContext); + } + if(g_d3dDevice) { IDXGIDevice* dxgiDevice = nullptr; @@ -237,6 +252,11 @@ HRESULT UseGoodGPUDevice() if (SUCCEEDED(hr)) { g_dxgiDevice = dxgiDevice; + if (g_pAdapter == nullptr) + { + // when running on WARP device, need find out adapter. + hr = dxgiDevice->GetAdapter(&g_pAdapter); + } return hr; } else diff --git a/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11Shaders.cpp b/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11Shaders.cpp index eba1184..f3e210b 100644 --- a/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11Shaders.cpp +++ b/tools/ArtistTools/source/CoreLib/Render/D3D11/D3D11Shaders.cpp @@ -30,7 +30,6 @@ #include "MeshShaderParam.h" #include "LightShaderParam.h" -//#include <Nv/Blast/NvHairSdk.h> #include "D3D11RenderShader.h" using namespace RenderInterface; @@ -39,7 +38,7 @@ using namespace RenderInterface; // Common shader settings //static D3D11RenderShader* g_pShaders[SHADER_TYPE_END]; static std::map<int, D3D11RenderShader*> g_pShaders; -/* + namespace BodyShaderBlobs { #include "Shaders/BodyShader_VS.h" @@ -76,22 +75,9 @@ namespace ColorBlobs #include "Shaders/Color_PS.h" } -#ifndef NV_ARTISTTOOLS -namespace BlastShaderBlobs -{ -#include "Shaders/BlastShader_PS.h" -} - -namespace BlastShadowBlobs -{ -#include "Shaders/BlastShadow_PS.h" -} -#endif // NV_ARTISTTOOLS -*/ ////////////////////////////////////////////////////////////////////////// bool InitializeShadersD3D11() { - /* D3D11_INPUT_ELEMENT_DESC layoutBodyRender[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, @@ -142,23 +128,6 @@ bool InitializeShadersD3D11() sizeof(SimpleShaderParam), 0, &layout_Position_And_Color[0], numElements2); -#ifndef NV_ARTISTTOOLS - g_pShaders[SHADER_TYPE_HAIR_SHADER_DEFAULT] = D3D11RenderShader::Create( - "hairShaderDefault", 0, 0, - (void*)BlastShaderBlobs::g_ps_main, sizeof(BlastShaderBlobs::g_ps_main), - sizeof(NvHair::ShaderConstantBuffer), - sizeof(LightShaderParam) - ); - - g_pShaders[SHADER_TYPE_HAIR_SHADER_SHADOW] = D3D11RenderShader::Create( - "hairShadow", 0, 0, - (void*)BlastShadowBlobs::g_ps_main, sizeof(BlastShadowBlobs::g_ps_main), - sizeof(NvHair::ShaderConstantBuffer), - 0); -#else - CoreLib::Inst()->D3D11Shaders_InitializeShadersD3D11(g_pShaders); -#endif // NV_ARTISTTOOLS - */ return true; } diff --git a/tools/ArtistTools/source/CoreLib/Resource/AppMainWindow.qrc b/tools/ArtistTools/source/CoreLib/Resource/AppMainWindow.qrc new file mode 100644 index 0000000..cffd039 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Resource/AppMainWindow.qrc @@ -0,0 +1,4 @@ +<RCC> + <qresource prefix="AppMainWindow"> + </qresource> +</RCC> diff --git a/tools/ArtistTools/source/CoreLib/Resource/D3DQt-CC.ico b/tools/ArtistTools/source/CoreLib/Resource/D3DQt-CC.ico Binary files differnew file mode 100644 index 0000000..4477340 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Resource/D3DQt-CC.ico diff --git a/tools/ArtistTools/source/CoreLib/Resource/resource.rc b/tools/ArtistTools/source/CoreLib/Resource/resource.rc new file mode 100644 index 0000000..abc138a --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Resource/resource.rc @@ -0,0 +1,2 @@ +IDI_ICON1 ICON DISCARDABLE "D3DQt-CC.ico" + diff --git a/tools/ArtistTools/source/CoreLib/Scene/Camera.cpp b/tools/ArtistTools/source/CoreLib/Scene/Camera.cpp index 74d93f4..2dba89a 100644 --- a/tools/ArtistTools/source/CoreLib/Scene/Camera.cpp +++ b/tools/ArtistTools/source/CoreLib/Scene/Camera.cpp @@ -136,9 +136,9 @@ D3DXMATRIX * D3DXMatrixLookAtLH( D3DXVECTOR3 yaxis = gfsdk_cross(zaxis, xaxis); gfsdk_makeIdentity(*pOut); - pOut->_11 = zaxis.x; - pOut->_21 = zaxis.y; - pOut->_31 = zaxis.z; + pOut->_11 = xaxis.x; + pOut->_21 = xaxis.y; + pOut->_31 = xaxis.z; pOut->_12 = yaxis.x; pOut->_22 = yaxis.y; pOut->_32 = yaxis.z; diff --git a/tools/ArtistTools/source/CoreLib/Scene/Gamepad.cpp b/tools/ArtistTools/source/CoreLib/Scene/Gamepad.cpp index 01e3323..246ce04 100644 --- a/tools/ArtistTools/source/CoreLib/Scene/Gamepad.cpp +++ b/tools/ArtistTools/source/CoreLib/Scene/Gamepad.cpp @@ -263,7 +263,7 @@ void ToggleSimulation() #endif // NV_ARTISTTOOLS } -void StartAnimation() +void PlaySample() { #ifndef NV_ARTISTTOOLS GlobalSettings::Inst().toggleSimulation(); @@ -282,7 +282,7 @@ void StartAnimation() // reset animation //toolbar->on_btnResetAnimation_clicked(); #else - CoreLib::Inst()->Gamepad_StartAnimation(); + CoreLib::Inst()->Gamepad_PlaySample(); #endif // NV_ARTISTTOOLS } @@ -353,7 +353,7 @@ void LoadSamples(bool bNext) continue; QString fn = t.toLower(); std::string strFN = fn.toUtf8().data(); - const char* ptest = strstr(strFN.c_str(), ".furproj"); + const char* ptest = strstr(strFN.c_str(), ".blastProj"); if (ptest) { const char* pchar = strchr(strFN.c_str(), ':'); @@ -397,7 +397,7 @@ void LoadSamples(bool bNext) if(!projectPath.isEmpty()) { QStringList filters; - filters<<QString("*.furproj"); + filters<<QString("*.blastProj"); QDirIterator dir_iterator(projectPath, filters, QDir::Files | QDir::NoSymLinks,QDirIterator::Subdirectories); while(dir_iterator.hasNext()) { @@ -1259,13 +1259,13 @@ void Gamepad::DemoModeOnOff() void Gamepad::DemoNext() { LoadSamples(true); - StartAnimation(); + PlaySample(); } void Gamepad::DemoPrev() { LoadSamples(false); - StartAnimation(); + PlaySample(); } void Gamepad::SetDemoMode(bool onOff) @@ -1278,9 +1278,6 @@ void Gamepad::SetDemoMode(bool onOff) { curentPrjIdx = -1; // make it start from first demo DemoNext(); - - // turn off FPS display - GlobalSettings::Inst().m_showFPS = false; } else { diff --git a/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.cpp b/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.cpp index 1903d32..6a826ca 100644 --- a/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.cpp +++ b/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.cpp @@ -250,11 +250,49 @@ void GlobalSettings::setSceneUnitIndex(int i) /////////////////////////////////////////////////////////////////////////////// +bool GlobalSettings::isSupportedUnitByUnitInCm(float fUnitInCm) +{ + int unit = identifyUnitByUnitInCm(fUnitInCm); + return unit != SCENE_UNIT_UNKNOWN; +} + +int GlobalSettings::identifyUnitByUnitInCm(float fUnitInCm) +{ + float fError = 0.001f; + if (fabs(fUnitInCm - 1.0f) < fError) + { + return SCENE_UNIT_CENTIMETER; + } + if (fabs(fUnitInCm - 2.54f) < fError) + { + return SCENE_UNIT_INCH; + } + if (fabs(fUnitInCm - 100.0f) < fError) + { + return SCENE_UNIT_METER; + } + if (fabs(fUnitInCm - 10.0f) < fError) + { + return SCENE_UNIT_DECIMETER; + } + return SCENE_UNIT_UNKNOWN; // should never happen +} + +void GlobalSettings::setSceneUnitByUnitInCm(float fUnitInCm) +{ + m_sceneUnitIndex = identifyUnitByUnitInCm(fUnitInCm); +} + float GlobalSettings::getSceneUnitInCentimeters() { + return getSceneUnitInCentimeters(m_sceneUnitIndex); +} + +float GlobalSettings::getSceneUnitInCentimeters(int unitIndex) +{ float unit = 1.0f; - switch (m_sceneUnitIndex) + switch (unitIndex) { case SCENE_UNIT_CENTIMETER: unit = 1.0f; diff --git a/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.h b/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.h index c83143b..7c1e666 100644 --- a/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.h +++ b/tools/ArtistTools/source/CoreLib/Scene/GlobalSettings.h @@ -148,7 +148,11 @@ public: bool isBindPose() { return m_animationIndex == 0; } float getSceneUnitInCentimeters(); + static float getSceneUnitInCentimeters(int unitIndex); void setSceneUnitIndex(int i); + void setSceneUnitByUnitInCm(float fUnitInCm); + static int identifyUnitByUnitInCm(float fUnitInCm); + static bool isSupportedUnitByUnitInCm(float fUnitInCm); void setTimeStep(float timeStep) { m_timeStep = timeStep; } diff --git a/tools/ArtistTools/source/CoreLib/Scene/Light.cpp b/tools/ArtistTools/source/CoreLib/Scene/Light.cpp index e18314e..5f17e66 100644 --- a/tools/ArtistTools/source/CoreLib/Scene/Light.cpp +++ b/tools/ArtistTools/source/CoreLib/Scene/Light.cpp @@ -512,7 +512,7 @@ bool Light::SetEnvTextureFromFilePath(const char* textureFilePath) m_envTextureFilePath = (textureFilePath) ? textureFilePath : ""; SAFE_RELEASE(m_pEnvTextureSRV); - if ((!textureFilePath) && (strlen(textureFilePath) > 0)) + if ((textureFilePath) && (strlen(textureFilePath) > 0)) m_pEnvTextureSRV = RenderInterface::CreateTextureResource(textureFilePath); return true; diff --git a/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.cpp b/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.cpp index a633770..ddbf517 100644 --- a/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.cpp +++ b/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.cpp @@ -171,8 +171,8 @@ bool SimpleScene::Initialize( HWND hWnd, int backdoor) if(!InitCameraMouse(hWnd)) return false; -// if (!SimpleRenderable::Initialize()) -// return false; + if (!SimpleRenderable::Initialize()) + return false; Light::Initialize(); @@ -189,30 +189,7 @@ bool SimpleScene::Initialize( HWND hWnd, int backdoor) SetFurModified(false); SetProjectModified(false); -#ifndef NV_ARTISTTOOLS - if (!InitializeBlastSDK(&g_logHandler, backdoor)) - return false; - - g_projectParamsContext = CreateProjectParamsContext(); - if (!g_projectParamsContext) return false; - - { - NvHair::Sdk* hairSdk = GetHairSDK(); - if (hairSdk) - { - const NvHair::BuildInfo& buildInfo = GetHairSDK()->getBuildInfo(); - - viewer_info(GetHairSDK()->getBuildInfo().m_buildString); - - char releaseVersion[100] = "Blast Release:"; - buildInfo.m_versionToStringFunc(buildInfo.m_releaseVersion, releaseVersion + strlen(releaseVersion)); - - viewer_info(releaseVersion); - } - } -#else CoreLib::Inst()->SimpleScene_Initialize(backdoor); -#endif // NV_ARTISTTOOLS AppMainWindow::Inst().updateUI(); @@ -324,22 +301,6 @@ Timer& SimpleScene::GetTimer() /////////////////////////////////////////////////////////////////////////////// void SimpleScene::Draw() { - CoreLib* pCore = CoreLib::Inst(); - pCore->D3DWidget_paintEvent(NULL); -#ifndef NV_ARTISTTOOLS -#else - //pCore->SimpleScene_Draw_DX12(); - - //RenderInterface::SwitchToDX11(); - - //pCore->SimpleScene_Draw_DX11(); - - //RenderInterface::FlushDX11(); -#endif - // present current window - //RenderInterface::PresentRenderWindow(); - return; - if (IsSceneLoading()) return; @@ -364,9 +325,6 @@ void SimpleScene::Draw() // update camera UpdateCamera(); - // draw lights - Light::DrawLights(m_pCamera); - // show ground grid if (globalSettings.m_showGrid) DrawGround(); @@ -386,23 +344,6 @@ void SimpleScene::Draw() if (GlobalSettings::Inst().m_visualizeShadowMap) Light::RenderShadowMap(); -#ifndef NV_ARTISTTOOLS - // init profiler stats - FurRenderer::ResetFrameTimer(); - // the main loop to simulate and render hairs and meshes - FurRenderer::UpdateFrame(); - FurRenderer::Render(m_pCamera); - - RenderInterface::SwitchToDX11(); - // draw bone name for first hair (hacky, needs to go into SDK) - HairInstance* pInstance = GetFurCharacter().GetFirstSelectedHairInstance(); - if (pInstance && globalSettings.m_visualizeBoneNames) - pInstance->DrawBoneNames(m_pCamera); - - // draw HUD. - FurRenderer::DrawHUD(); - RenderInterface::FlushDX11(); -#else CoreLib::Inst()->SimpleScene_Draw_DX12(); RenderInterface::SwitchToDX11(); @@ -411,7 +352,8 @@ void SimpleScene::Draw() RenderInterface::FlushDX11(); -#endif // NV_ARTISTTOOLS + // draw lights + Light::DrawLights(m_pCamera); // present current window RenderInterface::PresentRenderWindow(); @@ -512,18 +454,13 @@ SimpleScene::LoadSceneFromFbx(const char* dir, const char* fbxName) /////////////////////////////////////////////////////////////////////////////// bool SimpleScene::LoadProject(const char* dir, const char* file) { - GlobalSettings& globalSettings = GlobalSettings::Inst(); + Clear(); + GlobalSettings& globalSettings = GlobalSettings::Inst(); globalSettings.m_projectFileDir = dir; globalSettings.m_projectFileName = file; -#ifndef NV_ARTISTTOOLS - nvidia::parameterized::HairProjectParametersNS::ParametersStruct params; - if (!ProjectParamsLoad(g_projectParamsContext, globalSettings.getAbsoluteFilePath().c_str(), this)) - return false; -#else CoreLib::Inst()->SimpleScene_LoadProject(dir, file); -#endif // NV_ARTISTTOOLS SetProjectModified(false); @@ -950,18 +887,20 @@ void SimpleScene::UpdateCamera() float minZ = 1.0f; float maxZ = 10000.0f; // should calculate dynamically - +/* if (sceneUnit != 0.0f) { minZ /= sceneUnit; maxZ /= sceneUnit; } - +*/ m_pCamera->SetAspetRatio(aspect); m_pCamera->SetZFar(maxZ); m_pCamera->SetZNear(minZ); m_pCamera->Perspective(); + + CoreLib::Inst()->SimpleScene_UpdateCamera(); } void SimpleScene::FitCamera() @@ -975,7 +914,11 @@ void SimpleScene::FitCamera() if (m_pFurCharacter) m_pFurCharacter->ComputeBounds(center, extents, false); #else - CoreLib::Inst()->SimpleScene_FitCamera(center, extents); + bool valid = CoreLib::Inst()->SimpleScene_FitCamera(center, extents); + if (!valid) + { + return; + } #endif // NV_ARTISTTOOLS m_pCamera->FitBounds(center, extents); diff --git a/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.h b/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.h index 8d01970..79597d2 100644 --- a/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.h +++ b/tools/ArtistTools/source/CoreLib/Scene/SimpleScene.h @@ -34,6 +34,7 @@ #include <QtCore/QMap> #include "Camera.h" #include "Timer.h" +#include <DirectXMath.h> class FurCharacter; class DeviceManager; @@ -141,6 +142,34 @@ public: Timer& GetTimer(); + DirectX::XMMATRIX GetViewMatrix() const + { + atcore_float4x4& matrix = m_pCamera->_viewMatrix; + return DirectX::XMMATRIX( + matrix._11, matrix._12, matrix._13, matrix._14, + matrix._21, matrix._22, matrix._23, matrix._24, + matrix._31, matrix._32, matrix._33, matrix._34, + matrix._41, matrix._42, matrix._43, matrix._44); + } + DirectX::XMMATRIX GetProjMatrix() const + { + atcore_float4x4& matrix = m_pCamera->_projectionMatrix; + return DirectX::XMMATRIX( + matrix._11, matrix._12, matrix._13, matrix._14, + matrix._21, matrix._22, matrix._23, matrix._24, + matrix._31, matrix._32, matrix._33, matrix._34, + matrix._41, matrix._42, matrix._43, matrix._44); + } + DirectX::XMVECTOR GetEyePt() const + { + return DirectX::XMLoadFloat3( + reinterpret_cast<const DirectX::XMFLOAT3*>(&m_pCamera->_eye)); + } + DirectX::XMVECTOR GetLookAtPt() const + { + return DirectX::XMLoadFloat3( + reinterpret_cast<const DirectX::XMFLOAT3*>(&m_pCamera->_at)); + } private: // initialize scene components bool InitCameraMouse(HWND hAppWnd); diff --git a/tools/ArtistTools/source/CoreLib/UI/AppMainWindow.qrc b/tools/ArtistTools/source/CoreLib/UI/AppMainWindow.qrc new file mode 100644 index 0000000..3ec3217 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/AppMainWindow.qrc @@ -0,0 +1,36 @@ +<RCC> + <qresource prefix="AppMainWindow"> + <file>images/TextureBox.bmp</file> + <file>images/CheckBox.png</file> + <file>images/ArrowUp.png</file> + <file>images/ArrowDown.png</file> + <file>images/transportLoop.png</file> + <file>images/transportPlay.png</file> + <file>images/transportRewind.png</file> + <file>images/transportStepForward.png</file> + <file>images/transportStop.png</file> + <file>images/simulationPlay.png</file> + <file>images/simulationStop.png</file> + <file>images/simulationStep.png</file> + <file>images/DarkBorder.png</file> + <file>images/openFile.png</file> + <file>images/importFile.png</file> + <file>images/saveDisc.png</file> + <file>images/refreshReload.png</file> + <file>images/TextureEnabled_icon.png</file> + <file>images/TextureDisabled_icon.png</file> + <file>images/TextureIsUsed_icon.png</file> + <file>images/Remove_icon.png</file> + <file>images/Refresh_icon.png</file> + <file>images/CurveEditor.png</file> + <file>images/Add.png</file> + <file>images/Up.png</file> + <file>images/Down.png</file> + <file>images/EditWrench.png</file> + <file>images/playlist.png</file> + <file>images/visibilityToggle_notVisible.png</file> + <file>images/visibilityToggle_visible.png</file> + <file>ThemeDark.qss</file> + </qresource> +</RCC> +
\ No newline at end of file diff --git a/tools/ArtistTools/source/CoreLib/UI/AppMainWindow.ui b/tools/ArtistTools/source/CoreLib/UI/AppMainWindow.ui new file mode 100644 index 0000000..da546fa --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/AppMainWindow.ui @@ -0,0 +1,428 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AppMainWindowClass</class> + <widget class="QMainWindow" name="AppMainWindowClass"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>1078</width> + <height>683</height> + </rect> + </property> + <property name="windowTitle"> + <string>Blast Viewer</string> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <widget class="QWidget" name="centralWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="renderLayout"/> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menuBar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>1078</width> + <height>21</height> + </rect> + </property> + </widget> + <widget class="QStatusBar" name="statusBar"/> + <widget class="QDockWidget" name="dockWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>370</width> + <height>140</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>524287</width> + <height>10000</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="features"> + <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set> + </property> + <property name="allowedAreas"> + <set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set> + </property> + <property name="windowTitle"> + <string>Attributes</string> + </property> + <attribute name="dockWidgetArea"> + <number>2</number> + </attribute> + <widget class="QWidget" name="dockWidgetContents"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="leftMargin"> + <number>3</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QTabWidget" name="sideBarTab"> + <property name="currentIndex"> + <number>0</number> + </property> + <!-- + <widget class="QWidget" name="tabFur"> + <attribute name="title"> + <string>Hair</string> + </attribute> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item row="1" column="0"> + <widget class="QFrame" name="furMaterialEditorArea"> + <layout class="QVBoxLayout" name="furMaterialEditorAreaLayout"> + <property name="leftMargin"> + <number>2</number> + </property> + <property name="topMargin"> + <number>2</number> + </property> + <property name="rightMargin"> + <number>2</number> + </property> + <property name="bottomMargin"> + <number>2</number> + </property> + </layout> + </widget> + </item> + <item row="0" column="0"> + <widget class="QScrollArea" name="furScrollArea"> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <widget class="QWidget" name="furScrollAreaContents"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>359</width> + <height>481</height> + </rect> + </property> + <layout class="QVBoxLayout" name="furScrollAreaLayout"> + <property name="spacing"> + <number>3</number> + </property> + <property name="leftMargin"> + <number>2</number> + </property> + <property name="topMargin"> + <number>2</number> + </property> + <property name="rightMargin"> + <number>2</number> + </property> + <property name="bottomMargin"> + <number>2</number> + </property> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + --> + <widget class="QWidget" name="tabDisplay"> + <attribute name="title"> + <string>Settings</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QScrollArea" name="displayScrollArea"> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <widget class="QWidget" name="displayScrollAreaContents"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>359</width> + <height>491</height> + </rect> + </property> + <layout class="QVBoxLayout" name="displayScrollAreaLayout"> + <property name="spacing"> + <number>3</number> + </property> + <property name="leftMargin"> + <number>2</number> + </property> + <property name="topMargin"> + <number>2</number> + </property> + <property name="rightMargin"> + <number>2</number> + </property> + <property name="bottomMargin"> + <number>2</number> + </property> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + </widget> + <widget class="QDockWidget" name="dockOutputWindow"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Ignored"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>256</width> + <height>100</height> + </size> + </property> + <property name="features"> + <set>QDockWidget::AllDockWidgetFeatures</set> + </property> + <property name="allowedAreas"> + <set>Qt::AllDockWidgetAreas</set> + </property> + <property name="windowTitle"> + <string>Output Window</string> + </property> + <attribute name="dockWidgetArea"> + <number>8</number> + </attribute> + <widget class="QWidget" name="dockWidgetContents_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Ignored" vsizetype="Ignored"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="OutputWindow" name="outputWindow" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="openExternalLinks" stdset="0"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + <!-- + <widget class="QDockWidget" name="dockWidgetCurveEditor"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Ignored"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>160</width> + <height>50</height> + </size> + </property> + <property name="windowTitle"> + <string>Curve Editor</string> + </property> + <attribute name="dockWidgetArea"> + <number>8</number> + </attribute> + <widget class="QWidget" name="dockWidgetContents_3"> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QFrame" name="furCurveEditorArea"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="furCurveEditorAreaLayout"> + <property name="spacing"> + <number>3</number> + </property> + <property name="leftMargin"> + <number>2</number> + </property> + <property name="topMargin"> + <number>2</number> + </property> + <property name="rightMargin"> + <number>2</number> + </property> + <property name="bottomMargin"> + <number>2</number> + </property> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + --> + </widget> + <layoutdefault spacing="6" margin="11"/> + <customwidgets> + <customwidget> + <class>OutputWindow</class> + <extends>QWidget</extends> + <header>outputwindow.h</header> + </customwidget> + </customwidgets> + <resources> + <include location="AppMainWindow.qrc"/> + </resources> + <connections/> +</ui> diff --git a/tools/ArtistTools/source/CoreLib/UI/CameraBookmarksDialog.ui b/tools/ArtistTools/source/CoreLib/UI/CameraBookmarksDialog.ui new file mode 100644 index 0000000..e914b60 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/CameraBookmarksDialog.ui @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>CameraBookmarksDialog</class> + <widget class="QDialog" name="CameraBookmarksDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>CameraBookmarksDialog</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QListWidget" name="listWidgetBookmarks"/> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="labelBookmarkName"> + <property name="text"> + <string>Bookmark name:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="editBookmarkName"/> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="btnRename"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>23</height> + </size> + </property> + <property name="text"> + <string>rename</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnDelete"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>23</height> + </size> + </property> + <property name="text"> + <string>delete</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <layoutdefault spacing="6" margin="11"/> + <resources/> + <connections/> +</ui> diff --git a/tools/ArtistTools/source/CoreLib/UI/DisplayLightPanel.ui b/tools/ArtistTools/source/CoreLib/UI/DisplayLightPanel.ui new file mode 100644 index 0000000..41514f5 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/DisplayLightPanel.ui @@ -0,0 +1,645 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DisplayLightPanel</class> + <widget class="QWidget" name="DisplayLightPanel"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>340</width> + <height>315</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="10" column="0" colspan="2"> + <widget class="QListWidget" name="listSelectedLight"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>320</width> + <height>60</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>320</width> + <height>60</height> + </size> + </property> + </widget> + </item> + <item row="12" column="1"> + <widget class="QCheckBox" name="btnLightEnable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="20" column="0"> + <widget class="QLabel" name="label_1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Color</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="20" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QPushButton" name="btnLightColor"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnLightColorTex"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="whatsThis"> + <string/> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="accessibleDescription"> + <string/> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="text"> + <string/> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnLightColorTexReload"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="whatsThis"> + <string/> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="accessibleDescription"> + <string/> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="text"> + <string/> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnLightColorTexClear"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="whatsThis"> + <string/> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="accessibleDescription"> + <string/> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="text"> + <string/> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="30" column="0"> + <widget class="QLabel" name="label_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Intensity</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="30" column="1"> + <widget class="SlideSpinBox<QDoubleSpinBox, double>" name="spinLightIntensity" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>20</height> + </size> + </property> + </widget> + </item> + <item row="40" column="0"> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Cast Shadow</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="40" column="1"> + <widget class="QCheckBox" name="btnLightUseShadow"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="50" column="0"> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Shadow Map Resolution</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="50" column="1"> + <widget class="QComboBox" name="cbShadowMapResolution"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <item> + <property name="text"> + <string>2048 (Default)</string> + </property> + </item> + <item> + <property name="text"> + <string>4096</string> + </property> + </item> + <item> + <property name="text"> + <string>1024</string> + </property> + </item> + <item> + <property name="text"> + <string>512</string> + </property> + </item> + <item> + <property name="text"> + <string>8192</string> + </property> + </item> + <item> + <property name="text"> + <string>16384</string> + </property> + </item> + </widget> + </item> + <item row="12" column="0"> + <widget class="QLabel" name="label_4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Enable</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="11" column="0"> + <widget class="QLabel" name="label_5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Link Light</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="11" column="1"> + <widget class="QCheckBox" name="btnLinkLightEnable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>320</width> + <height>0</height> + </size> + </property> + <property name="title"> + <string>Visualize</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Light</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QCheckBox" name="btnVisualizeLight"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="15" column="0"> + <widget class="QLabel" name="label_shadow"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="text"> + <string>Shadow Map</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="15" column="1"> + <widget class="QCheckBox" name="btnVisualizeShadowMap"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="30" column="0"> + <widget class="QLabel" name="label_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Distance</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="30" column="1"> + <widget class="SlideSpinBox<QDoubleSpinBox, double>" name="spinLightDistance" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>20</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>SlideSpinBox<QDoubleSpinBox, double></class> + <extends>QWidget</extends> + <header>SlideSpinBox.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/tools/ArtistTools/source/CoreLib/UI/DisplayPreferencesPanel.ui b/tools/ArtistTools/source/CoreLib/UI/DisplayPreferencesPanel.ui new file mode 100644 index 0000000..0cdbcac --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/DisplayPreferencesPanel.ui @@ -0,0 +1,885 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DisplayPreferencesPanel</class> + <widget class="QWidget" name="DisplayPreferencesPanel"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>320</width> + <height>515</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QGridLayout" name="gridLayout"> + <property name="sizeConstraint"> + <enum>QLayout::SetFixedSize</enum> + </property> + <item row="0" column="1"> + <widget class="QComboBox" name="cbAntialiasing"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <item> + <property name="text"> + <string>Hardware MSAA</string> + </property> + </item> + <item> + <property name="text"> + <string>Custom MSAA 2x</string> + </property> + </item> + <item> + <property name="text"> + <string>Custom MSAA 4x</string> + </property> + </item> + <item> + <property name="text"> + <string>Custom MSAA 8x</string> + </property> + </item> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="labelRenderPlayRateFPS"> + <property name="text"> + <string>Render Play Rate FPS</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QDoubleSpinBox" name="spinRenderPlayRateFPS"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>80</width> + <height>16777215</height> + </size> + </property> + <property name="decimals"> + <number>0</number> + </property> + <property name="minimum"> + <double>10.000000000000000</double> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="value"> + <double>60.000000000000000</double> + </property> + </widget> + </item> + <item row="7" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="sizeConstraint"> + <enum>QLayout::SetMinimumSize</enum> + </property> + <item> + <widget class="QPushButton" name="btnBackgroundTex"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnBackgroundTexClear"> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>110</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Navigation Style</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="labelCustomMSAA"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Custom Hair MSAA</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QComboBox" name="cbUpAxis"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <item> + <property name="text"> + <string>Y</string> + </property> + </item> + <item> + <property name="text"> + <string>Z</string> + </property> + </item> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Background Image</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="SlideSpinBox<QDoubleSpinBox, double>" name="spinCameraFOV" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>20</height> + </size> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QComboBox" name="cbHandedness"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <item> + <property name="text"> + <string>Right Handed</string> + </property> + </item> + <item> + <property name="text"> + <string>Left Handed</string> + </property> + </item> + </widget> + </item> + <item row="3" column="1"> + <widget class="QComboBox" name="cbSceneUnit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="currentText"> + <string>Unknown</string> + </property> + <item> + <property name="text"> + <string>Unknown</string> + </property> + </item> + <item> + <property name="text"> + <string>Centimeter</string> + </property> + </item> + <item> + <property name="text"> + <string>Meter</string> + </property> + </item> + <item> + <property name="text"> + <string>Inch</string> + </property> + </item> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Handedness</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Scene Unit</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Up Axis</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QComboBox" name="cbNavigationStyle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <item> + <property name="text"> + <string>Maya</string> + </property> + </item> + <item> + <property name="text"> + <string>3ds Max</string> + </property> + </item> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="labelCameraFOV"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Camera FOV</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="labelSimulationRateFPS"> + <property name="text"> + <string>Simulation Rate FPS</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QDoubleSpinBox" name="spinSimulationRateFPS"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>80</width> + <height>16777215</height> + </size> + </property> + <property name="decimals"> + <number>0</number> + </property> + <property name="minimum"> + <double>10.000000000000000</double> + </property> + <property name="maximum"> + <double>1000.000000000000000</double> + </property> + <property name="value"> + <double>60.000000000000000</double> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>300</width> + <height>16777215</height> + </size> + </property> + <property name="title"> + <string>Playlists</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="30" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>60</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="btnPlaylistAddProj"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnPlaylistRemoveProj"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnPlaylistProjGoUp"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnPlaylistProjGoDown"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item row="1" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QPushButton" name="btnPlaylistsRename"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnPlaylistsAdd"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnPlaylistsReload"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnPlaylistsRemove"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16</width> + <height>16</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>60</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="1" column="0"> + <widget class="QComboBox" name="cbPlaylists"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="2" column="0" rowspan="3" colspan="2"> + <widget class="TipListView" name="listWidgetPlaylist" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>280</width> + <height>90</height> + </size> + </property> + </widget> + </item> + <item row="31" column="1"> + <widget class="QPushButton" name="btnPlaylistsPlay"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>SlideSpinBox<QDoubleSpinBox, double></class> + <extends>QWidget</extends> + <header>SlideSpinBox.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>TipListView</class> + <extends>QWidget</extends> + <header>tiplistview.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/tools/ArtistTools/source/CoreLib/UI/DisplayScenePanel.ui b/tools/ArtistTools/source/CoreLib/UI/DisplayScenePanel.ui new file mode 100644 index 0000000..5b24c41 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/DisplayScenePanel.ui @@ -0,0 +1,616 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DisplayScenePanel</class> + <widget class="QWidget" name="DisplayScenePanel"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>320</width> + <height>282</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="12" column="1"> + <widget class="QCheckBox" name="btnComputeProfile"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="9" column="1"> + <widget class="QCheckBox" name="btnShowAxis"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="QCheckBox" name="btnShowGrid"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="label_1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Show Grid</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QCheckBox" name="btnVisualizeWind"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="10" column="0"> + <widget class="QLabel" name="label_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Show HUD</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="9" column="0"> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Show Axis</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="10" column="1"> + <widget class="QCheckBox" name="btnShowHUD"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="7" column="2"> + <widget class="QLabel" name="label_4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="label_5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>138</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Visualize Wind</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="11" column="0"> + <widget class="QLabel" name="label_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Compute Stats</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="11" column="1"> + <widget class="QCheckBox" name="btnComputeStats"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="12" column="0"> + <widget class="QLabel" name="label_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Compute Profile</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="13" column="0"> + <widget class="QLabel" name="labelGizmoWithLocal"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>130</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string>Gizmo With Local</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="13" column="1"> + <widget class="QCheckBox" name="checkBoxGizmoWithLocal"/> + </item> + <item row="14" column="0"> + <widget class="QLabel" name="labelGizmoWithDepthTest"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>130</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string>Gizmo With DepthTest</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="14" column="1"> + <widget class="QCheckBox" name="checkBoxGizmoWithDepthTest"/> + </item> + <item row="15" column="0"> + <widget class="QLabel" name="labelShowPlane"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>130</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string>Show Plane</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="15" column="1"> + <widget class="QCheckBox" name="checkBoxShowPlane"/> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Mesh Rendering</string> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="4" column="0"> + <widget class="QLabel" name="label_8"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Render Type</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QComboBox" name="cbRenderType"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <property name="frame"> + <bool>true</bool> + </property> + <item> + <property name="text"> + <string>Wireframe</string> + </property> + </item> + <item> + <property name="text"> + <string>Flat</string> + </property> + </item> + <item> + <property name="text"> + <string>Shaded</string> + </property> + </item> + <item> + <property name="text"> + <string>Textured</string> + </property> + </item> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label_9"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Show Wireframe Over</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QCheckBox" name="btnShowWireframe"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="label_10"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Use Mesh Lighting</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QCheckBox" name="btnUseLighting"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="label_11"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Show Graphics Mesh</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="QCheckBox" name="btnShowGraphicsMesh"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="9" column="0"> + <widget class="QLabel" name="label_12"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Use Skinned Mesh Only</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="9" column="1"> + <widget class="QCheckBox" name="btnShowSkinnedOnly"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="10" column="0"> + <widget class="QLabel" name="label_13"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Use DQ Skinning</string> + </property> + <property name="textFormat"> + <enum>Qt::PlainText</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="10" column="1"> + <widget class="QCheckBox" name="btnSkinningDQ"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/tools/ArtistTools/source/CoreLib/UI/OutputWindow.ui b/tools/ArtistTools/source/CoreLib/UI/OutputWindow.ui new file mode 100644 index 0000000..accef7b --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/OutputWindow.ui @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>OutputWindow</class> + <widget class="QTextBrowser" name="textBrowser"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>676</width> + <height>430</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + </widget> + <resources/> + <connections/> +</ui> diff --git a/tools/ArtistTools/source/CoreLib/UI/ThemeDark.qss b/tools/ArtistTools/source/CoreLib/UI/ThemeDark.qss new file mode 100644 index 0000000..f742ff0 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/ThemeDark.qss @@ -0,0 +1,457 @@ +AppMainWindow * +{ + background-color:rgb(68,68,68); color:rgb(200,200,200); +} + +AppMainWindow::separator +{ + background-color: rgb(68, 68, 68); + + /*trick: qdockwidget stylesheet seems to have bugs, use the separator border*/ + + border-right-width: 2px; + border-image: url(:/AppMainWindow/images/DarkBorder.png) 2; +} + +AppMainWindow::separator:hover +{ + background-color: #666666; +} + +AppMainWindow QDockWidget::title +{ + text-align: center; + /* + border-top-color: rgb(45,45,45); + border-top-width: 2px; + border-top-style: groove; + */ + + background-color: rgb(68,68,68); + border-width: 2px; + border-image: url(:/AppMainWindow/images/DarkBorder.png) 2; + +} + +AppMainWindow QTextBrowser +{ + /* + border-width: 1px; + border-image: url(:/AppMainWindow/images/DarkBorder.png) 2; + */ + border: 1px solid gray; + background-color:rgb(40,40,40); +} + +AppMainWindow QCheckBox::indicator::unchecked +{ + background-color:rgb(40,40,40); +} + +AppMainWindow QCheckBox::indicator::checked +{ + image:url(:/AppMainWindow/images/CheckBox.png); +} + +AppMainWindow QPushButton +{ + border: 1px solid gray; +} + +AppMainWindow QPushButton:pressed +{ + border: 2px solid rgb(118,185,0); + /*background-color: rgb(118,185,0);*/ +} + +AppMainWindow QPushButton:checked +{ + border: 2px solid rgb(118,185,0); + /*background-color: rgb(118,185,0);*/ +} + +/****** QScrollbar Styles ******/ +AppMainWindow QScrollBar:vertical +{ + width: 22px; + /* + border-width: 2px; + border-image: url(:/AppMainWindow/images/DarkBorder.png) 2; + */ + border: 1px solid rgb(40,40,40); + margin: 20px 1px 20px 0px; +} + +AppMainWindow QScrollBar::handle:vertical +{ + border-top: 1px solid rgb(40,40,40); + border-bottom: 1px solid rgb(40,40,40); + background: qlineargradient(x1:0, y1:0, x2:1, y2:0, + stop:0 rgb(116,116,116), stop: 1 rgb(95,95,95)); + min-height: 20px; +} + +AppMainWindow QScrollBar::add-line:vertical +{ + border: 1px solid rgb(40,40,40); + background: qlineargradient(x1:0, y1:0, x2:1, y2:0, + stop:0 rgb(116,116,116), stop: 1 rgb(95,95,95)); + + margin-right: 1px; + margin-bottom: 1px; + height: 18px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +AppMainWindow QScrollBar::sub-line:vertical +{ + margin-top: 1px; + margin-right: 1px; + border: 1px solid rgb(40,40,40); + background: qlineargradient(x1:0, y1:0, x2:1, y2:0, + stop:0 rgb(116,116,116), stop: 1 rgb(95,95,95)); + height: 18px; + subcontrol-position: top; + subcontrol-origin: margin; +} + +QScrollBar::up-arrow:vertical +{ + image: url(:/AppMainWindow/images/ArrowUp.png); +} + +QScrollBar::up-arrow:vertical:pressed +{ + top: 1px; +} + +QScrollBar::down-arrow:vertical +{ + image: url(:/AppMainWindow/images/ArrowDown.png); +} + +QScrollBar::down-arrow:vertical:pressed +{ + top: 1px; +} + +AppMainWindow QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical +{ + background: none; +} + +/****** ListWidget Styles ******/ +AppMainWindow QListWidget { + alternate-background-color: yellow; + border: 1px solid gray; + border-radius: 0px; + } + +AppMainWindow QListWidget { + show-decoration-selected: 1; /* make the selection span the entire width of the view */ + } + + AppMainWindow QListWidget::item:alternate { + background: #EEEEEE; + } + + AppMainWindow QListWidget::item:selected { + border: 1px solid #6a6ea9; + } + + AppMainWindow QListWidget::item:selected:!active { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #00aa00, stop: 1 #00dd00); + } + + AppMainWindow QListWidget::item:selected:active { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #00aa00, stop: 1 #00dd00); + } + + AppMainWindow QListWidget::item:hover { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #DDFFDD, stop: 1 #CCFFCC); + } + + /****** TreeWidget Styles ******/ +AppMainWindow QTreeWidget { + alternate-background-color: yellow; + border: 1px solid gray; + border-radius: 0px; + } + +AppMainWindow QTreeWidget { + show-decoration-selected: 1; /* make the selection span the entire width of the view */ + } + + AppMainWindow QTreeWidget::item:alternate { + background: #EEEEEE; + } + + AppMainWindow QTreeWidget::item:selected { + border: 1px solid #6a6ea9; + } + + AppMainWindow QTreeWidget::item:selected:!active { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #00aa00, stop: 1 #00dd00); + } + + AppMainWindow QTreeWidget::item:selected:active { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #00aa00, stop: 1 #00dd00); + } + + AppMainWindow QTreeWidget::item:hover { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #DDFFDD, stop: 1 #CCFFCC); + } + +/****** ComboBox Styles ******/ +AppMainWindow QComboBox { + border: 1px solid gray; + border-radius: 0px; + } + +AppMainWindow QComboBox QAbstractItemView +{ + background-color: rgb(68,68,68); + selection-background-color: rgb(118,185,0); +} + + AppMainWindow QComboBox::drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + /*width: 15px;*/ + + border-left-width: 1px; + border-left-color: gray; + border-left-style: solid; + + } + +AppMainWindow QComboBox::down-arrow { + image: url(:/AppMainWindow/images/ArrowDown.png); + } + +AppMainWindow QComboBox::down-arrow:on { + top: 1px; + + } + +/****** QTabWidget Styles ******/ +AppMainWindow QTabWidget::pane +{ + /* The tab widget frame */ + border-top: 0px solid transparent; + +} + +AppMainWindow QTabWidget::tab-bar +{ + left: 5px; +} + +AppMainWindow QTabBar::tab { + margin-top: 1px; + background-color: rgb(68,68,68); + border: 1px solid gray; + border-bottom-color: rgb(68,68,68); /* same as the pane color */ + min-width: 10ex; + padding: 2px 8px; +} + +AppMainWindow QTabBar::tab:selected +{ + background-color: #666666; + border-color: gray; + border-bottom-color: transparent; +} + +AppMainWindow QTabBar::tab:!selected { + margin-top: 3px; /* make non-selected tabs look smaller */ +} + +/****** Spin And DoubleSpin Styles ******/ + +AppMainWindow QDoubleSpinBox + { + border: 1px solid gray; + background-color: rgb(40,40,40); + } + +AppMainWindow QSpinBox + { + border: 1px solid gray; + background-color: rgb(40,40,40); + } + +AppMainWindow QSpinBox::up-button +{ + background-color:rgb(68,68,68); + border: 1px solid gray; + margin-top: 1px; + margin-right: 1px; +} + +AppMainWindow QSpinBox::up-button:pressed { + border: 1px solid rgb(118,185,0); +} + +AppMainWindow QSpinBox::down-button +{ + background-color:rgb(68,68,68); + border: 1px solid gray; + margin-bottom: 1px; + margin-right: 1px; +} + +AppMainWindow QSpinBox::down-button:pressed { + border: 1px solid rgb(118,185,0); +} + +AppMainWindow QSpinBox::up-arrow +{ + image: url(:/AppMainWindow/images/ArrowUp.png); + width: 4px; +} +AppMainWindow QSpinBox::down-arrow +{ + image: url(:/AppMainWindow/images/ArrowDown.png); + width: 4px; +} + +AppMainWindow QDoubleSpinBox::up-button +{ + background-color:rgb(68,68,68); + border: 1px solid gray; + margin-top: 1px; + margin-right: 1px; +} + +AppMainWindow QDoubleSpinBox::up-button:pressed { + border: 1px solid rgb(118,185,0); +} + +AppMainWindow QDoubleSpinBox::down-button +{ + background-color:rgb(68,68,68); + border: 1px solid gray; + margin-bottom: 1px; + margin-right: 1px; +} + +AppMainWindow QDoubleSpinBox::down-button:pressed { + border: 1px solid rgb(118,185,0); +} + +AppMainWindow QDoubleSpinBox::up-arrow +{ + image: url(:/AppMainWindow/images/ArrowUp.png); + width: 4px; +} + +AppMainWindow QDoubleSpinBox::down-arrow +{ + image: url(:/AppMainWindow/images/ArrowDown.png); + width: 4px; +} + +AppMainWindow QDoubleSpinBox::disabled +{ + background-color:rgb(32,32,32); + color:rgb(68,68,68); + border: 1px solid rgb(68,68,68); +} + +AppMainWindow QDoubleSpinBox::up-button:disabled { + border: 1px solid rgb(68,68,68); +} + +AppMainWindow QDoubleSpinBox::down-button:disabled { + border: 1px solid rgb(68,68,68); +} + +/****** Menu Styles ******/ +QMenuBar +{ + border-image: url(:/AppMainWindow/images/DarkBorder.png) 2; + border-bottom-width: 2px; +} + +AppMainWindow QMenuBar::item +{ + spacing: 3px; /* spacing between menu bar items */ + padding: 1px 4px; + margin-bottom: 2px; + background: transparent; + border-radius: 0px; +} + +AppMainWindow QMenuBar::item:selected:enabled { /* when selected using mouse or keyboard */ + background: #666666; +} + +AppMainWindow QMenuBar::item:pressed:enabled { + background: rgb(118,185,0); +} + +AppMainWindow QMenu { + border: 1px solid rgb(50,50,50); + +} + +AppMainWindow QMenuBar:disabled +{ + color:rgb(0,0,0); +} + +AppMainWindow QMenu:disabled +{ + color:rgb(0,0,0); +} + +AppMainWindow QMenu::item { + padding: 2px 25px 2px 20px; + border: 1px solid transparent; /* reserve space for selection border */ +} + +AppMainWindow QMenu::item:selected:enabled { + border-color: rgb(70,70,70); + background: rgba(118,185,0, 250); +} +/****** ExpandablePanel Styles ******/ + +AppMainWindow QGroupBox +{ + margin-top: 1.5ex; + border: 1px solid gray; + border-radius: 0px; +} + +AppMainWindow QGroupBox::title +{ + subcontrol-origin: margin; + left: 10px; + padding: 0px 3px; +} + +/* +ExpandablePanel QPushButton[flat="true"] +{ + border-color: rgb(40,40,40); + image:url(:/AppMainWindow/images/TextureBox.bmp) +} + +ExpandablePanel QPushButton[flat="true"]:pressed +{ + margin: 2px; +} +*/ + +ExpandablePanel TitleLabel +{ + background:rgb(78, 78, 78); +} diff --git a/tools/ArtistTools/source/CoreLib/UI/ThemeDefault.qss b/tools/ArtistTools/source/CoreLib/UI/ThemeDefault.qss new file mode 100644 index 0000000..f59dd25 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/ThemeDefault.qss @@ -0,0 +1,76 @@ +/****** General Styles ******/ + +AppMainWindow QPushButton +{ + /*border: 1px solid gray;*/ + background-color: rgb(230,230,230); + border-left: 1px solid rgb(200,200,200); + border-top: 1px solid rgb(200,200,200); + border-right: 1px solid rgb(60,60,60); + border-bottom: 1px solid rgb(60,60,60); +} + + +AppMainWindow QPushButton:pressed +{ + /*border: 2px solid gray;*/ + border-left: 1px solid rgb(60,60,60); + border-top: 1px solid rgb(60,60,60); + border-right: 1px solid rgb(200,200,200); + border-bottom: 1px solid rgb(200,200,200); +} + +AppMainWindow QPushButton:checked +{ + border: 1px solid gray; + border-left: 1px solid rgb(60,60,60); + border-top: 1px solid rgb(60,60,60); + border-right: 1px solid rgb(200,200,200); + border-bottom: 1px solid rgb(200,200,200); +} +/****** MainToolbar Styles ******/ + +MainToolbar QPushButton[flat="true"] +{ + border:0px; +} + + +/****** ExpandablePanel Styles ******/ + +ExpandablePanel +{ + background:rgb(240,240,240); +} + +ExpandablePanel QGroupBox +{ + margin-top: 1.5ex; + border: 1px solid gray; + border-radius: 0px; +} + +ExpandablePanel QGroupBox::title +{ + subcontrol-origin: margin; + left: 10px; + padding: 0px 3px; +} + +ExpandablePanel QPushButton[flat="true"] +{ + border: 1px solid rgb(60,60,60); + image:url(:/AppMainWindow/images/TextureBox.bmp) +} + +ExpandablePanel QPushButton[flat="true"]:pressed +{ + border: 2px solid rgb(60,60,60); + image:url(:/AppMainWindow/images/TextureBox.bmp) +} + +ExpandablePanel TitleLabel +{ + background:rgb(219, 219, 219); + border-bottom:1px solid rgb(185,185,185); +}
\ No newline at end of file diff --git a/tools/ArtistTools/source/CoreLib/UI/images/Add.png b/tools/ArtistTools/source/CoreLib/UI/images/Add.png Binary files differnew file mode 100644 index 0000000..35fd8ed --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/Add.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/ArrowDown.png b/tools/ArtistTools/source/CoreLib/UI/images/ArrowDown.png Binary files differnew file mode 100644 index 0000000..9b55420 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/ArrowDown.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/ArrowUp.png b/tools/ArtistTools/source/CoreLib/UI/images/ArrowUp.png Binary files differnew file mode 100644 index 0000000..fea1fbe --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/ArrowUp.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/CheckBox.png b/tools/ArtistTools/source/CoreLib/UI/images/CheckBox.png Binary files differnew file mode 100644 index 0000000..ac53487 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/CheckBox.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/CurveEditor.png b/tools/ArtistTools/source/CoreLib/UI/images/CurveEditor.png Binary files differnew file mode 100644 index 0000000..f92c6e4 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/CurveEditor.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/DarkBorder.png b/tools/ArtistTools/source/CoreLib/UI/images/DarkBorder.png Binary files differnew file mode 100644 index 0000000..9771804 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/DarkBorder.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/Down.png b/tools/ArtistTools/source/CoreLib/UI/images/Down.png Binary files differnew file mode 100644 index 0000000..376a821 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/Down.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/EditWrench.png b/tools/ArtistTools/source/CoreLib/UI/images/EditWrench.png Binary files differnew file mode 100644 index 0000000..563a602 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/EditWrench.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/Refresh_icon.png b/tools/ArtistTools/source/CoreLib/UI/images/Refresh_icon.png Binary files differnew file mode 100644 index 0000000..c189dd5 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/Refresh_icon.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/Remove_icon.png b/tools/ArtistTools/source/CoreLib/UI/images/Remove_icon.png Binary files differnew file mode 100644 index 0000000..ebb63d9 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/Remove_icon.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/TextureBox.bmp b/tools/ArtistTools/source/CoreLib/UI/images/TextureBox.bmp Binary files differnew file mode 100644 index 0000000..43f95b2 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/TextureBox.bmp diff --git a/tools/ArtistTools/source/CoreLib/UI/images/TextureDisabled_icon.png b/tools/ArtistTools/source/CoreLib/UI/images/TextureDisabled_icon.png Binary files differnew file mode 100644 index 0000000..3a727f4 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/TextureDisabled_icon.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/TextureEnabled_icon.png b/tools/ArtistTools/source/CoreLib/UI/images/TextureEnabled_icon.png Binary files differnew file mode 100644 index 0000000..a8f11d5 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/TextureEnabled_icon.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/TextureIsUsed_icon.png b/tools/ArtistTools/source/CoreLib/UI/images/TextureIsUsed_icon.png Binary files differnew file mode 100644 index 0000000..75d52dc --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/TextureIsUsed_icon.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/Up.png b/tools/ArtistTools/source/CoreLib/UI/images/Up.png Binary files differnew file mode 100644 index 0000000..6f8903c --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/Up.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/importFile.png b/tools/ArtistTools/source/CoreLib/UI/images/importFile.png Binary files differnew file mode 100644 index 0000000..e4ffc91 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/importFile.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/openFile.png b/tools/ArtistTools/source/CoreLib/UI/images/openFile.png Binary files differnew file mode 100644 index 0000000..b91e69c --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/openFile.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/playlist.png b/tools/ArtistTools/source/CoreLib/UI/images/playlist.png Binary files differnew file mode 100644 index 0000000..3c6db13 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/playlist.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/refreshReload.png b/tools/ArtistTools/source/CoreLib/UI/images/refreshReload.png Binary files differnew file mode 100644 index 0000000..745c9cb --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/refreshReload.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/saveDisc.png b/tools/ArtistTools/source/CoreLib/UI/images/saveDisc.png Binary files differnew file mode 100644 index 0000000..c0dc719 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/saveDisc.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/simulationPlay.png b/tools/ArtistTools/source/CoreLib/UI/images/simulationPlay.png Binary files differnew file mode 100644 index 0000000..e5bc551 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/simulationPlay.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/simulationStep.png b/tools/ArtistTools/source/CoreLib/UI/images/simulationStep.png Binary files differnew file mode 100644 index 0000000..8ab9e49 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/simulationStep.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/simulationStop.png b/tools/ArtistTools/source/CoreLib/UI/images/simulationStop.png Binary files differnew file mode 100644 index 0000000..8576b5b --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/simulationStop.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/transportLoop.png b/tools/ArtistTools/source/CoreLib/UI/images/transportLoop.png Binary files differnew file mode 100644 index 0000000..3e13e2f --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/transportLoop.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/transportPlay.png b/tools/ArtistTools/source/CoreLib/UI/images/transportPlay.png Binary files differnew file mode 100644 index 0000000..e5e593e --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/transportPlay.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/transportRewind.png b/tools/ArtistTools/source/CoreLib/UI/images/transportRewind.png Binary files differnew file mode 100644 index 0000000..95664d2 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/transportRewind.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/transportStepForward.png b/tools/ArtistTools/source/CoreLib/UI/images/transportStepForward.png Binary files differnew file mode 100644 index 0000000..4d35753 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/transportStepForward.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/transportStop.png b/tools/ArtistTools/source/CoreLib/UI/images/transportStop.png Binary files differnew file mode 100644 index 0000000..27f3cbd --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/transportStop.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/visibilityToggle_notVisible.png b/tools/ArtistTools/source/CoreLib/UI/images/visibilityToggle_notVisible.png Binary files differnew file mode 100644 index 0000000..56b24fe --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/visibilityToggle_notVisible.png diff --git a/tools/ArtistTools/source/CoreLib/UI/images/visibilityToggle_visible.png b/tools/ArtistTools/source/CoreLib/UI/images/visibilityToggle_visible.png Binary files differnew file mode 100644 index 0000000..3e5a88e --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/UI/images/visibilityToggle_visible.png diff --git a/tools/ArtistTools/source/CoreLib/Utils/XMLHelper.cpp b/tools/ArtistTools/source/CoreLib/Utils/XMLHelper.cpp new file mode 100644 index 0000000..c48b0dc --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Utils/XMLHelper.cpp @@ -0,0 +1,121 @@ +#include "XMLHelper.h" +#include <QtXml\QtXml> +#include "ViewerOutput.h" + +static int gcounter = 0; +static char gbuf[256]; + +XMLFile::XMLFile(const QString& rootName) + : _rootName(rootName) +{ +} + +void XMLFile::load(const QString& filePath) +{ + QFile file(filePath); + + if (!file.open(QIODevice::ReadOnly)) + { + return; + } + + QDomDocument xmlDoc; + if (!xmlDoc.setContent(&file)) + { + file.close(); + return; + } + file.close(); + + if (xmlDoc.isNull() || xmlDoc.documentElement().tagName() != _rootName) + { + sprintf(gbuf, "The file you selected is empty or not a speficied file: %s.", filePath.toStdString().c_str()); + viewer_msg(gbuf); + return; + } + + loadItems(xmlDoc); + + //QDomNodeList elms = xmlDoc.documentElement().elementsByTagName(QObject::tr("StressSolverPreset")); + //for (int i = 0; i < elms.count(); ++i) + //{ + // StressSolverUserPreset preset(""); + // _userPresets.push_back(preset); + // _loadStressSolverPreset(elms.at(i).toElement(), _userPresets[i]); + //} +} + +void XMLFile::save(const QString& filePath) +{ + std::string rr = filePath.toStdString(); + rr; + + QFileInfo fileInfo(filePath); + QDir fileDir = fileInfo.absoluteDir(); + + QString tt = fileDir.absolutePath(); + std::string hh = tt.toStdString(); + hh; + + if (!fileDir.exists()) + { + if (!fileDir.mkdir(fileDir.absolutePath())) + { + sprintf(gbuf, "Failed to crreate the folder: %s.", filePath.toStdString().c_str()); + viewer_msg(gbuf); + return; + } + } + QFile file(filePath); + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) + { + return; + } + QTextStream out(&file); + + QDomDocument xmlDoc; + QDomElement rootElm = xmlDoc.createElement(_rootName); + xmlDoc.appendChild(rootElm); + + saveItems(xmlDoc); + + // 4 is count of indent + xmlDoc.save(out, 4); +} + +SingleItemKindFile::SingleItemKindFile(const QString& rootName, const QString& itemName) + : XMLFile(rootName) + , _itemName(itemName) +{ +} + +void SingleItemKindFile::loadItems(QDomDocument xmlDoc) +{ + QDomNodeList elms = xmlDoc.documentElement().elementsByTagName(_itemName); + for (int i = 0; i < elms.count(); ++i) + { + QDomElement elm = elms.at(i).toElement(); + _items.push_back(elm.attribute(QObject::tr("Value"))); + } +} + +void SingleItemKindFile::saveItems(QDomDocument xmlDoc) +{ + for (int i = 0; i < _items.count(); ++i) + { + QDomElement elm = xmlDoc.createElement(_itemName); + elm.setAttribute(QObject::tr("Value"), _items.at(i)); + xmlDoc.documentElement().appendChild(elm); + } +} + +bool SingleItemKindFile::isItemExist(const QString& item) +{ + for (int i = 0; i < _items.count(); ++i) + { + if (_items.at(i) == item) + return true; + } + + return false; +} diff --git a/tools/ArtistTools/source/CoreLib/Utils/XMLHelper.h b/tools/ArtistTools/source/CoreLib/Utils/XMLHelper.h new file mode 100644 index 0000000..ca43033 --- /dev/null +++ b/tools/ArtistTools/source/CoreLib/Utils/XMLHelper.h @@ -0,0 +1,39 @@ +#pragma once +#include <QtCore\QString> +#include <QtCore\QList> +#include "corelib_global.h" + +class QDomDocument; + +class CORELIB_EXPORT XMLFile +{ +public: + XMLFile(const QString& rootName); + + void load(const QString& filePath); + void save(const QString& filePath); + +protected: + virtual void loadItems(QDomDocument xmlDoc) = 0; + virtual void saveItems(QDomDocument xmlDoc) = 0; +protected: + QString _rootName; +}; + +class CORELIB_EXPORT SingleItemKindFile : public XMLFile +{ +public: + SingleItemKindFile(const QString& rootName, const QString& itemName); + + virtual void loadItems(QDomDocument xmlDoc); + virtual void saveItems(QDomDocument xmlDoc); + + void addItemBack(const QString& item) { _items.push_back(item); } + void addItemFront(const QString& item) { _items.push_back(item); } + QList<QString>& getItems() { return _items; } + bool isItemExist(const QString& item); + +private: + QString _itemName; + QList<QString> _items; +}; diff --git a/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.cpp b/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.cpp index 3a85d8b..31a5dc5 100644 --- a/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.cpp +++ b/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.cpp @@ -151,6 +151,8 @@ AppMainWindow::AppMainWindow(QWidget *parent, Qt::WindowFlags flags) ,_bookmarkActionGroup(0) ,_actionAddBookmark(0) ,_actionEditBookmarks(0) + , _recentMenu(NV_NULL) + , _recentFileRecordFile("RecentFiles", "File") { setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); @@ -178,6 +180,8 @@ AppMainWindow::AppMainWindow(QWidget *parent, Qt::WindowFlags flags) _progressDialog.close(); // prevent show one empty progress dialog when it runs. m_bGizmoWithLocal = false; + m_bGizmoWithDepthTest = false; + m_bShowPlane = false; } void AppMainWindow::InitUI() @@ -279,6 +283,8 @@ void AppMainWindow::InitMenuItems() if (_connectionMode != 1) { + connect(ui.menuBar, SIGNAL(triggered(QAction*)), this, SLOT(menu_item_triggered(QAction*))); + act = new QAction("Clear scene", this); act->setShortcut(QKeySequence::New); connect(act, SIGNAL(triggered()), this, SLOT(menu_clearScene())); @@ -292,6 +298,15 @@ void AppMainWindow::InitMenuItems() fileMenu->addSeparator(); + act = new QAction("Recents", this); + fileMenu->addAction(act); + _recentMenu = new QMenu("Recents", this); + act->setMenu(_recentMenu); + + fileMenu->addSeparator(); + + _loadRecentFile(); + #ifndef NV_ARTISTTOOLS fileMenu->addSeparator(); act = new QAction("Open project file", this); @@ -559,6 +574,7 @@ void AppMainWindow::InitMainTab() panel->AddContent(_displayMeshesPanel); ui.displayScrollAreaLayout->insertWidget(idx++, panel); panel->SetTitle("Display Meshes"); + panel->setVisible(false); } if (_connectionMode != 1) @@ -792,9 +808,10 @@ bool AppMainWindow::openProject(QString fileName) return false; } -void AppMainWindow::processDragAndDrop(QString fname) +void AppMainWindow::processDragAndDrop(const QStringList& fileNames) { - openProject(fname); + CoreLib::Inst()->SimpleScene_OpenFilesByDrop(fileNames); + updateUI(); } void AppMainWindow::removeBookmark(const QString& name) @@ -861,6 +878,33 @@ void AppMainWindow::ShowCurveEditor(int paramId) } #endif +void AppMainWindow::menu_item_triggered(QAction* action) +{ + qDebug("%s", __FUNCTION__); +#ifdef NV_ARTISTTOOLS + + bool clickRecent = false; + for (int i = 0; i < _recentFileActions.count(); ++i) + { + if (_recentFileActions.at(i) == action) + { + clickRecent = true; + break; + } + } + + if (clickRecent) + { + QStringList recentFile; + recentFile.push_back(action->text()); + CoreLib::Inst()->SimpleScene_OpenFilesByDrop(recentFile); + return; + } + + CoreLib::Inst()->menu_item_triggered(action); +#endif // NV_ARTISTTOOLS +} + void AppMainWindow::menu_clearScene() { SimpleScene::Inst()->Clear(); @@ -905,7 +949,9 @@ bool AppMainWindow::menu_openfbx() */ // dir and file will get in blast open asset dialog - return SimpleScene::Inst()->LoadSceneFromFbx("", ""); + bool res = SimpleScene::Inst()->LoadSceneFromFbx("", ""); + updateUI(); + return res; } void AppMainWindow::menu_addBookmark() @@ -1146,7 +1192,8 @@ char AppMainWindow::TestMouseScheme( Qt::KeyboardModifiers modifiers, Qt::MouseB if (op != 0) return op; - if (modifiers == Qt::KeyboardModifier(Qt::ControlModifier)) + bool isKeyL = (GetAsyncKeyState('L') && 0x8000); + if (isKeyL) //if(modifiers == Qt::KeyboardModifier(Qt::ControlModifier)) // ctrl is used by Selection Tool { if (buttons == Qt::MouseButton(Qt::LeftButton)) return 'L'; @@ -1174,16 +1221,114 @@ char AppMainWindow::TestDragCamera( Qt::KeyboardModifiers modifiers, Qt::MouseBu if(scheme == MAYA_SCHEME) { auto itr = _mayaScheme.find(input); - if(itr != _mayaScheme.end()) return itr.value(); + if(itr != _mayaScheme.end()) + return itr.value(); } else { auto itr = _maxScheme.find(input); - if(itr != _maxScheme.end()) return itr.value(); + if(itr != _maxScheme.end()) + return itr.value(); } return 0; } +void AppMainWindow::addRecentFile(const QString filePath) +{ + if (filePath.isEmpty()) + return; + + if (_recentFileRecordFile.getItems().count() > 0 && _recentFileRecordFile.getItems().first() == filePath) + return; + + if (_recentFileActions.count() == 8) + { + QAction* act = _recentFileActions.last(); + _recentMenu->removeAction(act); + + _recentFileRecordFile.getItems().pop_back(); + _recentFileActions.pop_back(); + } + + if (_recentFileRecordFile.isItemExist(filePath)) + { + _resetRecentFile(filePath); + return; + } + + QAction* act = new QAction(filePath, _recentMenu); + if (_recentFileActions.count() > 0) + _recentMenu->insertAction(_recentFileActions.first(), act); + else + _recentMenu->addAction(act); + + _recentFileActions.push_front(act); + + _recentFileRecordFile.getItems().push_front(filePath); + + _saveRecentFile(); +} + +void AppMainWindow::_resetRecentFile(const QString filePath) +{ + if (filePath.isEmpty()) + return; + + if (_recentFileRecordFile.getItems().count() > 0 && _recentFileRecordFile.getItems().first() == filePath) + return; + + if (!_recentFileRecordFile.isItemExist(filePath)) + return; + + QList<QAction*> actions; + for (int i = 0; i < _recentFileActions.count(); ++i) + { + QAction* act = _recentFileActions.at(i); + if (act->text() == filePath) + actions.push_front(act); + else + actions.push_back(act); + } + + _recentMenu->addActions(actions); + _recentFileActions = actions; + + QList<QString> filesTMP; + QList<QString>& filesCurrent = _recentFileRecordFile.getItems(); + for (int i = 0; i < filesCurrent.count(); ++i) + { + QString item = filesCurrent.at(i); + if (item == filePath) + filesTMP.push_front(item); + else + filesTMP.push_back(item); + } + filesCurrent.clear(); + filesCurrent = filesTMP; + + _saveRecentFile(); +} + +void AppMainWindow::_loadRecentFile() +{ + QString recentFileRecordFile = QCoreApplication::applicationDirPath() + "/RecentFiles.rfs"; + _recentFileRecordFile.load(recentFileRecordFile); + + QList<QString> recentFiles = _recentFileRecordFile.getItems(); + _recentFileRecordFile.getItems().clear(); + + for (int i = recentFiles.count() - 1; i >= 0; --i) + { + addRecentFile(recentFiles.at(i)); + } +} + +void AppMainWindow::_saveRecentFile() +{ + QString recentFileRecordFile = QCoreApplication::applicationDirPath() + "/RecentFiles.rfs"; + _recentFileRecordFile.save(recentFileRecordFile); +} + QString AppMainWindow::OpenTextureFile(QString title) { QString lastDir = _lastFilePath; @@ -1268,7 +1413,7 @@ void AppMainWindow::updateMainToolbar() bool AppMainWindow::menu_openProject() { QString lastDir = _lastFilePath; - QString fileName = QFileDialog::getOpenFileName(this, "Open Hair Project File", lastDir, "Hair Project File (*.furproj)"); + QString fileName = QFileDialog::getOpenFileName(this, "Open Project File", lastDir, "Project File (*.blastProj)"); return openProject(fileName); } @@ -1318,7 +1463,7 @@ bool AppMainWindow::menu_saveProjectAs() char message[1024]; QString lastDir = _lastFilePath; - QString fileName = QFileDialog::getSaveFileName(this, "Save Hair Project File", lastDir, "Hair Project File (*.furproj)"); + QString fileName = QFileDialog::getSaveFileName(this, "Save Project File", lastDir, "Project File (*.blastProj)"); if (!fileName.isEmpty()) { QFileInfo fileInfo(fileName); diff --git a/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.h b/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.h index 4183fc2..823c14f 100644 --- a/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.h +++ b/tools/ArtistTools/source/CoreLib/Window/AppMainWindow.h @@ -6,6 +6,7 @@ #include "ui_AppMainWindow.h" #include "UIGlobal.h" +#include "XMLHelper.h" class StyleMaterialPanel; class AssetControlPanel; @@ -72,7 +73,7 @@ public: CORELIB_EXPORT void quit(); CORELIB_EXPORT void updateMainToolbar(); - CORELIB_EXPORT void processDragAndDrop(QString fname); + CORELIB_EXPORT void processDragAndDrop(const QStringList& fileNames); CORELIB_EXPORT bool openProject(QString fileName); CORELIB_EXPORT static void setConnectionMode(int); @@ -96,6 +97,7 @@ signals: void aboutToQuit(); public slots: + CORELIB_EXPORT void menu_item_triggered(QAction* action); CORELIB_EXPORT void menu_clearScene(); CORELIB_EXPORT bool menu_openfbx(); CORELIB_EXPORT void menu_addBookmark(); @@ -125,9 +127,14 @@ signals: CORELIB_EXPORT void onReloadColorAttributeTexture(nvidia::CurveEditor::ColorAttribute* attribute, bool reloadColorTex, int selectedCtrlPntIndex); #endif + CORELIB_EXPORT void addRecentFile(const QString filePath); private: char TestDragCamera(Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons); + void _resetRecentFile(const QString filePath); + void _loadRecentFile(); + void _saveRecentFile(); + public: void InitMenuItems(); void InitToolbar(); @@ -140,6 +147,10 @@ public: Ui::AppMainWindowClass ui; D3DWidget* _d3dWidget; + QMenu* _recentMenu; + QList<QAction*> _recentFileActions; + SingleItemKindFile _recentFileRecordFile; + QMenu* _bookmarksMenu; DisplayMeshesPanel* _displayMeshesPanel; @@ -203,6 +214,8 @@ private: #endif // NV_ARTISTTOOLS bool m_bGizmoWithLocal; + bool m_bGizmoWithDepthTest; + bool m_bShowPlane; }; #endif // APPMAINWINDOW_H diff --git a/tools/ArtistTools/source/CoreLib/Window/D3DWidget.cpp b/tools/ArtistTools/source/CoreLib/Window/D3DWidget.cpp index 69be706..73aabfc 100644 --- a/tools/ArtistTools/source/CoreLib/Window/D3DWidget.cpp +++ b/tools/ArtistTools/source/CoreLib/Window/D3DWidget.cpp @@ -58,21 +58,18 @@ void D3DWidget::dropEvent(QDropEvent *e) return; QList<QUrl> urlList = data->urls(); - QString text; + QStringList fileNames; for (int i = 0; i < urlList.size() && i < 32; ++i) { - QString url = urlList.at(i).toLocalFile(); - text += url; + fileNames.append(urlList.at(i).toLocalFile()); } e->acceptProposedAction(); - AppMainWindow::Inst().processDragAndDrop(text); + AppMainWindow::Inst().processDragAndDrop(fileNames); } void D3DWidget::paintEvent( QPaintEvent* e ) { - CoreLib::Inst()->D3DWidget_paintEvent(e); - SimpleScene::Inst()->Draw(); } @@ -98,40 +95,42 @@ void D3DWidget::resizeEvent( QResizeEvent* e ) void D3DWidget::mouseMoveEvent( QMouseEvent* e ) { - CoreLib::Inst()->D3DWidget_mouseMoveEvent(e); - atcore_float2 pos = gfsdk_makeFloat2(e->x(), e->y()); SimpleScene::Inst()->onMouseMove(pos); Q_ASSERT(_appWindow != NV_NULL); char mode = _appWindow->TestMouseScheme(e->modifiers(), e->buttons()); - + CoreLib::Inst()->D3DWidget_mouseMoveEvent(e); + if (!e->isAccepted()) + { + return; + } if(mode == 0) return; SimpleScene::Inst()->Drag(mode); } void D3DWidget::wheelEvent(QWheelEvent* e) { - CoreLib::Inst()->D3DWidget_wheelEvent(e); - SimpleScene::Inst()->onMouseWheel(e->delta()); SimpleScene::Inst()->WheelZoom(); + + CoreLib::Inst()->D3DWidget_wheelEvent(e); } void D3DWidget::mousePressEvent( QMouseEvent* e ) { - CoreLib::Inst()->D3DWidget_mousePressEvent(e); - atcore_float2 pos = gfsdk_makeFloat2(e->x(), e->y()); SimpleScene::Inst()->onMouseDown(pos); + + CoreLib::Inst()->D3DWidget_mousePressEvent(e); } void D3DWidget::mouseReleaseEvent( QMouseEvent* e ) { - CoreLib::Inst()->D3DWidget_mouseReleaseEvent(e); - atcore_float2 pos = gfsdk_makeFloat2(e->x(), e->y()); SimpleScene::Inst()->onMouseUp(pos); + + CoreLib::Inst()->D3DWidget_mouseReleaseEvent(e); } void D3DWidget::keyPressEvent( QKeyEvent* e ) diff --git a/tools/ArtistTools/source/CoreLib/Window/DisplayPreferencesPanel.cpp b/tools/ArtistTools/source/CoreLib/Window/DisplayPreferencesPanel.cpp index fe4b808..3f010fb 100644 --- a/tools/ArtistTools/source/CoreLib/Window/DisplayPreferencesPanel.cpp +++ b/tools/ArtistTools/source/CoreLib/Window/DisplayPreferencesPanel.cpp @@ -397,7 +397,7 @@ void DisplayPreferencesPanel::on_btnPlaylistAddProj_clicked() { lastPath = PlaylistsLoader::mediaPath; } - QString fileNameInput = QFileDialog::getOpenFileName(this, "Open Hair Project File", lastPath, "Hair Project File (*.furproj)"); + QString fileNameInput = QFileDialog::getOpenFileName(this, "Open Project File", lastPath, "Project File (*.blastProj)"); if (!QFile::exists(fileNameInput)) return; std::string tmp = fileNameInput.toUtf8().data(); @@ -561,6 +561,7 @@ void PlaylistsLoader::ReleasePlaylistParamsContext() void PlaylistsLoader::loadPlaylistsFromMediaPath() { + std::string t1 = projectPath.toUtf8().data(); if (projectPath.isEmpty()) { QString appDir = qApp->applicationDirPath(); @@ -579,7 +580,12 @@ void PlaylistsLoader::loadPlaylistsFromMediaPath() projectPath = dirTmp.absolutePath(); } } - if (!projectPath.isEmpty()) + if (projectPath.isEmpty()) + { + projectPath = qApp->applicationDirPath(); + mediaPath = projectPath; + } + else { if (dirTmp.cd("..")) { @@ -688,30 +694,30 @@ bool PlaylistsLoader::saveProjectsInPlaylist(int idx, QList<QString>& projects) objects[numObjects++] = params; NvParameterized::Interface* iface = static_cast<NvParameterized::Interface*>(params); + std::vector<std::string> strArray; + std::vector<const char*> strOutput; + if (1) { nvidia::parameterized::PlaylistParams* params = static_cast<nvidia::parameterized::PlaylistParams*>(iface); nvidia::parameterized::PlaylistParamsNS::ParametersStruct& targetDesc = params->parameters(); NvParameterized::Handle handle(iface); - if (iface->getParameterHandle("furprojFilePaths", handle) == NvParameterized::ERROR_NONE) + if (iface->getParameterHandle("blastProjFilePaths", handle) == NvParameterized::ERROR_NONE) { int num = projects.size(); - - std::vector<std::string> strArray; - const char** strOutput = new const char*[num]; + strArray.resize(num); + strOutput.resize(num); for (int i = 0; i < num; i++) { std::string proj = projects[i].toUtf8().data(); - strArray.push_back(proj); + strArray[i] = proj; strOutput[i] = strArray[i].c_str(); } handle.resizeArray(num); - handle.setParamStringArray(strOutput, num); - - delete[] strOutput; + handle.setParamStringArray(&strOutput[0], num); } } @@ -762,6 +768,8 @@ QString PlaylistsLoader::convertToAbsoluteFilePath(QString& filePath) QString PlaylistsLoader::convertToSaveingFilePath(QString& filePath) { + std::string t1 = mediaPath.toUtf8().data(); + std::string t2 = projectPath.toUtf8().data(); QString fname; bool bCanBeRelativePath = false; bool bAbsPath = (filePath.indexOf(':') >= 0); @@ -771,7 +779,7 @@ QString PlaylistsLoader::convertToSaveingFilePath(QString& filePath) { QFileInfo fi(filePath); int pos = fi.absoluteFilePath().indexOf(mediaPath, Qt::CaseInsensitive); - if (pos >= 0) + if (pos >= 0 && mediaPath.length()) { // convert to relative path fname = filePath.right(filePath.size() - (pos + mediaPath.size() + 1)); @@ -800,6 +808,7 @@ QString PlaylistsLoader::convertToSaveingFilePath(QString& filePath) { fname = filePath; } + std::string tmp3 = fname.toUtf8().data(); QFileInfo fi(mediaPath + "/" + fname); std::string tmp = fi.absoluteFilePath().toUtf8().data(); if (!QFile::exists(fi.absoluteFilePath())) @@ -853,7 +862,7 @@ int PlaylistsLoader::getProjectsInPlaylist(int idx, QList<QString>& projects) nvidia::parameterized::PlaylistParams* params = static_cast<nvidia::parameterized::PlaylistParams*>(iface); nvidia::parameterized::PlaylistParamsNS::ParametersStruct& srcDesc = params->parameters(); NvParameterized::Handle handle(iface); - if (iface->getParameterHandle("furprojFilePaths", handle) == NvParameterized::ERROR_NONE) + if (iface->getParameterHandle("blastProjFilePaths", handle) == NvParameterized::ERROR_NONE) { int arraySize; handle.getArraySize(arraySize); diff --git a/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.cpp b/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.cpp index b118b6b..7c0e382 100644 --- a/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.cpp +++ b/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.cpp @@ -76,6 +76,17 @@ void DisplayScenePanel::on_btnSkinningDQ_stateChanged(int state) void DisplayScenePanel::on_checkBoxGizmoWithLocal_stateChanged(int state) { AppMainWindow::Inst().m_bGizmoWithLocal = state; + CoreLib::Inst()->AppMainWindow_updateMainToolbar(); +} + +void DisplayScenePanel::on_checkBoxGizmoWithDepthTest_stateChanged(int state) +{ + AppMainWindow::Inst().m_bGizmoWithDepthTest = state; +} + +void DisplayScenePanel::on_checkBoxShowPlane_stateChanged(int state) +{ + AppMainWindow::Inst().m_bShowPlane = state; } void DisplayScenePanel::updateValues() @@ -90,4 +101,6 @@ void DisplayScenePanel::updateValues() ui.btnUseLighting->setChecked(globalSettings.m_useLighting); ui.btnShowGraphicsMesh->setChecked( globalSettings.m_showGraphicsMesh); ui.btnShowSkinnedOnly->setChecked( globalSettings.m_showSkinnedMeshOnly); + ui.checkBoxGizmoWithLocal->setChecked(AppMainWindow::Inst().m_bGizmoWithLocal); + ui.checkBoxGizmoWithDepthTest->setChecked(AppMainWindow::Inst().m_bGizmoWithDepthTest); } diff --git a/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.h b/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.h index 6614eca..cd277b6 100644 --- a/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.h +++ b/tools/ArtistTools/source/CoreLib/Window/DisplayScenePanel.h @@ -30,6 +30,8 @@ public: CORELIB_EXPORT void on_btnShowSkinnedOnly_stateChanged(int state); CORELIB_EXPORT void on_btnSkinningDQ_stateChanged(int state); CORELIB_EXPORT void on_checkBoxGizmoWithLocal_stateChanged(int state); + CORELIB_EXPORT void on_checkBoxGizmoWithDepthTest_stateChanged(int state); + CORELIB_EXPORT void on_checkBoxShowPlane_stateChanged(int state); private: |