Merge branch 'alph40_pbrConfig_BREAKINGWip' of https://github.com/Azaezel/Torque3D into Preview4_0

This commit is contained in:
Areloch 2019-11-22 21:24:59 -06:00
commit ac77315e29
36 changed files with 1157 additions and 763 deletions

View file

@ -393,10 +393,9 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
%file.writeline(" AOMap[0] = \"" @ %AOAssetPath @"\";");
%file.writeline(" AOMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.AOImageAsset.assetName @"\";");
}
if(%assetItem.compositeImageAsset)
if(%assetItem.PBRConfigMapImageAsset)
{
%compAssetPath = %assetPath @ fileName(%assetItem.compositeImageAsset.filePath);
%file.writeline(" PBRConfigMap[0] = \"" @ %compAssetPath @"\";");
%file.writeline(" PBRConfigMap[0] = \"" @ %assetItem.compositeImageAsset.filePath @"\";");
%file.writeline(" PBRConfigMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.compositeImageAsset.assetName @"\";");
}
%file.writeline("};");

View file

@ -566,6 +566,132 @@
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
new GuiContainer(){
profile = "ToolsGuiTransparentProfile";
isContainer = "1";
position = "0 0";
Extent = "185 50";
HorizSizing = "width";
new GuiTextCtrl() {
HorizSizing = "right";
VertSizing = "bottom";
position = "9 4";
Extent = "72 16";
text = "Smoothness";
Profile = "ToolsGuiTextProfile";
};
new GuiTextCtrl() {
HorizSizing = "right";
VertSizing = "bottom";
position = "9 26";
Extent = "72 16";
text = "Metalness";
Profile = "ToolsGuiTextProfile";
};
new GuiControl() {
class = "AggregateControl";
position = "91 4";
Extent = "96 20";
new GuiSliderCtrl() {
canSaveDynamicFields = "0";
internalName = "SmoothnessSlider";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiSliderProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 1";
Extent = "61 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Sets Smoothness.";
hovertime = "1000";
range = "0 1";
ticks = "0";
value = "0";
};
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "SmoothnessTextEdit";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "64 0";
Extent = "29 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
hovertime = "1000";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "0";
};
};
new GuiControl() {
class = "AggregateControl";
position = "91 26";
Extent = "96 20";
new GuiSliderCtrl() {
canSaveDynamicFields = "0";
internalName = "MetalnessSlider";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiSliderProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 1";
Extent = "61 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateActiveMaterial(\"Metalness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Metalness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Sets Metalness.";
hovertime = "1000";
range = "0 1";
ticks = "0";
value = "0";
};
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "MetalnessTextEdit";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "64 0";
Extent = "29 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Metalness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
hovertime = "1000";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "0";
};
};
};
new GuiContainer(){ // spec Map options
profile="ToolsGuiDefaultProfile";
@ -605,7 +731,7 @@
HorizSizing = "right";
VertSizing = "bottom";
position = "70 2";
Extent = "57 16";
Extent = "107 16";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
@ -646,7 +772,7 @@
new GuiBitmapCtrl() {
canSaveDynamicFields = "0";
internalName = "specMapDisplayBitmap";
internalName = "PBRConfigMapDisplayBitmap";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
@ -680,7 +806,7 @@
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Composite Map";
text = "PBR Config Map";
maxLength = "1024";
};
new GuiBitmapButtonCtrl() {
@ -695,7 +821,7 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateSpecMap(1);";
Command = "MaterialEditorGui.updatePBRConfigMap(1);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Change the packed spec map for this layer. \n Smoothness (R), Ambient Occlusion (G), and Metalness(B))";
hovertime = "1000";
@ -706,7 +832,7 @@
};
new GuiTextCtrl() {
canSaveDynamicFields = "0";
internalName = "specMapNameText";
internalName = "PBRConfigMapNameText";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextProfile";
@ -735,7 +861,7 @@
position = "134 34";
Extent = "40 16";
buttonType = "PushButton";
command="MaterialEditorGui.updateSpecMap(1);";
command="MaterialEditorGui.updatePBRConfigMap(1);";
};
new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";
@ -749,7 +875,7 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateSpecMap(0);";
Command = "MaterialEditorGui.updatePBRConfigMap(0);";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
@ -1552,6 +1678,236 @@
canSaveDynamicFields = "0";
};
};
new GuiBitmapCtrl() {
bitmap = "tools/gui/images/separator-v";
wrap = "0";
position = "6 75";
extent = "175 2";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiContainer() {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "6 364";
extent = "185 67";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
position = "1 1";
extent = "48 48";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "glowMapDisplayBitmap";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "glow";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 5";
extent = "35 8";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "1 1";
extent = "48 48";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "MaterialEditorGui.updateglowMap(1);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Change the glowness Map for this layer.";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "None";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 17";
extent = "143 17";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "glowMapNameText";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Edit";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "134 34";
extent = "40 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "MaterialEditorGui.updateglowMap(1);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/gui/images/delete";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "177 34";
extent = "16 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "MaterialEditorGui.updateglowMap(0);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
HorizSizing = "right";
VertSizing = "bottom";
position = "9 48";
Extent = "72 16";
text = "GlowMul";
Profile = "ToolsGuiTextProfile";
};
new GuiControl() {
class = "AggregateControl";
position = "91 48";
Extent = "96 20";
new GuiSliderCtrl() {
canSaveDynamicFields = "0";
internalName = "GlowMulSlider";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiSliderProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 1";
Extent = "61 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Sets GlowMul.";
hovertime = "1000";
range = "0 20";
ticks = "0";
value = "0";
};
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "GlowMulTextEdit";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "64 0";
Extent = "29 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
hovertime = "1000";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "0";
};
};
};
};
};
new GuiRolloutCtrl(advancedTextureMapsRollout) {
@ -2767,131 +3123,6 @@
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
new GuiContainer(){ // specular
profile = "ToolsGuiTransparentProfile";
isContainer = "1";
position = "0 0";
Extent = "185 44";
HorizSizing = "width";
new GuiTextCtrl() {
profile = "ToolsGuiTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "9 4";
Extent = "72 16";
text = "Smoothness";
};
new GuiTextCtrl() {
profile = "ToolsGuiTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "9 26";
Extent = "72 16";
text = "Metalness";
};
new GuiControl() {
class = "AggregateControl";
position = "91 4";
Extent = "96 20";
new GuiSliderCtrl() {
canSaveDynamicFields = "0";
internalName = "SmoothnessSlider";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiSliderProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 1";
Extent = "61 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Sets Smoothness.";
hovertime = "1000";
range = "0 1";
ticks = "0";
value = "0";
};
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "SmoothnessTextEdit";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "64 0";
Extent = "29 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
hovertime = "1000";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "0";
};
};
new GuiControl() {
class = "AggregateControl";
position = "91 26";
Extent = "96 20";
new GuiSliderCtrl() {
canSaveDynamicFields = "0";
internalName = "MetalnessSlider";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiSliderProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 1";
Extent = "61 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateActiveMaterial(\"Metalness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Metalness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Sets Metalness.";
hovertime = "1000";
range = "0 1";
ticks = "0";
value = "0";
};
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "MetalnessTextEdit";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "64 0";
Extent = "29 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Metalness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
hovertime = "1000";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "0";
};
};
};
new GuiContainer(){ // glow emissive
profile = "ToolsGuiTransparentProfile";
isContainer = "1";

View file

@ -590,9 +590,9 @@ function MaterialEditorGui::convertTextureFields(%this)
for(%specI = 0; %specI < 4; %specI++)
{
%specMap = MaterialEditorGui.currentMaterial.specularMap[%specI];
%specMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %specMap);
MaterialEditorGui.currentMaterial.specularMap[%specI] = %specMap;
%PBRConfigMap = MaterialEditorGui.currentMaterial.PBRConfigMap[%specI];
%PBRConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %PBRConfigMap);
MaterialEditorGui.currentMaterial.PBRConfigMap[%specI] = %PBRConfigMap;
}
for(%roughI = 0; %roughI < 4; %roughI++)
@ -615,6 +615,13 @@ function MaterialEditorGui::convertTextureFields(%this)
%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;
}
}
// still needs to be optimized further
@ -901,15 +908,15 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
MaterialEditorPropertiesWindow-->invertSmoothnessCheckbox.setValue((%material).invertSmoothness[%layer]);
if((%material).specularMap[%layer] $= "")
if((%material).PBRConfigMap[%layer] $= "")
{
MaterialEditorPropertiesWindow-->specMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
else
{
MaterialEditorPropertiesWindow-->specMapNameText.setText( (%material).specularMap[%layer] );
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( (%material).specularMap[%layer] );
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( (%material).PBRConfigMap[%layer] );
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( (%material).PBRConfigMap[%layer] );
}
if((%material).roughMap[%layer] $= "")
@ -945,6 +952,17 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->metalMapDisplayBitmap.setBitmap( (%material).metalMap[%layer] );
}
if((%material).glowMap[%layer] $= "")
{
MaterialEditorPropertiesWindow-->glowMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" );
}
else
{
MaterialEditorPropertiesWindow-->glowMapNameText.setText( (%material).glowMap[%layer] );
MaterialEditorPropertiesWindow-->glowMapDisplayBitmap.setBitmap( (%material).glowMap[%layer] );
}
MaterialEditorPropertiesWindow-->accuScaleTextEdit.setText((%material).accuScale[%layer]);
MaterialEditorPropertiesWindow-->accuScaleTextEdit.setText((%material).accuScale[%layer]);
MaterialEditorPropertiesWindow-->accuDirectionTextEdit.setText((%material).accuDirection[%layer]);
@ -966,6 +984,8 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->SmoothnessSlider.setValue((%material).Smoothness[%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]);
MaterialEditorPropertiesWindow-->emissiveCheckbox.setValue((%material).emissive[%layer]);
MaterialEditorPropertiesWindow-->parallaxTextEdit.setText((%material).parallaxScale[%layer]);
@ -1040,6 +1060,7 @@ function MaterialEditorGui::guiSync( %this, %material )
%this.getRoughChan((%material).SmoothnessChan[%layer]);
%this.getAOChan((%material).AOChan[%layer]);
%this.getMetalChan((%material).metalChan[%layer]);
%this.getGlowChan((%material).glowChan[%layer]);
%this.preventUndo = false;
}
@ -1061,6 +1082,11 @@ function MaterialEditorGui::getMetalChan(%this, %channel)
%guiElement = metalChanBtn @ %channel;
%guiElement.setStateOn(true);
}
function MaterialEditorGui::getGlowChan(%this, %channel)
{
%guiElement = glowChanBtn @ %channel;
%guiElement.setStateOn(true);
}
//=======================================
// Material Update Functionality
@ -1242,7 +1268,7 @@ function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
}
function MaterialEditorGui::updateSpecMap(%this,%action)
function MaterialEditorGui::updatePBRConfigMap(%this,%action)
{
%layer = MaterialEditorGui.currentLayer;
@ -1253,20 +1279,20 @@ function MaterialEditorGui::updateSpecMap(%this,%action)
{
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/","");
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap(%bitmap);
MaterialEditorPropertiesWindow-->specMapNameText.setText(%bitmap);
MaterialEditorGui.updateActiveMaterial("specularMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%bitmap);
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText(%bitmap);
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
}
}
else
{
MaterialEditorPropertiesWindow-->specMapNameText.setText("None");
MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
MaterialEditorGui.updateActiveMaterial("specularMap[" @ %layer @ "]","");
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText("None");
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","");
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
@ -1356,6 +1382,34 @@ function MaterialEditorGui::updatemetalMap(%this,%action)
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
function MaterialEditorGui::updateGlowMap(%this,%action)
{
%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 );
}
function MaterialEditorGui::updateRotationOffset(%this, %isSlider, %onMouseUp)
{
%layer = MaterialEditorGui.currentLayer;
@ -2478,6 +2532,12 @@ function MaterialEditorGui::setMetalChan(%this, %value)
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
function MaterialEditorGui::setGlowChan(%this, %value)
{
MaterialEditorGui.updateActiveMaterial("glowChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
function MaterialEditorGui::saveCompositeMap(%this)
{
%saveAs = "";
@ -2503,13 +2563,15 @@ function MaterialEditorGui::saveCompositeMap(%this)
%roughMap = %material.roughMap[%layer];
%aoMap = %material.aoMap[%layer];
%metalMap = %material.metalMap[%layer];
%glowMap = %material.glowMap[%layer];
%smooth = %material.SmoothnessChan[%layer];
%ao = %material.AOChan[%layer];
%metal = %material.metalChan[%layer];
%glow = %material.glowChan[%layer];
%channelKey = %smooth SPC %ao SPC %metal SPC 3;
%channelKey = %smooth SPC %ao SPC %metal SPC %glow;
error("Storing: \"" @ %roughMap @"\" \""@ %aoMap @"\" \""@ %metalMap @"\" \""@ %channelKey @"\" \""@ %saveAs @"\"");
saveCompositeTexture(%roughMap,%aoMap,%metalMap,"",%channelKey, %saveAs);
saveCompositeTexture(%roughMap,%aoMap,%metalMap,%glowMap,%channelKey, %saveAs);
%dlg.delete();
}

View file

@ -1257,6 +1257,182 @@
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiContainer() {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "6 216";
extent = "174 53";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "tools/materialEditor/gui/unknownImage";
color = "255 255 255 255";
wrap = "0";
position = "1 1";
extent = "47 47";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "compositeTexCtrl";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
masked = "0";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "1 1";
extent = "48 48";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg.changecomposite();";
tooltipProfile = "ToolsGuiDefaultProfile";
tooltip = "Change the active composite Map for this layer.";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Composite";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 -3";
extent = "61 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "EditorTextProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "None";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "56 17";
extent = "79 17";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Edit";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "111 0";
extent = "40 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg.changecomposite();";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "tools/gui/images/delete";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
masked = "0";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "154 0";
extent = "16 16";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
command = "TerrainMaterialDlg-->compositeTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl() {
bitmap = "tools/gui/images/separator-v";
color = "255 255 255 255";
wrap = "0";
position = "4 51";
extent = "148 2";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
new GuiBitmapCtrl() {
bitmap = "tools/gui/images/separator-v";