Fallback to material stages for GetEditorImage()

This commit is contained in:
Robert Beckebans 2023-10-08 14:27:22 +02:00
parent eb2d963784
commit 6f98740772
3 changed files with 11 additions and 2 deletions

View file

@ -2052,6 +2052,14 @@ void idDeclManagerLocal::ExportMaterialsToBlender_f( const idCmdArgs& args )
{
const idMaterial* material = static_cast< const idMaterial* >( declManagerLocal.FindType( DECL_MATERIAL, declManagerLocal.linearLists[ DECL_MATERIAL ][ i ]->GetName(), false ) );
#if 0
const char* matName = material->GetName();
if( idStr::FindText( matName, "textures/base_floor/ghotile3", false ) != -1 )
{
totalMaterialsCount++;
}
#endif
material->ExportJSON( file, i == ( count - 1 ) );
totalMaterialsCount++;

View file

@ -576,6 +576,8 @@ void idImage::FinalizeImage( bool fromBackEnd, nvrhi::ICommandList* commandList
opts.numLevels = 1;
DeriveOpts();
defaulted = true; // RB
if( !commandList )
{
return;
@ -603,7 +605,6 @@ void idImage::FinalizeImage( bool fromBackEnd, nvrhi::ICommandList* commandList
SubImageUpload( level, 0, 0, 0, opts.width >> level, opts.height >> level, clear.Ptr() );
}
#endif
defaulted = true; // RB
isLoaded = true;
return;
}

View file

@ -260,7 +260,7 @@ idImage* idMaterial::GetEditorImage() const
// look for the diffusemap alternative like TrenchBroom does
// this is required to have the texture dimensions for the convertMapToValve220 cmd
if( editorImage && editorImage->IsLoaded() && editorImage->IsDefaulted() )
if( editorImage && /*editorImage->IsLoaded() &&*/ editorImage->IsDefaulted() )
{
// _D3XP :: First check for a diffuse image, then use the first
if( numStages && stages )