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 && materialAssetId == StringTable->EmptyString(); i++)
  310. {
  311. TerrainMaterialAsset* matAsset = AssetDatabase.acquireAsset<TerrainMaterialAsset>(query.mAssetList[i]);
  312. if (matAsset)
  313. {
  314. if (matAsset->getMaterialDefinitionName() == matName)
  315. materialAssetId = matAsset->getAssetId();
  316. AssetDatabase.releaseAsset(query.mAssetList[i]);
  317. }
  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