# Setting compression settings on newly-imported textures?

**URL:** <https://forums.unrealengine.com/t/setting-compression-settings-on-newly-imported-textures/152924>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [October 29, 2020, 10:22pm UTC](https://forums.unrealengine.com/t/setting-compression-settings-on-newly-imported-textures/152924 "2020-10-29T22:22:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![haruspexile](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@haruspexile](https://forums.unrealengine.com/u/haruspexile)\
**Post date:** [October 29, 2020, 10:22pm UTC](https://forums.unrealengine.com/t/setting-compression-settings-on-newly-imported-textures/152924/1 "2020-10-29T22:22:27Z")

</div>

Hi, I’m trying to automate the import process for various textures.

I assumed that the path to do this would be to create a TextureFactory for each compression settings like so:

```auto

texFactory_orm.set_editor_property('compression_settings', unreal.TextureCompressionSettings.TC_MASKS)

```

and then assign that factory conditionally to the AssetImportTask:

```auto

def build_texture_import_task(filename, destination_path, destination_name='', replace_existing=False):
    task = unreal.AssetImportTask()
    
    texname = os.path.splitext(os.path.basename(filename))[0]
    if texname.endswith('_N'):
        task.set_editor_property('factory', texFactory_normal)
    elif texname.endswith('_ORM'):
        task.set_editor_property('factory', texFactory_orm)
    elif texname.endswith('_H'):
        task.set_editor_property('factory', texFactory_height)
    else:
        task.set_editor_property('factory', texFactory_standard)

    task.set_editor_property('automated', True)
    task.set_editor_property('filename', filename)
    task.set_editor_property('destination_path', destination_path)
    task.set_editor_property('destination_name', destination_name)
    task.set_editor_property('replace_existing', replace_existing)
    task.set_editor_property('save', True)
    return task

```

but… this doesn’t work.

What am I doing wrong? There’s very little documentation I can find about texture import settings. There doesn’t seem to be a “FbxImportUI” equivalent.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![KBeu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KBeu](https://forums.unrealengine.com/u/KBeu)\
**Post date:** [November 19, 2020, 5:48pm UTC](https://forums.unrealengine.com/t/setting-compression-settings-on-newly-imported-textures/152924/2 "2020-11-19T17:48:04Z")

</div>

Unfortunately I do not have an answer for you. I tried doing the same thing with the same negative results. If you haven’t already resorted to this workaround I just ended up specifying the compression settings on the textures after import. It’s a bit unsatisfying as it seems like specifying it in the factory should work, but it gets me what I need.

```auto

imported_texture.set_editor_property('compression_settings', unreal.TextureCompressionSettings.TC_MASKS)

```

---

<div class="post-metadata">

**Author:** ![BojanglesTheLess](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BojanglesTheLess](https://forums.unrealengine.com/u/BojanglesTheLess)\
**Post date:** [November 11, 2024, 3:26pm UTC](https://forums.unrealengine.com/t/setting-compression-settings-on-newly-imported-textures/152924/3 "2024-11-11T15:26:40Z")

</div>

> [@KBeu](#):
>
> `unreal.TextureCompressionSettings.TC_`

For whatever reason, 5.3 wouldn’t let me do it directly. I had to store it in a variable to get it to work 🤷‍♂️

```auto
#https://dev.epicgames.com/documentation/en-us/unreal-engine/python-api/class/TextureCompressionSettings?application_version=5.1#unreal.TextureCompressionSettings
cs = unreal.TextureCompressionSettings.TC_NORMALMAP 
normal.set_editor_property("compression_settings", cs)

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Abezod](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Abezod](https://forums.unrealengine.com/u/Abezod)\
**Post date:** [October 16, 2025, 6:27pm UTC](https://forums.unrealengine.com/t/setting-compression-settings-on-newly-imported-textures/152924/4 "2025-10-16T18:27:41Z")

</div>

Anyone been able to get this to work? It seems like the the texture factory isn’t actually working…
