|
Is it possible in Unity to override / add to the default automatic asset import behavior? I would like to add custom behavior to the way that Unity handles Modo lxo files. Ideally I would like to be able to completely take over the import procedure for certain lxo files that the user could specifies.
(comments are locked)
|
|
You might be able to use AssetPostprocessor.OnPostprocessAllAssets. If it's not a supported asset type it is usually recognised as "TextAsset" so you can access it as binary data. If you want a custom inspector for the asset itself you could try to implement your own editor for TextAsset (so you replace the old TextAssetInspector which is an internal class). I never tried something like that. I'm also not sure if Unity will treat such assets as TextAssets but if it does it should work. edit Modo is one of the supported packages, and lxo is an accepted asset type to Unity. I am trying to override the default behavior for these particular types of asset in Unity. I believe what you have given me is enough to accomplish my goal, thanks!
May 06 '12 at 07:37 PM
deus_duke
Sorry, I'm not an artist and I've never come across a lox file ;) So it's basically just a model. Unity uses the collada exporter of modo since Unity only supports ".FBX, .dae, .3DS, .dxf and .obj" Model assets are fully processed by an AssetPostprocessor so you can change anything afterwards. Keep in mind that Unity doesn't use the asset itself. Model-assets are represented be it's importer. The importer will create sub assets (which are stored in the library folder in the assetdatabase). Those sub assets are usually the mesh data as seperate Mesh, the bone hierarchy as a GameObject tree and animations as anim assets. You can add your own stuff as sub assets to any kind of asset via AssetDatabase.AddObjectToAsset. But like stated in the docs when you reimport the asset such sub assets will be lost.
May 06 '12 at 08:20 PM
Bunny83
Oh so is it not possible to tell Unity not to import anything from the lxo at all? My goal is to mark certain assets to not be imported by Unity but to defer all processing to my script, which will process the file.
May 07 '12 at 02:21 AM
deus_duke
(comments are locked)
|
|
Ah that's different then what I had in mind but it works. Thanks for all your help!
(comments are locked)
|
