mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Fixes assignment of the mapTo field for terrain FX materials to point to the assetId rather than just the assetName, fixing the material mapping lookups
Fixes project import to comply to above change Makes Material default mEffectColor to white instead of whatever default value it comes up with due to memset
This commit is contained in:
parent
c2857efe28
commit
bae6a3f514
|
|
@ -229,6 +229,9 @@ Material::Material()
|
|||
|
||||
dMemset(mEffectColor, 0, sizeof(mEffectColor));
|
||||
|
||||
mEffectColor[0] = LinearColorF::WHITE;
|
||||
mEffectColor[1] = LinearColorF::WHITE;
|
||||
|
||||
mFootstepSoundId = -1; mImpactSoundId = -1;
|
||||
mImpactFXIndex = -1;
|
||||
INIT_ASSET(CustomFootstepSound);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function AssetBrowser::createTerrainMaterialAsset(%this)
|
|||
|
||||
%fxMatDef = new Material("TerrainFX_" @ %assetName)
|
||||
{
|
||||
mapTo = %assetName;
|
||||
mapTo = %moduleName @ ":" @ %assetName;
|
||||
footstepSoundId = 0;
|
||||
terrainMaterials = "1";
|
||||
ShowDust = "1";
|
||||
|
|
|
|||
|
|
@ -1203,7 +1203,7 @@ function T3Dpre4ProjectImporter::processTerrainMaterialObject(%this, %fileObject
|
|||
{
|
||||
%fxMatObj = getField(%fxMatList, %i);
|
||||
%fxMatObjMapTo = findObjectField(%fxMatObj, "mapTo");
|
||||
if(%fxMatObjMapTo $= %objectName)
|
||||
if(%fxMatObjMapTo $= %objectName || %fxMatObjMapTo $= %assetName)
|
||||
{
|
||||
%fileObject.FXMaterial = %fxMatObj;
|
||||
break;
|
||||
|
|
@ -1215,7 +1215,7 @@ function T3Dpre4ProjectImporter::processTerrainMaterialObject(%this, %fileObject
|
|||
if(%fileObject.FXMaterial !$= "")
|
||||
{
|
||||
//Ensure our mapto is up to date for any name sanitize/tweaks
|
||||
setObjectField(%fileObject.FXMaterial, "mapTo", %objectName);
|
||||
setObjectField(%fileObject.FXMaterial, "mapTo", %moduleName @ ":" @ %assetName);
|
||||
|
||||
//we associated to an FX material, so process that now
|
||||
%objectDefinition = "";
|
||||
|
|
@ -1249,7 +1249,7 @@ function T3Dpre4ProjectImporter::processTerrainMaterialObject(%this, %fileObject
|
|||
//if after all that we still have no FXMaterial, just create a new one
|
||||
%fxMat = new Material("TerrainFX_" @ %objectName)
|
||||
{
|
||||
mapTo = %objectName;
|
||||
mapTo = %moduleName @ ":" @ %assetName;
|
||||
};
|
||||
%asset.add(%fxMat);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ function TerrainMaterialDlg::prepSaveDirtyMaterial(%this, %material)
|
|||
if(!isObject(%fxMat))
|
||||
{
|
||||
%fxMat = new Material("TerrainFX_" @ %assetDef.assetName){
|
||||
mapTo = %assetDef.assetName;
|
||||
mapTo = %material.internalName;
|
||||
};
|
||||
|
||||
%assetDef.add(%fxMat);
|
||||
|
|
|
|||
Loading…
Reference in a new issue