TerrainMaterialAsset.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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 TERRAINMATERIALASSET_H
  23. #include "TerrainMaterialAsset.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 "console/script.h"
  38. #include "T3D/assets/assetImporter.h"
  39. StringTableEntry TerrainMaterialAsset::smNoTerrainMaterialAssetFallback = NULL;
  40. //-----------------------------------------------------------------------------
  41. IMPLEMENT_CONOBJECT(TerrainMaterialAsset);
  42. ConsoleType(TerrainMaterialAssetPtr, TypeTerrainMaterialAssetPtr, TerrainMaterialAsset, ASSET_ID_FIELD_PREFIX)
  43. //-----------------------------------------------------------------------------
  44. ConsoleGetType(TypeTerrainMaterialAssetPtr)
  45. {
  46. // Fetch asset Id.
  47. return (*((AssetPtr<TerrainMaterialAsset>*)dptr)).getAssetId();
  48. }
  49. //-----------------------------------------------------------------------------
  50. ConsoleSetType(TypeTerrainMaterialAssetPtr)
  51. {
  52. // Was a single argument specified?
  53. if (argc == 1)
  54. {
  55. // Yes, so fetch field value.
  56. const char* pFieldValue = argv[0];
  57. // Fetch asset pointer.
  58. AssetPtr<TerrainMaterialAsset>* pAssetPtr = dynamic_cast<AssetPtr<TerrainMaterialAsset>*>((AssetPtrBase*)(dptr));
  59. // Is the asset pointer the correct type?
  60. if (pAssetPtr == NULL)
  61. {
  62. // No, so fail.
  63. //Con::warnf("(TypeMaterialAssetPtr) - Failed to set asset Id '%d'.", pFieldValue);
  64. return;
  65. }
  66. // Set asset.
  67. pAssetPtr->setAssetId(pFieldValue);
  68. return;
  69. }
  70. // Warn.
  71. Con::warnf("(TypeTerrainMaterialAssetPtr) - Cannot set multiple args to a single asset.");
  72. }
  73. ConsoleType(assetIdString, TypeTerrainMaterialAssetId, const char*, ASSET_ID_FIELD_PREFIX)
  74. ConsoleGetType(TypeTerrainMaterialAssetId)
  75. {
  76. // Fetch asset Id.
  77. return *((const char**)(dptr));
  78. }
  79. ConsoleSetType(TypeTerrainMaterialAssetId)
  80. {
  81. // Was a single argument specified?
  82. if (argc == 1)
  83. {
  84. // Yes, so fetch field value.
  85. const char* pFieldValue = argv[0];
  86. // Fetch asset Id.
  87. StringTableEntry* assetId = (StringTableEntry*)(dptr);
  88. // Update asset value.
  89. *assetId = StringTable->insert(pFieldValue);
  90. return;
  91. }
  92. // Warn.
  93. Con::warnf("(TypeTerrainMaterialAssetId) - Cannot set multiple args to a single asset.");
  94. }
  95. //-----------------------------------------------------------------------------
  96. TerrainMaterialAsset::TerrainMaterialAsset()
  97. {
  98. mScriptFile = StringTable->EmptyString();
  99. mScriptPath = StringTable->EmptyString();
  100. mMatDefinitionName = StringTable->EmptyString();
  101. mMaterialDefinition = nullptr;
  102. mFXMaterialDefinition = nullptr;
  103. }
  104. //-----------------------------------------------------------------------------
  105. TerrainMaterialAsset::~TerrainMaterialAsset()
  106. {
  107. if (mMaterialDefinition)
  108. mMaterialDefinition->safeDeleteObject();
  109. if (mFXMaterialDefinition)
  110. mFXMaterialDefinition->safeDeleteObject();
  111. }
  112. //-----------------------------------------------------------------------------
  113. void TerrainMaterialAsset::consoleInit()
  114. {
  115. Parent::consoleInit();
  116. Con::addVariable("$Core::NoTerrainMaterialAssetFallback", TypeString, &smNoTerrainMaterialAssetFallback,
  117. "The assetId of the material to display when the requested material asset is missing.\n"
  118. "@ingroup GFX\n");
  119. smNoTerrainMaterialAssetFallback = StringTable->insert(Con::getVariable("$Core::NoTerrainMaterialAssetFallback"));
  120. }
  121. void TerrainMaterialAsset::initPersistFields()
  122. {
  123. docsURL;
  124. // Call parent.
  125. Parent::initPersistFields();
  126. //addField("shaderGraph", TypeRealString, Offset(mShaderGraphFile, TerrainMaterialAsset), "");
  127. //addProtectedField("scriptFile", TypeAssetLooseFilePath, Offset(mScriptFile, TerrainMaterialAsset),
  128. // &setScriptFile, &getScriptFile, "Path to the file containing the material definition.");
  129. addField("scriptFile", TypeAssetLooseFilePath, Offset(mScriptFile, TerrainMaterialAsset), "");
  130. addField("materialDefinitionName", TypeString, Offset(mMatDefinitionName, TerrainMaterialAsset), "Name of the material definition this asset is for.");
  131. }
  132. void TerrainMaterialAsset::initializeAsset()
  133. {
  134. // Call parent.
  135. Parent::initializeAsset();
  136. mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
  137. if (mMatDefinitionName == StringTable->EmptyString())
  138. {
  139. mLoadedState = Failed;
  140. return;
  141. }
  142. if (size() != 0 && mScriptPath == StringTable->EmptyString())
  143. {
  144. mLoadedState = EmbeddedDefinition;
  145. }
  146. else if (Con::isScriptFile(mScriptPath))
  147. {
  148. if (!Sim::findObject(mMatDefinitionName))
  149. {
  150. if (Con::executeFile(mScriptPath, false, false))
  151. {
  152. mLoadedState = ScriptLoaded;
  153. }
  154. else
  155. {
  156. mLoadedState = Failed;
  157. }
  158. }
  159. else
  160. {
  161. mLoadedState = DefinitionAlreadyExists;
  162. }
  163. }
  164. load();
  165. }
  166. void TerrainMaterialAsset::onAssetRefresh()
  167. {
  168. mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
  169. if (mMatDefinitionName == StringTable->EmptyString())
  170. {
  171. mLoadedState = Failed;
  172. return;
  173. }
  174. if (Con::isScriptFile(mScriptPath))
  175. {
  176. //Since we're refreshing, we can assume that the file we're executing WILL have an existing definition.
  177. //But that definition, whatever it is, is the 'correct' one, so we enable the Replace Existing behavior
  178. //when the engine encounters a named object conflict.
  179. String redefineBehaviorPrev = Con::getVariable("$Con::redefineBehavior");
  180. Con::setVariable("$Con::redefineBehavior", "replaceExisting");
  181. if (Con::executeFile(mScriptPath, false, false))
  182. mLoadedState = ScriptLoaded;
  183. else
  184. mLoadedState = Failed;
  185. //And now that we've executed, switch back to the prior behavior
  186. Con::setVariable("$Con::redefineBehavior", redefineBehaviorPrev.c_str());
  187. }
  188. load();
  189. }
  190. void TerrainMaterialAsset::setScriptFile(const char* pScriptFile)
  191. {
  192. // Sanity!
  193. AssertFatal(pScriptFile != NULL, "Cannot use a NULL script file.");
  194. pScriptFile = StringTable->insert(pScriptFile, true);
  195. // Update.
  196. mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
  197. // Refresh the asset.
  198. refreshAsset();
  199. }
  200. //------------------------------------------------------------------------------
  201. U32 TerrainMaterialAsset::load()
  202. {
  203. if (mMaterialDefinition)
  204. mMaterialDefinition->safeDeleteObject();
  205. if (mFXMaterialDefinition)
  206. mFXMaterialDefinition->safeDeleteObject();
  207. if (mLoadedState == EmbeddedDefinition)
  208. {
  209. if (size() != 0)
  210. {
  211. for (U32 i = 0; i < size(); i++)
  212. {
  213. TerrainMaterial* terrMat = dynamic_cast<TerrainMaterial*>(getObject(i));
  214. if (terrMat)
  215. {
  216. mMaterialDefinition = terrMat;
  217. mLoadedState = Ok;
  218. mMaterialDefinition->setInternalName(getAssetId());
  219. continue;
  220. }
  221. //Otherwise, check if it's our FX material
  222. Material* fxMat = dynamic_cast<Material*>(getObject(i));
  223. if (fxMat)
  224. {
  225. mFXMaterialDefinition = fxMat;
  226. //mMaterialDefinition->setInternalName(getAssetId());
  227. mFXMaterialDefinition->reload();
  228. continue;
  229. }
  230. }
  231. }
  232. if(mLoadedState == Ok)
  233. return mLoadedState;
  234. }
  235. else if ((mLoadedState == ScriptLoaded || mLoadedState == DefinitionAlreadyExists) && mMatDefinitionName != StringTable->EmptyString())
  236. {
  237. TerrainMaterial* matDef;
  238. if (!Sim::findObject(mMatDefinitionName, matDef))
  239. {
  240. Con::errorf("TerrainMaterialAsset: Unable to find the Material %s", mMatDefinitionName);
  241. mLoadedState = BadFileReference;
  242. return mLoadedState;
  243. }
  244. mMaterialDefinition = matDef;
  245. mLoadedState = Ok;
  246. mMaterialDefinition->setInternalName(getAssetId());
  247. return mLoadedState;
  248. }
  249. mLoadedState = Failed;
  250. return mLoadedState;
  251. }
  252. //------------------------------------------------------------------------------
  253. void TerrainMaterialAsset::copyTo(SimObject* object)
  254. {
  255. // Call to parent.
  256. Parent::copyTo(object);
  257. }
  258. //------------------------------------------------------------------------------
  259. U32 TerrainMaterialAsset::getAssetByMaterialName(StringTableEntry matName, AssetPtr<TerrainMaterialAsset>* matAsset)
  260. {
  261. AssetQuery query;
  262. U32 foundAssetcount = AssetDatabase.findAssetType(&query, "TerrainMaterialAsset");
  263. if (foundAssetcount == 0)
  264. {
  265. //Didn't work, so have us fall back to a placeholder asset
  266. matAsset->setAssetId(TerrainMaterialAsset::smNoTerrainMaterialAssetFallback);
  267. if (matAsset->isNull())
  268. {
  269. //Well that's bad, loading the fallback failed.
  270. Con::warnf("TerrainMaterialAsset::getAssetByMaterialName - Finding of asset associated with material name %s failed with no fallback asset", matName);
  271. return AssetErrCode::Failed;
  272. }
  273. //handle noshape not being loaded itself
  274. if ((*matAsset)->mLoadedState == BadFileReference)
  275. {
  276. Con::warnf("TerrainMaterialAsset::getAssetByMaterialName - Finding of associated with aterial name %s failed, and fallback asset reported error of Bad File Reference.", matName);
  277. return AssetErrCode::BadFileReference;
  278. }
  279. Con::warnf("TerrainMaterialAsset::getAssetByMaterialName - Finding of associated with aterial name %s failed, utilizing fallback asset", matName);
  280. (*matAsset)->mLoadedState = AssetErrCode::UsingFallback;
  281. return AssetErrCode::UsingFallback;
  282. }
  283. else
  284. {
  285. for (U32 i = 0; i < foundAssetcount; i++)
  286. {
  287. TerrainMaterialAsset* tMatAsset = AssetDatabase.acquireAsset<TerrainMaterialAsset>(query.mAssetList[i]);
  288. if (tMatAsset && tMatAsset->getMaterialDefinitionName() == matName)
  289. {
  290. matAsset->setAssetId(query.mAssetList[i]);
  291. AssetDatabase.releaseAsset(query.mAssetList[i]);
  292. return (*matAsset)->mLoadedState;
  293. }
  294. AssetDatabase.releaseAsset(query.mAssetList[i]); //cleanup if that's not the one we needed
  295. }
  296. }
  297. //Somehow we failed to bind an asset, so just use the fallback and mark the failure
  298. matAsset->setAssetId(TerrainMaterialAsset::smNoTerrainMaterialAssetFallback);
  299. (*matAsset)->mLoadedState = AssetErrCode::UsingFallback;
  300. return AssetErrCode::UsingFallback;
  301. }
  302. StringTableEntry TerrainMaterialAsset::getAssetIdByMaterialName(StringTableEntry matName)
  303. {
  304. if (matName == StringTable->EmptyString())
  305. return StringTable->EmptyString();
  306. StringTableEntry materialAssetId = TerrainMaterialAsset::smNoTerrainMaterialAssetFallback;
  307. AssetQuery query;
  308. U32 foundCount = AssetDatabase.findAssetType(&query, "TerrainMaterialAsset");
  309. if (foundCount != 0)
  310. {
  311. for (U32 i = 0; i < foundCount && materialAssetId == StringTable->EmptyString(); i++)
  312. {
  313. TerrainMaterialAsset* matAsset = AssetDatabase.acquireAsset<TerrainMaterialAsset>(query.mAssetList[i]);
  314. if (matAsset)
  315. {
  316. if (matAsset->getMaterialDefinitionName() == matName)
  317. materialAssetId = matAsset->getAssetId();
  318. AssetDatabase.releaseAsset(query.mAssetList[i]);
  319. }
  320. }
  321. }
  322. return materialAssetId;
  323. }
  324. U32 TerrainMaterialAsset::getAssetById(StringTableEntry assetId, AssetPtr<TerrainMaterialAsset>* materialAsset)
  325. {
  326. (*materialAsset) = assetId;
  327. if (materialAsset->notNull())
  328. {
  329. return (*materialAsset)->mLoadedState;
  330. }
  331. else
  332. {
  333. //Didn't work, so have us fall back to a placeholder asset
  334. materialAsset->setAssetId(TerrainMaterialAsset::smNoTerrainMaterialAssetFallback);
  335. if (materialAsset->isNull())
  336. {
  337. //Well that's bad, loading the fallback failed.
  338. Con::warnf("TerrainMaterialAsset::getAssetById - Finding of asset with id %s failed with no fallback asset", assetId);
  339. return AssetErrCode::Failed;
  340. }
  341. //handle noshape not being loaded itself
  342. if ((*materialAsset)->mLoadedState == BadFileReference)
  343. {
  344. Con::warnf("TerrainMaterialAsset::getAssetById - Finding of asset with id %s failed, and fallback asset reported error of Bad File Reference.", assetId);
  345. return AssetErrCode::BadFileReference;
  346. }
  347. Con::warnf("TerrainMaterialAsset::getAssetById - Finding of asset with id %s failed, utilizing fallback asset", assetId);
  348. (*materialAsset)->mLoadedState = AssetErrCode::UsingFallback;
  349. return AssetErrCode::UsingFallback;
  350. }
  351. }
  352. SimObjectPtr<TerrainMaterial> TerrainMaterialAsset::findMaterialDefinitionByAssetId(StringTableEntry assetId)
  353. {
  354. SimSet* terrainMatSet;
  355. if (!Sim::findObject("TerrainMaterialSet", terrainMatSet))
  356. {
  357. return nullptr;
  358. }
  359. SimObjectPtr<TerrainMaterial> matDef = dynamic_cast<TerrainMaterial*>(terrainMatSet->findObjectByInternalName(assetId));
  360. return matDef;
  361. }
  362. #ifdef TORQUE_TOOLS
  363. DefineEngineStaticMethod(TerrainMaterialAsset, getAssetIdByMaterialName, const char*, (const char* materialName), (""),
  364. "Queries the Asset Database to see if any asset exists that is associated with the provided material name.\n"
  365. "@return The AssetId of the associated asset, if any.")
  366. {
  367. return TerrainMaterialAsset::getAssetIdByMaterialName(StringTable->insert(materialName));
  368. }
  369. //MaterialAsset::findMaterialDefinitionByAssetId("Prototyping:Detail")
  370. DefineEngineStaticMethod(TerrainMaterialAsset, findMaterialDefinitionByAssetId, S32, (const char* assetId), (""),
  371. "Queries the MaterialSet to see if any MaterialDefinition exists that is associated to the provided assetId.\n"
  372. "@return The MaterialDefinition Id associated to the assetId, if any")
  373. {
  374. SimObjectPtr<TerrainMaterial> matDef = TerrainMaterialAsset::findMaterialDefinitionByAssetId(StringTable->insert(assetId));
  375. if (matDef.isNull())
  376. return SimObjectId(0);
  377. else
  378. return matDef->getId();
  379. }
  380. DefineEngineMethod(TerrainMaterialAsset, getScriptPath, const char*, (), ,
  381. "Queries the Asset Database to see if any asset exists that is associated with the provided material name.\n"
  382. "@return The AssetId of the associated asset, if any.")
  383. {
  384. return object->getScriptPath();
  385. }
  386. DefineEngineMethod(TerrainMaterialAsset, getMaterialDefinition, S32, (), ,
  387. "Queries the Asset Database to see if any asset exists that is associated with the provided material name.\n"
  388. "@return The AssetId of the associated asset, if any.")
  389. {
  390. SimObjectPtr<TerrainMaterial> mat = object->getMaterialDefinition();
  391. if (mat.isValid())
  392. return mat->getId();
  393. else
  394. return 0;
  395. }
  396. DefineEngineMethod(TerrainMaterialAsset, getFXMaterialDefinition, S32, (), ,
  397. "Queries the Asset Database to see if any asset exists that is associated with the provided material name.\n"
  398. "@return The AssetId of the associated asset, if any.")
  399. {
  400. SimObjectPtr<Material> mat = object->getFXMaterialDefinition();
  401. if (mat.isValid())
  402. return mat->getId();
  403. else
  404. return 0;
  405. }
  406. //-----------------------------------------------------------------------------
  407. // GuiInspectorTypeAssetId
  408. //-----------------------------------------------------------------------------
  409. IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainMaterialAssetPtr);
  410. ConsoleDocClass(GuiInspectorTypeTerrainMaterialAssetPtr,
  411. "@brief Inspector field type for Material Asset Objects\n\n"
  412. "Editor use only.\n\n"
  413. "@internal"
  414. );
  415. void GuiInspectorTypeTerrainMaterialAssetPtr::consoleInit()
  416. {
  417. Parent::consoleInit();
  418. ConsoleBaseType::getType(TypeTerrainMaterialAssetPtr)->setInspectorFieldType("GuiInspectorTypeTerrainMaterialAssetPtr");
  419. }
  420. GuiControl* GuiInspectorTypeTerrainMaterialAssetPtr::constructEditControl()
  421. {
  422. // Create base filename edit controls
  423. GuiControl* retCtrl = Parent::constructEditControl();
  424. if (retCtrl == NULL)
  425. return retCtrl;
  426. // Change filespec
  427. char szBuffer[512];
  428. dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainMaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
  429. mInspector->getIdString(), mCaption);
  430. mBrowseButton->setField("Command", szBuffer);
  431. setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
  432. // Create "Open in Editor" button
  433. mEditButton = new GuiBitmapButtonCtrl();
  434. dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.editAsset(%d.getText());", retCtrl->getId());
  435. mEditButton->setField("Command", szBuffer);
  436. char bitmapName[512] = "ToolsModule:material_editor_n_image";
  437. mEditButton->setBitmap(StringTable->insert(bitmapName));
  438. mEditButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
  439. mEditButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
  440. mEditButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
  441. mEditButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this asset in the Terrain Material Editor");
  442. mEditButton->registerObject();
  443. addObject(mEditButton);
  444. return retCtrl;
  445. }
  446. bool GuiInspectorTypeTerrainMaterialAssetPtr::updateRects()
  447. {
  448. S32 dividerPos, dividerMargin;
  449. mInspector->getDivider(dividerPos, dividerMargin);
  450. Point2I fieldExtent = getExtent();
  451. Point2I fieldPos = getPosition();
  452. mCaptionRect.set(0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y);
  453. mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y);
  454. bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
  455. if (mBrowseButton != NULL)
  456. {
  457. mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4);
  458. resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent);
  459. }
  460. if (mEditButton != NULL)
  461. {
  462. RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4);
  463. resized |= mEditButton->resize(shapeEdRect.point, shapeEdRect.extent);
  464. }
  465. return resized;
  466. }
  467. IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainMaterialAssetId);
  468. ConsoleDocClass(GuiInspectorTypeTerrainMaterialAssetId,
  469. "@brief Inspector field type for Terrain Material Assets\n\n"
  470. "Editor use only.\n\n"
  471. "@internal"
  472. );
  473. void GuiInspectorTypeTerrainMaterialAssetId::consoleInit()
  474. {
  475. Parent::consoleInit();
  476. ConsoleBaseType::getType(TypeTerrainMaterialAssetId)->setInspectorFieldType("GuiInspectorTypeTerrainMaterialAssetId");
  477. }
  478. #endif