|
@@ -230,6 +230,11 @@ function MaterialEditorGui::openFile( %this, %fileType )
|
|
|
return makeRelativePath( %filename, getMainDotCsDir() );
|
|
|
}
|
|
|
|
|
|
+function MaterialEditorGui::selectMaterialAsset(%this, %assetId)
|
|
|
+{
|
|
|
+ AssetBrowser.editAsset(%assetId);
|
|
|
+}
|
|
|
+
|
|
|
//==============================================================================
|
|
|
// SubMaterial(Material Target) -- Supports different ways to grab the
|
|
|
// material from the dropdown list. We're here either because-
|
|
@@ -253,7 +258,16 @@ function SubMaterialSelector::onSelect( %this )
|
|
|
// object does not have a valid method to grab a material
|
|
|
if( !isObject( %material ) )
|
|
|
{
|
|
|
- // look for a newMaterial name to grab
|
|
|
+ if(!AssetDatabase.isDeclaredAsset(%material))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ %assetDef = AssetDatabase.acquireAsset(%material);
|
|
|
+ %material = %assetDef.materialDefinitionName;
|
|
|
+ }
|
|
|
+ /*// look for a newMaterial name to grab
|
|
|
// addiitonally, convert "." to "_" in case we have something like: "base.texname" as a material name
|
|
|
// at the end we will have generated material name: "base_texname_mat"
|
|
|
%material = getUniqueName( strreplace(%material, ".", "_") @ "_mat" );
|
|
@@ -268,7 +282,7 @@ function SubMaterialSelector::onSelect( %this )
|
|
|
eval( "MaterialEditorGui.currentObject." @ strreplace(%this.getText(),".","_") @ " = " @ %material @ ";");
|
|
|
|
|
|
if( MaterialEditorGui.currentObject.isMethod("postApply") )
|
|
|
- MaterialEditorGui.currentObject.postApply();
|
|
|
+ MaterialEditorGui.currentObject.postApply();*/
|
|
|
}
|
|
|
|
|
|
MaterialEditorGui.prepareActiveMaterial( %material.getId() );
|
|
@@ -325,7 +339,7 @@ function MaterialEditorGui::prepareActiveObject( %this, %override )
|
|
|
{
|
|
|
%fieldName = %obj.getField(%i);
|
|
|
|
|
|
- if( %obj.getFieldType(%fieldName) !$= "TypeMaterialName" )
|
|
|
+ if( %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetId" && %obj.getFieldType(%fieldName) !$= "TypeMaterialName")
|
|
|
continue;
|
|
|
|
|
|
if( !%canSupportMaterial )
|
|
@@ -409,7 +423,8 @@ function MaterialEditorGui::prepareActiveMaterial(%this, %material, %override)
|
|
|
{
|
|
|
// If were not valid, grab the first valid material out of the materialSet
|
|
|
if( !isObject(%material) )
|
|
|
- %material = MaterialSet.getObject(0);
|
|
|
+ return;
|
|
|
+ //%material = MaterialSet.getObject(0);
|
|
|
|
|
|
// Check made in order to avoid loading the same material. Overriding
|
|
|
// made in special cases
|
|
@@ -501,7 +516,13 @@ function MaterialEditorGui::setMaterialDirty(%this)
|
|
|
// materials created in the material selector are given that as its filename, so we run another check
|
|
|
if( MaterialEditorGui.isMatEditorMaterial( MaterialEditorGui.currentMaterial ) )
|
|
|
{
|
|
|
- if( MaterialEditorGui.currentMaterial.isAutoGenerated() )
|
|
|
+ %currentMatFilename = MaterialEditorGui.currentMaterial.getFilename();
|
|
|
+
|
|
|
+ if(%currentMatFilename !$= "")
|
|
|
+ {
|
|
|
+ matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, %currentMatFilename);
|
|
|
+ }
|
|
|
+ else if( MaterialEditorGui.currentMaterial.isAutoGenerated() )
|
|
|
{
|
|
|
%obj = MaterialEditorGui.currentObject;
|
|
|
|
|
@@ -525,13 +546,9 @@ function MaterialEditorGui::setMaterialDirty(%this)
|
|
|
|
|
|
matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, %savePath);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, "art/materials." @ $TorqueScriptFileExtension);
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
- matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial);
|
|
|
+ matEd_PersistMan.setDirty(MaterialEditorGui.currentMaterial, MaterialEditorGui.defaultMaterialFile);
|
|
|
}
|
|
|
|
|
|
function MaterialEditorGui::convertTextureFields(%this)
|
|
@@ -539,88 +556,30 @@ function MaterialEditorGui::convertTextureFields(%this)
|
|
|
// Find the absolute paths for the texture filenames so that
|
|
|
// we can properly wire up the preview materials and controls.
|
|
|
|
|
|
- for(%diffuseI = 0; %diffuseI < 4; %diffuseI++)
|
|
|
- {
|
|
|
- %diffuseMap = MaterialEditorGui.currentMaterial.diffuseMap[%diffuseI];
|
|
|
- %diffuseMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %diffuseMap);
|
|
|
- MaterialEditorGui.currentMaterial.diffuseMap[%diffuseI] = %diffuseMap;
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "DiffuseMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "NormalMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "OverlayMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "DetailMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "LightMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "ToneMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "ORMConfigMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "RoughMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "AOMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "MetalMap");
|
|
|
+ %this.convertMaterialTextureField(MaterialEditorGui.currentMaterial, "GlowMap");
|
|
|
}
|
|
|
|
|
|
- for(%normalI = 0; %normalI < 4; %normalI++)
|
|
|
+function MaterialEditorGui::convertMaterialTextureField(%this, %material, %mapName)
|
|
|
{
|
|
|
- %normalMap = MaterialEditorGui.currentMaterial.normalMap[%normalI];
|
|
|
- %normalMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %normalMap);
|
|
|
- MaterialEditorGui.currentMaterial.normalMap[%normalI] = %normalMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%overlayI = 0; %overlayI < 4; %overlayI++)
|
|
|
+ for(%index = 0; %index < 4; %index++)
|
|
|
{
|
|
|
- %overlayMap = MaterialEditorGui.currentMaterial.overlayMap[%overlayI];
|
|
|
- %overlayMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %overlayMap);
|
|
|
- MaterialEditorGui.currentMaterial.overlayMap[%overlayI] = %overlayMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%detailI = 0; %detailI < 4; %detailI++)
|
|
|
+ %mapFile = %material.call("get" @ %mapName, %index);
|
|
|
+ if(%mapFile !$= "" && !isFile(%mapFile))
|
|
|
{
|
|
|
- %detailMap = MaterialEditorGui.currentMaterial.detailMap[%detailI];
|
|
|
- %detailMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %detailMap);
|
|
|
- MaterialEditorGui.currentMaterial.detailMap[%detailI] = %detailMap;
|
|
|
+ //see if we can't go finding it
|
|
|
+ %mapFile = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %mapFile);
|
|
|
+ MaterialEditorGui.currentMaterial.call("set" @ %mapName, %mapFile, %index);
|
|
|
}
|
|
|
-
|
|
|
- for(%detailNormalI = 0; %detailNormalI < 4; %detailNormalI++)
|
|
|
- {
|
|
|
- %detailNormalMap = MaterialEditorGui.currentMaterial.detailNormalMap[%detailNormalI];
|
|
|
- %detailNormalMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %detailNormalMap);
|
|
|
- MaterialEditorGui.currentMaterial.detailNormalMap[%detailNormalI] = %detailNormalMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%lightI = 0; %lightI < 4; %lightI++)
|
|
|
- {
|
|
|
- %lightMap = MaterialEditorGui.currentMaterial.lightMap[%lightI];
|
|
|
- %lightMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %lightMap);
|
|
|
- MaterialEditorGui.currentMaterial.lightMap[%lightI] = %lightMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%toneI = 0; %toneI < 4; %toneI++)
|
|
|
- {
|
|
|
- %toneMap = MaterialEditorGui.currentMaterial.toneMap[%toneI];
|
|
|
- %toneMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %toneMap);
|
|
|
- MaterialEditorGui.currentMaterial.toneMap[%toneI] = %toneMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%specI = 0; %specI < 4; %specI++)
|
|
|
- {
|
|
|
- %ORMConfigMap = MaterialEditorGui.currentMaterial.ORMConfigMap[%specI];
|
|
|
- %ORMConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %ORMConfigMap);
|
|
|
- MaterialEditorGui.currentMaterial.ORMConfigMap[%specI] = %ORMConfigMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%roughI = 0; %roughI < 4; %roughI++)
|
|
|
- {
|
|
|
- %roughMap = MaterialEditorGui.currentMaterial.roughMap[%roughI];
|
|
|
- %roughMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %roughMap);
|
|
|
- MaterialEditorGui.currentMaterial.roughMap[%specI] = %roughMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%aoI = 0; %aoI < 4; %aoI++)
|
|
|
- {
|
|
|
- %aoMap = MaterialEditorGui.currentMaterial.aoMap[%aoI];
|
|
|
- %aoMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %aoMap);
|
|
|
- MaterialEditorGui.currentMaterial.aoMap[%specI] = %aoMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%metalI = 0; %metalI < 4; %metalI++)
|
|
|
- {
|
|
|
- %metalMap = MaterialEditorGui.currentMaterial.metalMap[%metalI];
|
|
|
- %metalMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %metalMap);
|
|
|
- MaterialEditorGui.currentMaterial.metalMap[%metalI] = %metalMap;
|
|
|
- }
|
|
|
-
|
|
|
- for(%glowI = 0; %glowI < 4; %glowI++)
|
|
|
- {
|
|
|
- %glowMap = MaterialEditorGui.currentMaterial.glowMap[%glowI];
|
|
|
- %glowMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %glowMap);
|
|
|
- MaterialEditorGui.currentMaterial.glowMap[%glowI] = %glowMap;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -785,15 +744,6 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|
|
MaterialEditorPropertiesWindow-->castShadows.setValue((%material).castShadows);
|
|
|
MaterialEditorPropertiesWindow-->castDynamicShadows.setValue((%material).castDynamicShadows);
|
|
|
MaterialEditorPropertiesWindow-->translucentCheckbox.setValue((%material).translucent);
|
|
|
- /*
|
|
|
-
|
|
|
- MaterialEditorPropertiesWindow-->blendingTypePopUp.add(preMul,1);
|
|
|
- MaterialEditorPropertiesWindow-->blendingTypePopUp.add(LerpAlpha,2);
|
|
|
- MaterialEditorPropertiesWindow-->blendingTypePopUp.add(Mul,3);
|
|
|
- MaterialEditorPropertiesWindow-->blendingTypePopUp.add(Add,4);
|
|
|
- MaterialEditorPropertiesWindow-->blendingTypePopUp.add(AddAlpha,5);
|
|
|
- MaterialEditorPropertiesWindow-->blendingTypePopUp.add(Sub,6);
|
|
|
- */
|
|
|
switch$((%material).translucentBlendOp)
|
|
|
{
|
|
|
case "None": %selectedNum = 0;
|
|
@@ -837,138 +787,174 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|
|
//layer specific controls are located here
|
|
|
%layer = MaterialEditorGui.currentLayer;
|
|
|
|
|
|
- if((%material).diffuseMap[%layer] $= "")
|
|
|
+ //Diffuse
|
|
|
+ if((%material).getDiffuseMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ %difAsset = (%material).getDiffuseMapAsset(%layer);
|
|
|
+ MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( (%material).getDiffuseMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( (%material).getDiffuseMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( (%material).diffuseMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( (%material).diffuseMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).normalMap[%layer] $= "")
|
|
|
+ //Normal
|
|
|
+ if((%material).getNormalMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->normalMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->normalMapNameText.setText( (%material).getNormalMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( (%material).getNormalMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->normalMapNameText.setText( (%material).normalMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( (%material).normalMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->normalMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).overlayMap[%layer] $= "")
|
|
|
+ //ORM Config
|
|
|
+ if((%material).getORMConfigMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->overlayMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( (%material).getORMConfigMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( (%material).getORMConfigMap(%layer) );
|
|
|
+ //hide unused
|
|
|
+ MaterialEditorPropertiesWindow-->RoughnessTextEdit.setVisible(false);
|
|
|
+ MaterialEditorPropertiesWindow-->RoughnessSlider.setVisible(false);
|
|
|
+ MaterialEditorPropertiesWindow-->MetalnessTextEdit.setVisible(false);
|
|
|
+ MaterialEditorPropertiesWindow-->MetalnessSlider.setVisible(false);
|
|
|
+
|
|
|
+ MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
|
|
|
+ MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
|
|
|
+ //show used
|
|
|
+ MaterialEditorPropertiesWindow-->isSRGBCheckbox.setVisible(true);
|
|
|
+ MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setVisible(true);
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->overlayMapNameText.setText( (%material).overlayMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( (%material).overlayMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+
|
|
|
+ MaterialEditorPropertiesWindow-->RoughnessTextEdit.setText((%material).Roughness[%layer]);
|
|
|
+ MaterialEditorPropertiesWindow-->RoughnessSlider.setValue((%material).Roughness[%layer]);
|
|
|
+ MaterialEditorPropertiesWindow-->MetalnessTextEdit.setText((%material).Metalness[%layer]);
|
|
|
+ MaterialEditorPropertiesWindow-->MetalnessSlider.setValue((%material).Metalness[%layer]);
|
|
|
+ //show used
|
|
|
+ MaterialEditorPropertiesWindow-->RoughnessTextEdit.setVisible(true);
|
|
|
+ MaterialEditorPropertiesWindow-->RoughnessSlider.setVisible(true);
|
|
|
+ MaterialEditorPropertiesWindow-->MetalnessTextEdit.setVisible(true);
|
|
|
+ MaterialEditorPropertiesWindow-->MetalnessSlider.setVisible(true);
|
|
|
+
|
|
|
+ //hide unused
|
|
|
+ MaterialEditorPropertiesWindow-->isSRGBCheckbox.setVisible(false);
|
|
|
+ MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setVisible(false);
|
|
|
}
|
|
|
|
|
|
- if((%material).detailMap[%layer] $= "")
|
|
|
+ //AOMap
|
|
|
+ if((%material).getAOMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->detailMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->aoMapNameText.setText( (%material).getAOMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( (%material).getAOMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->detailMapNameText.setText( (%material).detailMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( (%material).detailMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->aoMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
-
|
|
|
- if((%material).detailNormalMap[%layer] $= "")
|
|
|
+ //RoughMap
|
|
|
+ if((%material).getRoughMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->roughMapNameText.setText( (%material).getRoughMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( (%material).getRoughMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( (%material).detailNormalMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( (%material).detailNormalMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->roughMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).lightMap[%layer] $= "")
|
|
|
+ //MetalMap
|
|
|
+ if((%material).getMetalMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->lightMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->metalMapNameText.setText( (%material).getMetalMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).getMetalMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->lightMapNameText.setText( (%material).lightMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( (%material).lightMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->metalMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).toneMap[%layer] $= "")
|
|
|
+ //GlowMap
|
|
|
+ if((%material).getGlowMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->toneMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->glowMapNameText.setText( (%material).getGlowMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( (%material).getGlowMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->toneMapNameText.setText( (%material).toneMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).toneMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->glowMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
- MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
|
|
|
- MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
|
|
|
|
|
|
- if((%material).ORMConfigMap[%layer] $= "")
|
|
|
+ //Overlay
|
|
|
+ if((%material).getOverlayMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->overlayMapNameText.setText( (%material).getOverlayMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( (%material).getOverlayMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( (%material).ORMConfigMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( (%material).ORMConfigMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->overlayMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).roughMap[%layer] $= "")
|
|
|
+ //Detail
|
|
|
+ if((%material).getDetailMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->roughMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->detailMapNameText.setText( (%material).getDetailMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( (%material).getDetailMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->roughMapNameText.setText( (%material).roughMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap( (%material).roughMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->detailMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).aoMap[%layer] $= "")
|
|
|
+ //Detail Normal
|
|
|
+ if((%material).getDetailNormalMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->aoMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( (%material).getDetailNormalMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( (%material).getDetailNormalMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->aoMapNameText.setText( (%material).aoMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap( (%material).aoMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).metalMap[%layer] $= "")
|
|
|
+ //Light
|
|
|
+ if((%material).getLightMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->metalMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->lightMapNameText.setText( (%material).getLightMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( (%material).getLightMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->metalMapNameText.setText( (%material).metalMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).metalMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->lightMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
- if((%material).glowMap[%layer] $= "")
|
|
|
+ //Tone
|
|
|
+ if((%material).getToneMap(%layer) !$= "")
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->glowMapNameText.setText( "None" );
|
|
|
- MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
|
|
|
+ MaterialEditorPropertiesWindow-->toneMapNameText.setText( (%material).getToneMapAsset(%layer) );
|
|
|
+ MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).getToneMap(%layer) );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->glowMapNameText.setText( (%material).glowMap[%layer] );
|
|
|
- MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( (%material).glowMap[%layer] );
|
|
|
+ MaterialEditorPropertiesWindow-->toneMapNameText.setText( "None" );
|
|
|
+ MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
|
|
}
|
|
|
|
|
|
MaterialEditorPropertiesWindow-->accuScaleTextEdit.setText((%material).accuScale[%layer]);
|
|
@@ -988,10 +974,6 @@ function MaterialEditorGui::guiSync( %this, %material )
|
|
|
MaterialEditorPropertiesWindow-->colorTintSwatch.color = (%material).diffuseColor[%layer];
|
|
|
MaterialEditorPropertiesWindow-->specularColorSwatch.color = (%material).specular[%layer];
|
|
|
|
|
|
- MaterialEditorPropertiesWindow-->RoughnessTextEdit.setText((%material).Roughness[%layer]);
|
|
|
- MaterialEditorPropertiesWindow-->RoughnessSlider.setValue((%material).Roughness[%layer]);
|
|
|
- MaterialEditorPropertiesWindow-->MetalnessTextEdit.setText((%material).Metalness[%layer]);
|
|
|
- MaterialEditorPropertiesWindow-->MetalnessSlider.setValue((%material).Metalness[%layer]);
|
|
|
MaterialEditorPropertiesWindow-->glowMulTextEdit.setText((%material).glowMul[%layer]);
|
|
|
MaterialEditorPropertiesWindow-->glowMulSlider.setValue((%material).glowMul[%layer]);
|
|
|
MaterialEditorPropertiesWindow-->glowCheckbox.setValue((%material).glow[%layer]);
|
|
@@ -1240,182 +1222,65 @@ function MaterialEditorGui::updateTextureMap( %this, %type, %action )
|
|
|
|
|
|
if( %action )
|
|
|
{
|
|
|
- %texture = MaterialEditorGui.openFile("texture");
|
|
|
- if( %texture !$= "" )
|
|
|
- {
|
|
|
- %bitmapCtrl.setBitmap(%texture);
|
|
|
-
|
|
|
- %bitmap = %bitmapCtrl.bitmap;
|
|
|
- %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
|
|
- %bitmapCtrl.setBitmap(%bitmap);
|
|
|
- %textCtrl.setText(%bitmap);
|
|
|
- MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
|
|
- }
|
|
|
+ AssetBrowser.showDialog("ImageAsset", %this@".doUpdateTextureMap");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
%textCtrl.setText("None");
|
|
|
%bitmapCtrl.setBitmap("tools/materialEditor/gui/unknownImage");
|
|
|
MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","");
|
|
|
+ MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]","");
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-function MaterialEditorGui::updateDetailScale(%this,%newScale)
|
|
|
-{
|
|
|
- %layer = MaterialEditorGui.currentLayer;
|
|
|
-
|
|
|
- %detailScale = "\"" @ %newScale SPC %newScale @ "\"";
|
|
|
- MaterialEditorGui.updateActiveMaterial("detailScale[" @ %layer @ "]", %detailScale);
|
|
|
-}
|
|
|
-
|
|
|
-function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
|
|
|
-{
|
|
|
- %layer = MaterialEditorGui.currentLayer;
|
|
|
-
|
|
|
- %detailStrength = "\"" @ %newStrength @ "\"";
|
|
|
- MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
|
|
|
-}
|
|
|
-
|
|
|
-function MaterialEditorGui::updateORMConfigMap(%this,%action)
|
|
|
-{
|
|
|
- %layer = MaterialEditorGui.currentLayer;
|
|
|
-
|
|
|
- if( %action )
|
|
|
- {
|
|
|
- %texture = MaterialEditorGui.openFile("texture");
|
|
|
- if( %texture !$= "" )
|
|
|
- {
|
|
|
- MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", 0);
|
|
|
-
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%texture);
|
|
|
-
|
|
|
- %bitmap = MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.bitmap;
|
|
|
- %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%bitmap);
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText(%bitmap);
|
|
|
- MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText("None");
|
|
|
- MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
|
|
|
- MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","");
|
|
|
- }
|
|
|
-
|
|
|
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
|
|
}
|
|
|
|
|
|
-function MaterialEditorGui::updateRoughMap(%this,%action)
|
|
|
+function MaterialEditorGui::doUpdateTextureMap( %this, %assetId )
|
|
|
+{
|
|
|
+ if(%assetId !$= "")
|
|
|
{
|
|
|
%layer = MaterialEditorGui.currentLayer;
|
|
|
|
|
|
- if( %action )
|
|
|
- {
|
|
|
- %texture = MaterialEditorGui.openFile("texture");
|
|
|
- if( %texture !$= "" )
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap(%texture);
|
|
|
+ %type = %this.updatingTextureType;
|
|
|
|
|
|
- %bitmap = MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.bitmap;
|
|
|
- %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
|
|
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap(%bitmap);
|
|
|
- MaterialEditorPropertiesWindow-->roughMapNameText.setText(%bitmap);
|
|
|
- MaterialEditorGui.updateActiveMaterial("roughMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->roughMapNameText.setText("None");
|
|
|
- MaterialEditorPropertiesWindow-->roughMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
|
|
|
- MaterialEditorGui.updateActiveMaterial("roughMap[" @ %layer @ "]","");
|
|
|
- }
|
|
|
+ %bitmapCtrl = MaterialEditorPropertiesWindow.findObjectByInternalName( %type @ "MapDisplayBitmap", true );
|
|
|
+ %textCtrl = MaterialEditorPropertiesWindow.findObjectByInternalName( %type @ "MapNameText", true );
|
|
|
|
|
|
- MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
|
|
-}
|
|
|
+ %assetDef = AssetDatabase.acquireAsset(%assetId);
|
|
|
|
|
|
-function MaterialEditorGui::updateaoMap(%this,%action)
|
|
|
-{
|
|
|
- %layer = MaterialEditorGui.currentLayer;
|
|
|
+ %texture = %assetDef.getImagePath();
|
|
|
|
|
|
- if( %action )
|
|
|
- {
|
|
|
- %texture = MaterialEditorGui.openFile("texture");
|
|
|
+ //%texture = MaterialEditorGui.openFile("texture");
|
|
|
if( %texture !$= "" )
|
|
|
{
|
|
|
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%texture);
|
|
|
+ %bitmapCtrl.setBitmap(%texture);
|
|
|
|
|
|
- %bitmap = MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.bitmap;
|
|
|
+ %bitmap = %bitmapCtrl.bitmap;
|
|
|
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
|
|
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap(%bitmap);
|
|
|
- MaterialEditorPropertiesWindow-->aoMapNameText.setText(%bitmap);
|
|
|
- MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
|
|
+ %bitmapCtrl.setBitmap(%bitmap);
|
|
|
+ %textCtrl.setText(%assetId);
|
|
|
+ MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]","\"\"");
|
|
|
+ MaterialEditorGui.updateActiveMaterial(%type @ "MapAsset[" @ %layer @ "]","\"" @ %assetId @ "\"");
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->aoMapNameText.setText("None");
|
|
|
- MaterialEditorPropertiesWindow-->aoMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
|
|
|
- MaterialEditorGui.updateActiveMaterial("aoMap[" @ %layer @ "]","");
|
|
|
- }
|
|
|
|
|
|
+ %this.updatingTextureType = "";
|
|
|
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
|
|
}
|
|
|
|
|
|
-function MaterialEditorGui::updatemetalMap(%this,%action)
|
|
|
+function MaterialEditorGui::updateDetailScale(%this,%newScale)
|
|
|
{
|
|
|
%layer = MaterialEditorGui.currentLayer;
|
|
|
|
|
|
- if( %action )
|
|
|
- {
|
|
|
- %texture = MaterialEditorGui.openFile("texture");
|
|
|
- if( %texture !$= "" )
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap(%texture);
|
|
|
-
|
|
|
- %bitmap = MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.bitmap;
|
|
|
- %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
|
|
- MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap(%bitmap);
|
|
|
- MaterialEditorPropertiesWindow-->metalMapNameText.setText(%bitmap);
|
|
|
- MaterialEditorGui.updateActiveMaterial("metalMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->metalMapNameText.setText("None");
|
|
|
- MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
|
|
|
- MaterialEditorGui.updateActiveMaterial("metalMap[" @ %layer @ "]","");
|
|
|
+ %detailScale = "\"" @ %newScale SPC %newScale @ "\"";
|
|
|
+ MaterialEditorGui.updateActiveMaterial("detailScale[" @ %layer @ "]", %detailScale);
|
|
|
}
|
|
|
|
|
|
- MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
|
|
-}
|
|
|
-
|
|
|
-function MaterialEditorGui::updateGlowMap(%this,%action)
|
|
|
+function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
|
|
|
{
|
|
|
%layer = MaterialEditorGui.currentLayer;
|
|
|
|
|
|
- if( %action )
|
|
|
- {
|
|
|
- %texture = MaterialEditorGui.openFile("texture");
|
|
|
- if( %texture !$= "" )
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.setBitmap(%texture);
|
|
|
-
|
|
|
- %bitmap = MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.bitmap;
|
|
|
- %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
|
|
- MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.setBitmap(%bitmap);
|
|
|
- MaterialEditorPropertiesWindow-->GlowMapNameText.setText(%bitmap);
|
|
|
- MaterialEditorGui.updateActiveMaterial("glowMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- MaterialEditorPropertiesWindow-->GlowMapNameText.setText("None");
|
|
|
- MaterialEditorPropertiesWindow-->GlowMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage");
|
|
|
- MaterialEditorGui.updateActiveMaterial("glowMap[" @ %layer @ "]","");
|
|
|
- }
|
|
|
-
|
|
|
- MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
|
|
+ %detailStrength = "\"" @ %newStrength @ "\"";
|
|
|
+ MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
|
|
|
}
|
|
|
|
|
|
function MaterialEditorGui::updateRotationOffset(%this, %isSlider, %onMouseUp)
|
|
@@ -1599,12 +1464,6 @@ function MaterialEditorGui::updateColorMultiply(%this,%color)
|
|
|
%this.syncGuiColor(MaterialEditorPropertiesWindow-->colorTintSwatch, %propName, %color);
|
|
|
}
|
|
|
|
|
|
-function MaterialEditorGui::updateSpecularCheckbox(%this,%value)
|
|
|
-{
|
|
|
- MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", %value);
|
|
|
- MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
|
|
-}
|
|
|
-
|
|
|
function MaterialEditorGui::updateSpecular(%this, %color)
|
|
|
{
|
|
|
%propName = "specular[" @ MaterialEditorGui.currentLayer @ "]";
|
|
@@ -2164,6 +2023,16 @@ function MaterialEditorGui::save( %this )
|
|
|
|
|
|
function MaterialEditorGui::createNewMaterial( %this )
|
|
|
{
|
|
|
+ AssetBrowser_SelectModule.showDialog("MaterialEditorGui.pickedNewMaterialTargetModule");
|
|
|
+ AssetBrowser_SelectModuleWindow.selectWindow();
|
|
|
+}
|
|
|
+
|
|
|
+function MaterialEditorGui::pickedNewMaterialTargetModule( %this, %module )
|
|
|
+{
|
|
|
+ %moduleDef = ModuleDatabase.findModule(%module);
|
|
|
+ PE_EmitterEditor.targetModule = %module;
|
|
|
+ MaterialEditorGui.defaultMaterialFile = %moduleDef.ModulePath @ "/scripts/managedData/materials." @ $TorqueScriptFileExtension;
|
|
|
+
|
|
|
%action = %this.createUndo(ActionCreateNewMaterial, "Create New Material");
|
|
|
%action.object = "";
|
|
|
|
|
@@ -2571,10 +2440,10 @@ function MaterialEditorGui::saveCompositeMap(%this)
|
|
|
%material = %this.currentMaterial;
|
|
|
%layer = %this.currentLayer;
|
|
|
|
|
|
- %roughMap = %material.roughMap[%layer];
|
|
|
- %aoMap = %material.aoMap[%layer];
|
|
|
- %metalMap = %material.metalMap[%layer];
|
|
|
- %glowMap = %material.glowMap[%layer];
|
|
|
+ %roughMap = %material.getRoughMap(%layer);
|
|
|
+ %aoMap = %material.getAOMap(%layer);
|
|
|
+ %metalMap = %material.getMetalMap(%layer);
|
|
|
+ %glowMap = %material.getGlowMap(%layer);
|
|
|
|
|
|
%roughness = %material.RoughnessChan[%layer];
|
|
|
%ao = %material.AOChan[%layer];
|