x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How can I change Texture Editor Settings from a plugin

Hi,

I'm trying to import textures and meshes from an external directory through an editor plugin. I've managed to achieve this by using the FAssetToolsModule's function ImportAssets. Now I'm trying to improve the import times by changing texture settings like MipGenSettings and CompressionSettings. I've two specific questions:

1) Is it possible to change these settings BEFORE invoking the call to ImportAssets ? I've tried doing something like the following, but it didn't quite work:

 UTextureFactory * TextureFactory = ConstructObject<UTextureFactory>(UTextureFactory::StaticClass());
 TextureFactory->MipGenSettings = TextureMipGenSettings::TMGS_NoMipmaps;    
 TArray<UObject*> ImportedAssets = AssetToolsModule.Get().ImportAssets(FileNames, DestPathTexture, TextureFactory);

2) If the above isn't possible, then can we change the above mentioned settings through code (in the same way we change them through the Editor) ?. I've been unable to find the right class/object/method to update these.

Product Version: Not Selected
Tags:
more ▼

asked Oct 21 '14 at 02:38 PM in C++ Programming

avatar image

SameerMirza
15 2 3 5

avatar image iceprincefounder Mar 25 '16 at 08:38 AM

Hi SameerMirza :

I tried your code,I wonder how to define the AssetToolsModule,like this:

 FAssetToolsModule AssetToolsModule;
 TArray<UObject*> ImportedAssets = AssetToolsModule.Get().ImportAssets(FileNames, DestPathTexture, TextureFactory);
 

and it doesn`t work!

can you give me some advice?

Thanks a lot!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

So apparently we CAN change these settings on the texture objects. It was only a matter of using a compiler directive to set these settings (since these members were marked as editor only:

 #if WITH_EDITORONLY_DATA
         texture->CompressionNone = true;
         texture->MipGenSettings = TMGS_NoMipmaps;
 #endif

Looking at the code in the engine source. It seems that the TextureFactory settings are ignored since the factory object you pass in might not directly be used to create the binary. Hence our option was to set these values on the texture objects instead.

more ▼

answered Oct 24 '14 at 08:56 AM

avatar image

SameerMirza
15 2 3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question