/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/EditorPlugins/Assets/EditorPluginAssets/AnimationGraphAsset/AnimationGraphAssetManager.cpp
59 строк
2 KB
Jan Krassnigg
Fixed #1144: Resource file extension cleanup (#1374)
20 авг 2024, 21:47
Не верифицирован
20 авг 2024, 21:47
c453d11
Код
Авторство
О чём код?
#include <EditorPluginAssets/EditorPluginAssetsPCH.h> #include <EditorPluginAssets/AnimationGraphAsset/AnimationGraphAsset.h> #include <EditorPluginAssets/AnimationGraphAsset/AnimationGraphAssetManager.h> #include <EditorPluginAssets/AnimationGraphAsset/AnimationGraphAssetWindow.moc.h> EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezAnimationGraphAssetManager, 1, ezRTTIDefaultAllocator<ezAnimationGraphAssetManager>) EZ_END_DYNAMIC_REFLECTED_TYPE; ezAnimationGraphAssetManager::ezAnimationGraphAssetManager() { ezDocumentManager::s_Events.AddEventHandler(ezMakeDelegate(&ezAnimationGraphAssetManager::OnDocumentManagerEvent, this)); m_DocTypeDesc.m_sDocumentTypeName = "Animation Graph"; m_DocTypeDesc.m_sFileExtension = "ezAnimationGraphAsset"; m_DocTypeDesc.m_sIcon = ":/AssetIcons/AnimationGraph.svg"; m_DocTypeDesc.m_sAssetCategory = "Animation"; m_DocTypeDesc.m_pDocumentType = ezGetStaticRTTI<ezAnimationGraphAssetDocument>(); m_DocTypeDesc.m_pManager = this; m_DocTypeDesc.m_CompatibleTypes.PushBack("CompatibleAsset_Keyframe_Graph"); m_DocTypeDesc.m_sResourceFileExtension = "ezBinAnimGraph"; m_DocTypeDesc.m_AssetDocumentFlags = ezAssetDocumentFlags::AutoTransformOnSave; ezQtImageCache::GetSingleton()->RegisterTypeImage("Animation Graph", QPixmap(":/AssetIcons/AnimationGraph.svg")); } ezAnimationGraphAssetManager::~ezAnimationGraphAssetManager() { ezDocumentManager::s_Events.RemoveEventHandler(ezMakeDelegate(&ezAnimationGraphAssetManager::OnDocumentManagerEvent, this)); } void ezAnimationGraphAssetManager::OnDocumentManagerEvent(const ezDocumentManager::Event& e) { switch (e.m_Type) { case ezDocumentManager::Event::Type::DocumentWindowRequested: { if (e.m_pDocument->GetDynamicRTTI() == ezGetStaticRTTI<ezAnimationGraphAssetDocument>()) { new ezQtAnimationGraphAssetDocumentWindow(e.m_pDocument); // NOLINT: not a memory leak } } break; default: break; } } void ezAnimationGraphAssetManager::InternalCreateDocument(ezStringView sDocumentTypeName, ezStringView sPath, bool bCreateNewDocument, ezDocument*& out_pDocument, const ezDocumentObject* pOpenContext) { out_pDocument = new ezAnimationGraphAssetDocument(sPath); } void ezAnimationGraphAssetManager::InternalGetSupportedDocumentTypes(ezDynamicArray<const ezDocumentTypeDescriptor*>& inout_DocumentTypes) const { inout_DocumentTypes.PushBack(&m_DocTypeDesc); }