• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by JimmyJJeeter · Sep 12, 2012 at 11:08 PM · editorimportassetpostprocessor

How to 'call' AssetPostprocessor script?

I am trying to make a model post process using something like what they say here: http://docs.unity3d.com/Documentation/ScriptReference/AssetPostprocessor.OnPostprocessModel.html But it's not doing anything. I put the script in the Editor folder, is that enough? Do I have to call it explicitly or attach it to something, or should it just work whenever the model re-imports?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DoktorAce · Dec 03, 2012 at 09:09 AM

Yes, the script should run whenever the AssetPostprocessor starts (When an asset is being imported or re-imported). And the script do have to be inside a folder called Editor.

I've been doing this with textures and it works just fine, but I've done it using C#. (You might have to put "using UnityEditor;" at the top of your class)

 class Postprocessing : AssetPostprocessor {
     void OnPostprocessTexture (Texture2D texture) {
         //Do stuff with the texture
     }
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Adding custom functionality to 2D texture import settings -- where to start? 0 Answers

Out of system memory 1 Answer

Shader isn't displaying properly in editor view, but when built it displays properly. 0 Answers

Help with AssetPostProcessor and keyframes? 0 Answers

AssetPostprocessor - Can't change Mesh Data 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges