TerrainMaterialAsset.cpp 19 KB

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