TerrainMaterialAsset.cpp 19 KB

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