Fixes a few minor behavioral issues with the MaterialEditor

- Fixes not properly handling TypeMaterialAssetRef
- Fixed erroneous sanity checks that prevented temp editing mats from being made for the editor
This commit is contained in:
JeffR 2026-07-12 13:36:39 -05:00
parent 79f773f38d
commit 0dfab42763
2 changed files with 9 additions and 3 deletions

View file

@ -245,6 +245,11 @@ function GuiInspectorTypeMaterialAssetPtr::onControlDropped( %this, %payload, %p
EWorldEditor.isDirty = true; EWorldEditor.isDirty = true;
} }
function GuiInspectorTypeMaterialAssetRef::onControlDropped( %this, %payload, %position )
{
GuiInspectorTypeMaterialAssetPtr::onControlDropped( %this, %payload, %position );
}
function GuiInspectorGroup::buildMaterialInheritListField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %callbackName, %ownerObj) function GuiInspectorGroup::buildMaterialInheritListField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %callbackName, %ownerObj)
{ {
%extent = 18; %extent = 18;

View file

@ -48,7 +48,7 @@ function MaterialEditorGui::establishMaterials(%this)
}; };
} }
if(!isObject(materialEd_previewMaterial)) if(!isObject(materialEd_justAlphaMaterial))
{ {
singleton CustomMaterial( materialEd_justAlphaMaterial ) singleton CustomMaterial( materialEd_justAlphaMaterial )
{ {
@ -57,7 +57,7 @@ function MaterialEditorGui::establishMaterials(%this)
}; };
} }
if(!isObject(materialEd_previewMaterial)) if(!isObject(materialEd_justAlphaShader))
{ {
//Custom shader to allow the display of just the alpha channel. //Custom shader to allow the display of just the alpha channel.
singleton ShaderData( materialEd_justAlphaShader ) singleton ShaderData( materialEd_justAlphaShader )
@ -526,7 +526,8 @@ function MaterialEditorGui::prepareActiveObject( %this, %override )
{ {
%fieldName = %obj.getField(%i); %fieldName = %obj.getField(%i);
if( %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetId" && %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetPtr") if( %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetId" && %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetPtr"
&& %obj.getFieldType(%fieldName) !$= "TypeMaterialAssetRef")
continue; continue;
if( !%canSupportMaterial ) if( !%canSupportMaterial )