- Home /
How to Change Default Import Settings?
For example when I import a sprite I don't want to manually set things such as PPU, or filter mode and have them standard across the entire project when I import.
Also is there anyway to change the default settings for the Sprite Editor? If I by default want it to slice something up in a grid can that be done?
Answer by lassade · Jan 17, 2016 at 05:22 AM
Yes its possible! you need to write a AssetImporter and put inside any Editor folder http://docs.unity3d.com/ScriptReference/AssetImporter.html
see this for an example: http://www.sarpersoher.com/a-custom-asset-importer-for-unity/
Thanks! Still not sure how to change the Sprite Editor stuff for multiple sprites. Any tips on how to do that automatically? For Example by default I would like it so splice the sheet up into a 1024x1024 grid with the pivot on the bottom of each one.
Here is a good example of import setting manager. You can just rewrite it or supplement it to support more types of assets. http://wiki.unity3d.com/index.php/$$anonymous$$odelImporterPreset$$anonymous$$anager
Great share. Clearly-commented and also outlined the simplicity of custom import settings. Another +1 for Unity!
Answer by daniel254973 · Jul 16, 2018 at 10:50 AM
With new Unity Presets (2018.1) all the answers are deprecated.
You can change default import settings with it.
Use Presets to specify default properties for new components and Asset importers. You cannot set the default properties for Project settings , Preferences settings or native Assets such as $$anonymous$$aterials, Animations or SpriteSheets.
Seems like for that you still have to use the source from above: source
Okay just for the guys com$$anonymous$$g here later my quote of the reference above is obsolete.
If you have added a default Preset into the Preset$$anonymous$$anager you have to select the assets (if already imported) and hit reset. Reimport won't do anything. Also I would suggest using this script here if you need different settings for different folders: https://docs.unity3d.com/$$anonymous$$anual/DefaultPresetsByFolder.html
oh cool, I didn't know about Presets, this looks super useful for what I'm working on. There's one import setting for FBX models (Convert Units is normally on, but I need that off for how scaling is applied) that I need to change for all models.
Here's a video showing how to use the preset system to setup default import settings: https://www.youtube.com/watch?v=RXDS0mAhtKw
Answer by shieldgenerator7 · Nov 20, 2021 at 11:45 AM
Here's a step-by-step guide on how to do this with the Unity Preset Manager:
Setup a sprite with the settings you want, then click the Presets button
Press "Save current to..." and save your preset. I named mine "TextureImporterPNG.preset"
Go to "Edit->Project Settings..." and select "Preset Manager" on the list on the left
Click "Add Default Preset"
Search for "texture"
Select "TextureImporter"
In the filter box, type
glob:"*.png"
In the Preset box: click and drag your saved texture preset from step 2 into the Preset box
You're done!
Note: You may have to delete the .meta
files of already imported PNGs if you want to have them reimported with these default settings.
Nice solution! I'm trying to get this to work on generated lightmaps, but to no success. The lightmap textures get default settings, but if I right-click and "Reset", my values appear, letting me know I've got it correct set up in Preset Manager, they just don't apply on automatically on generated lightmaps.. Have you got that to work in some way?
Answer by Krahazik · Oct 05, 2017 at 03:15 PM
@tomekkie2 @Iassade I am getting several errors with the script and I do not know how to fix them.
Using this script - http://www.sarpersoher.com/a-custom-asset-importer-for-unity/
Assets/Scripts/AssetImporter.cs(41,12): error CS1502: The best overloaded method match for `UnityEditor.TextureImporter.SetPlatformTextureSettings(string, int, UnityEditor.TextureImporterFormat, bool)' has some invalid arguments
Assets/Scripts/AssetImporter.cs(42,101): error CS1503: Argument `#4' cannot convert `int' expression to type `bool'
How can I edit the script to effect the Materials import settings (Material Naming and Material Search) for an imported asset to use 'From Model's Material' and 'Project-Wide'?
I also just tried using the script linked by @tomekkie2 but there were errors with that script as well. Stuff about deprecieted functions or something.
Answer by SweatyChair · Dec 07, 2017 at 02:25 AM
There's also plugin for people who don't code:
https://assetstore.unity.com/packages/tools/utilities/defaulter-custom-importer-defaults-beta-77952
Your answer
Follow this Question
Related Questions
Save generated Texture2D as Texture type Sprite 1 Answer
When to use Generate Lightmap UV? 0 Answers
How to stop gradient banding? 2 Answers