shift pbrconfig to ORM

This commit is contained in:
AzaezelX 2020-09-30 13:51:12 -05:00
parent 22b0785c73
commit 0c7811bd1a
54 changed files with 879 additions and 680 deletions

View file

@ -590,9 +590,9 @@ function MaterialEditorGui::convertTextureFields(%this)
for(%specI = 0; %specI < 4; %specI++)
{
%PBRConfigMap = MaterialEditorGui.currentMaterial.PBRConfigMap[%specI];
%PBRConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %PBRConfigMap);
MaterialEditorGui.currentMaterial.PBRConfigMap[%specI] = %PBRConfigMap;
%ORMConfigMap = MaterialEditorGui.currentMaterial.ORMConfigMap[%specI];
%ORMConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %ORMConfigMap);
MaterialEditorGui.currentMaterial.ORMConfigMap[%specI] = %ORMConfigMap;
}
for(%roughI = 0; %roughI < 4; %roughI++)
@ -914,17 +914,17 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).toneMap[%layer] );
}
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
MaterialEditorPropertiesWindow-->invertSmoothnessCheckbox.setValue((%material).invertSmoothness[%layer]);
MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
if((%material).PBRConfigMap[%layer] $= "")
if((%material).ORMConfigMap[%layer] $= "")
{
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
else
{
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( (%material).PBRConfigMap[%layer] );
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( (%material).PBRConfigMap[%layer] );
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( (%material).ORMConfigMap[%layer] );
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( (%material).ORMConfigMap[%layer] );
}
if((%material).roughMap[%layer] $= "")
@ -988,8 +988,8 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->colorTintSwatch.color = (%material).diffuseColor[%layer];
MaterialEditorPropertiesWindow-->specularColorSwatch.color = (%material).specular[%layer];
MaterialEditorPropertiesWindow-->SmoothnessTextEdit.setText((%material).Smoothness[%layer]);
MaterialEditorPropertiesWindow-->SmoothnessSlider.setValue((%material).Smoothness[%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]);
@ -1065,7 +1065,7 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->accuCheckbox.setValue((%material).accuEnabled[%layer]);
%this.getRoughChan((%material).SmoothnessChan[%layer]);
%this.getRoughChan((%material).RoughnessChan[%layer]);
%this.getAOChan((%material).AOChan[%layer]);
%this.getMetalChan((%material).metalChan[%layer]);
%this.getGlowChan((%material).glowChan[%layer]);
@ -1276,7 +1276,7 @@ function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
}
function MaterialEditorGui::updatePBRConfigMap(%this,%action)
function MaterialEditorGui::updateORMConfigMap(%this,%action)
{
%layer = MaterialEditorGui.currentLayer;
@ -1287,20 +1287,20 @@ function MaterialEditorGui::updatePBRConfigMap(%this,%action)
{
MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", 0);
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%texture);
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%texture);
%bitmap = MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.bitmap;
%bitmap = MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.bitmap;
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%bitmap);
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText(%bitmap);
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%bitmap);
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText(%bitmap);
MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
}
}
else
{
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText("None");
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","");
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText("None");
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","");
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
@ -2524,7 +2524,7 @@ function MaterialEditorGui::updateAccuCheckbox(%this, %value)
// channel in selectors
function MaterialEditorGui::setRoughChan(%this, %value)
{
MaterialEditorGui.updateActiveMaterial("SmoothnessChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
MaterialEditorGui.updateActiveMaterial("RoughnessChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
@ -2573,13 +2573,12 @@ function MaterialEditorGui::saveCompositeMap(%this)
%metalMap = %material.metalMap[%layer];
%glowMap = %material.glowMap[%layer];
%smooth = %material.SmoothnessChan[%layer];
%roughness = %material.RoughnessChan[%layer];
%ao = %material.AOChan[%layer];
%metal = %material.metalChan[%layer];
%glow = %material.glowChan[%layer];
%channelKey = %smooth SPC %ao SPC %metal SPC %glow;
%channelKey = %roughness SPC %ao SPC %metal SPC 0;
error("Storing: \"" @ %roughMap @"\" \""@ %aoMap @"\" \""@ %metalMap @"\" \""@ %channelKey @"\" \""@ %saveAs @"\"");
saveCompositeTexture(%roughMap,%aoMap,%metalMap,%glowMap,%channelKey, %saveAs);
saveCompositeTexture(%roughMap,%aoMap,%metalMap,"",%channelKey, %saveAs);
%dlg.delete();
}