ImageAsset.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef IMAGE_ASSET_H
  23. #include "ImageAsset.h"
  24. #endif
  25. #ifndef _ASSET_MANAGER_H_
  26. #include "assets/assetManager.h"
  27. #endif
  28. #ifndef _CONSOLETYPES_H_
  29. #include "console/consoleTypes.h"
  30. #endif
  31. #ifndef _TAML_
  32. #include "persistence/taml/taml.h"
  33. #endif
  34. #ifndef _ASSET_PTR_H_
  35. #include "assets/assetPtr.h"
  36. #endif
  37. #include "gfx/gfxStringEnumTranslate.h"
  38. #include "ImageAssetInspectors.h"
  39. // Debug Profiling.
  40. #include "platform/profiler.h"
  41. #include "T3D/assets/assetImporter.h"
  42. #include "gfx/gfxDrawUtil.h"
  43. //-----------------------------------------------------------------------------
  44. StringTableEntry ImageAsset::smNoImageAssetFallback(StringTable->insert(Con::getVariable("$Core::NoImageAssetFallback")));
  45. //-----------------------------------------------------------------------------
  46. IMPLEMENT_CONOBJECT(ImageAsset);
  47. ConsoleType(ImageAssetPtr, TypeImageAssetPtr, const char*, ASSET_ID_FIELD_PREFIX)
  48. //-----------------------------------------------------------------------------
  49. ConsoleGetType(TypeImageAssetPtr)
  50. {
  51. // Fetch asset Id.
  52. return *((const char**)(dptr));
  53. }
  54. //-----------------------------------------------------------------------------
  55. ConsoleSetType(TypeImageAssetPtr)
  56. {
  57. // Was a single argument specified?
  58. if (argc == 1)
  59. {
  60. // Yes, so fetch field value.
  61. *((const char**)dptr) = StringTable->insert(argv[0]);
  62. return;
  63. }
  64. // Warn.
  65. Con::warnf("(TypeImageAssetPtr) - Cannot set multiple args to a single asset.");
  66. }
  67. ConsoleType(assetIdString, TypeImageAssetId, const char*, ASSET_ID_FIELD_PREFIX)
  68. ConsoleGetType(TypeImageAssetId)
  69. {
  70. // Fetch asset Id.
  71. return *((const char**)(dptr));
  72. }
  73. ConsoleSetType(TypeImageAssetId)
  74. {
  75. // Was a single argument specified?
  76. if (argc == 1)
  77. {
  78. *((const char**)dptr) = StringTable->insert(argv[0]);
  79. return;
  80. }
  81. // Warn.
  82. Con::warnf("(TypeAssetId) - Cannot set multiple args to a single asset.");
  83. }
  84. //-----------------------------------------------------------------------------
  85. ImplementEnumType(ImageAssetType,
  86. "Type of mesh data available in a shape.\n"
  87. "@ingroup gameObjects")
  88. { ImageAsset::Albedo, "Albedo", "" },
  89. { ImageAsset::Normal, "Normal", "" },
  90. { ImageAsset::ORMConfig, "ORMConfig", "" },
  91. { ImageAsset::GUI, "GUI", "" },
  92. { ImageAsset::Roughness, "Roughness", "" },
  93. { ImageAsset::AO, "AO", "" },
  94. { ImageAsset::Metalness, "Metalness", "" },
  95. { ImageAsset::Glow, "Glow", "" },
  96. { ImageAsset::Particle, "Particle", "" },
  97. { ImageAsset::Decal, "Decal", "" },
  98. { ImageAsset::Cubemap, "Cubemap", "" },
  99. EndImplementEnumType;
  100. //-----------------------------------------------------------------------------
  101. ImageAsset::ImageAsset() : AssetBase(), mUseMips(true), mIsHDRImage(false), mIsValidImage(false), mImageType(Albedo)
  102. {
  103. mImageFileName = StringTable->EmptyString();
  104. mImagePath = StringTable->EmptyString();
  105. mLoadedState = AssetErrCode::NotLoaded;
  106. }
  107. //-----------------------------------------------------------------------------
  108. ImageAsset::~ImageAsset()
  109. {
  110. }
  111. void ImageAsset::consoleInit()
  112. {
  113. Parent::consoleInit();
  114. Con::addVariable("$Core::NoImageAssetFallback", TypeString, &smNoImageAssetFallback,
  115. "The assetId of the texture to display when the requested image asset is missing.\n"
  116. "@ingroup GFX\n");
  117. }
  118. //-----------------------------------------------------------------------------
  119. void ImageAsset::initPersistFields()
  120. {
  121. // Call parent.
  122. Parent::initPersistFields();
  123. addProtectedField("imageFile", TypeAssetLooseFilePath, Offset(mImageFileName, ImageAsset),
  124. &setImageFileName, &getImageFileName, "Path to the image file.");
  125. addField("useMips", TypeBool, Offset(mUseMips, ImageAsset), "Should the image use mips? (Currently unused).");
  126. addField("isHDRImage", TypeBool, Offset(mIsHDRImage, ImageAsset), "Is the image in an HDR format? (Currently unused)");
  127. addField("imageType", TypeImageAssetType, Offset(mImageType, ImageAsset), "What the main use-case for the image is for.");
  128. }
  129. //------------------------------------------------------------------------------
  130. //Utility function to 'fill out' bindings and resources with a matching asset if one exists
  131. U32 ImageAsset::getAssetByFilename(StringTableEntry fileName, AssetPtr<ImageAsset>* imageAsset)
  132. {
  133. AssetQuery query;
  134. S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, fileName);
  135. if (foundAssetcount == 0)
  136. {
  137. //Didn't work, so have us fall back to a placeholder asset
  138. imageAsset->setAssetId(ImageAsset::smNoImageAssetFallback);
  139. if (imageAsset->isNull())
  140. {
  141. //Well that's bad, loading the fallback failed.
  142. Con::warnf("ImageAsset::getAssetByFilename - Finding of asset associated with file %s failed with no fallback asset", fileName);
  143. return AssetErrCode::Failed;
  144. }
  145. //handle noshape not being loaded itself
  146. if ((*imageAsset)->mLoadedState == BadFileReference)
  147. {
  148. Con::warnf("ImageAsset::getAssetByFilename - Finding of associated with file %s failed, and fallback asset reported error of Bad File Reference.", fileName);
  149. return AssetErrCode::BadFileReference;
  150. }
  151. Con::warnf("ImageAsset::getAssetByFilename - Finding of associated with file %s failed, utilizing fallback asset", fileName);
  152. (*imageAsset)->mLoadedState = AssetErrCode::UsingFallback;
  153. return AssetErrCode::UsingFallback;
  154. }
  155. else
  156. {
  157. //acquire and bind the asset, and return it out
  158. imageAsset->setAssetId(query.mAssetList[0]);
  159. return (*imageAsset)->mLoadedState;
  160. }
  161. }
  162. StringTableEntry ImageAsset::getAssetIdByFilename(StringTableEntry fileName)
  163. {
  164. if (fileName == StringTable->EmptyString())
  165. return StringTable->EmptyString();
  166. StringTableEntry imageAssetId = ImageAsset::smNoImageAssetFallback;
  167. AssetQuery query;
  168. S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, fileName);
  169. if (foundAssetcount != 0)
  170. {
  171. //acquire and bind the asset, and return it out
  172. imageAssetId = query.mAssetList[0];
  173. }
  174. return imageAssetId;
  175. }
  176. U32 ImageAsset::getAssetById(StringTableEntry assetId, AssetPtr<ImageAsset>* imageAsset)
  177. {
  178. (*imageAsset) = assetId;
  179. if (imageAsset->notNull())
  180. {
  181. return (*imageAsset)->mLoadedState;
  182. }
  183. else
  184. {
  185. if (imageAsset->isNull())
  186. {
  187. //Well that's bad, loading the fallback failed.
  188. Con::warnf("ImageAsset::getAssetById - Finding of asset with id %s failed with no fallback asset", assetId);
  189. return AssetErrCode::Failed;
  190. }
  191. //handle noshape not being loaded itself
  192. if ((*imageAsset)->mLoadedState == BadFileReference)
  193. {
  194. Con::warnf("ImageAsset::getAssetById - Finding of asset with id %s failed, and fallback asset reported error of Bad File Reference.", assetId);
  195. return AssetErrCode::BadFileReference;
  196. }
  197. Con::warnf("ImageAsset::getAssetById - Finding of asset with id %s failed, utilizing fallback asset", assetId);
  198. (*imageAsset)->mLoadedState = AssetErrCode::UsingFallback;
  199. return AssetErrCode::UsingFallback;
  200. }
  201. }
  202. //------------------------------------------------------------------------------
  203. void ImageAsset::copyTo(SimObject* object)
  204. {
  205. // Call to parent.
  206. Parent::copyTo(object);
  207. }
  208. void ImageAsset::loadImage()
  209. {
  210. if (mImagePath)
  211. {
  212. if (!Torque::FS::IsFile(mImagePath))
  213. {
  214. Con::errorf("ImageAsset::initializeAsset: Attempted to load file %s but it was not valid!", mImageFileName);
  215. mLoadedState = BadFileReference;
  216. return;
  217. }
  218. mLoadedState = Ok;
  219. mIsValidImage = true;
  220. return;
  221. //GFXTexHandle texture = getTexture(&GFXStaticTextureSRGBProfile);
  222. //mTexture.set(mImagePath, &GFXStaticTextureSRGBProfile, avar("%s() - mImage (line %d)", __FUNCTION__, __LINE__));
  223. /*if (texture.isValid())
  224. {
  225. mIsValidImage = true;
  226. //mBitmap = texture.getBitmap();
  227. return;
  228. }*/
  229. mChangeSignal.trigger();
  230. }
  231. mLoadedState = BadFileReference;
  232. mIsValidImage = false;
  233. }
  234. void ImageAsset::initializeAsset()
  235. {
  236. if (mImageFileName == StringTable->insert("z.png"))
  237. {
  238. Con::printf("Loaded z");
  239. }
  240. ResourceManager::get().getChangedSignal().notify(this, &ImageAsset::_onResourceChanged);
  241. mImagePath = expandAssetFilePath(mImageFileName);
  242. loadImage();
  243. }
  244. void ImageAsset::onAssetRefresh()
  245. {
  246. mImagePath = expandAssetFilePath(mImageFileName);
  247. loadImage();
  248. }
  249. void ImageAsset::_onResourceChanged(const Torque::Path& path)
  250. {
  251. if (path != Torque::Path(mImagePath))
  252. return;
  253. refreshAsset();
  254. loadImage();
  255. }
  256. void ImageAsset::setImageFileName(const char* pScriptFile)
  257. {
  258. // Sanity!
  259. AssertFatal(pScriptFile != NULL, "Cannot use a NULL image file.");
  260. // Update.
  261. mImageFileName = StringTable->insert(pScriptFile);
  262. }
  263. const GBitmap& ImageAsset::getImage()
  264. {
  265. return GBitmap(); //TODO fix this
  266. }
  267. GFXTexHandle ImageAsset::getTexture(GFXTextureProfile* requestedProfile)
  268. {
  269. if (mResourceMap.contains(requestedProfile))
  270. {
  271. mLoadedState = Ok;
  272. return mResourceMap.find(requestedProfile)->value;
  273. }
  274. else
  275. {
  276. //If we don't have an existing map case to the requested format, we'll just create it and insert it in
  277. GFXTexHandle newTex = TEXMGR->createTexture(mImagePath, requestedProfile);
  278. if (newTex)
  279. {
  280. mResourceMap.insert(requestedProfile, newTex);
  281. mLoadedState = Ok;
  282. return newTex;
  283. }
  284. else
  285. mLoadedState = BadFileReference;
  286. }
  287. //if (mTexture.isValid())
  288. // return mTexture;
  289. return nullptr;
  290. }
  291. const char* ImageAsset::getImageInfo()
  292. {
  293. if (mIsValidImage)
  294. {
  295. static const U32 bufSize = 2048;
  296. char* returnBuffer = Con::getReturnBuffer(bufSize);
  297. GFXTexHandle newTex = TEXMGR->createTexture(mImagePath, &GFXStaticTextureSRGBProfile);
  298. if (newTex)
  299. {
  300. dSprintf(returnBuffer, bufSize, "%s %d %d %d", GFXStringTextureFormat[newTex->getFormat()], newTex->getHeight(), newTex->getWidth(), newTex->getDepth());
  301. newTex = nullptr;
  302. }
  303. else
  304. {
  305. dSprintf(returnBuffer, bufSize, "ImageAsset::getImageInfo() - Failed to get image info for %s", getAssetId());
  306. }
  307. return returnBuffer;
  308. }
  309. return "";
  310. }
  311. const char* ImageAsset::getImageTypeNameFromType(ImageAsset::ImageTypes type)
  312. {
  313. // must match ImageTypes order
  314. static const char* _names[] = {
  315. "Albedo",
  316. "Normal",
  317. "ORMConfig",
  318. "GUI",
  319. "Roughness",
  320. "AO",
  321. "Metalness",
  322. "Glow",
  323. "Particle",
  324. "Decal",
  325. "Cubemap"
  326. };
  327. if (type < 0 || type >= ImageTypeCount)
  328. {
  329. Con::errorf("ImageAsset::getAdapterNameFromType - Invalid ImageType, defaulting to Albedo");
  330. return _names[Albedo];
  331. }
  332. return _names[type];
  333. }
  334. ImageAsset::ImageTypes ImageAsset::getImageTypeFromName(const char* name)
  335. {
  336. if (dStrIsEmpty(name))
  337. {
  338. return (ImageTypes)Albedo;
  339. }
  340. S32 ret = -1;
  341. for (S32 i = 0; i < ImageTypeCount; i++)
  342. {
  343. if (!dStricmp(getImageTypeNameFromType((ImageTypes)i), name))
  344. ret = i;
  345. }
  346. if (ret == -1)
  347. {
  348. Con::errorf("ImageAsset::getImageTypeFromName - Invalid ImageType name, defaulting to Albedo");
  349. ret = Albedo;
  350. }
  351. return (ImageTypes)ret;
  352. }
  353. DefineEngineMethod(ImageAsset, getImagePath, const char*, (), ,
  354. "Creates an instance of the given GameObject given the asset definition.\n"
  355. "@return The GameObject entity created from the asset.")
  356. {
  357. return object->getImagePath();
  358. }
  359. DefineEngineMethod(ImageAsset, getImageInfo, const char*, (), ,
  360. "Creates an instance of the given GameObject given the asset definition.\n"
  361. "@return The GameObject entity created from the asset.")
  362. {
  363. return object->getImageInfo();
  364. }
  365. #ifdef TORQUE_TOOLS
  366. DefineEngineStaticMethod(ImageAsset, getAssetIdByFilename, const char*, (const char* filePath), (""),
  367. "Queries the Asset Database to see if any asset exists that is associated with the provided file path.\n"
  368. "@return The AssetId of the associated asset, if any.")
  369. {
  370. return ImageAsset::getAssetIdByFilename(StringTable->insert(filePath));
  371. }
  372. #endif
  373. //-----------------------------------------------------------------------------
  374. // GuiInspectorTypeAssetId
  375. //-----------------------------------------------------------------------------
  376. IMPLEMENT_CONOBJECT(GuiInspectorTypeImageAssetPtr);
  377. ConsoleDocClass(GuiInspectorTypeImageAssetPtr,
  378. "@brief Inspector field type for Shapes\n\n"
  379. "Editor use only.\n\n"
  380. "@internal"
  381. );
  382. void GuiInspectorTypeImageAssetPtr::consoleInit()
  383. {
  384. Parent::consoleInit();
  385. ConsoleBaseType::getType(TypeImageAssetPtr)->setInspectorFieldType("GuiInspectorTypeImageAssetPtr");
  386. }
  387. GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
  388. {
  389. if (mInspector->getInspectObject() == nullptr)
  390. return nullptr;
  391. // Create base filename edit controls
  392. GuiControl* retCtrl = Parent::constructEditControl();
  393. if (retCtrl == NULL)
  394. return retCtrl;
  395. retCtrl->getRenderTooltipDelegate().bind(this, &GuiInspectorTypeImageAssetPtr::renderTooltip);
  396. // Change filespec
  397. char szBuffer[512];
  398. dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
  399. mInspector->getInspectObject()->getIdString(), mCaption);
  400. mBrowseButton->setField("Command", szBuffer);
  401. const char* id = mInspector->getInspectObject()->getIdString();
  402. setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
  403. // Create "Open in ShapeEditor" button
  404. mImageEdButton = new GuiBitmapButtonCtrl();
  405. dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
  406. mImageEdButton->setField("Command", szBuffer);
  407. char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
  408. mImageEdButton->setBitmap(StringTable->insert(bitmapName));
  409. mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
  410. mImageEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
  411. mImageEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
  412. mImageEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Shape Editor");
  413. mImageEdButton->registerObject();
  414. addObject(mImageEdButton);
  415. return retCtrl;
  416. }
  417. bool GuiInspectorTypeImageAssetPtr::updateRects()
  418. {
  419. S32 dividerPos, dividerMargin;
  420. mInspector->getDivider(dividerPos, dividerMargin);
  421. Point2I fieldExtent = getExtent();
  422. Point2I fieldPos = getPosition();
  423. mCaptionRect.set(0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y);
  424. mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y);
  425. bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
  426. if (mBrowseButton != NULL)
  427. {
  428. mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4);
  429. resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent);
  430. }
  431. if (mImageEdButton != NULL)
  432. {
  433. RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4);
  434. resized |= mImageEdButton->resize(shapeEdRect.point, shapeEdRect.extent);
  435. }
  436. return resized;
  437. }
  438. bool GuiInspectorTypeImageAssetPtr::renderTooltip(const Point2I& hoverPos, const Point2I& cursorPos, const char* tipText)
  439. {
  440. if (!mAwake)
  441. return false;
  442. GuiCanvas* root = getRoot();
  443. if (!root)
  444. return false;
  445. AssetPtr<ImageAsset> imgAsset;
  446. U32 assetState = ImageAsset::getAssetById(getData(), &imgAsset);
  447. if (imgAsset == NULL || assetState == ImageAsset::Failed)
  448. return false;
  449. StringTableEntry filename = imgAsset->getImagePath();
  450. if (!filename || !filename[0])
  451. return false;
  452. GFXTexHandle texture(filename, &GFXStaticTextureSRGBProfile, avar("%s() - tooltip texture (line %d)", __FUNCTION__, __LINE__));
  453. if (texture.isNull())
  454. return false;
  455. // Render image at a reasonable screen size while
  456. // keeping its aspect ratio...
  457. Point2I screensize = getRoot()->getWindowSize();
  458. Point2I offset = hoverPos;
  459. Point2I tipBounds;
  460. U32 texWidth = texture.getWidth();
  461. U32 texHeight = texture.getHeight();
  462. F32 aspect = (F32)texHeight / (F32)texWidth;
  463. const F32 newWidth = 150.0f;
  464. F32 newHeight = aspect * newWidth;
  465. // Offset below cursor image
  466. offset.y += 20; // TODO: Attempt to fix?: root->getCursorExtent().y;
  467. tipBounds.x = newWidth;
  468. tipBounds.y = newHeight;
  469. // Make sure all of the tooltip will be rendered width the app window,
  470. // 5 is given as a buffer against the edge
  471. if (screensize.x < offset.x + tipBounds.x + 5)
  472. offset.x = screensize.x - tipBounds.x - 5;
  473. if (screensize.y < offset.y + tipBounds.y + 5)
  474. offset.y = hoverPos.y - tipBounds.y - 5;
  475. RectI oldClip = GFX->getClipRect();
  476. RectI rect(offset, tipBounds);
  477. GFX->setClipRect(rect);
  478. GFXDrawUtil* drawer = GFX->getDrawUtil();
  479. drawer->clearBitmapModulation();
  480. GFX->getDrawUtil()->drawBitmapStretch(texture, rect);
  481. GFX->setClipRect(oldClip);
  482. return true;
  483. }
  484. IMPLEMENT_CONOBJECT(GuiInspectorTypeImageAssetId);
  485. ConsoleDocClass(GuiInspectorTypeImageAssetId,
  486. "@brief Inspector field type for Shapes\n\n"
  487. "Editor use only.\n\n"
  488. "@internal"
  489. );
  490. void GuiInspectorTypeImageAssetId::consoleInit()
  491. {
  492. Parent::consoleInit();
  493. ConsoleBaseType::getType(TypeImageAssetId)->setInspectorFieldType("GuiInspectorTypeImageAssetId");
  494. }