How to disable importing blue images as NormalMap?

This is what my rubber duck gave me:

import unreal

# Define the path to your textures
import_path = "/Game/MyTextures"

# Get all texture assets in the import path
assets = unreal.EditorAssetLibrary.list_assets(import_path)

# Iterate through the assets and update compression settings
for asset_path in assets:
    asset = unreal.EditorAssetLibrary.load_asset(asset_path)
    
    # Check if it's a texture
    if isinstance(asset, unreal.Texture):
        asset.compression_settings = unreal.TextureCompressionSettings.TC_DEFAULT  # Not a normal map
        asset.srgb = True  # Enable sRGB if needed
        asset.modify()  # Apply changes
        unreal.EditorAssetLibrary.save_asset(asset_path)  # Save changes

As usual there may be really silly bugs in this, but that last if statement looks correct at first glance.

So it may be enough to just force TC_DEFAULT, and asser.srgb = True. in your script.

And you can always create blueprint tool, or event (executable from editor) that goes trough textures in folder and changes compression.

Or use property matrix on whole folder and change all textures to SRGB

1 Like