mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
conversion lockin: cleans out eroneous editor refs to specmap and specularmap in favor of the desired PBRConfigMap var name for the combined (smooth,ao,metalness) map used throughout
This commit is contained in:
parent
fb67458eaf
commit
60d2b0a0f6
4 changed files with 28 additions and 28 deletions
|
|
@ -304,7 +304,7 @@ void Material::initPersistFields()
|
||||||
addField("invertSmoothness", TypeBool, Offset(mInvertSmoothness, Material), MAX_STAGES,
|
addField("invertSmoothness", TypeBool, Offset(mInvertSmoothness, Material), MAX_STAGES,
|
||||||
"Treat Smoothness as Roughness");
|
"Treat Smoothness as Roughness");
|
||||||
|
|
||||||
addField( "specularMap", TypeImageFilename, Offset(mPBRConfigMapFilename, Material), MAX_STAGES,
|
addField( "PBRConfigMap", TypeImageFilename, Offset(mPBRConfigMapFilename, Material), MAX_STAGES,
|
||||||
"Prepacked specular map texture. The RGB channels of this texture provide per-pixel reference values for: "
|
"Prepacked specular map texture. The RGB channels of this texture provide per-pixel reference values for: "
|
||||||
"smoothness (R), Ambient Occlusion (G), and metalness(B)");
|
"smoothness (R), Ambient Occlusion (G), and metalness(B)");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -385,10 +385,10 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
|
||||||
%file.writeline(" AOMap[0] = \"" @ %assetItem.AOImageAsset.filePath @"\";");
|
%file.writeline(" AOMap[0] = \"" @ %assetItem.AOImageAsset.filePath @"\";");
|
||||||
%file.writeline(" AOMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.AOImageAsset.assetName @"\";");
|
%file.writeline(" AOMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.AOImageAsset.assetName @"\";");
|
||||||
}
|
}
|
||||||
if(%assetItem.compositeImageAsset)
|
if(%assetItem.PBRConfigMapImageAsset)
|
||||||
{
|
{
|
||||||
%file.writeline(" CompositeMap[0] = \"" @ %assetItem.compositeImageAsset.filePath @"\";");
|
%file.writeline(" PBRConfigMap[0] = \"" @ %assetItem.compositeImageAsset.filePath @"\";");
|
||||||
%file.writeline(" CompositeMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.compositeImageAsset.assetName @"\";");
|
%file.writeline(" PBRConfigMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.compositeImageAsset.assetName @"\";");
|
||||||
}
|
}
|
||||||
%file.writeline("};");
|
%file.writeline("};");
|
||||||
%file.writeline("//--- OBJECT WRITE END ---");
|
%file.writeline("//--- OBJECT WRITE END ---");
|
||||||
|
|
|
||||||
|
|
@ -731,7 +731,7 @@
|
||||||
HorizSizing = "right";
|
HorizSizing = "right";
|
||||||
VertSizing = "bottom";
|
VertSizing = "bottom";
|
||||||
position = "70 2";
|
position = "70 2";
|
||||||
Extent = "57 16";
|
Extent = "107 16";
|
||||||
MinExtent = "8 2";
|
MinExtent = "8 2";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
Visible = "1";
|
Visible = "1";
|
||||||
|
|
@ -772,7 +772,7 @@
|
||||||
|
|
||||||
new GuiBitmapCtrl() {
|
new GuiBitmapCtrl() {
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
internalName = "specMapDisplayBitmap";
|
internalName = "PBRConfigMapDisplayBitmap";
|
||||||
Enabled = "1";
|
Enabled = "1";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
Profile = "ToolsGuiDefaultProfile";
|
Profile = "ToolsGuiDefaultProfile";
|
||||||
|
|
@ -806,7 +806,7 @@
|
||||||
AnchorBottom = "0";
|
AnchorBottom = "0";
|
||||||
AnchorLeft = "1";
|
AnchorLeft = "1";
|
||||||
AnchorRight = "0";
|
AnchorRight = "0";
|
||||||
text = "Composite Map";
|
text = "PBR Config Map";
|
||||||
maxLength = "1024";
|
maxLength = "1024";
|
||||||
};
|
};
|
||||||
new GuiBitmapButtonCtrl() {
|
new GuiBitmapButtonCtrl() {
|
||||||
|
|
@ -821,7 +821,7 @@
|
||||||
MinExtent = "8 2";
|
MinExtent = "8 2";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
Visible = "1";
|
Visible = "1";
|
||||||
Command = "MaterialEditorGui.updateSpecMap(1);";
|
Command = "MaterialEditorGui.updatePBRConfigMap(1);";
|
||||||
tooltipprofile = "ToolsGuiDefaultProfile";
|
tooltipprofile = "ToolsGuiDefaultProfile";
|
||||||
ToolTip = "Change the packed spec map for this layer. \n Smoothness (R), Ambient Occlusion (G), and Metalness(B))";
|
ToolTip = "Change the packed spec map for this layer. \n Smoothness (R), Ambient Occlusion (G), and Metalness(B))";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
@ -832,7 +832,7 @@
|
||||||
};
|
};
|
||||||
new GuiTextCtrl() {
|
new GuiTextCtrl() {
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
internalName = "specMapNameText";
|
internalName = "PBRConfigMapNameText";
|
||||||
Enabled = "1";
|
Enabled = "1";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
Profile = "ToolsGuiTextProfile";
|
Profile = "ToolsGuiTextProfile";
|
||||||
|
|
@ -861,7 +861,7 @@
|
||||||
position = "134 34";
|
position = "134 34";
|
||||||
Extent = "40 16";
|
Extent = "40 16";
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
command="MaterialEditorGui.updateSpecMap(1);";
|
command="MaterialEditorGui.updatePBRConfigMap(1);";
|
||||||
};
|
};
|
||||||
new GuiBitmapButtonCtrl() {
|
new GuiBitmapButtonCtrl() {
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
@ -875,7 +875,7 @@
|
||||||
MinExtent = "8 2";
|
MinExtent = "8 2";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
Visible = "1";
|
Visible = "1";
|
||||||
Command = "MaterialEditorGui.updateSpecMap(0);";
|
Command = "MaterialEditorGui.updatePBRConfigMap(0);";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
groupNum = "-1";
|
groupNum = "-1";
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
|
|
|
||||||
|
|
@ -589,9 +589,9 @@ function MaterialEditorGui::convertTextureFields(%this)
|
||||||
|
|
||||||
for(%specI = 0; %specI < 4; %specI++)
|
for(%specI = 0; %specI < 4; %specI++)
|
||||||
{
|
{
|
||||||
%specMap = MaterialEditorGui.currentMaterial.specularMap[%specI];
|
%PBRConfigMap = MaterialEditorGui.currentMaterial.PBRConfigMap[%specI];
|
||||||
%specMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %specMap);
|
%PBRConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %PBRConfigMap);
|
||||||
MaterialEditorGui.currentMaterial.specularMap[%specI] = %specMap;
|
MaterialEditorGui.currentMaterial.PBRConfigMap[%specI] = %PBRConfigMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(%roughI = 0; %roughI < 4; %roughI++)
|
for(%roughI = 0; %roughI < 4; %roughI++)
|
||||||
|
|
@ -906,15 +906,15 @@ function MaterialEditorGui::guiSync( %this, %material )
|
||||||
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
|
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
|
||||||
MaterialEditorPropertiesWindow-->invertSmoothnessCheckbox.setValue((%material).invertSmoothness[%layer]);
|
MaterialEditorPropertiesWindow-->invertSmoothnessCheckbox.setValue((%material).invertSmoothness[%layer]);
|
||||||
|
|
||||||
if((%material).specularMap[%layer] $= "")
|
if((%material).PBRConfigMap[%layer] $= "")
|
||||||
{
|
{
|
||||||
MaterialEditorPropertiesWindow-->specMapNameText.setText( "None" );
|
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( "None" );
|
||||||
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MaterialEditorPropertiesWindow-->specMapNameText.setText( (%material).specularMap[%layer] );
|
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( (%material).PBRConfigMap[%layer] );
|
||||||
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( (%material).specularMap[%layer] );
|
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( (%material).PBRConfigMap[%layer] );
|
||||||
}
|
}
|
||||||
|
|
||||||
if((%material).roughMap[%layer] $= "")
|
if((%material).roughMap[%layer] $= "")
|
||||||
|
|
@ -1266,7 +1266,7 @@ function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
|
||||||
MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
|
MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
|
||||||
}
|
}
|
||||||
|
|
||||||
function MaterialEditorGui::updateSpecMap(%this,%action)
|
function MaterialEditorGui::updatePBRConfigMap(%this,%action)
|
||||||
{
|
{
|
||||||
%layer = MaterialEditorGui.currentLayer;
|
%layer = MaterialEditorGui.currentLayer;
|
||||||
|
|
||||||
|
|
@ -1277,20 +1277,20 @@ function MaterialEditorGui::updateSpecMap(%this,%action)
|
||||||
{
|
{
|
||||||
MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", 0);
|
MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", 0);
|
||||||
|
|
||||||
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap(%texture);
|
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%texture);
|
||||||
|
|
||||||
%bitmap = MaterialEditorPropertiesWindow-->specMapDisplayBitmap.bitmap;
|
%bitmap = MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.bitmap;
|
||||||
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
|
||||||
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap(%bitmap);
|
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%bitmap);
|
||||||
MaterialEditorPropertiesWindow-->specMapNameText.setText(%bitmap);
|
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText(%bitmap);
|
||||||
MaterialEditorGui.updateActiveMaterial("specularMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MaterialEditorPropertiesWindow-->specMapNameText.setText("None");
|
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText("None");
|
||||||
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
|
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
|
||||||
MaterialEditorGui.updateActiveMaterial("specularMap[" @ %layer @ "]","");
|
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","");
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
MaterialEditorGui.guiSync( materialEd_previewMaterial );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue