mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 21:05:39 +00:00
material definition
changing the beast over to the refactor
This commit is contained in:
parent
4d980e5406
commit
cebfdbc5ec
13 changed files with 61 additions and 105 deletions
|
|
@ -721,5 +721,20 @@ public:
|
|||
#define INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(name, arraySize, consoleClass, docs) \
|
||||
addProtectedField(assetText(name, Asset), TypeImageAssetPtrRefactor, Offset(m##name##Asset, consoleClass), _set##name##Data, &defaultProtectedGetFn, arraySize, assetDoc(name, asset docs.));
|
||||
|
||||
#define DEF_IMAGEASSET_ARRAY_BINDS_REFACTOR(className,name, max)\
|
||||
DefineEngineMethod(className, get##name, const char*, (S32 index), , "get name")\
|
||||
{\
|
||||
return object->get##name##Asset(index).notNull() ? object->get##name##Asset(index)->getImageFile() : ""; \
|
||||
}\
|
||||
DefineEngineMethod(className, get##name##Asset, const char*, (S32 index), , assetText(name, asset reference))\
|
||||
{\
|
||||
if(index >= max || index < 0)\
|
||||
return "";\
|
||||
return object->_get##name(index); \
|
||||
}\
|
||||
DefineEngineMethod(className, set##name, void, (const char* map, S32 index), , assetText(name,assignment. first tries asset then flat file.))\
|
||||
{\
|
||||
object->_set##name(StringTable->insert(map), index);\
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
|
|
|||
|
|
@ -644,7 +644,7 @@ void GuiInspectorTypeMaterialAssetPtr::updatePreviewImage()
|
|||
MaterialAsset* matAsset = AssetDatabase.acquireAsset<MaterialAsset>(previewImage);
|
||||
if (matAsset && matAsset->getMaterialDefinition())
|
||||
{
|
||||
mPreviewImage->_setBitmap(matAsset->getMaterialDefinition()->mDiffuseMapAssetId[0]);
|
||||
mPreviewImage->_setBitmap(matAsset->getMaterialDefinition()->_getDiffuseMap(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -676,7 +676,7 @@ void GuiInspectorTypeMaterialAssetPtr::setPreviewImage(StringTableEntry assetId)
|
|||
MaterialAsset* matAsset = AssetDatabase.acquireAsset<MaterialAsset>(assetId);
|
||||
if (matAsset && matAsset->getMaterialDefinition())
|
||||
{
|
||||
mPreviewImage->_setBitmap(matAsset->getMaterialDefinition()->mDiffuseMapAssetId[0]);
|
||||
mPreviewImage->_setBitmap(matAsset->getMaterialDefinition()->_getDiffuseMap(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2988,11 +2988,11 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem)
|
|||
|
||||
if (imageType == ImageAsset::ImageTypes::Albedo || childItem->imageSuffixType.isEmpty())
|
||||
{
|
||||
newMat->mDiffuseMapAssetId[0] = assetMapFillInStr;
|
||||
newMat->_setDiffuseMap(assetMapFillInStr,0);
|
||||
}
|
||||
else if (imageType == ImageAsset::ImageTypes::Normal)
|
||||
{
|
||||
newMat->mNormalMapAssetId[0] = assetMapFillInStr;
|
||||
newMat->_setNormalMap(assetMapFillInStr, 0);
|
||||
}
|
||||
else if (imageType == ImageAsset::ImageTypes::ORMConfig)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -969,10 +969,10 @@ void GroundCover::_initialize( U32 cellCount, U32 cellPlacementCount )
|
|||
if(mat)
|
||||
{
|
||||
GFXTexHandle tex;
|
||||
if (mat->getDiffuseMapResource(0))
|
||||
tex = mat->getDiffuseMapResource(0);
|
||||
else if (mat->getDiffuseMap(0) != StringTable->EmptyString())
|
||||
tex = GFXTexHandle(mat->getDiffuseMap(0), &GFXStaticTextureSRGBProfile, "GroundCover texture aspect ratio check");
|
||||
if (mat->getDiffuseMap(0))
|
||||
tex = mat->getDiffuseMap(0);
|
||||
else if (mat->getDiffuseMapAsset(0).notNull())
|
||||
tex = mat->getDiffuseMap(0);
|
||||
|
||||
if(tex.isValid())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue