├── Assembly-CSharp-Editor-vs.csproj ├── Assembly-CSharp-Editor.csproj ├── Assembly-CSharp-vs.csproj ├── Assembly-CSharp.csproj ├── Assets ├── Models.meta ├── Models │ ├── Bird.ms3d │ ├── Bird.ms3d.meta │ ├── Sinbad.material │ ├── Sinbad.material.meta │ ├── Sinbad.mesh │ ├── Sinbad.mesh.meta │ ├── Sinbad.skeleton │ ├── Sinbad.skeleton.meta │ ├── boblampclean.md5anim │ ├── boblampclean.md5anim.meta │ ├── boblampclean.md5mesh │ ├── boblampclean.md5mesh.meta │ ├── bones.ms3d │ ├── bones.ms3d.meta │ ├── dwarf.ms3d │ ├── dwarf.ms3d.meta │ ├── minotouaxesplit.b3d │ ├── minotouaxesplit.b3d.meta │ ├── minotouaxesplite.ms3d │ ├── minotouaxesplite.ms3d.meta │ ├── sinbad_body.tga │ ├── sinbad_body.tga.meta │ ├── sinbad_clothes.tga │ ├── sinbad_clothes.tga.meta │ ├── sinbad_sword.tga │ ├── sinbad_sword.tga.meta │ ├── viking.ms3d │ └── viking.ms3d.meta ├── Prefabs.meta ├── Resources.meta ├── Resources │ ├── Textures.meta │ └── Textures │ │ ├── Bird_Skin.png │ │ ├── Bird_Skin.png.meta │ │ ├── Bird_Skind.png │ │ ├── Bird_Skind.png.meta │ │ ├── RuinT00.png │ │ ├── RuinT00.png.meta │ │ ├── RuinT01.tga │ │ ├── RuinT01.tga.meta │ │ ├── RuinT01n.jpg │ │ ├── RuinT01n.jpg.meta │ │ ├── RuinT02.tga │ │ ├── RuinT02.tga.meta │ │ ├── RuinT02n.jpg │ │ ├── RuinT02n.jpg.meta │ │ ├── RuinT02n.tga │ │ ├── RuinT02n.tga.meta │ │ ├── RuinT03.tga │ │ ├── RuinT03.tga.meta │ │ ├── RuinT03n.jpg │ │ ├── RuinT03n.jpg.meta │ │ ├── RuinT04.tga │ │ ├── RuinT04.tga.meta │ │ ├── RuinT04n.jpg │ │ ├── RuinT04n.jpg.meta │ │ ├── RuinT05n.jpg │ │ ├── RuinT05n.jpg.meta │ │ ├── axe.jpg │ │ ├── axe.jpg.meta │ │ ├── detailWall02.jpg │ │ ├── detailWall02.jpg.meta │ │ ├── dwarf2n.jpg │ │ ├── dwarf2n.jpg.meta │ │ ├── guard1_body normal.tga │ │ ├── guard1_body normal.tga.meta │ │ ├── guard1_body.tga │ │ ├── guard1_body.tga.meta │ │ ├── guard1_face normal.png │ │ ├── guard1_face normal.png.meta │ │ ├── guard1_face.tga │ │ ├── guard1_face.tga.meta │ │ ├── guard1_helmet -normal.tga │ │ ├── guard1_helmet -normal.tga.meta │ │ ├── guard1_helmet.tga │ │ ├── guard1_helmet.tga.meta │ │ ├── mino_axe.jpg │ │ ├── mino_axe.jpg.meta │ │ ├── mino_axen.jpg │ │ ├── mino_axen.jpg.meta │ │ ├── minotaur.jpg │ │ ├── minotaur.jpg.meta │ │ ├── minotaurn.jpg │ │ ├── minotaurn.jpg.meta │ │ ├── normal.bmp │ │ ├── normal.bmp.meta │ │ ├── rockwallHeight.png │ │ ├── rockwallHeight.png.meta │ │ ├── rockwallNormal.png │ │ ├── rockwallNormal.png.meta │ │ ├── sinbad_body.tga │ │ ├── sinbad_body.tga.meta │ │ ├── sinbad_clothes.tga │ │ ├── sinbad_clothes.tga.meta │ │ ├── sinbad_sword.tga │ │ └── sinbad_sword.tga.meta ├── Scripts.meta ├── Scripts │ ├── Anim.cs │ ├── Anim.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── Assimp.cs │ │ ├── Assimp.cs.meta │ │ ├── ImportAssimp.cs │ │ ├── ImportAssimp.cs.meta │ │ ├── ImportAssimpKeys.cs │ │ ├── ImportAssimpKeys.cs.meta │ │ ├── ImportAssimpSkinned.cs │ │ ├── ImportAssimpSkinned.cs.meta │ │ ├── ImportAssimpSkinnedCombine.cs │ │ ├── ImportAssimpSkinnedCombine.cs.meta │ │ ├── ViewSkeletonEditor.cs │ │ └── ViewSkeletonEditor.cs.meta │ ├── Player.cs │ ├── Player.cs.meta │ ├── SkinnedMeshCombiner.cs │ ├── SkinnedMeshCombiner.cs.meta │ ├── ViewSkeleton.cs │ └── ViewSkeleton.cs.meta ├── Static.meta └── Static │ ├── Teapot.b3d │ ├── Teapot.b3d.meta │ ├── level.ms3d │ ├── level.ms3d.meta │ ├── room.ms3d │ └── room.ms3d.meta ├── README.md ├── UnityAssimp-csharp.sln ├── UnityAssimp-csharp.suo ├── UnityAssimp.sln ├── assimp.pas ├── assimp32.dll └── assimp64.dll /Assembly-CSharp-Editor-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_0_1;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_32;UNITY_EDITOR_WIN 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll 43 | 44 | 45 | C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 57 | 58 | 59 | C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll 60 | 61 | 62 | C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.Graphs.dll 63 | 64 | 65 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/androidplayer/UnityEditor.Android.Extensions.dll 66 | 67 | 68 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.dll 69 | 70 | 71 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/wp8support/UnityEditor.WP8.Extensions.dll 72 | 73 | 74 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/metrosupport/UnityEditor.Metro.Extensions.dll 75 | 76 | 77 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/blackberryplayer/UnityEditor.BB10.Extensions.dll 78 | 79 | 80 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/webglsupport/UnityEditor.WebGL.Extensions.dll 81 | 82 | 83 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/linuxstandalonesupport/UnityEditor.LinuxStandalone.Extensions.dll 84 | 85 | 86 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll 87 | 88 | 89 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/macstandalonesupport/UnityEditor.OSXStandalone.Extensions.dll 90 | 91 | 92 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll 93 | 94 | 95 | 96 | 97 | {D52D985A-EF14-E3C5-3D07-39A927FB448D} Assembly-CSharp-vs 98 | 99 | 100 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /Assembly-CSharp-Editor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_0_1;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_32;UNITY_EDITOR_WIN 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll 43 | 44 | 45 | C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 57 | 58 | 59 | C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll 60 | 61 | 62 | C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.Graphs.dll 63 | 64 | 65 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/androidplayer/UnityEditor.Android.Extensions.dll 66 | 67 | 68 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.dll 69 | 70 | 71 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/wp8support/UnityEditor.WP8.Extensions.dll 72 | 73 | 74 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/metrosupport/UnityEditor.Metro.Extensions.dll 75 | 76 | 77 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/blackberryplayer/UnityEditor.BB10.Extensions.dll 78 | 79 | 80 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/webglsupport/UnityEditor.WebGL.Extensions.dll 81 | 82 | 83 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/linuxstandalonesupport/UnityEditor.LinuxStandalone.Extensions.dll 84 | 85 | 86 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll 87 | 88 | 89 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/macstandalonesupport/UnityEditor.OSXStandalone.Extensions.dll 90 | 91 | 92 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll 93 | 94 | 95 | 96 | 97 | {D52D985A-EF14-E3C5-3D07-39A927FB448D} Assembly-CSharp 98 | 99 | 100 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /Assembly-CSharp-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {D52D985A-EF14-E3C5-3D07-39A927FB448D} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_0_1;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_32;UNITY_EDITOR_WIN 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll 43 | 44 | 45 | C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 55 | 56 | 57 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll 58 | 59 | 60 | 61 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Assembly-CSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {D52D985A-EF14-E3C5-3D07-39A927FB448D} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_0_1;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_32;UNITY_EDITOR_WIN 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll 43 | 44 | 45 | C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 55 | 56 | 57 | C:/Program Files/Unity/Editor/Data/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll 58 | 59 | 60 | 61 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Assets/Models.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3019c1ce80900a24a88fd24b7c110d5c 3 | folderAsset: yes 4 | timeCreated: 1430981820 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Models/Bird.ms3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/Bird.ms3d -------------------------------------------------------------------------------- /Assets/Models/Bird.ms3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 207ae985da2779544beb03900f74f674 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/Sinbad.material: -------------------------------------------------------------------------------- 1 | material Sinbad/Body 2 | { 3 | receive_shadows on 4 | technique 5 | { 6 | pass 7 | { 8 | ambient 0.75 0.75 0.75 9 | diffuse 1 1 1 1 10 | 11 | texture_unit 12 | { 13 | texture sinbad_body.tga 14 | } 15 | } 16 | } 17 | } 18 | material Sinbad/Gold 19 | { 20 | receive_shadows on 21 | technique 22 | { 23 | pass 24 | { 25 | ambient 0.75 0.75 0.75 26 | diffuse 0.8 0.8 0.8 1 27 | specular 0.3 0.3 0.2 5.5 28 | 29 | texture_unit 30 | { 31 | texture sinbad_clothes.tga 32 | } 33 | } 34 | } 35 | } 36 | material Sinbad/Sheaths 37 | { 38 | receive_shadows on 39 | technique 40 | { 41 | pass 42 | { 43 | ambient 0.75 0.75 0.75 44 | diffuse 1 1 1 1 45 | specular 0.2 0.1 0.1 1.0 50.0 46 | 47 | texture_unit 48 | { 49 | texture sinbad_sword.tga 50 | } 51 | } 52 | } 53 | } 54 | material Sinbad/Clothes 55 | { 56 | receive_shadows on 57 | technique 58 | { 59 | pass 60 | { 61 | ambient 0.75 0.75 0.75 62 | diffuse 1 1 1 1 63 | specular 0.05 0.05 0.05 12.5 64 | 65 | texture_unit 66 | { 67 | texture sinbad_clothes.tga 68 | } 69 | } 70 | } 71 | } 72 | material Sinbad/Teeth 73 | { 74 | receive_shadows on 75 | technique 76 | { 77 | pass 78 | { 79 | ambient 0.75 0.75 0.75 80 | diffuse 1 1 1 1 81 | specular 0.25 0.25 0.25 10.5 82 | 83 | texture_unit 84 | { 85 | texture sinbad_body.tga 86 | } 87 | } 88 | } 89 | } 90 | material Sinbad/Eyes 91 | { 92 | receive_shadows on 93 | technique 94 | { 95 | pass 96 | { 97 | ambient 0.75 0.75 0.75 98 | diffuse 1 1 1 1 99 | specular 0.75 0.75 0.75 55.5 100 | 101 | texture_unit 102 | { 103 | texture sinbad_body.tga 104 | } 105 | } 106 | } 107 | } 108 | material Sinbad/Spikes 109 | { 110 | receive_shadows on 111 | technique 112 | { 113 | pass 114 | { 115 | ambient 0.75 0.75 0.75 116 | diffuse 1 1 1 1 117 | specular 0.75 0.75 0.75 20.5 118 | 119 | texture_unit 120 | { 121 | texture sinbad_clothes.tga 122 | } 123 | } 124 | } 125 | } 126 | material Sinbad/Blade 127 | { 128 | receive_shadows on 129 | technique 130 | { 131 | pass 132 | { 133 | ambient 0.75 0.75 0.75 134 | diffuse 1 1 1 1 135 | specular 1 1 1 10.5 136 | 137 | texture_unit 138 | { 139 | texture sinbad_sword.tga 140 | } 141 | } 142 | } 143 | } 144 | material Sinbad/Ruby 145 | { 146 | receive_shadows on 147 | technique 148 | { 149 | pass 150 | { 151 | ambient 0.75 0.75 0.75 152 | diffuse 1 1 1 1 153 | specular 0.75 0.75 0.75 20.5 154 | 155 | texture_unit 156 | { 157 | texture sinbad_sword.tga 158 | } 159 | } 160 | } 161 | } 162 | material Sinbad/Hilt 163 | { 164 | receive_shadows on 165 | technique 166 | { 167 | pass 168 | { 169 | ambient 0.75 0.75 0.75 170 | diffuse 0.8 0.8 0.8 1 171 | specular 0.3 0.3 0.2 5.5 172 | 173 | texture_unit 174 | { 175 | texture sinbad_sword.tga 176 | } 177 | } 178 | } 179 | } 180 | material Sinbad/Handle 181 | { 182 | receive_shadows on 183 | technique 184 | { 185 | pass 186 | { 187 | ambient 0.75 0.75 0.75 188 | diffuse 1 1 1 1 189 | specular 0.05 0.05 0.05 12.5 190 | 191 | texture_unit 192 | { 193 | texture sinbad_sword.tga 194 | } 195 | } 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /Assets/Models/Sinbad.material.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e2d35b38227bdc4eb166510556bc107 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/Sinbad.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/Sinbad.mesh -------------------------------------------------------------------------------- /Assets/Models/Sinbad.mesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 512e89699381b0e4d9b3a5a0a102934c 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/Sinbad.skeleton: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/Sinbad.skeleton -------------------------------------------------------------------------------- /Assets/Models/Sinbad.skeleton.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 585cfd886a3a2334b927b1fcecef26f0 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/boblampclean.md5anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c46ecf91444b8f146a9f6978321ad372 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/boblampclean.md5mesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8102b56f82c5614aae3019e062e4cb8 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/bones.ms3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/bones.ms3d -------------------------------------------------------------------------------- /Assets/Models/bones.ms3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfe78af9217386142a4de24914b1be6d 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/dwarf.ms3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/dwarf.ms3d -------------------------------------------------------------------------------- /Assets/Models/dwarf.ms3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30aa087ea5bf3c14885cc150f54337bb 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/minotouaxesplit.b3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/minotouaxesplit.b3d -------------------------------------------------------------------------------- /Assets/Models/minotouaxesplit.b3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e03bd671964772845a66e6d669a3dff2 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/minotouaxesplite.ms3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/minotouaxesplite.ms3d -------------------------------------------------------------------------------- /Assets/Models/minotouaxesplite.ms3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2aada197eb7bf4e44bd9d2919c8954f3 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Models/sinbad_body.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/sinbad_body.tga -------------------------------------------------------------------------------- /Assets/Models/sinbad_body.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 974818531f66c3c47bb956da741ae47c 3 | timeCreated: 1430983366 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 5 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Models/sinbad_clothes.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/sinbad_clothes.tga -------------------------------------------------------------------------------- /Assets/Models/sinbad_clothes.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 509e17ea119dda349af08fd13131e367 3 | timeCreated: 1430983368 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 5 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Models/sinbad_sword.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/sinbad_sword.tga -------------------------------------------------------------------------------- /Assets/Models/sinbad_sword.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dae83877e60faa24a944c56b50cb80de 3 | timeCreated: 1430983366 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 5 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Models/viking.ms3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Models/viking.ms3d -------------------------------------------------------------------------------- /Assets/Models/viking.ms3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa30b58b203f8994eb49067d6bdffbfe 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74336ee6db0f4fc4c811307ccd71256d 3 | folderAsset: yes 4 | timeCreated: 1430983363 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 901e689eb6a2a6b429f048fb8497edd7 3 | folderAsset: yes 4 | timeCreated: 1430981820 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d060a394bba9924b8049cf4f0316329 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/Bird_Skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/Bird_Skin.png -------------------------------------------------------------------------------- /Assets/Resources/Textures/Bird_Skin.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3623de3ceaca134792fc188c240e249 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/Bird_Skind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/Bird_Skind.png -------------------------------------------------------------------------------- /Assets/Resources/Textures/Bird_Skind.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53b65486dabac2e4683fd827cae5835e 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT00.png -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT00.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90690819b7d2e434cb3622314cfd2e43 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT01.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT01.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT01.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd33a6b84e03bdf4eae5af872a8cf507 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT01n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT01n.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT01n.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cce7ce7684c87a7459d19eb7213d3427 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT02.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT02.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT02.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fff5b58acef7ec479ff1c9fa76c68e8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT02n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT02n.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT02n.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b9bd60b87d8f114791527aba524c6b1 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT02n.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT02n.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT02n.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac41abff776a580488313cd01b9dd2f9 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT03.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT03.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT03.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01c58b3d29cdf3f48a0ca806b98e392c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT03n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT03n.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT03n.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aba5e5319e2643549b38eacdb2123409 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT04.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT04.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT04.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f8c1f576f06744498c896ede6447046 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT04n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT04n.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT04n.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d62766797dc84244da912a0b05a49dae 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT05n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/RuinT05n.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/RuinT05n.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abcead32558a0b74aa17a9b51c8bcec4 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/axe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/axe.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/axe.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f893022c050652d45a98c4688dd9f0ad 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/detailWall02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/detailWall02.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/detailWall02.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc9176afbcdadce45bdd78d6b1fe9b34 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/dwarf2n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/dwarf2n.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/dwarf2n.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61b309a8f01f70b48997e9d2e61bd2dd 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_body normal.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/guard1_body normal.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_body normal.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29a6e474d04b0084c8f9dbfac82bf39b 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_body.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/guard1_body.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_body.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa7160cc7350370448b5a9de0503ed57 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_face normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/guard1_face normal.png -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_face normal.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7c55a70b9a619a4590da795e3ad2fee 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_face.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/guard1_face.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_face.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b355a7b608488f345814b2a58a2fa37d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_helmet -normal.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8889df71e0c1bf4f824e13743e8ce79 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/guard1_helmet.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d313519f24f4f64a810d8cc9c837a94 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/mino_axe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/mino_axe.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/mino_axe.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 092023a1f1e38664a8688ecdd236001d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/mino_axen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/mino_axen.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/mino_axen.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5890d15509216014c91d3bdb68ccb702 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/minotaur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/minotaur.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/minotaur.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be5be5bf3b40ce54c9482d548ffd64eb 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/minotaurn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/minotaurn.jpg -------------------------------------------------------------------------------- /Assets/Resources/Textures/minotaurn.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 895a4a9837eaeba45b4a047b6a8befee 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/normal.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/normal.bmp -------------------------------------------------------------------------------- /Assets/Resources/Textures/normal.bmp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c9f9cfb6b24e1d479d05941f1b5c0d7 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/rockwallHeight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/rockwallHeight.png -------------------------------------------------------------------------------- /Assets/Resources/Textures/rockwallHeight.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7142b6f4457d1bc4a86dc7f2e27a1626 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/rockwallNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/rockwallNormal.png -------------------------------------------------------------------------------- /Assets/Resources/Textures/rockwallNormal.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2be78c825fef1f248adfc4919fae4c1b 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/sinbad_body.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/sinbad_body.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/sinbad_body.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68835dbf8ede07243af26fb1bf0b3a5a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/sinbad_clothes.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/sinbad_clothes.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/sinbad_clothes.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 670ff1315136a8d40b0da41bf0b38402 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Resources/Textures/sinbad_sword.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Resources/Textures/sinbad_sword.tga -------------------------------------------------------------------------------- /Assets/Resources/Textures/sinbad_sword.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 654b0bbb501cec7468d7e0dacdbc3f36 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | seamlessCubemap: 0 24 | textureFormat: -1 25 | maxTextureSize: 1024 26 | textureSettings: 27 | filterMode: -1 28 | aniso: -1 29 | mipBias: -1 30 | wrapMode: -1 31 | nPOTScale: 1 32 | lightmap: 0 33 | compressionQuality: 50 34 | spriteMode: 0 35 | spriteExtrude: 1 36 | spriteMeshType: 1 37 | alignment: 0 38 | spritePivot: {x: .5, y: .5} 39 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 40 | spritePixelsToUnits: 100 41 | alphaIsTransparency: 0 42 | textureType: -1 43 | buildTargetSettings: [] 44 | spriteSheet: 45 | sprites: [] 46 | spritePackingTag: 47 | userData: 48 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2ef932e1c8102f4f99df3b681bb2140 3 | folderAsset: yes 4 | timeCreated: 1430981820 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Anim.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | [System.Serializable] 3 | public class Anim 4 | { 5 | public string name; 6 | public int frameStart; 7 | public int frameEnd; 8 | public int fps; 9 | 10 | public Anim(string name,int start,int end,int fps ) 11 | { 12 | this.name = name; 13 | this.frameStart = start; 14 | this.frameEnd = end; 15 | this.fps = fps; 16 | 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/Scripts/Anim.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01973599ab91a254b9f33b55a94ac06a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ce4742026b0b1c449a39b5528ca437d 3 | folderAsset: yes 4 | timeCreated: 1430981820 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/Assimp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbe1d95d959f61240928c42108ef126b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimp.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Runtime.InteropServices; 7 | using System.Collections; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | 11 | 12 | public static class ImportAssimp 13 | { 14 | public static bool saveAssets = true; 15 | 16 | [MenuItem("Assets/Djoker Tools/Assimp/ImportStatic")] 17 | static void init() 18 | { 19 | 20 | string filename = Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)); 21 | string rootPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(Selection.activeObject)); 22 | 23 | readMesh(rootPath, filename, ""); 24 | 25 | } 26 | 27 | 28 | private static void trace(string msg) 29 | { 30 | 31 | } 32 | 33 | 34 | 35 | 36 | private class AssimpMesh 37 | { 38 | public Mesh geometry; 39 | public string name; 40 | public Material material; 41 | public List vertices; 42 | public List normals; 43 | public List tangents; 44 | public List uvcoords; 45 | public List faces; 46 | public GameObject meshContainer; 47 | public MeshFilter meshFilter; 48 | public MeshRenderer meshRenderer; 49 | public GameObject Root; 50 | 51 | 52 | 53 | public AssimpMesh(GameObject parent, GameObject root, string name) 54 | { 55 | this.name = name; 56 | meshContainer = new GameObject(name); 57 | 58 | this.Root = root; 59 | meshContainer.transform.parent = parent.transform; 60 | 61 | meshContainer.AddComponent(); 62 | meshContainer.AddComponent(); 63 | meshFilter = meshContainer.GetComponent(); 64 | meshRenderer = meshContainer.GetComponent(); 65 | 66 | meshFilter.sharedMesh = new Mesh(); 67 | geometry = meshFilter.sharedMesh; 68 | vertices = new List(); 69 | normals = new List(); 70 | tangents = new List(); 71 | uvcoords = new List(); 72 | faces = new List(); 73 | 74 | 75 | } 76 | public void addVertex(Vector3 pos, Vector3 normal, Vector2 uv ,Vector4 tan) 77 | { 78 | vertices.Add(pos); 79 | normals.Add(normal); 80 | uvcoords.Add(uv); 81 | tangents.Add(tan); 82 | 83 | } 84 | public void setmaterial(Material mat) 85 | { 86 | meshRenderer.sharedMaterial = mat; 87 | } 88 | 89 | public void addFace(int a, int b, int c) 90 | { 91 | faces.Add(a); 92 | faces.Add(b); 93 | faces.Add(c); 94 | } 95 | 96 | 97 | public void build() 98 | { 99 | 100 | geometry.vertices = vertices.ToArray(); 101 | geometry.normals = normals.ToArray(); 102 | geometry.uv = uvcoords.ToArray(); 103 | //geometry.u = uvcoords.ToArray(); 104 | geometry.triangles = faces.ToArray(); 105 | geometry.tangents = tangents.ToArray(); 106 | Unwrapping.GenerateSecondaryUVSet(geometry); 107 | // geometry.RecalculateNormals(); 108 | geometry.RecalculateBounds(); 109 | // TangentSolver(geometry); 110 | 111 | geometry.Optimize(); 112 | } 113 | public void dispose() 114 | { 115 | vertices.Clear(); 116 | normals.Clear(); 117 | faces.Clear(); 118 | uvcoords.Clear(); 119 | tangents.Clear(); 120 | } 121 | 122 | public void TangentSolver(Mesh mesh) 123 | { 124 | Vector3[] tan2 = new Vector3[mesh.vertices.Length]; 125 | Vector3[] tan1 = new Vector3[mesh.vertices.Length]; 126 | Vector4[] tangents = new Vector4[mesh.vertices.Length]; 127 | //Vector3[] binormal = new Vector3[mesh.vertices.Length]; 128 | for (int a = 0; a < (mesh.triangles.Length); a += 3) 129 | { 130 | long i1 = mesh.triangles[a + 0]; 131 | long i2 = mesh.triangles[a + 1]; 132 | long i3 = mesh.triangles[a + 2]; 133 | 134 | Vector3 v1 = mesh.vertices[i1]; 135 | Vector3 v2 = mesh.vertices[i2]; 136 | Vector3 v3 = mesh.vertices[i3]; 137 | 138 | Vector2 w1 = mesh.uv[i1]; 139 | Vector2 w2 = mesh.uv[i2]; 140 | Vector2 w3 = mesh.uv[i3]; 141 | 142 | float x1 = v2.x - v1.x; 143 | float x2 = v3.x - v1.x; 144 | float y1 = v2.y - v1.y; 145 | float y2 = v3.y - v1.y; 146 | float z1 = v2.z - v1.z; 147 | float z2 = v3.z - v1.z; 148 | 149 | float s1 = w2.x - w1.x; 150 | float s2 = w3.x - w1.x; 151 | float t1 = w2.y - w1.y; 152 | float t2 = w3.y - w1.y; 153 | 154 | float r = 1.0F / (s1 * t2 - s2 * t1); 155 | Vector3 sdir = new Vector3((t2 * x1 - t1 * x2) * r, (t2 * y1 - t1 * y2) * r, (t2 * z1 - t1 * z2) * r); 156 | Vector3 tdir = new Vector3((s1 * x2 - s2 * x1) * r, (s1 * y2 - s2 * y1) * r, (s1 * z2 - s2 * z1) * r); 157 | 158 | tan1[i1] += sdir; 159 | tan1[i2] += sdir; 160 | tan1[i3] += sdir; 161 | 162 | tan2[i1] += tdir; 163 | tan2[i2] += tdir; 164 | tan2[i3] += tdir; 165 | } 166 | 167 | for (int a = 0; a < mesh.vertices.Length; a++) 168 | { 169 | Vector3 n = mesh.normals[a]; 170 | Vector3 t = tan1[a]; 171 | 172 | Vector3.OrthoNormalize(ref n, ref t); 173 | tangents[a].x = t.x; 174 | tangents[a].y = t.y; 175 | tangents[a].z = t.z; 176 | 177 | // Calculate handedness 178 | tangents[a].w = (Vector3.Dot(Vector3.Cross(n, t), tan2[a]) < 0.0f) ? -1.0f : 1.0f; 179 | 180 | //To calculate binormals if required as vector3 try one of below:- 181 | //Vector3 binormal[a] = (Vector3.Cross(n, t) * tangents[a].w).normalized; 182 | //Vector3 binormal[a] = Vector3.Normalize(Vector3.Cross(n, t) * tangents[a].w) 183 | } 184 | mesh.tangents = tangents; 185 | } 186 | 187 | } 188 | 189 | public static void readMesh(string path, string filename, string texturepath) 190 | { 191 | string importingAssetsDir; 192 | 193 | if (File.Exists(path + "/" + filename)) 194 | { 195 | 196 | 197 | 198 | 199 | Assimp.PostProcessSteps flags = ( 200 | // Assimp.PostProcessSteps.MakeLeftHanded | 201 | 202 | Assimp.PostProcessSteps.OptimizeMeshes | 203 | Assimp.PostProcessSteps.OptimizeGraph | 204 | Assimp.PostProcessSteps.RemoveRedundantMaterials | 205 | Assimp.PostProcessSteps.SortByPrimitiveType | 206 | Assimp.PostProcessSteps.SplitLargeMeshes | 207 | Assimp.PostProcessSteps.Triangulate | 208 | Assimp.PostProcessSteps.CalculateTangentSpace | 209 | Assimp.PostProcessSteps.GenerateUVCoords | 210 | Assimp.PostProcessSteps.GenerateSmoothNormals | 211 | Assimp.PostProcessSteps.RemoveComponent | 212 | Assimp.PostProcessSteps.JoinIdenticalVertices ); 213 | 214 | IntPtr config = Assimp.aiCreatePropertyStore(); 215 | 216 | Assimp.aiSetImportPropertyFloat(config, Assimp.AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, 60.0f); 217 | 218 | // IntPtr scene = Assimp.aiImportFile(path + "/" + filename, (uint)flags); 219 | IntPtr scene = Assimp.aiImportFileWithProperties(path + "/" + filename, (uint)flags, config); 220 | Assimp.aiReleasePropertyStore(config); 221 | if (scene == null) 222 | { 223 | 224 | Debug.LogWarning("failed to read file: " + path + "/" + filename); 225 | return; 226 | } 227 | else 228 | { 229 | 230 | 231 | string nm = Path.GetFileNameWithoutExtension(filename); 232 | 233 | 234 | importingAssetsDir = "Assets/Prefabs/" + nm + "/"; 235 | 236 | if (saveAssets) 237 | { 238 | if (!Directory.Exists(importingAssetsDir)) 239 | { 240 | Directory.CreateDirectory(importingAssetsDir); 241 | } 242 | AssetDatabase.Refresh(); 243 | } 244 | 245 | 246 | GameObject ObjectRoot = new GameObject(nm); 247 | GameObject meshContainer = new GameObject(nm + "_Mesh"); 248 | meshContainer.transform.parent = ObjectRoot.transform; 249 | 250 | 251 | List materials = new List(); 252 | List MeshList = new List(); 253 | 254 | 255 | for (int i = 0; i < Assimp.aiScene_GetNumMaterials(scene); i++) 256 | { 257 | string matName = Assimp.aiMaterial_GetName(scene, i); 258 | matName = nm + "_mat" + i; 259 | 260 | // string fname = Path.GetFileNameWithoutExtension(Assimp.aiMaterial_GetTexture(scene, i, (int)Assimp.TextureType.Diffuse)); 261 | string fname = Path.GetFileName(Assimp.aiMaterial_GetTexture(scene, i, (int)Assimp.TextureType.Diffuse)); 262 | Debug.Log("texture " + fname + "Material :" + matName); 263 | 264 | Color ambient = Assimp.aiMaterial_GetAmbient(scene, i); 265 | Color diffuse = Assimp.aiMaterial_GetDiffuse(scene, i); 266 | Color specular = Assimp.aiMaterial_GetSpecular(scene, i); 267 | Color emissive = Assimp.aiMaterial_GetEmissive(scene, i); 268 | 269 | Material mat = new Material(Shader.Find("Diffuse")); 270 | mat.name = matName; 271 | 272 | string texturename = path +"/"+ fname; 273 | 274 | Texture2D tex = null; 275 | if (File.Exists(texturename )) 276 | { 277 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename, typeof(Texture2D)); 278 | } 279 | else 280 | if (File.Exists(texturename + ".PNG")) 281 | { 282 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".PNG", typeof(Texture2D)); 283 | } 284 | else 285 | if (File.Exists(texturename + ".JPG")) 286 | { 287 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".JPG", typeof(Texture2D)); 288 | } else 289 | if (File.Exists(texturename + ".BMP")) 290 | { 291 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".BMP", typeof(Texture2D)); 292 | } 293 | else 294 | if (File.Exists(texturename + ".TGA")) 295 | { 296 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".TGA", typeof(Texture2D)); 297 | } 298 | else 299 | if (File.Exists(texturename + ".DDS")) 300 | { 301 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".DDS", typeof(Texture2D)); 302 | } 303 | 304 | 305 | 306 | //Texture2D tex = Resources.Load(texturename) as Texture2D; 307 | 308 | // Texture2D tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename, typeof(Texture2D)); 309 | 310 | 311 | if (tex != null) 312 | { 313 | Debug.Log("LOAD (" + texturename + ") texture"); 314 | mat.SetTexture("_MainTex", tex); 315 | 316 | } 317 | else 318 | { 319 | Debug.LogError("Fail LOAD (" + texturename + ") error"); 320 | } 321 | 322 | 323 | if (saveAssets) 324 | { 325 | string materialAssetPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + mat.name + ".asset"); 326 | AssetDatabase.CreateAsset(mat, materialAssetPath); 327 | } 328 | materials.Add(mat); 329 | 330 | } 331 | 332 | AssetDatabase.Refresh(); 333 | 334 | 335 | 336 | 337 | if (Assimp.aiScene_HasMeshes(scene)) 338 | { 339 | 340 | 341 | 342 | for (int i = 0; i < Assimp.aiScene_GetNumMeshes(scene); i++) 343 | { 344 | string name = "Mesh_"; 345 | name += i.ToString(); 346 | 347 | 348 | bool HasNormals = Assimp.aiMesh_HasNormals(scene, i); 349 | bool HasTexCoord = Assimp.aiMesh_HasTextureCoords(scene, i, 0); 350 | bool HasFaces = Assimp.aiMesh_HasFaces(scene, i); 351 | 352 | 353 | AssimpMesh mesh = new AssimpMesh(meshContainer, ObjectRoot, name); 354 | mesh.setmaterial(materials[Assimp.aiMesh_GetMaterialIndex(scene, i)]); 355 | MeshList.Add(mesh); 356 | 357 | 358 | 359 | for (int v = 0; v < Assimp.aiMesh_GetNumVertices(scene, i); v++) 360 | { 361 | 362 | Vector3 vertex = Assimp.aiMesh_Vertex(scene, i, v); 363 | Vector3 n = Assimp.aiMesh_Normal(scene, i, v); 364 | float x = Assimp.aiMesh_TextureCoordX(scene, i, v, 0); 365 | float y = Assimp.aiMesh_TextureCoordY(scene, i, v, 0); 366 | 367 | 368 | Vector3 binormalf = Assimp.aiMesh_Bitangent(scene, i, v); 369 | Vector3 tangentf = Assimp.aiMesh_Tangent(scene, i, v); 370 | 371 | Vector4 outputTangent =new Vector4(tangentf.x, tangentf.y, tangentf.z, 0.0F); 372 | 373 | float dp = Vector3.Dot(Vector3.Cross(n, tangentf), binormalf); 374 | if (dp > 0.0F) 375 | outputTangent.w = 1.0F; 376 | else 377 | outputTangent.w = -1.0F; 378 | 379 | 380 | 381 | 382 | 383 | 384 | mesh.addVertex(vertex, n, new Vector2(x, y), outputTangent); 385 | 386 | 387 | //mesh.addVertex(vertex, new Vector3(1 * -n.x, n.y, n.z), new Vector2(x, y), outputTangent); 388 | 389 | 390 | 391 | } 392 | 393 | for (int f = 0; f < Assimp.aiMesh_GetNumFaces(scene, i); f++) 394 | { 395 | int a = Assimp.aiMesh_Indice(scene, i, f, 0); 396 | int b = Assimp.aiMesh_Indice(scene, i, f, 1); 397 | int c = Assimp.aiMesh_Indice(scene, i, f, 2); 398 | mesh.addFace(a, b, c); 399 | } 400 | 401 | 402 | 403 | 404 | 405 | 406 | //********** 407 | 408 | 409 | 410 | mesh.build(); 411 | 412 | 413 | if (saveAssets) 414 | { 415 | 416 | string meshAssetPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + mesh.name + ".asset"); 417 | AssetDatabase.CreateAsset(mesh.geometry, meshAssetPath); 418 | } 419 | 420 | mesh.dispose(); 421 | } 422 | } 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | if (saveAssets) 431 | { 432 | 433 | string prefabPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + filename + ".prefab"); 434 | var prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 435 | PrefabUtility.ReplacePrefab(ObjectRoot, prefab, ReplacePrefabOptions.ConnectToPrefab); 436 | AssetDatabase.Refresh(); 437 | } 438 | 439 | MeshList.Clear(); 440 | } 441 | 442 | 443 | 444 | Assimp.aiReleaseImport(scene); 445 | Debug.LogWarning(path + "/" + filename + " Imported ;) "); 446 | } 447 | 448 | } 449 | 450 | 451 | } 452 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74dc3284b1955f1409153007506469e3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimpKeys.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Runtime.InteropServices; 7 | using System.Collections; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | 11 | 12 | public static class ImportAssimpKeys 13 | { 14 | public static bool saveAssets = true; 15 | public static bool useTangents = true; 16 | 17 | private static StreamWriter streamWriter; 18 | private static List listJoints = new List(); 19 | [MenuItem("Assets/Djoker Tools/Assimp/ImportKeyFrames")] 20 | static void init() 21 | { 22 | 23 | string filename = Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)); 24 | string rootPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(Selection.activeObject)); 25 | 26 | readMesh(rootPath, filename, "Textures/"); 27 | 28 | } 29 | 30 | 31 | 32 | 33 | 34 | private static void trace(string msg) 35 | { 36 | // streamWriter.WriteLine("LOG:" + msg); 37 | } 38 | 39 | 40 | 41 | 42 | 43 | public class AssimpJoint 44 | { 45 | public string parentName; 46 | public string Name; 47 | public string Path; 48 | public Vector3 Position; 49 | public Quaternion Orientation; 50 | public AssimpJoint parent; 51 | public Transform transform; 52 | 53 | 54 | 55 | public AssimpJoint() 56 | { 57 | 58 | Name = ""; 59 | parentName = ""; 60 | parent = null; 61 | Path = ""; 62 | 63 | } 64 | 65 | } 66 | 67 | 68 | 69 | private static void readMesh(string path, string filename, string texturepath) 70 | { 71 | string importingAssetsDir; 72 | 73 | if (File.Exists(path + "/" + filename)) 74 | { 75 | 76 | 77 | 78 | Assimp.PostProcessSteps flags = ( 79 | 80 | Assimp.PostProcessSteps.RemoveComponent ); 81 | 82 | IntPtr config = Assimp.aiCreatePropertyStore(); 83 | 84 | Assimp.aiSetImportPropertyFloat(config, Assimp.AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, 60.0f); 85 | Assimp.aiSetImportPropertyInteger(config,Assimp.AI_CONFIG_PP_LBW_MAX_WEIGHTS,4); 86 | // IntPtr scene = Assimp.aiImportFile(path + "/" + filename, (uint)flags); 87 | IntPtr scene = Assimp.aiImportFileWithProperties(path + "/" + filename, (uint)flags, config); 88 | Assimp.aiReleasePropertyStore(config); 89 | if (scene == null) 90 | { 91 | 92 | Debug.LogWarning("failed to read file: " + path + "/" + filename); 93 | return; 94 | } 95 | else 96 | { 97 | 98 | 99 | string nm = Path.GetFileNameWithoutExtension(filename); 100 | 101 | 102 | importingAssetsDir = "Assets/Prefabs/" + nm + "/"; 103 | 104 | if (saveAssets) 105 | { 106 | if (!Directory.Exists(importingAssetsDir)) 107 | { 108 | Directory.CreateDirectory(importingAssetsDir); 109 | } 110 | AssetDatabase.Refresh(); 111 | } 112 | 113 | 114 | GameObject ObjectRoot = new GameObject(nm); 115 | 116 | AssetDatabase.Refresh(); 117 | 118 | if (Assimp.aiScene_GetRootNode(scene) != null) 119 | { 120 | ObjectRoot.transform.position = Assimp.aiNode_GetPosition(Assimp.aiScene_GetRootNode(scene)); 121 | 122 | //assimp quaternion is w,x,y,z and unity x,y,z,w bu int this lib i fix this for unity 123 | Quaternion assQuad = Assimp.aiNode_GetRotation(Assimp.aiScene_GetRootNode(scene)); 124 | ObjectRoot.transform.rotation = assQuad; 125 | 126 | 127 | GameObject skeleton = new GameObject("Skeleton"); 128 | skeleton.transform.parent = ObjectRoot.transform; 129 | processNodes(scene, Assimp.aiScene_GetRootNode(scene), ref listJoints); 130 | 131 | for (int i = 0; i < listJoints.Count; i++) 132 | { 133 | 134 | AssimpJoint joint = listJoints[i]; 135 | Transform bone = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; 136 | // Transform bone = new GameObject(joint.Name).transform; 137 | // DebugBone debug = (DebugBone)bone.gameObject.AddComponent(typeof(DebugBone)); 138 | 139 | 140 | 141 | bone.name = joint.Name; 142 | bone.parent = skeleton.transform; 143 | 144 | if (getBoneByName(joint.parentName) != null) 145 | { 146 | int index = findBoneByName(joint.parentName); 147 | bone.parent = joint.parent.transform; 148 | } 149 | bone.localPosition = joint.Position; 150 | bone.localRotation = joint.Orientation; 151 | 152 | joint.transform = bone; 153 | } 154 | 155 | } 156 | 157 | 158 | 159 | 160 | //create key frames 161 | if (Assimp.aiScene_HasAnimation(scene)) 162 | { 163 | Animation anim = (UnityEngine.Animation)ObjectRoot.AddComponent(typeof(Animation)); 164 | 165 | int numAnimation = Assimp.aiScene_GetNumAnimations(scene); 166 | 167 | for (int a = 0; a < numAnimation; a++) 168 | { 169 | 170 | AnimationClip clip = new AnimationClip(); 171 | string anima = Assimp.aiAnim_GetName(scene, a); 172 | clip.name = nm + "_" + anima + "_" + a; 173 | 174 | 175 | clip.wrapMode = WrapMode.Loop; 176 | 177 | float tinks = (float)Assimp.aiAnim_GetTicksPerSecond(scene, a); 178 | if (tinks <= 1f) tinks = 1f; 179 | float fps = tinks; 180 | clip.frameRate = tinks; 181 | 182 | 183 | Debug.Log("animation fps :" + fps); 184 | 185 | 186 | 187 | int numchannels = Assimp.aiAnim_GetNumChannels(scene, a); 188 | for (int i = 0; i < numchannels; i++) 189 | { 190 | string name = Assimp.aiAnim_GetChannelName(scene, a, i); 191 | AssimpJoint joint = getBoneByName(name); 192 | 193 | 194 | 195 | // Debug.Log(String.Format("anim channel {0} bone name {1} poskeys {2} rotkeys{2}", i, name, Assimp.aiAnim_GetNumPositionKeys(scene, 0, i), Assimp.aiAnim_GetNumRotationKeys(scene, 0, i))); 196 | 197 | 198 | 199 | 200 | if (Assimp.aiAnim_GetNumScalingKeys(scene, a, i) != 0) 201 | { 202 | AnimationCurve scaleXcurve = new AnimationCurve(); 203 | AnimationCurve scaleYcurve = new AnimationCurve(); 204 | AnimationCurve scaleZcurve = new AnimationCurve(); 205 | 206 | for (int j = 0; j < Assimp.aiAnim_GetNumScalingKeys(scene, a, i); j++) 207 | { 208 | float time = (float)Assimp.aiAnim_GetScalingFrame(scene, a, i, j);// *fps; 209 | Vector3 scale = Assimp.aiAnim_GetScalingKey(scene, a, i, j); 210 | //time = (float)j; 211 | scaleXcurve.AddKey(time, scale.x); 212 | scaleYcurve.AddKey(time, scale.y); 213 | scaleZcurve.AddKey(time, scale.z); 214 | } 215 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.x", scaleXcurve); 216 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.y", scaleYcurve); 217 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.z", scaleZcurve); 218 | 219 | } 220 | 221 | 222 | if (Assimp.aiAnim_GetNumPositionKeys(scene, a, i) != 0) 223 | { 224 | AnimationCurve posXcurve = new AnimationCurve(); 225 | AnimationCurve posYcurve = new AnimationCurve(); 226 | AnimationCurve posZcurve = new AnimationCurve(); 227 | 228 | 229 | for (int j = 0; j < Assimp.aiAnim_GetNumPositionKeys(scene, a, i); j++) 230 | { 231 | float time = (float)Assimp.aiAnim_GetPositionFrame(scene, a, i, j);// *fps; 232 | Vector3 pos = Assimp.aiAnim_GetPositionKey(scene, a, i, j); 233 | // time = (float)j; 234 | posXcurve.AddKey(time, pos.x); 235 | posYcurve.AddKey(time, pos.y); 236 | posZcurve.AddKey(time, pos.z); 237 | } 238 | 239 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.x", posXcurve); 240 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.y", posYcurve); 241 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.z", posZcurve); 242 | } 243 | if (Assimp.aiAnim_GetNumRotationKeys(scene, a, i) != 0) 244 | { 245 | 246 | AnimationCurve rotXcurve = new AnimationCurve(); 247 | AnimationCurve rotYcurve = new AnimationCurve(); 248 | AnimationCurve rotZcurve = new AnimationCurve(); 249 | AnimationCurve rotWcurve = new AnimationCurve(); 250 | 251 | for (int j = 0; j < Assimp.aiAnim_GetNumRotationKeys(scene, a, i); j++) 252 | { 253 | float time = (float)Assimp.aiAnim_GetRotationFrame(scene, a, i, j);// *fps; 254 | 255 | Quaternion rotation = Assimp.aiAnim_GetRotationKey(scene, a, i, j); 256 | // time = (float)j; 257 | rotXcurve.AddKey(time, rotation.x); 258 | rotYcurve.AddKey(time, rotation.y); 259 | rotZcurve.AddKey(time, rotation.z); 260 | rotWcurve.AddKey(time, rotation.w); 261 | 262 | } 263 | 264 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.x", rotXcurve); 265 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.y", rotYcurve); 266 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.z", rotZcurve); 267 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.w", rotWcurve); 268 | 269 | } 270 | 271 | } 272 | 273 | 274 | 275 | clip.EnsureQuaternionContinuity(); 276 | anim.AddClip(clip, clip.name); 277 | anim.clip = clip; 278 | 279 | 280 | string clipAssetPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + clip.name + ".asset"); 281 | AssetDatabase.CreateAsset(clip, clipAssetPath); 282 | 283 | // AssetDatabase.CreateAsset(clip, "Assets/Models/" + nm +"_"+a+ ".anim"); 284 | // AssetDatabase.SaveAssets(); 285 | } 286 | 287 | } 288 | 289 | 290 | if (saveAssets) 291 | { 292 | 293 | string prefabPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + filename + ".prefab"); 294 | var prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 295 | PrefabUtility.ReplacePrefab(ObjectRoot, prefab, ReplacePrefabOptions.ConnectToPrefab); 296 | AssetDatabase.Refresh(); 297 | } 298 | 299 | 300 | } 301 | 302 | listJoints.Clear(); 303 | 304 | Assimp.aiReleaseImport(scene); 305 | Debug.LogWarning(path + "/" + filename + " Imported ;) "); 306 | } 307 | 308 | } 309 | 310 | private static AssimpJoint getBoneByName(string name) 311 | { 312 | for (int i = 0; i < listJoints.Count; i++) 313 | { 314 | 315 | AssimpJoint bone = listJoints[i]; 316 | if (bone.Name == name) 317 | { 318 | return bone; 319 | 320 | } 321 | } 322 | return null; 323 | } 324 | private static int findBoneByName(string name) 325 | { 326 | for (int i = 0; i < listJoints.Count; i++) 327 | { 328 | 329 | AssimpJoint bone = listJoints[i]; 330 | if (bone.Name == name) 331 | { 332 | return i; 333 | 334 | } 335 | } 336 | return -1; 337 | } 338 | 339 | private static void processNodes(IntPtr scene, IntPtr node, ref List listJoints) 340 | { 341 | 342 | AssimpJoint joint = new AssimpJoint(); 343 | 344 | string name = Assimp.aiNode_GetName(node); 345 | if (name == "") name = "REMOVE-ME"; 346 | joint.Name = name; 347 | joint.parentName = ""; 348 | joint.Position = Assimp.aiNode_GetPosition(node); 349 | //assimp quaternion is w,x,y,z and unity x,y,z,w bu int this lib i fix this for unity 350 | Quaternion quad = Assimp.aiNode_GetRotation(node); 351 | 352 | joint.Orientation = quad; 353 | 354 | 355 | 356 | if (Assimp.aiNode_GetParent(node) != null) 357 | { 358 | string parentName = Assimp.aiNode_GetName(Assimp.aiNode_GetParent(node)); 359 | joint.parentName = parentName; 360 | 361 | } 362 | 363 | 364 | listJoints.Add(joint); 365 | 366 | for (int i = 0; i < listJoints.Count; i++) 367 | { 368 | 369 | AssimpJoint parent = listJoints[i]; 370 | if (joint.parentName == parent.Name) 371 | { 372 | joint.parent = parent; 373 | joint.Path += parent.Path + "/"; 374 | break; 375 | } 376 | 377 | } 378 | 379 | joint.Path += name; 380 | 381 | if (joint.parent != null) 382 | { 383 | // trace(string.Format(" Joint name: {0} ; parent:{1} ; path:{2} ", joint.Name, joint.parent.Name, joint.Path)); 384 | } 385 | else 386 | { 387 | // trace(string.Format(" Joint name: {0} ; path:{1} ", joint.Name, joint.Path)); 388 | } 389 | 390 | for (int n = 0; n < Assimp.aiNode_GetNumChildren(node); n++) 391 | { 392 | processNodes(scene, Assimp.aiNode_GetChild(node, n), ref listJoints); 393 | 394 | } 395 | } 396 | 397 | 398 | } 399 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimpKeys.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb44042f426f65a4889add0c9e87a7e1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimpSkinned.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Runtime.InteropServices; 7 | using System.Collections; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | 11 | public static class ImportAssimpSkinned 12 | { 13 | public static bool saveAssets = true; 14 | public static bool useTangents = true; 15 | public static bool ignoreRotations = false; 16 | public static bool ignorePositions = false; 17 | public static bool ignoreScalling = true; 18 | 19 | private static StreamWriter streamWriter; 20 | private static List listJoints = new List(); 21 | [MenuItem("Assets/Djoker Tools/Assimp/ImportSkinned")] 22 | static void init() 23 | { 24 | 25 | string filename = Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)); 26 | string rootPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(Selection.activeObject)); 27 | /* 28 | FileStream fileStream = new FileStream("Assets/Log.txt", 29 | FileMode.Create, 30 | FileAccess.Write, 31 | FileShare.ReadWrite); 32 | streamWriter = new StreamWriter(fileStream);//"Assets/Log.txt",false); 33 | streamWriter.WriteLine("Import mesh"); 34 | */ 35 | 36 | readMesh(rootPath, filename, "Textures/"); 37 | /* 38 | streamWriter.Flush(); 39 | streamWriter.Close(); 40 | */ 41 | 42 | } 43 | 44 | 45 | 46 | 47 | 48 | private static void trace(string msg) 49 | { 50 | // Debug.Log("LOG:" + msg); 51 | } 52 | 53 | public class IBone 54 | { 55 | public int BoneIndex; 56 | public float Weight; 57 | public IBone() 58 | { 59 | BoneIndex = 0; 60 | Weight = 0; 61 | } 62 | 63 | 64 | } 65 | 66 | 67 | 68 | public class BoneVertex 69 | { 70 | 71 | public IBone[] bones; 72 | public int numbones; 73 | public BoneVertex() 74 | { 75 | bones = new IBone[4]; 76 | for (int i = 0; i < 4; i++) 77 | { 78 | bones[i] = new IBone(); 79 | } 80 | 81 | numbones = 0; 82 | } 83 | 84 | public void addBone(int bone, float w) 85 | { 86 | for (int i = 0; i < 4; i++) 87 | { 88 | if (bones[i].Weight == 0) 89 | { 90 | bones[i].BoneIndex = bone; 91 | bones[i].Weight = w; 92 | numbones++; 93 | return; 94 | } 95 | } 96 | 97 | 98 | } 99 | 100 | } 101 | 102 | 103 | 104 | public class AssimpJoint 105 | { 106 | public string parentName; 107 | public string Name; 108 | public string Path; 109 | public Vector3 Position; 110 | public Quaternion Orientation; 111 | public AssimpJoint parent; 112 | public Transform transform; 113 | 114 | 115 | 116 | public AssimpJoint() 117 | { 118 | 119 | Name = ""; 120 | parentName = ""; 121 | parent = null; 122 | Path = ""; 123 | 124 | } 125 | 126 | } 127 | 128 | public class AssimpMesh 129 | { 130 | public Mesh geometry; 131 | public string name; 132 | public List joints; 133 | public List bones; 134 | public List BoneVertexList; 135 | public List boneWeightsList; 136 | public Material material; 137 | public List vertices; 138 | public List normals; 139 | public List tangents; 140 | public List uvcoords; 141 | public List faces; 142 | public GameObject meshContainer; 143 | public SkinnedMeshRenderer meshRenderer; 144 | public GameObject Root; 145 | public int maxBones; 146 | 147 | 148 | public AssimpMesh(GameObject parent, GameObject root, string name) 149 | { 150 | this.name = name; 151 | meshContainer = new GameObject(name); 152 | this.Root = root; 153 | meshContainer.transform.parent = parent.transform; 154 | meshRenderer = (SkinnedMeshRenderer)meshContainer.AddComponent(typeof(SkinnedMeshRenderer)); 155 | meshRenderer.quality=SkinQuality.Auto; 156 | meshRenderer.sharedMesh = new Mesh(); 157 | meshRenderer.sharedMaterial = new Material(Shader.Find("Diffuse")); 158 | geometry = meshRenderer.sharedMesh; 159 | joints = new List(); 160 | BoneVertexList = new List(); 161 | boneWeightsList = new List(); 162 | vertices = new List(); 163 | normals = new List(); 164 | uvcoords = new List(); 165 | tangents= new List(); 166 | faces = new List(); 167 | bones = new List(); 168 | maxBones=1; 169 | 170 | } 171 | public void addVertex(Vector3 pos, Vector3 normal,Vector4 tan, Vector2 uv) 172 | { 173 | vertices.Add(pos); 174 | normals.Add(normal); 175 | uvcoords.Add(uv); 176 | if(useTangents) tangents.Add(tan); 177 | BoneVertexList.Add(new BoneVertex()); 178 | 179 | } 180 | public void setmaterial(Material mat) 181 | { 182 | meshRenderer.sharedMaterial = mat; 183 | } 184 | 185 | public void addFace(int a, int b, int c) 186 | { 187 | faces.Add(a); 188 | faces.Add(b); 189 | faces.Add(c); 190 | } 191 | public void addJoint(AssimpJoint joint) 192 | { 193 | joints.Add(joint); 194 | bones.Add(joint.transform); 195 | } 196 | public void addBone(int vertexID, int JointId, float force) 197 | { 198 | BoneVertex vertex = BoneVertexList[vertexID]; 199 | vertex.addBone(JointId, force); 200 | BoneVertexList[vertexID] = vertex; 201 | } 202 | public void BuilSkin() 203 | { 204 | 205 | Debug.Log ("****** build skin ******************"); 206 | 207 | for (int i = 0; i < BoneVertexList.Count; i++) 208 | { 209 | BoneVertex vertex = BoneVertexList[i]; 210 | var wight = new BoneWeight(); 211 | float len=0; 212 | 213 | 214 | var orderdWeights=vertex.bones.OrderByDescending(t=>t.Weight).ToList(); 215 | switch (orderdWeights.Count) 216 | { 217 | case 0: 218 | 219 | break; 220 | case 1: 221 | 222 | 223 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 224 | wight.weight0 = orderdWeights[0].Weight; 225 | 226 | break; 227 | case 2: 228 | 229 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 230 | 231 | wight.boneIndex1 = orderdWeights[1].BoneIndex; 232 | 233 | len = Mathf.Sqrt(orderdWeights[0].Weight * orderdWeights[0].Weight + 234 | orderdWeights[1].Weight * orderdWeights[1].Weight); 235 | wight.weight0 = orderdWeights[0].Weight / len; 236 | wight.weight1 = orderdWeights[1].Weight / len; 237 | break; 238 | case 3: 239 | 240 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 241 | wight.boneIndex1 = orderdWeights[1].BoneIndex; 242 | wight.boneIndex2 = orderdWeights[2].BoneIndex; 243 | 244 | len = Mathf.Sqrt(orderdWeights[0].Weight * orderdWeights[0].Weight + 245 | orderdWeights[1].Weight * orderdWeights[1].Weight + 246 | orderdWeights[2].Weight * orderdWeights[2].Weight); 247 | wight.weight0 = orderdWeights[0].Weight / len; 248 | wight.weight1 = orderdWeights[1].Weight / len; 249 | wight.weight2 = orderdWeights[2].Weight / len; 250 | 251 | break; 252 | default: 253 | 254 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 255 | wight.boneIndex1 = orderdWeights[1].BoneIndex; 256 | wight.boneIndex2 = orderdWeights[2].BoneIndex; 257 | wight.boneIndex3 = orderdWeights[3].BoneIndex; 258 | 259 | len = Mathf.Sqrt(orderdWeights[0].Weight * orderdWeights[0].Weight + 260 | orderdWeights[1].Weight * orderdWeights[1].Weight + 261 | orderdWeights[2].Weight * orderdWeights[2].Weight + 262 | orderdWeights[3].Weight * orderdWeights[3].Weight); 263 | wight.weight0 = orderdWeights[0].Weight / len; 264 | wight.weight1 = orderdWeights[1].Weight / len; 265 | wight.weight2 = orderdWeights[2].Weight / len; 266 | wight.weight3 = orderdWeights[3].Weight / len; 267 | 268 | break; 269 | } 270 | 271 | 272 | // trace("----------"); 273 | // trace(" "); 274 | // trace(string.Format(" vertex:{0} num Bones:{1} force {2}", i, vertex.numbones,len)); 275 | maxBones=Math.Max(maxBones,vertex.numbones); 276 | 277 | // Debug.Log(string.Format(" vertex:{0} num Bones:{1} force {2}", i, vertex.numbones,len)); 278 | 279 | // trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex0, wight.weight0)); 280 | // trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex1, wight.weight1)); 281 | // trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex2, wight.weight2)); 282 | // trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex3, wight.weight3)); 283 | 284 | boneWeightsList.Add(wight); 285 | 286 | 287 | 288 | } 289 | 290 | 291 | } 292 | public void build() 293 | { 294 | Debug.Log ("****** build mesh ******************"); 295 | List bindposes = new List(); 296 | 297 | for (int i = 0; i < joints.Count; i++) 298 | { 299 | AssimpJoint joint = joints[i]; 300 | Transform bone = bones[i]; 301 | bindposes.Add(bone.worldToLocalMatrix * Root.transform.localToWorldMatrix); 302 | 303 | 304 | } 305 | 306 | 307 | geometry.vertices = vertices.ToArray(); 308 | geometry.normals = normals.ToArray(); 309 | geometry.uv = uvcoords.ToArray(); 310 | geometry.triangles = faces.ToArray(); 311 | geometry.bindposes = bindposes.ToArray(); 312 | geometry.boneWeights = boneWeightsList.ToArray(); 313 | if(useTangents)geometry.tangents = tangents.ToArray(); 314 | geometry.RecalculateBounds(); 315 | // geometry.RecalculateNormals(); 316 | geometry.Optimize(); 317 | meshRenderer.sharedMesh = geometry; 318 | meshRenderer.bones = bones.ToArray(); 319 | Debug.Log (string.Format("mesh quality:{0}(num Bones)", maxBones)); 320 | 321 | switch (maxBones) 322 | { 323 | case 0: 324 | { 325 | Debug.Log (" ?0? set 1 bones "); 326 | meshRenderer.quality=SkinQuality.Bone1; 327 | break; 328 | } 329 | case 1: 330 | { 331 | Debug.Log (" is 1 set 1 bones "); 332 | meshRenderer.quality=SkinQuality.Bone2; 333 | break; 334 | } 335 | case 2: 336 | { 337 | meshRenderer.quality=SkinQuality.Bone2; 338 | Debug.Log (" set 2 bones "); 339 | break; 340 | } 341 | 342 | case 3: 343 | { 344 | meshRenderer.quality=SkinQuality.Bone4; 345 | Debug.Log (" set 4 bones "); 346 | break; 347 | } 348 | default: 349 | { 350 | Debug.Log ("????? set "+maxBones.ToString()+" bones ???"); 351 | meshRenderer.quality=SkinQuality.Bone1; 352 | break; 353 | } 354 | } 355 | // meshRenderer.quality = maxBones; 356 | 357 | 358 | } 359 | public void dispose() 360 | { 361 | joints.Clear(); 362 | boneWeightsList.Clear(); 363 | BoneVertexList.Clear(); 364 | vertices.Clear(); 365 | normals.Clear(); 366 | faces.Clear(); 367 | tangents.Clear(); 368 | uvcoords.Clear(); 369 | } 370 | 371 | 372 | } 373 | 374 | private static void readMesh(string path, string filename, string texturepath) 375 | { 376 | string importingAssetsDir; 377 | 378 | if (File.Exists(path + "/" + filename)) 379 | { 380 | 381 | 382 | 383 | Assimp.PostProcessSteps flags = ( 384 | // Assimp.PostProcessSteps.MakeLeftHanded | 385 | Assimp.PostProcessSteps.Triangulate | 386 | Assimp.PostProcessSteps.CalculateTangentSpace | 387 | Assimp.PostProcessSteps.GenerateUVCoords | 388 | Assimp.PostProcessSteps.GenerateSmoothNormals | 389 | Assimp.PostProcessSteps.RemoveComponent | 390 | Assimp.PostProcessSteps.JoinIdenticalVertices); 391 | 392 | IntPtr config = Assimp.aiCreatePropertyStore(); 393 | 394 | Assimp.aiSetImportPropertyFloat(config, Assimp.AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, 60.0f); 395 | Assimp.aiSetImportPropertyInteger(config,Assimp.AI_CONFIG_PP_LBW_MAX_WEIGHTS,4); 396 | // IntPtr scene = Assimp.aiImportFile(path + "/" + filename, (uint)flags); 397 | IntPtr scene = Assimp.aiImportFileWithProperties(path + "/" + filename, (uint)flags, config); 398 | Assimp.aiReleasePropertyStore(config); 399 | if (scene == null) 400 | { 401 | 402 | Debug.LogWarning("failed to read file: " + path + "/" + filename); 403 | return; 404 | } 405 | else 406 | { 407 | 408 | 409 | string nm = Path.GetFileNameWithoutExtension(filename); 410 | 411 | 412 | importingAssetsDir = "Assets/Prefabs/" + nm + "/"; 413 | 414 | if (saveAssets) 415 | { 416 | if (!Directory.Exists(importingAssetsDir)) 417 | { 418 | Directory.CreateDirectory(importingAssetsDir); 419 | } 420 | AssetDatabase.Refresh(); 421 | } 422 | 423 | 424 | GameObject ObjectRoot = new GameObject(nm); 425 | GameObject meshContainer = new GameObject(nm + "_Mesh"); 426 | meshContainer.transform.parent = ObjectRoot.transform; 427 | 428 | 429 | 430 | 431 | // List combineInstances = new List(); 432 | List materials = new List(); 433 | List MeshList = new List(); 434 | 435 | 436 | for (int i = 0; i < Assimp.aiScene_GetNumMaterials(scene); i++) 437 | { 438 | string matName = Assimp.aiMaterial_GetName(scene, i); 439 | matName = nm + "_mat" + i; 440 | 441 | // string fname = Path.GetFileNameWithoutExtension(Assimp.aiMaterial_GetTexture(scene, i, (int)Assimp.TextureType.Diffuse)); 442 | string fname = Path.GetFileName(Assimp.aiMaterial_GetTexture(scene, i, (int)Assimp.TextureType.Diffuse)); 443 | Debug.Log("texture " + fname + "Material :" + matName); 444 | 445 | Color ambient = Assimp.aiMaterial_GetAmbient(scene, i); 446 | Color diffuse = Assimp.aiMaterial_GetDiffuse(scene, i); 447 | Color specular = Assimp.aiMaterial_GetSpecular(scene, i); 448 | Color emissive = Assimp.aiMaterial_GetEmissive(scene, i); 449 | 450 | Material mat = new Material(Shader.Find("Diffuse")); 451 | mat.name = matName; 452 | mat.color=diffuse; 453 | 454 | // Debug.Log(ambient.ToString()); 455 | // Debug.Log(diffuse.ToString()); 456 | // Debug.Log(specular.ToString()); 457 | // Debug.Log(emissive.ToString()); 458 | 459 | 460 | string texturename = path + "/" + fname; 461 | 462 | Texture2D tex = null; 463 | if (File.Exists(texturename)) 464 | { 465 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename, typeof(Texture2D)); 466 | } 467 | else 468 | if (File.Exists(texturename + ".PNG")) 469 | { 470 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".PNG", typeof(Texture2D)); 471 | } 472 | else 473 | if (File.Exists(texturename + ".JPG")) 474 | { 475 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".JPG", typeof(Texture2D)); 476 | } 477 | else 478 | if (File.Exists(texturename + ".BMP")) 479 | { 480 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".BMP", typeof(Texture2D)); 481 | } 482 | else 483 | if (File.Exists(texturename + ".TGA")) 484 | { 485 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".TGA", typeof(Texture2D)); 486 | } 487 | else 488 | if (File.Exists(texturename + ".DDS")) 489 | { 490 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".DDS", typeof(Texture2D)); 491 | } 492 | 493 | if (tex != null) 494 | { 495 | Debug.Log("LOAD (" + texturename + ") texture"); 496 | mat.SetTexture("_MainTex", tex); 497 | 498 | } 499 | else 500 | { 501 | Debug.LogError("Fail LOAD (" + texturename + ") error"); 502 | } 503 | 504 | 505 | if (saveAssets) 506 | { 507 | string materialAssetPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + mat.name + ".asset"); 508 | AssetDatabase.CreateAsset(mat, materialAssetPath); 509 | } 510 | materials.Add(mat); 511 | 512 | } 513 | 514 | 515 | AssetDatabase.Refresh(); 516 | 517 | if (Assimp.aiScene_GetRootNode(scene) != null) 518 | { 519 | ObjectRoot.transform.position = Assimp.aiNode_GetPosition(Assimp.aiScene_GetRootNode(scene)); 520 | 521 | //assimp quaternion is w,x,y,z and unity x,y,z,w bu int this lib i fix this for unity 522 | Quaternion assQuad = Assimp.aiNode_GetRotation(Assimp.aiScene_GetRootNode(scene)); 523 | ObjectRoot.transform.rotation = assQuad; 524 | 525 | 526 | GameObject skeleton = new GameObject("Skeleton"); 527 | skeleton.transform.parent = ObjectRoot.transform; 528 | processNodes(scene, Assimp.aiScene_GetRootNode(scene), ref listJoints); 529 | 530 | for (int i = 0; i < listJoints.Count; i++) 531 | { 532 | 533 | AssimpJoint joint = listJoints[i]; 534 | Transform bone = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; 535 | // bone.transform.localScale.Set(2,2,2); 536 | // Transform bone = new GameObject(joint.Name).transform; 537 | // DebugBone debug = (DebugBone)bone.gameObject.AddComponent(typeof(DebugBone)); 538 | 539 | 540 | 541 | bone.name = joint.Name; 542 | bone.parent = skeleton.transform; 543 | 544 | if (getBoneByName(joint.parentName) != null) 545 | { 546 | int index = findBoneByName(joint.parentName); 547 | bone.parent = joint.parent.transform; 548 | } 549 | bone.localPosition = joint.Position; 550 | bone.localRotation = joint.Orientation; 551 | 552 | joint.transform = bone; 553 | } 554 | 555 | } 556 | 557 | 558 | 559 | 560 | if (Assimp.aiScene_HasMeshes(scene)) 561 | { 562 | 563 | 564 | 565 | for (int i = 0; i < Assimp.aiScene_GetNumMeshes(scene); i++) 566 | { 567 | string name = "Mesh_"; 568 | name += i.ToString(); 569 | 570 | 571 | bool HasNormals = Assimp.aiMesh_HasNormals(scene, i); 572 | bool HasTexCoord = Assimp.aiMesh_HasTextureCoords(scene, i, 0); 573 | bool HasFaces = Assimp.aiMesh_HasFaces(scene, i); 574 | 575 | 576 | AssimpMesh mesh = new AssimpMesh(meshContainer, ObjectRoot, name); 577 | mesh.setmaterial(materials[Assimp.aiMesh_GetMaterialIndex(scene, i)]); 578 | MeshList.Add(mesh); 579 | 580 | 581 | 582 | for (int v = 0; v < Assimp.aiMesh_GetNumVertices(scene, i); v++) 583 | { 584 | 585 | Vector3 vertex = Assimp.aiMesh_Vertex(scene, i, v); 586 | Vector3 n = Assimp.aiMesh_Normal(scene, i, v); 587 | float x = Assimp.aiMesh_TextureCoordX(scene, i, v, 0); 588 | float y = Assimp.aiMesh_TextureCoordY(scene, i, v, 0); 589 | 590 | Vector3 binormalf = Assimp.aiMesh_Bitangent(scene, i, v); 591 | Vector3 tangentf = Assimp.aiMesh_Tangent(scene, i, v); 592 | 593 | Vector4 outputTangent = new Vector4(tangentf.x, tangentf.y, tangentf.z, 0.0F); 594 | 595 | float dp = Vector3.Dot(Vector3.Cross(n, tangentf), binormalf); 596 | if (dp > 0.0F) 597 | outputTangent.w = 1.0F; 598 | else 599 | outputTangent.w = -1.0F; 600 | 601 | 602 | mesh.addVertex(vertex, n, outputTangent, new Vector2(x, y)); 603 | 604 | 605 | } 606 | 607 | for (int f = 0; f < Assimp.aiMesh_GetNumFaces(scene, i); f++) 608 | { 609 | int a = Assimp.aiMesh_Indice(scene, i, f, 0); 610 | int b = Assimp.aiMesh_Indice(scene, i, f, 1); 611 | int c = Assimp.aiMesh_Indice(scene, i, f, 2); 612 | mesh.addFace(a, b, c); 613 | } 614 | 615 | 616 | 617 | 618 | //**** 619 | int numBone = Assimp.aiMesh_GetNumBones(scene, i); 620 | 621 | 622 | for (int b = 0; b < numBone; b++) 623 | { 624 | string bname = Assimp.aiMesh_GetBoneName(scene, i, b); 625 | AssimpJoint joint = getBoneByName(bname); 626 | int boneID = findBoneByName(bname); 627 | 628 | 629 | int numWeights = Assimp.aiMesh_GetNumBoneWeights(scene, i, b); 630 | for (int w = 0; w < numWeights; w++) 631 | { 632 | float Weight = Assimp.aiMesh_GetBoneWeight(scene, i, b, w); 633 | int VertexId = Assimp.aiMesh_GetBoneVertexId(scene, i, b, w); 634 | mesh.addBone(VertexId, boneID, Weight); 635 | } 636 | } 637 | 638 | for (int j = 0; j < listJoints.Count; j++) 639 | { 640 | AssimpJoint joint = listJoints[j]; 641 | mesh.addJoint(joint); 642 | } 643 | 644 | //********** 645 | 646 | 647 | mesh.BuilSkin(); 648 | mesh.build(); 649 | 650 | 651 | if (saveAssets) 652 | { 653 | 654 | string meshAssetPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + mesh.name + ".asset"); 655 | AssetDatabase.CreateAsset(mesh.geometry, meshAssetPath); 656 | } 657 | 658 | 659 | mesh.dispose(); 660 | } 661 | 662 | 663 | } 664 | 665 | 666 | 667 | //create key frames 668 | if (Assimp.aiScene_HasAnimation(scene)) 669 | { 670 | Animation anim = (UnityEngine.Animation)ObjectRoot.AddComponent(typeof(Animation)); 671 | 672 | int numAnimation = Assimp.aiScene_GetNumAnimations(scene); 673 | 674 | Debug.Log("count animation :" + numAnimation); 675 | 676 | 677 | for (int a = 0; a < numAnimation; a++) 678 | { 679 | 680 | AnimationClip clip = new AnimationClip(); 681 | string anima = Assimp.aiAnim_GetName(scene, a); 682 | clip.name = nm + "_" + anima + "_" + a; 683 | clip.legacy=true; 684 | 685 | clip.wrapMode = WrapMode.Loop; 686 | 687 | float tinks = (float)Assimp.aiAnim_GetTicksPerSecond(scene, a); 688 | if (tinks <= 1f) tinks = 1f; 689 | float fps = tinks; 690 | clip.frameRate = tinks; 691 | 692 | 693 | Debug.Log("animation fps :" + fps); 694 | 695 | 696 | 697 | int numchannels = Assimp.aiAnim_GetNumChannels(scene, a); 698 | for (int i = 0; i < numchannels; i++) 699 | { 700 | string name = Assimp.aiAnim_GetChannelName(scene, a, i); 701 | AssimpJoint joint = getBoneByName(name); 702 | 703 | 704 | 705 | // Debug.Log(String.Format("anim channel {0} bone name {1} poskeys {2} rotkeys{2}", i, name, Assimp.aiAnim_GetNumPositionKeys(scene, 0, i), Assimp.aiAnim_GetNumRotationKeys(scene, 0, i))); 706 | 707 | //public static bool ignoreRotations = true; 708 | // public static bool ignorePositions = true; 709 | // public static bool ignoreScalling = true; 710 | 711 | if (!ignoreScalling) 712 | { 713 | if (Assimp.aiAnim_GetNumScalingKeys(scene, a, i) !=0) 714 | { 715 | AnimationCurve scaleXcurve = new AnimationCurve(); 716 | AnimationCurve scaleYcurve = new AnimationCurve(); 717 | AnimationCurve scaleZcurve = new AnimationCurve(); 718 | 719 | for (int j = 0; j < Assimp.aiAnim_GetNumScalingKeys(scene, a, i); j++) 720 | { 721 | float time = (float)Assimp.aiAnim_GetScalingFrame(scene, a, i, j);// / fps; 722 | Vector3 scale = Assimp.aiAnim_GetScalingKey(scene, a, i, j); 723 | scaleXcurve.AddKey(time, scale.x); 724 | scaleYcurve.AddKey(time, scale.y); 725 | scaleZcurve.AddKey(time, scale.z); 726 | } 727 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.x", scaleXcurve); 728 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.y", scaleYcurve); 729 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.z", scaleZcurve); 730 | 731 | } 732 | } 733 | 734 | if (!ignorePositions) 735 | { 736 | if (Assimp.aiAnim_GetNumPositionKeys(scene, a, i) != 0) 737 | { 738 | AnimationCurve posXcurve = new AnimationCurve(); 739 | AnimationCurve posYcurve = new AnimationCurve(); 740 | AnimationCurve posZcurve = new AnimationCurve(); 741 | 742 | 743 | for (int j = 0; j < Assimp.aiAnim_GetNumPositionKeys(scene, a, i); j++) 744 | { 745 | float time = (float)Assimp.aiAnim_GetPositionFrame(scene, a, i, j);// / fps; 746 | Vector3 pos = Assimp.aiAnim_GetPositionKey(scene, a, i, j); 747 | posXcurve.AddKey(time, pos.x); 748 | posYcurve.AddKey(time, pos.y); 749 | posZcurve.AddKey(time, pos.z); 750 | } 751 | 752 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.x", posXcurve); 753 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.y", posYcurve); 754 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.z", posZcurve); 755 | } 756 | } 757 | 758 | if (!ignoreRotations) 759 | { 760 | if (Assimp.aiAnim_GetNumRotationKeys(scene, a, i) != 0) 761 | { 762 | 763 | AnimationCurve rotXcurve = new AnimationCurve(); 764 | AnimationCurve rotYcurve = new AnimationCurve(); 765 | AnimationCurve rotZcurve = new AnimationCurve(); 766 | AnimationCurve rotWcurve = new AnimationCurve(); 767 | 768 | for (int j = 0; j < Assimp.aiAnim_GetNumRotationKeys(scene, a, i); j++) 769 | { 770 | float time = (float)Assimp.aiAnim_GetRotationFrame(scene, a, i, j);// / fps; 771 | 772 | Quaternion rotation = Assimp.aiAnim_GetRotationKey(scene, a, i, j); 773 | rotXcurve.AddKey(time, rotation.x); 774 | rotYcurve.AddKey(time, rotation.y); 775 | rotZcurve.AddKey(time, rotation.z); 776 | rotWcurve.AddKey(time, rotation.w); 777 | 778 | } 779 | 780 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.x", rotXcurve); 781 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.y", rotYcurve); 782 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.z", rotZcurve); 783 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.w", rotWcurve); 784 | 785 | } 786 | } 787 | 788 | 789 | 790 | } 791 | 792 | 793 | 794 | clip.EnsureQuaternionContinuity(); 795 | anim.AddClip(clip, clip.name); 796 | anim.clip = clip; 797 | 798 | string clipAssetPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + clip.name + ".asset"); 799 | AssetDatabase.CreateAsset(clip, clipAssetPath); 800 | 801 | // AssetDatabase.CreateAsset(clip, "Assets/Models/" + nm +"_"+a+ ".anim"); 802 | // AssetDatabase.SaveAssets(); 803 | } 804 | 805 | 806 | 807 | } 808 | 809 | 810 | if (saveAssets) 811 | { 812 | 813 | string prefabPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + filename + ".prefab"); 814 | var prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 815 | PrefabUtility.ReplacePrefab(ObjectRoot, prefab, ReplacePrefabOptions.ConnectToPrefab); 816 | AssetDatabase.Refresh(); 817 | } 818 | 819 | MeshList.Clear(); 820 | } 821 | 822 | listJoints.Clear(); 823 | 824 | Assimp.aiReleaseImport(scene); 825 | Debug.LogWarning(path + "/" + filename + " Imported ;) "); 826 | } 827 | 828 | } 829 | 830 | private static AssimpJoint getBoneByName(string name) 831 | { 832 | for (int i = 0; i < listJoints.Count; i++) 833 | { 834 | 835 | AssimpJoint bone = listJoints[i]; 836 | if (bone.Name == name) 837 | { 838 | return bone; 839 | 840 | } 841 | } 842 | return null; 843 | } 844 | private static int findBoneByName(string name) 845 | { 846 | for (int i = 0; i < listJoints.Count; i++) 847 | { 848 | 849 | AssimpJoint bone = listJoints[i]; 850 | if (bone.Name == name) 851 | { 852 | return i; 853 | 854 | } 855 | } 856 | return -1; 857 | } 858 | 859 | private static void processNodes(IntPtr scene, IntPtr node, ref List listJoints) 860 | { 861 | 862 | AssimpJoint joint = new AssimpJoint(); 863 | 864 | string name = Assimp.aiNode_GetName(node); 865 | if (name == "") name = "REMOVE-ME"; 866 | joint.Name = name; 867 | joint.parentName = "NONE"; 868 | joint.Position = Assimp.aiNode_GetPosition(node); 869 | //assimp quaternion is w,x,y,z and unity x,y,z,w bu int this lib i fix this for unity 870 | Quaternion quad = Assimp.aiNode_GetRotation(node); 871 | 872 | joint.Orientation = quad; 873 | 874 | 875 | 876 | if (Assimp.aiNode_GetParent(node) != null) 877 | { 878 | string parentName = Assimp.aiNode_GetName(Assimp.aiNode_GetParent(node)); 879 | joint.parentName = parentName; 880 | 881 | } 882 | 883 | 884 | listJoints.Add(joint); 885 | 886 | for (int i = 0; i < listJoints.Count; i++) 887 | { 888 | 889 | AssimpJoint parent = listJoints[i]; 890 | if (joint.parentName == parent.Name) 891 | { 892 | joint.parent = parent; 893 | joint.Path += parent.Path + "/"; 894 | break; 895 | } 896 | 897 | } 898 | 899 | joint.Path += name; 900 | 901 | if (joint.parent != null) 902 | { 903 | // Debug.Log(string.Format(" Joint name: {0} ; parent:{1} ; animation path:{2} ", joint.Name, joint.parent.Name,"Skeleton/" + joint.Path)); 904 | } 905 | else 906 | { 907 | // Debug.Log(string.Format(" Joint name: {0} ; animation path:{1} ", joint.Name,"Skeleton/" + joint.Path)); 908 | } 909 | 910 | for (int n = 0; n < Assimp.aiNode_GetNumChildren(node); n++) 911 | { 912 | processNodes(scene, Assimp.aiNode_GetChild(node, n), ref listJoints); 913 | 914 | } 915 | } 916 | 917 | 918 | } 919 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimpSkinned.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9902d6b44ee7acc4398dd859e93eadfa 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimpSkinnedCombine.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Runtime.InteropServices; 7 | using System.Collections; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | 11 | public static class ImportAssimpSkinnedCombine 12 | { 13 | public static bool saveAssets = true; 14 | public static bool useTangents = true; 15 | public static bool ignoreRotations = false; 16 | public static bool ignorePositions = false; 17 | public static bool ignoreScalling = true; 18 | 19 | private static StreamWriter streamWriter; 20 | private static List listJoints = new List(); 21 | [MenuItem("Assets/Djoker Tools/Assimp/ImportSkinnedOptimize")] 22 | static void init() 23 | { 24 | 25 | string filename = Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)); 26 | string rootPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(Selection.activeObject)); 27 | /* 28 | FileStream fileStream = new FileStream("Assets/Log.txt", 29 | FileMode.Create, 30 | FileAccess.Write, 31 | FileShare.ReadWrite); 32 | streamWriter = new StreamWriter(fileStream);//"Assets/Log.txt",false); 33 | streamWriter.WriteLine("Import mesh"); 34 | */ 35 | 36 | readMesh(rootPath, filename, "Textures/"); 37 | /* 38 | streamWriter.Flush(); 39 | streamWriter.Close(); 40 | */ 41 | 42 | } 43 | 44 | 45 | 46 | 47 | 48 | private static void trace(string msg) 49 | { 50 | // streamWriter.WriteLine("LOG:" + msg); 51 | } 52 | 53 | public class IBone 54 | { 55 | public int BoneIndex; 56 | public float Weight; 57 | public IBone() 58 | { 59 | BoneIndex = 0; 60 | Weight = 0; 61 | } 62 | 63 | 64 | } 65 | 66 | 67 | 68 | public class BoneVertex 69 | { 70 | 71 | public IBone[] bones; 72 | public int numbones; 73 | public BoneVertex() 74 | { 75 | bones = new IBone[4]; 76 | for (int i = 0; i < 4; i++) 77 | { 78 | bones[i] = new IBone(); 79 | } 80 | 81 | numbones = 0; 82 | } 83 | 84 | public void addBone(int bone, float w) 85 | { 86 | for (int i = 0; i < 4; i++) 87 | { 88 | if (bones[i].Weight == 0) 89 | { 90 | bones[i].BoneIndex = bone; 91 | bones[i].Weight = w; 92 | numbones++; 93 | return; 94 | } 95 | } 96 | 97 | 98 | } 99 | 100 | } 101 | 102 | 103 | 104 | public class AssimpJoint 105 | { 106 | public string parentName; 107 | public string Name; 108 | public string Path; 109 | public Vector3 Position; 110 | public Quaternion Orientation; 111 | public AssimpJoint parent; 112 | public Transform transform; 113 | 114 | 115 | 116 | public AssimpJoint() 117 | { 118 | 119 | Name = ""; 120 | parentName = ""; 121 | parent = null; 122 | Path = ""; 123 | 124 | } 125 | 126 | } 127 | 128 | public class AssimpMesh 129 | { 130 | public Mesh geometry; 131 | public string name; 132 | public List joints; 133 | public List bones; 134 | public List BoneVertexList; 135 | public List boneWeightsList; 136 | public Material material; 137 | public List vertices; 138 | public List normals; 139 | public List tangents; 140 | public List uvcoords; 141 | public List faces; 142 | public GameObject meshContainer; 143 | public SkinnedMeshRenderer meshRenderer; 144 | public GameObject Root; 145 | private int maxBones; 146 | 147 | 148 | 149 | public AssimpMesh(GameObject parent, GameObject root, string name) 150 | { 151 | this.name = name; 152 | meshContainer = new GameObject(name); 153 | this.Root = root; 154 | meshContainer.transform.parent = parent.transform; 155 | meshRenderer = (SkinnedMeshRenderer)meshContainer.AddComponent(typeof(SkinnedMeshRenderer)); 156 | meshRenderer.sharedMesh = new Mesh(); 157 | meshRenderer.quality=SkinQuality.Auto; 158 | maxBones=1; 159 | meshRenderer.sharedMaterial = new Material(Shader.Find("Diffuse")); 160 | geometry = meshRenderer.sharedMesh; 161 | joints = new List(); 162 | BoneVertexList = new List(); 163 | boneWeightsList = new List(); 164 | vertices = new List(); 165 | normals = new List(); 166 | uvcoords = new List(); 167 | tangents= new List(); 168 | faces = new List(); 169 | bones = new List(); 170 | 171 | } 172 | public void addVertex(Vector3 pos, Vector3 normal,Vector4 tan, Vector2 uv) 173 | { 174 | vertices.Add(pos); 175 | normals.Add(normal); 176 | uvcoords.Add(uv); 177 | if(useTangents) tangents.Add(tan); 178 | BoneVertexList.Add(new BoneVertex()); 179 | 180 | } 181 | public void setmaterial(Material mat) 182 | { 183 | meshRenderer.sharedMaterial = mat; 184 | } 185 | 186 | public void addFace(int a, int b, int c) 187 | { 188 | faces.Add(a); 189 | faces.Add(b); 190 | faces.Add(c); 191 | } 192 | public void addJoint(AssimpJoint joint) 193 | { 194 | joints.Add(joint); 195 | bones.Add(joint.transform); 196 | } 197 | public void addBone(int vertexID, int JointId, float force) 198 | { 199 | BoneVertex vertex = BoneVertexList[vertexID]; 200 | vertex.addBone(JointId, force); 201 | BoneVertexList[vertexID] = vertex; 202 | } 203 | public void BuilSkin() 204 | { 205 | 206 | 207 | 208 | for (int i = 0; i < BoneVertexList.Count; i++) 209 | { 210 | BoneVertex vertex = BoneVertexList[i]; 211 | var wight = new BoneWeight(); 212 | float len=0; 213 | 214 | 215 | var orderdWeights=vertex.bones.OrderByDescending(t=>t.Weight).ToList(); 216 | switch (orderdWeights.Count) 217 | { 218 | case 0: 219 | 220 | break; 221 | case 1: 222 | 223 | 224 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 225 | wight.weight0 = orderdWeights[0].Weight; 226 | 227 | break; 228 | case 2: 229 | 230 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 231 | 232 | wight.boneIndex1 = orderdWeights[1].BoneIndex; 233 | 234 | len = Mathf.Sqrt(orderdWeights[0].Weight * orderdWeights[0].Weight + 235 | orderdWeights[1].Weight * orderdWeights[1].Weight); 236 | wight.weight0 = orderdWeights[0].Weight / len; 237 | wight.weight1 = orderdWeights[1].Weight / len; 238 | break; 239 | case 3: 240 | 241 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 242 | wight.boneIndex1 = orderdWeights[1].BoneIndex; 243 | wight.boneIndex2 = orderdWeights[2].BoneIndex; 244 | 245 | len = Mathf.Sqrt(orderdWeights[0].Weight * orderdWeights[0].Weight + 246 | orderdWeights[1].Weight * orderdWeights[1].Weight + 247 | orderdWeights[2].Weight * orderdWeights[2].Weight); 248 | wight.weight0 = orderdWeights[0].Weight / len; 249 | wight.weight1 = orderdWeights[1].Weight / len; 250 | wight.weight2 = orderdWeights[2].Weight / len; 251 | 252 | break; 253 | default: 254 | 255 | wight.boneIndex0 = orderdWeights[0].BoneIndex; 256 | wight.boneIndex1 = orderdWeights[1].BoneIndex; 257 | wight.boneIndex2 = orderdWeights[2].BoneIndex; 258 | wight.boneIndex3 = orderdWeights[3].BoneIndex; 259 | 260 | len = Mathf.Sqrt(orderdWeights[0].Weight * orderdWeights[0].Weight + 261 | orderdWeights[1].Weight * orderdWeights[1].Weight + 262 | orderdWeights[2].Weight * orderdWeights[2].Weight + 263 | orderdWeights[3].Weight * orderdWeights[3].Weight); 264 | wight.weight0 = orderdWeights[0].Weight / len; 265 | wight.weight1 = orderdWeights[1].Weight / len; 266 | wight.weight2 = orderdWeights[2].Weight / len; 267 | wight.weight3 = orderdWeights[3].Weight / len; 268 | 269 | break; 270 | } 271 | maxBones=Math.Max(maxBones,vertex.numbones); 272 | 273 | trace("----------"); 274 | trace(" "); 275 | trace(string.Format(" vertex:{0} num Bones:{1} force {2}", i, vertex.numbones,len)); 276 | 277 | trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex0, wight.weight0)); 278 | trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex1, wight.weight1)); 279 | trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex2, wight.weight2)); 280 | trace(string.Format(" bone index :{0} w:{1}", wight.boneIndex3, wight.weight3)); 281 | 282 | boneWeightsList.Add(wight); 283 | 284 | 285 | 286 | } 287 | 288 | 289 | } 290 | public void build() 291 | { 292 | List bindposes = new List(); 293 | 294 | for (int i = 0; i < joints.Count; i++) 295 | { 296 | AssimpJoint joint = joints[i]; 297 | Transform bone = bones[i]; 298 | bindposes.Add(bone.worldToLocalMatrix * Root.transform.localToWorldMatrix); 299 | 300 | 301 | } 302 | 303 | 304 | geometry.vertices = vertices.ToArray(); 305 | geometry.normals = normals.ToArray(); 306 | geometry.uv = uvcoords.ToArray(); 307 | geometry.triangles = faces.ToArray(); 308 | geometry.bindposes = bindposes.ToArray(); 309 | geometry.boneWeights = boneWeightsList.ToArray(); 310 | if(useTangents)geometry.tangents = tangents.ToArray(); 311 | geometry.RecalculateBounds(); 312 | // geometry.RecalculateNormals(); 313 | geometry.Optimize(); 314 | meshRenderer.sharedMesh = geometry; 315 | meshRenderer.bones = bones.ToArray(); 316 | 317 | 318 | switch (maxBones) 319 | { 320 | case 0: 321 | { 322 | Debug.Log (" ?0? set 1 bones "); 323 | meshRenderer.quality=SkinQuality.Bone1; 324 | break; 325 | } 326 | case 1: 327 | { 328 | Debug.Log (" is 1 set 1 bones "); 329 | meshRenderer.quality=SkinQuality.Bone2; 330 | break; 331 | } 332 | case 2: 333 | { 334 | meshRenderer.quality=SkinQuality.Bone2; 335 | Debug.Log (" set 2 bones "); 336 | break; 337 | } 338 | 339 | case 3: 340 | { 341 | meshRenderer.quality=SkinQuality.Bone4; 342 | Debug.Log (" set 4 bones "); 343 | break; 344 | } 345 | default: 346 | { 347 | Debug.Log ("????? set "+maxBones.ToString()+" bones ???"); 348 | meshRenderer.quality=SkinQuality.Bone1; 349 | break; 350 | } 351 | } 352 | 353 | 354 | } 355 | public void dispose() 356 | { 357 | joints.Clear(); 358 | boneWeightsList.Clear(); 359 | BoneVertexList.Clear(); 360 | vertices.Clear(); 361 | normals.Clear(); 362 | faces.Clear(); 363 | tangents.Clear(); 364 | uvcoords.Clear(); 365 | } 366 | 367 | 368 | } 369 | 370 | private static void readMesh(string path, string filename, string texturepath) 371 | { 372 | string importingAssetsDir; 373 | 374 | if (File.Exists(path + "/" + filename)) 375 | { 376 | 377 | 378 | 379 | Assimp.PostProcessSteps flags = ( 380 | // Assimp.PostProcessSteps.MakeLeftHanded | 381 | Assimp.PostProcessSteps.Triangulate | 382 | Assimp.PostProcessSteps.CalculateTangentSpace | 383 | Assimp.PostProcessSteps.GenerateUVCoords | 384 | Assimp.PostProcessSteps.GenerateSmoothNormals | 385 | Assimp.PostProcessSteps.RemoveComponent | 386 | Assimp.PostProcessSteps.JoinIdenticalVertices); 387 | 388 | IntPtr config = Assimp.aiCreatePropertyStore(); 389 | 390 | Assimp.aiSetImportPropertyFloat(config, Assimp.AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, 60.0f); 391 | Assimp.aiSetImportPropertyInteger(config,Assimp.AI_CONFIG_PP_LBW_MAX_WEIGHTS,4); 392 | // IntPtr scene = Assimp.aiImportFile(path + "/" + filename, (uint)flags); 393 | IntPtr scene = Assimp.aiImportFileWithProperties(path + "/" + filename, (uint)flags, config); 394 | Assimp.aiReleasePropertyStore(config); 395 | if (scene == null) 396 | { 397 | 398 | Debug.LogWarning("failed to read file: " + path + "/" + filename); 399 | return; 400 | } 401 | else 402 | { 403 | 404 | 405 | string nm = Path.GetFileNameWithoutExtension(filename); 406 | 407 | 408 | importingAssetsDir = "Assets/Prefabs/" + nm + "/"; 409 | 410 | if (saveAssets) 411 | { 412 | if (!Directory.Exists(importingAssetsDir)) 413 | { 414 | Directory.CreateDirectory(importingAssetsDir); 415 | } 416 | AssetDatabase.Refresh(); 417 | } 418 | 419 | 420 | GameObject ObjectRoot = new GameObject(nm); 421 | GameObject meshContainer = new GameObject(nm + "_Mesh"); 422 | meshContainer.transform.parent = ObjectRoot.transform; 423 | 424 | 425 | 426 | 427 | // List combineInstances = new List(); 428 | List materials = new List(); 429 | List MeshList = new List(); 430 | 431 | 432 | 433 | for (int i = 0; i < Assimp.aiScene_GetNumMaterials(scene); i++) 434 | { 435 | string matName = Assimp.aiMaterial_GetName(scene, i); 436 | matName = nm + "_mat" + i; 437 | 438 | // string fname = Path.GetFileNameWithoutExtension(Assimp.aiMaterial_GetTexture(scene, i, (int)Assimp.TextureType.Diffuse)); 439 | string fname = Path.GetFileName(Assimp.aiMaterial_GetTexture(scene, i, (int)Assimp.TextureType.Diffuse)); 440 | Debug.Log("texture " + fname + "Material :" + matName); 441 | 442 | Color ambient = Assimp.aiMaterial_GetAmbient(scene, i); 443 | Color diffuse = Assimp.aiMaterial_GetDiffuse(scene, i); 444 | Color specular = Assimp.aiMaterial_GetSpecular(scene, i); 445 | Color emissive = Assimp.aiMaterial_GetEmissive(scene, i); 446 | 447 | Material mat = new Material(Shader.Find("Diffuse")); 448 | mat.name = matName; 449 | 450 | string texturename = path + "/" + fname; 451 | 452 | Texture2D tex = null; 453 | if (File.Exists(texturename)) 454 | { 455 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename, typeof(Texture2D)); 456 | } 457 | else 458 | if (File.Exists(texturename + ".PNG")) 459 | { 460 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".PNG", typeof(Texture2D)); 461 | } 462 | else 463 | if (File.Exists(texturename + ".JPG")) 464 | { 465 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".JPG", typeof(Texture2D)); 466 | } 467 | else 468 | if (File.Exists(texturename + ".BMP")) 469 | { 470 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".BMP", typeof(Texture2D)); 471 | } 472 | else 473 | if (File.Exists(texturename + ".TGA")) 474 | { 475 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".TGA", typeof(Texture2D)); 476 | } 477 | else 478 | if (File.Exists(texturename + ".DDS")) 479 | { 480 | tex = (Texture2D)AssetDatabase.LoadAssetAtPath(texturename + ".DDS", typeof(Texture2D)); 481 | } 482 | 483 | if (tex != null) 484 | { 485 | string p = AssetDatabase.GetAssetPath(tex); 486 | ConfigureForAtlas(p); 487 | 488 | 489 | Debug.Log("LOAD (" + texturename + ") texture"); 490 | mat.SetTexture("_MainTex", tex); 491 | 492 | } 493 | else 494 | { 495 | Debug.LogError("Fail LOAD (" + texturename + ") error"); 496 | } 497 | 498 | 499 | materials.Add(mat); 500 | 501 | } 502 | 503 | AssetDatabase.Refresh(); 504 | 505 | if (Assimp.aiScene_GetRootNode(scene) != null) 506 | { 507 | ObjectRoot.transform.position = Assimp.aiNode_GetPosition(Assimp.aiScene_GetRootNode(scene)); 508 | 509 | //assimp quaternion is w,x,y,z and unity x,y,z,w bu int this lib i fix this for unity 510 | Quaternion assQuad = Assimp.aiNode_GetRotation(Assimp.aiScene_GetRootNode(scene)); 511 | ObjectRoot.transform.rotation = assQuad; 512 | 513 | 514 | GameObject skeleton = new GameObject("Skeleton"); 515 | skeleton.transform.parent = ObjectRoot.transform; 516 | processNodes(scene, Assimp.aiScene_GetRootNode(scene), ref listJoints); 517 | 518 | for (int i = 0; i < listJoints.Count; i++) 519 | { 520 | 521 | AssimpJoint joint = listJoints[i]; 522 | //Transform bone = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; 523 | Transform bone = new GameObject(joint.Name).transform; 524 | // DebugBone debug = (DebugBone)bone.gameObject.AddComponent(typeof(DebugBone)); 525 | 526 | 527 | 528 | bone.name = joint.Name; 529 | bone.parent = skeleton.transform; 530 | 531 | if (getBoneByName(joint.parentName) != null) 532 | { 533 | int index = findBoneByName(joint.parentName); 534 | bone.parent = joint.parent.transform; 535 | } 536 | bone.localPosition = joint.Position; 537 | bone.localRotation = joint.Orientation; 538 | 539 | joint.transform = bone; 540 | } 541 | 542 | } 543 | 544 | 545 | 546 | 547 | if (Assimp.aiScene_HasMeshes(scene)) 548 | { 549 | 550 | 551 | 552 | for (int i = 0; i < Assimp.aiScene_GetNumMeshes(scene); i++) 553 | { 554 | string name = "Mesh_"; 555 | name += i.ToString(); 556 | 557 | 558 | bool HasNormals = Assimp.aiMesh_HasNormals(scene, i); 559 | bool HasTexCoord = Assimp.aiMesh_HasTextureCoords(scene, i, 0); 560 | bool HasFaces = Assimp.aiMesh_HasFaces(scene, i); 561 | 562 | 563 | AssimpMesh mesh = new AssimpMesh(meshContainer, ObjectRoot, name); 564 | mesh.setmaterial(materials[Assimp.aiMesh_GetMaterialIndex(scene, i)]); 565 | MeshList.Add(mesh); 566 | 567 | 568 | 569 | for (int v = 0; v < Assimp.aiMesh_GetNumVertices(scene, i); v++) 570 | { 571 | 572 | Vector3 vertex = Assimp.aiMesh_Vertex(scene, i, v); 573 | Vector3 n = Assimp.aiMesh_Normal(scene, i, v); 574 | float x = Assimp.aiMesh_TextureCoordX(scene, i, v, 0); 575 | float y = Assimp.aiMesh_TextureCoordY(scene, i, v, 0); 576 | 577 | Vector3 binormalf = Assimp.aiMesh_Bitangent(scene, i, v); 578 | Vector3 tangentf = Assimp.aiMesh_Tangent(scene, i, v); 579 | 580 | Vector4 outputTangent = new Vector4(tangentf.x, tangentf.y, tangentf.z, 0.0F); 581 | 582 | float dp = Vector3.Dot(Vector3.Cross(n, tangentf), binormalf); 583 | if (dp > 0.0F) 584 | outputTangent.w = 1.0F; 585 | else 586 | outputTangent.w = -1.0F; 587 | 588 | 589 | mesh.addVertex(vertex, n, outputTangent, new Vector2(x, y)); 590 | 591 | 592 | } 593 | 594 | for (int f = 0; f < Assimp.aiMesh_GetNumFaces(scene, i); f++) 595 | { 596 | int a = Assimp.aiMesh_Indice(scene, i, f, 0); 597 | int b = Assimp.aiMesh_Indice(scene, i, f, 1); 598 | int c = Assimp.aiMesh_Indice(scene, i, f, 2); 599 | mesh.addFace(a, b, c); 600 | } 601 | 602 | 603 | 604 | 605 | //**** 606 | int numBone = Assimp.aiMesh_GetNumBones(scene, i); 607 | 608 | 609 | for (int b = 0; b < numBone; b++) 610 | { 611 | string bname = Assimp.aiMesh_GetBoneName(scene, i, b); 612 | AssimpJoint joint = getBoneByName(bname); 613 | int boneID = findBoneByName(bname); 614 | 615 | 616 | int numWeights = Assimp.aiMesh_GetNumBoneWeights(scene, i, b); 617 | for (int w = 0; w < numWeights; w++) 618 | { 619 | float Weight = Assimp.aiMesh_GetBoneWeight(scene, i, b, w); 620 | int VertexId = Assimp.aiMesh_GetBoneVertexId(scene, i, b, w); 621 | mesh.addBone(VertexId, boneID, Weight); 622 | } 623 | } 624 | 625 | for (int j = 0; j < listJoints.Count; j++) 626 | { 627 | AssimpJoint joint = listJoints[j]; 628 | mesh.addJoint(joint); 629 | } 630 | 631 | //********** 632 | 633 | 634 | mesh.BuilSkin(); 635 | mesh.build(); 636 | mesh.dispose(); 637 | } 638 | 639 | 640 | } 641 | 642 | Mesh m = CombineInstance(ObjectRoot,meshContainer, importingAssetsDir); 643 | 644 | 645 | 646 | //create key frames 647 | if (Assimp.aiScene_HasAnimation(scene)) 648 | { 649 | Animation anim = (UnityEngine.Animation)ObjectRoot.AddComponent(typeof(Animation)); 650 | 651 | int numAnimation = Assimp.aiScene_GetNumAnimations(scene); 652 | 653 | Debug.Log("count animation :" + numAnimation); 654 | 655 | 656 | for (int a = 0; a < numAnimation; a++) 657 | { 658 | 659 | AnimationClip clip = new AnimationClip(); 660 | string anima = Assimp.aiAnim_GetName(scene, a); 661 | clip.name = nm + "_" + anima + "_" + a; 662 | clip.legacy=true; 663 | 664 | clip.wrapMode = WrapMode.Loop; 665 | 666 | float tinks = (float)Assimp.aiAnim_GetTicksPerSecond(scene, a); 667 | if (tinks <= 1f) tinks = 1f; 668 | float fps = tinks; 669 | clip.frameRate = tinks; 670 | 671 | 672 | Debug.Log("animation fps :" + fps); 673 | 674 | 675 | 676 | int numchannels = Assimp.aiAnim_GetNumChannels(scene, a); 677 | for (int i = 0; i < numchannels; i++) 678 | { 679 | string name = Assimp.aiAnim_GetChannelName(scene, a, i); 680 | AssimpJoint joint = getBoneByName(name); 681 | 682 | 683 | 684 | // Debug.Log(String.Format("anim channel {0} bone name {1} poskeys {2} rotkeys{2}", i, name, Assimp.aiAnim_GetNumPositionKeys(scene, 0, i), Assimp.aiAnim_GetNumRotationKeys(scene, 0, i))); 685 | 686 | //public static bool ignoreRotations = true; 687 | // public static bool ignorePositions = true; 688 | // public static bool ignoreScalling = true; 689 | 690 | if (!ignoreScalling) 691 | { 692 | if (Assimp.aiAnim_GetNumScalingKeys(scene, a, i) !=0) 693 | { 694 | AnimationCurve scaleXcurve = new AnimationCurve(); 695 | AnimationCurve scaleYcurve = new AnimationCurve(); 696 | AnimationCurve scaleZcurve = new AnimationCurve(); 697 | 698 | for (int j = 0; j < Assimp.aiAnim_GetNumScalingKeys(scene, a, i); j++) 699 | { 700 | float time = (float)Assimp.aiAnim_GetScalingFrame(scene, a, i, j) ;/// fps; 701 | Vector3 scale = Assimp.aiAnim_GetScalingKey(scene, a, i, j); 702 | // time = (float)j; 703 | scaleXcurve.AddKey(time, scale.x); 704 | scaleYcurve.AddKey(time, scale.y); 705 | scaleZcurve.AddKey(time, scale.z); 706 | } 707 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.x", scaleXcurve); 708 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.y", scaleYcurve); 709 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "m_LocalScale.z", scaleZcurve); 710 | 711 | } 712 | } 713 | 714 | if (!ignorePositions) 715 | { 716 | if (Assimp.aiAnim_GetNumPositionKeys(scene, a, i) != 0) 717 | { 718 | AnimationCurve posXcurve = new AnimationCurve(); 719 | AnimationCurve posYcurve = new AnimationCurve(); 720 | AnimationCurve posZcurve = new AnimationCurve(); 721 | 722 | 723 | for (int j = 0; j < Assimp.aiAnim_GetNumPositionKeys(scene, a, i); j++) 724 | { 725 | float time = (float)Assimp.aiAnim_GetPositionFrame(scene, a, i, j);// / fps; 726 | Vector3 pos = Assimp.aiAnim_GetPositionKey(scene, a, i, j); 727 | // time = (float)j; 728 | posXcurve.AddKey(time, pos.x); 729 | posYcurve.AddKey(time, pos.y); 730 | posZcurve.AddKey(time, pos.z); 731 | } 732 | 733 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.x", posXcurve); 734 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.y", posYcurve); 735 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localPosition.z", posZcurve); 736 | } 737 | } 738 | 739 | if (!ignoreRotations) 740 | { 741 | if (Assimp.aiAnim_GetNumRotationKeys(scene, a, i) != 0) 742 | { 743 | 744 | AnimationCurve rotXcurve = new AnimationCurve(); 745 | AnimationCurve rotYcurve = new AnimationCurve(); 746 | AnimationCurve rotZcurve = new AnimationCurve(); 747 | AnimationCurve rotWcurve = new AnimationCurve(); 748 | 749 | for (int j = 0; j < Assimp.aiAnim_GetNumRotationKeys(scene, a, i); j++) 750 | { 751 | float time = (float)Assimp.aiAnim_GetRotationFrame(scene, a, i, j);// / fps; 752 | 753 | Quaternion rotation = Assimp.aiAnim_GetRotationKey(scene, a, i, j); 754 | // time = (float)j; 755 | rotXcurve.AddKey(time, rotation.x); 756 | rotYcurve.AddKey(time, rotation.y); 757 | rotZcurve.AddKey(time, rotation.z); 758 | rotWcurve.AddKey(time, rotation.w); 759 | 760 | } 761 | 762 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.x", rotXcurve); 763 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.y", rotYcurve); 764 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.z", rotZcurve); 765 | clip.SetCurve("Skeleton/" + joint.Path, typeof(Transform), "localRotation.w", rotWcurve); 766 | 767 | } 768 | } 769 | 770 | 771 | 772 | } 773 | 774 | 775 | 776 | clip.EnsureQuaternionContinuity(); 777 | anim.AddClip(clip, clip.name); 778 | anim.clip = clip; 779 | 780 | string clipAssetPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + clip.name + ".asset"); 781 | AssetDatabase.CreateAsset(clip, clipAssetPath); 782 | } 783 | 784 | 785 | 786 | } 787 | 788 | 789 | if (saveAssets) 790 | { 791 | 792 | string prefabPath = AssetDatabase.GenerateUniqueAssetPath(importingAssetsDir + filename + ".prefab"); 793 | var prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 794 | PrefabUtility.ReplacePrefab(ObjectRoot, prefab, ReplacePrefabOptions.ConnectToPrefab); 795 | AssetDatabase.Refresh(); 796 | } 797 | 798 | MeshList.Clear(); 799 | } 800 | 801 | listJoints.Clear(); 802 | 803 | Assimp.aiReleaseImport(scene); 804 | Debug.LogWarning(path + "/" + filename + " Imported ;) "); 805 | } 806 | 807 | } 808 | private static void ConfigureForAtlas(string TexturePath) 809 | { 810 | TextureImporter TexImport = AssetImporter.GetAtPath(TexturePath) as TextureImporter; 811 | TextureImporterSettings tiSettings = new TextureImporterSettings(); 812 | TexImport.textureType = TextureImporterType.Advanced; 813 | TexImport.ReadTextureSettings(tiSettings); 814 | tiSettings.readable = true; 815 | TexImport.SetTextureSettings(tiSettings); 816 | AssetDatabase.ImportAsset(TexturePath, ImportAssetOptions.ForceUpdate); 817 | AssetDatabase.Refresh(); 818 | } 819 | 820 | private static Mesh CombineInstance(GameObject root,GameObject obj,string path) 821 | { 822 | SkinnedMeshRenderer[] smRenderers = obj.GetComponentsInChildren(); 823 | List bones = new List(); 824 | List boneWeights = new List(); 825 | List combineInstances = new List(); 826 | List textures = new List(); 827 | int numSubs = 0; 828 | 829 | foreach (SkinnedMeshRenderer smr in smRenderers) 830 | numSubs += smr.sharedMesh.subMeshCount; 831 | 832 | 833 | 834 | int[] meshIndex = new int[numSubs]; 835 | int boneOffset = 0; 836 | for (int s = 0; s < smRenderers.Length; s++) 837 | { 838 | SkinnedMeshRenderer smr = smRenderers[s]; 839 | 840 | BoneWeight[] meshBoneweight = smr.sharedMesh.boneWeights; 841 | 842 | // May want to modify this if the renderer shares bones as unnecessary bones will get added. 843 | foreach (BoneWeight bw in meshBoneweight) 844 | { 845 | BoneWeight bWeight = bw; 846 | 847 | bWeight.boneIndex0 += boneOffset; 848 | bWeight.boneIndex1 += boneOffset; 849 | bWeight.boneIndex2 += boneOffset; 850 | bWeight.boneIndex3 += boneOffset; 851 | 852 | boneWeights.Add(bWeight); 853 | } 854 | boneOffset += smr.bones.Length; 855 | 856 | Transform[] meshBones = smr.bones; 857 | 858 | foreach (Transform bone in meshBones) 859 | bones.Add(bone); 860 | 861 | if (smr.material.mainTexture != null) 862 | textures.Add(smr.GetComponent().material.mainTexture as Texture2D); 863 | 864 | CombineInstance ci = new CombineInstance(); 865 | ci.mesh = smr.sharedMesh; 866 | meshIndex[s] = ci.mesh.vertexCount; 867 | ci.transform = smr.transform.localToWorldMatrix; 868 | combineInstances.Add(ci); 869 | 870 | 871 | UnityEngine.Object.DestroyImmediate(smr.gameObject); 872 | } 873 | 874 | // var children = new List(); 875 | // foreach (Transform child in obj.transform) children.Add(child.gameObject); 876 | // children.ForEach(child => UnityEngine.Object.DestroyImmediate(child)); 877 | 878 | 879 | List bindposes = new List(); 880 | 881 | for (int b = 0; b < bones.Count; b++) 882 | { 883 | bindposes.Add(bones[b].worldToLocalMatrix * obj.transform.worldToLocalMatrix); 884 | } 885 | 886 | SkinnedMeshRenderer r = obj.AddComponent(); 887 | r.sharedMesh = new Mesh(); 888 | r.sharedMesh.CombineMeshes(combineInstances.ToArray(), true, true); 889 | //r.rootBone = root.transform; 890 | 891 | Texture2D skinnedMeshAtlas = new Texture2D(128, 128); 892 | Rect[] packingResult = skinnedMeshAtlas.PackTextures(textures.ToArray(), 0); 893 | Vector2[] originalUVs = r.sharedMesh.uv; 894 | Vector2[] atlasUVs = new Vector2[originalUVs.Length]; 895 | 896 | int rectIndex = 0; 897 | int vertTracker = 0; 898 | for (int i = 0; i < atlasUVs.Length; i++) 899 | { 900 | atlasUVs[i].x = Mathf.Lerp(packingResult[rectIndex].xMin, packingResult[rectIndex].xMax, originalUVs[i].x); 901 | atlasUVs[i].y = Mathf.Lerp(packingResult[rectIndex].yMin, packingResult[rectIndex].yMax, originalUVs[i].y); 902 | 903 | if (i >= meshIndex[rectIndex] + vertTracker) 904 | { 905 | vertTracker += meshIndex[rectIndex]; 906 | rectIndex++; 907 | } 908 | } 909 | 910 | string assetPath = AssetDatabase.GenerateUniqueAssetPath(path + "texture.asset"); 911 | AssetDatabase.CreateAsset(skinnedMeshAtlas, assetPath); 912 | 913 | Material combinedMat = new Material(Shader.Find("Diffuse")); 914 | combinedMat.mainTexture = skinnedMeshAtlas; 915 | r.sharedMesh.uv = atlasUVs; 916 | r.sharedMaterial = combinedMat; 917 | 918 | assetPath = AssetDatabase.GenerateUniqueAssetPath(path + "material.asset"); 919 | AssetDatabase.CreateAsset(combinedMat, assetPath); 920 | 921 | 922 | r.bones = bones.ToArray(); 923 | r.sharedMesh.boneWeights = boneWeights.ToArray(); 924 | r.sharedMesh.bindposes = bindposes.ToArray(); 925 | r.sharedMesh.RecalculateBounds(); 926 | 927 | assetPath = AssetDatabase.GenerateUniqueAssetPath(path + "mesh.asset"); 928 | AssetDatabase.CreateAsset(r.sharedMesh, assetPath); 929 | 930 | 931 | return r.sharedMesh; 932 | } 933 | private static AssimpJoint getBoneByName(string name) 934 | { 935 | for (int i = 0; i < listJoints.Count; i++) 936 | { 937 | 938 | AssimpJoint bone = listJoints[i]; 939 | if (bone.Name == name) 940 | { 941 | return bone; 942 | 943 | } 944 | } 945 | return null; 946 | } 947 | private static int findBoneByName(string name) 948 | { 949 | for (int i = 0; i < listJoints.Count; i++) 950 | { 951 | 952 | AssimpJoint bone = listJoints[i]; 953 | if (bone.Name == name) 954 | { 955 | return i; 956 | 957 | } 958 | } 959 | return -1; 960 | } 961 | 962 | private static void processNodes(IntPtr scene, IntPtr node, ref List listJoints) 963 | { 964 | 965 | AssimpJoint joint = new AssimpJoint(); 966 | 967 | string name = Assimp.aiNode_GetName(node); 968 | if (name == "") name = "REMOVE-ME"; 969 | joint.Name = name; 970 | joint.parentName = "NONE"; 971 | joint.Position = Assimp.aiNode_GetPosition(node); 972 | //assimp quaternion is w,x,y,z and unity x,y,z,w bu int this lib i fix this for unity 973 | Quaternion quad = Assimp.aiNode_GetRotation(node); 974 | 975 | joint.Orientation = quad; 976 | 977 | 978 | 979 | if (Assimp.aiNode_GetParent(node) != null) 980 | { 981 | string parentName = Assimp.aiNode_GetName(Assimp.aiNode_GetParent(node)); 982 | joint.parentName = parentName; 983 | 984 | } 985 | 986 | 987 | listJoints.Add(joint); 988 | 989 | for (int i = 0; i < listJoints.Count; i++) 990 | { 991 | 992 | AssimpJoint parent = listJoints[i]; 993 | if (joint.parentName == parent.Name) 994 | { 995 | joint.parent = parent; 996 | joint.Path += parent.Path + "/"; 997 | break; 998 | } 999 | 1000 | } 1001 | 1002 | joint.Path += name; 1003 | 1004 | if (joint.parent != null) 1005 | { 1006 | // Debug.Log(string.Format(" Joint name: {0} ; parent:{1} ; animation path:{2} ", joint.Name, joint.parent.Name,"Skeleton/" + joint.Path)); 1007 | } 1008 | else 1009 | { 1010 | // Debug.Log(string.Format(" Joint name: {0} ; animation path:{1} ", joint.Name,"Skeleton/" + joint.Path)); 1011 | } 1012 | 1013 | for (int n = 0; n < Assimp.aiNode_GetNumChildren(node); n++) 1014 | { 1015 | processNodes(scene, Assimp.aiNode_GetChild(node, n), ref listJoints); 1016 | 1017 | } 1018 | } 1019 | 1020 | 1021 | } 1022 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ImportAssimpSkinnedCombine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77bd3548b6f589f42b8898b6d39592fe 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ViewSkeletonEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | 5 | [CustomEditor(typeof(ViewSkeleton))] 6 | public class ViewSkeletonEditor : Editor 7 | { 8 | 9 | public override void OnInspectorGUI() 10 | { 11 | ViewSkeleton myTarget = (ViewSkeleton)target; 12 | 13 | EditorGUILayout.BeginHorizontal("Box"); 14 | myTarget.rootNode = (Transform)EditorGUILayout.ObjectField(myTarget.rootNode, typeof(Transform)); 15 | 16 | if(myTarget != null) 17 | { 18 | if (GUILayout.Button("PopulateChildren")) 19 | { 20 | myTarget.PopulateChildren(); 21 | } 22 | } 23 | EditorGUILayout.EndHorizontal(); 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ViewSkeletonEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f90fd586f07a37448de5eeec523ce36 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Player.cs: -------------------------------------------------------------------------------- 1 |  2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | public class Player : MonoBehaviour { 7 | 8 | public Animation anim; 9 | public AnimationState state; 10 | private string name; 11 | public float frame; 12 | public float length; 13 | public float fps = 100f; 14 | 15 | [HideInInspector] 16 | private List animations; 17 | public int currentFrame; 18 | private int nextFrame; 19 | public Anim currAnimation; 20 | private int lastanimation; 21 | public int currentAnimation; 22 | private int rollto_anim; 23 | private bool RollOver; 24 | private float lastTime; 25 | private float lerptime; 26 | public bool manual = false; 27 | 28 | void Start () { 29 | 30 | //anim.clip.frameRate = 0; 31 | fps = anim.clip.frameRate; 32 | 33 | length = anim.clip.length; 34 | name = anim.clip.name; 35 | state = anim[name]; 36 | state.speed = 0; 37 | state.wrapMode = WrapMode.Clamp; 38 | 39 | 40 | animations = new List (); 41 | 42 | lastanimation = -1; 43 | currentAnimation = 0; 44 | rollto_anim = 0; 45 | RollOver=false; 46 | currentFrame = 0; 47 | lastTime = tickcount (); 48 | 49 | animations.Add(new Anim("walk", 2, 14, 60)); 50 | animations.Add(new Anim("run", 16, 26, 60)); 51 | animations.Add(new Anim("jump", 42, 54, 60)); 52 | animations.Add(new Anim("crouch", 56, 60, 60)); 53 | animations.Add(new Anim("staycrouch", 60, 69, 60)); 54 | animations.Add(new Anim("getup", 70, 74, 60)); 55 | 56 | animations.Add(new Anim("idle1", 75, 88, 60)); 57 | animations.Add(new Anim("idle2", 90, 110, 60)); 58 | animations.Add(new Anim("idle3", 292, 325, 60)); 59 | animations.Add(new Anim("idle4", 327, 360,60)); 60 | 61 | animations.Add(new Anim("swipe", 112, 126, 60)); 62 | animations.Add(new Anim("jumpattack", 128, 142, 60)); 63 | animations.Add(new Anim("spin", 144, 160, 60)); 64 | animations.Add(new Anim("swipes", 162, 180, 60)); 65 | animations.Add(new Anim("stab", 182, 192, 60)); 66 | animations.Add(new Anim("block", 194,210, 60)); 67 | 68 | animations.Add(new Anim("die1", 212, 227, 60)); 69 | animations.Add(new Anim("die2", 230,251, 60)); 70 | 71 | animations.Add(new Anim("nod", 253, 272, 60)); 72 | animations.Add(new Anim("shake", 274, 290,60)); 73 | 74 | currentFrame=0; 75 | nextFrame = 1; 76 | 77 | setAnimation(0); 78 | 79 | } 80 | 81 | private float tickcount() 82 | { 83 | return Time.time; 84 | } 85 | 86 | // Update is called once per frame 87 | void Update () 88 | { 89 | 90 | float time = tickcount (); 91 | float elapsedTime = time - lastTime; 92 | lerptime = tickcount() / (1.0f / currAnimation.fps); 93 | 94 | 95 | 96 | 97 | if (!manual) 98 | { 99 | nextFrame = (currentFrame + 1); 100 | if (nextFrame > currAnimation.frameEnd) 101 | { 102 | nextFrame = currAnimation.frameStart; 103 | } 104 | 105 | 106 | if (RollOver) 107 | { 108 | if (currentFrame >= currAnimation.frameEnd) 109 | { 110 | setAnimation(rollto_anim); 111 | RollOver = false; 112 | } 113 | } 114 | 115 | if (elapsedTime >= (1.0f / currAnimation.fps)) 116 | { 117 | currentFrame = nextFrame; 118 | lastTime = tickcount(); 119 | } 120 | 121 | } 122 | 123 | 124 | if (Input.GetKey(KeyCode.D)) 125 | { 126 | NextAnimation(); 127 | } 128 | else 129 | if (Input.GetKey(KeyCode.A)) 130 | { 131 | BackAnimation(); 132 | } 133 | 134 | frame=(currentFrame * 1.0f / fps); 135 | 136 | state.time = frame; 137 | } 138 | 139 | public int addAnimation(string name, int startFrame, int endFrame, int fps) 140 | { 141 | animations.Add(new Anim(name, startFrame, endFrame, fps)); 142 | return (animations.Count - 1); 143 | 144 | } 145 | public int NumAnimations() 146 | { 147 | return animations.Count - 1; 148 | } 149 | 150 | public void BackAnimation() 151 | { 152 | currentAnimation = (currentAnimation - 1) % (NumAnimations()); 153 | if (currentAnimation < 0) currentAnimation = NumAnimations(); 154 | setAnimation(currentAnimation); 155 | } 156 | public void NextAnimation() 157 | { 158 | currentAnimation = (currentAnimation + 1) % (NumAnimations()); 159 | if (currentAnimation > NumAnimations()) currentAnimation = 0; 160 | setAnimation(currentAnimation); 161 | } 162 | public void setAnimation(int num) 163 | { 164 | if (num == lastanimation) return; 165 | if (num > animations.Count) return; 166 | 167 | currentAnimation = num; 168 | currAnimation = animations[currentAnimation]; 169 | currentFrame = animations[currentAnimation].frameStart; 170 | lastanimation = currentAnimation; 171 | } 172 | public void setAnimationByName(string name) 173 | { 174 | 175 | for (int i = 0; i < animations.Count; i++) 176 | { 177 | 178 | if (animations[i].name == name) 179 | { 180 | setAnimation(i); 181 | break; 182 | } 183 | 184 | } 185 | 186 | } 187 | public void SetAnimationRollOver(int num, int next) 188 | { 189 | if (num == lastanimation) return; 190 | if (num > animations.Count) return; 191 | 192 | currentAnimation = num; 193 | currAnimation = animations[currentAnimation]; 194 | currentFrame = animations[currentAnimation].frameStart; 195 | lastanimation = currentAnimation; 196 | RollOver = true; 197 | rollto_anim = next; 198 | } 199 | 200 | } 201 | -------------------------------------------------------------------------------- /Assets/Scripts/Player.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 649f54559d154ea46a6a52e2059699d0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SkinnedMeshCombiner.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | public class SkinnedMeshCombiner : MonoBehaviour 5 | { 6 | 7 | void Start() 8 | { 9 | 10 | SkinnedMeshRenderer[] smRenderers = GetComponentsInChildren(); 11 | List bones = new List(); 12 | List boneWeights = new List(); 13 | List combineInstances = new List(); 14 | List textures = new List(); 15 | int numSubs = 0; 16 | 17 | foreach (SkinnedMeshRenderer smr in smRenderers) 18 | numSubs += smr.sharedMesh.subMeshCount; 19 | 20 | int[] meshIndex = new int[numSubs]; 21 | int boneOffset = 0; 22 | for (int s = 0; s < smRenderers.Length; s++) 23 | { 24 | SkinnedMeshRenderer smr = smRenderers[s]; 25 | 26 | BoneWeight[] meshBoneweight = smr.sharedMesh.boneWeights; 27 | 28 | // May want to modify this if the renderer shares bones as unnecessary bones will get added. 29 | foreach (BoneWeight bw in meshBoneweight) 30 | { 31 | BoneWeight bWeight = bw; 32 | 33 | bWeight.boneIndex0 += boneOffset; 34 | bWeight.boneIndex1 += boneOffset; 35 | bWeight.boneIndex2 += boneOffset; 36 | bWeight.boneIndex3 += boneOffset; 37 | 38 | boneWeights.Add(bWeight); 39 | } 40 | boneOffset += smr.bones.Length; 41 | 42 | Transform[] meshBones = smr.bones; 43 | foreach (Transform bone in meshBones) 44 | bones.Add(bone); 45 | 46 | if (smr.material.mainTexture != null) 47 | textures.Add(smr.GetComponent().material.mainTexture as Texture2D); 48 | 49 | CombineInstance ci = new CombineInstance(); 50 | ci.mesh = smr.sharedMesh; 51 | meshIndex[s] = ci.mesh.vertexCount; 52 | ci.transform = smr.transform.localToWorldMatrix; 53 | combineInstances.Add(ci); 54 | 55 | Object.Destroy(smr.gameObject); 56 | } 57 | 58 | List bindposes = new List(); 59 | 60 | for (int b = 0; b < bones.Count; b++) 61 | { 62 | bindposes.Add(bones[b].worldToLocalMatrix * transform.worldToLocalMatrix); 63 | } 64 | 65 | SkinnedMeshRenderer r = gameObject.AddComponent(); 66 | r.sharedMesh = new Mesh(); 67 | r.sharedMesh.CombineMeshes(combineInstances.ToArray(), true, true); 68 | 69 | Texture2D skinnedMeshAtlas = new Texture2D(128, 128); 70 | Rect[] packingResult = skinnedMeshAtlas.PackTextures(textures.ToArray(), 0); 71 | Vector2[] originalUVs = r.sharedMesh.uv; 72 | Vector2[] atlasUVs = new Vector2[originalUVs.Length]; 73 | 74 | int rectIndex = 0; 75 | int vertTracker = 0; 76 | for (int i = 0; i < atlasUVs.Length; i++) 77 | { 78 | atlasUVs[i].x = Mathf.Lerp(packingResult[rectIndex].xMin, packingResult[rectIndex].xMax, originalUVs[i].x); 79 | atlasUVs[i].y = Mathf.Lerp(packingResult[rectIndex].yMin, packingResult[rectIndex].yMax, originalUVs[i].y); 80 | 81 | if (i >= meshIndex[rectIndex] + vertTracker) 82 | { 83 | vertTracker += meshIndex[rectIndex]; 84 | rectIndex++; 85 | } 86 | } 87 | 88 | Material combinedMat = new Material(Shader.Find("Diffuse")); 89 | combinedMat.mainTexture = skinnedMeshAtlas; 90 | r.sharedMesh.uv = atlasUVs; 91 | r.sharedMaterial = combinedMat; 92 | 93 | r.bones = bones.ToArray(); 94 | r.sharedMesh.boneWeights = boneWeights.ToArray(); 95 | r.sharedMesh.bindposes = bindposes.ToArray(); 96 | r.sharedMesh.RecalculateBounds(); 97 | } 98 | } -------------------------------------------------------------------------------- /Assets/Scripts/SkinnedMeshCombiner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4264517f9b427a44a8b1be6fff54aba4 3 | timeCreated: 1430981820 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/ViewSkeleton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class ViewSkeleton : MonoBehaviour 6 | { 7 | 8 | public Transform rootNode; 9 | public Transform[] childNodes; 10 | public float size = 1f; 11 | 12 | 13 | void OnDrawGizmosSelected() 14 | { 15 | if (rootNode != null) 16 | { 17 | //Gizmos.DrawCube(rootNode.position, new Vector3(.1f, .1f, .1f)); 18 | foreach (Transform child in childNodes) 19 | { 20 | if (child == rootNode) 21 | { 22 | Gizmos.color = Color.green; 23 | Gizmos.DrawCube(child.position, new Vector3(1.5f, 1.5f, 1.5f)); 24 | } 25 | else 26 | { 27 | Gizmos.color = Color.yellow; 28 | Gizmos.DrawLine(child.position, child.parent.position); 29 | Gizmos.DrawCube(child.position, new Vector3(size, size, size)); 30 | } 31 | } 32 | 33 | } 34 | } 35 | 36 | public void PopulateChildren() 37 | { 38 | childNodes = rootNode.GetComponentsInChildren(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/Scripts/ViewSkeleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c0020312d94d3f41b90d77ba5e3646d 3 | timeCreated: 1430981821 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Static.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b038322d8972864495a15de47074659 3 | folderAsset: yes 4 | timeCreated: 1430981820 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Static/Teapot.b3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Static/Teapot.b3d -------------------------------------------------------------------------------- /Assets/Static/Teapot.b3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e6ce95765b654240b167250b52fcef9 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Static/level.ms3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Static/level.ms3d -------------------------------------------------------------------------------- /Assets/Static/level.ms3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f7d351a48b778e4faca735b6cbb6e23 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Static/room.ms3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/Assets/Static/room.ms3d -------------------------------------------------------------------------------- /Assets/Static/room.ms3d.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 814964f8ab1018a49b43c1ce4bff8bdd 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityAssimp 2 | Use assimp importer on unity 3 | 4 | import skeleton animated mesh and static meshes. 5 | 6 | unity5 broke all the mesh and joints i need do find the problem but with unity 4 works fine :( 7 | feel free to chance or improve this project. 8 | 9 | 10 | Demo: 11 | https://b29a2ae9f766df349e7634e9febca18668927db2.googledrive.com/host/0B9n2UEk_-VqyQ2I1QllmQlVUbGM/bi.html 12 | animated and static . 13 | 14 | videos: 15 | https://www.youtube.com/watch?v=iLc440wX2hg 16 | ogre mesh https://www.youtube.com/watch?v=XpgTzoGC4pY 17 | doom mesh https://www.youtube.com/watch?v=PEkskhltA9A 18 | manual bones animation https://www.youtube.com/watch?v=02HhEZWbrAQ 19 | 20 | 21 | -------------------------------------------------------------------------------- /UnityAssimp-csharp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{1FDCAADB-278A-0413-E340-BFD5DE36D0BD}") = "UnityAssimp", "Assembly-CSharp-vs.csproj", "{D52D985A-EF14-E3C5-3D07-39A927FB448D}" 5 | EndProject 6 | Project("{1FDCAADB-278A-0413-E340-BFD5DE36D0BD}") = "UnityAssimp", "Assembly-CSharp-Editor-vs.csproj", "{EBFB22A5-410B-8B39-E4FB-7A362F74F35C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | GlobalSection(MonoDevelopProperties) = preSolution 27 | StartupItem = Assembly-CSharp.csproj 28 | Policies = $0 29 | $0.TextStylePolicy = $1 30 | $1.inheritsSet = null 31 | $1.scope = text/x-csharp 32 | $0.CSharpFormattingPolicy = $2 33 | $2.inheritsSet = Mono 34 | $2.inheritsScope = text/x-csharp 35 | $2.scope = text/x-csharp 36 | $0.TextStylePolicy = $3 37 | $3.FileWidth = 120 38 | $3.TabWidth = 4 39 | $3.EolMarker = Unix 40 | $3.inheritsSet = Mono 41 | $3.inheritsScope = text/plain 42 | $3.scope = text/plain 43 | EndGlobalSection 44 | 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /UnityAssimp-csharp.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/UnityAssimp-csharp.suo -------------------------------------------------------------------------------- /UnityAssimp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{1FDCAADB-278A-0413-E340-BFD5DE36D0BD}") = "UnityAssimp", "Assembly-CSharp.csproj", "{D52D985A-EF14-E3C5-3D07-39A927FB448D}" 5 | EndProject 6 | Project("{1FDCAADB-278A-0413-E340-BFD5DE36D0BD}") = "UnityAssimp", "Assembly-CSharp-Editor.csproj", "{EBFB22A5-410B-8B39-E4FB-7A362F74F35C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D52D985A-EF14-E3C5-3D07-39A927FB448D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {EBFB22A5-410B-8B39-E4FB-7A362F74F35C}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | GlobalSection(MonoDevelopProperties) = preSolution 27 | StartupItem = Assembly-CSharp.csproj 28 | Policies = $0 29 | $0.TextStylePolicy = $1 30 | $1.inheritsSet = null 31 | $1.scope = text/x-csharp 32 | $0.CSharpFormattingPolicy = $2 33 | $2.inheritsSet = Mono 34 | $2.inheritsScope = text/x-csharp 35 | $2.scope = text/x-csharp 36 | $0.TextStylePolicy = $3 37 | $3.FileWidth = 120 38 | $3.TabWidth = 4 39 | $3.EolMarker = Unix 40 | $3.inheritsSet = Mono 41 | $3.inheritsScope = text/plain 42 | $3.scope = text/plain 43 | EndGlobalSection 44 | 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /assimp.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/assimp.pas -------------------------------------------------------------------------------- /assimp32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/assimp32.dll -------------------------------------------------------------------------------- /assimp64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akadjoker/UnityAssimp/8969538f27cb1c7ce9da47a6d2da145680c78623/assimp64.dll --------------------------------------------------------------------------------