diff --git a/unity/Assets/OBJ-IO/Editor.meta b/unity/Assets/OBJ-IO/Editor.meta index b944d9f..c3bb4f5 100644 --- a/unity/Assets/OBJ-IO/Editor.meta +++ b/unity/Assets/OBJ-IO/Editor.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 5c86e6fe65d4e4946b243172e73ba161 +guid: ba9cb60ce484c4b1092b2b70b583d7fc folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Editor/OBJEditor.cs b/unity/Assets/OBJ-IO/Editor/OBJEditor.cs index 2dba06e..c092e18 100644 --- a/unity/Assets/OBJ-IO/Editor/OBJEditor.cs +++ b/unity/Assets/OBJ-IO/Editor/OBJEditor.cs @@ -1,50 +1,99 @@ - -using System; +using System; +using System.Collections.Generic; using System.IO; -using System.Collections; -using UnityEngine; using UnityEditor; - +using UnityEngine; using UnityExtension; + public class OBJWindow : EditorWindow { //------------------------------------------------------------------------------------------------------------ - private MeshFilter m_MeshFilter = null; - - //------------------------------------------------------------------------------------------------------------ - [MenuItem("OBJ-IO/OBJ Mesh Exporter")] - public static void Execute() - { - OBJWindow.GetWindow(); - } - - //------------------------------------------------------------------------------------------------------------ - private void OnGUI() - { - m_MeshFilter = (MeshFilter)EditorGUILayout.ObjectField("MeshFilter", m_MeshFilter, typeof(MeshFilter), true); - - if (m_MeshFilter != null) + private Transform m_root = null; + + //------------------------------------------------------------------------------------------------------------ + [MenuItem("Window/OBJ-IO Mesh Exporter")] + public static void Execute() + { + OBJWindow.GetWindow(); + } + + [MenuItem("CONTEXT/Transform/OBJ-IO Export Mesh")] + public static void ExportTransform(MenuCommand command) + { + var selection = command.context as Transform; + ExportMesh(selection); + } + + [MenuItem("CONTEXT/Transform/OBJ-IO Export Mesh", true)] + public static bool CheckTransformExport(MenuCommand command) + { + var selection = command.context as Transform; + if (selection == null) { - if (GUILayout.Button("Export OBJ")) - { - var lOutputPath = EditorUtility.SaveFilePanel("Save Mesh as OBJ", "", m_MeshFilter.name + ".obj", "obj"); - - if (File.Exists(lOutputPath)) - { - File.Delete(lOutputPath); - } - - var lStream = new FileStream(lOutputPath, FileMode.Create); - var lOBJData = m_MeshFilter.sharedMesh.EncodeOBJ(); - OBJLoader.ExportOBJ(lOBJData, lStream); - lStream.Close(); + return false; + } + + return selection.GetComponent() != null || selection.GetComponentInChildren() != null; + } + + [MenuItem("CONTEXT/MeshFilter/OBJ-IO Export Mesh")] + public static void ExportMeshFilter(MenuCommand command) + { + var selection = command.context as MeshFilter; + ExportMesh(selection.transform); + } + + + //------------------------------------------------------------------------------------------------------------ + private void OnGUI() + { + m_root = (Transform)EditorGUILayout.ObjectField("Root", m_root, typeof(Transform), true); + + if (m_root == null) + { + GUILayout.Label("Please provide a Transform which contains (including it's children) at least on or more MeshFilter component"); + return; + } + + if (GUILayout.Button("Export OBJ")) + { + ExportMesh(m_root); + } + } + + private static void ExportMesh(Transform root) { + var meshFilters = new List(); + meshFilters.AddRange(root.GetComponents()); + meshFilters.AddRange(root.GetComponentsInChildren()); + + Mesh mesh; + if (meshFilters.Count > 0) { + CombineInstance[] combine = new CombineInstance[meshFilters.Count]; + for (int i = 0; i < meshFilters.Count; ++i) { + combine[i].mesh = meshFilters[i].sharedMesh; + combine[i].transform = meshFilters[i].transform.localToWorldMatrix; } + + mesh = new Mesh(); + mesh.CombineMeshes(combine); + mesh.Optimize(); + mesh.name = root.name; + } else { + return; } - else + + var lOutputPath = EditorUtility.SaveFilePanel("Save Mesh as OBJ", "", root.name + ".obj", "obj"); + + if (File.Exists(lOutputPath)) { - GUILayout.Label("Please provide a MeshFilter"); + File.Delete(lOutputPath); } - } + + var lStream = new FileStream(lOutputPath, FileMode.Create); + var lOBJData = mesh.EncodeOBJ(); + OBJLoader.ExportOBJ(lOBJData, lStream); + lStream.Close(); +} } diff --git a/unity/Assets/OBJ-IO/Editor/OBJEditor.cs.meta b/unity/Assets/OBJ-IO/Editor/OBJEditor.cs.meta index e0f5e91..728c0bd 100644 --- a/unity/Assets/OBJ-IO/Editor/OBJEditor.cs.meta +++ b/unity/Assets/OBJ-IO/Editor/OBJEditor.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 5cb377fb273c8634296cc421905b1d34 +guid: 844115d3abd794bb3ac1379b641b63e0 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples.meta b/unity/Assets/OBJ-IO/Examples.meta index 0a599e9..2d822b2 100644 --- a/unity/Assets/OBJ-IO/Examples.meta +++ b/unity/Assets/OBJ-IO/Examples.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 33368388f581b994fab7f5ef248c0f63 +guid: 786bf829568704eeab3e43d11a3fed54 folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Meshes.meta b/unity/Assets/OBJ-IO/Examples/Meshes.meta index 616e31a..edc404d 100644 --- a/unity/Assets/OBJ-IO/Examples/Meshes.meta +++ b/unity/Assets/OBJ-IO/Examples/Meshes.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: e0433cb2bd36d3942883bf0f0998e2bb +guid: b431154bd41db4039a68d8da9687bbd0 folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Meshes/Materials.meta b/unity/Assets/OBJ-IO/Examples/Meshes/Materials.meta new file mode 100644 index 0000000..05b4998 --- /dev/null +++ b/unity/Assets/OBJ-IO/Examples/Meshes/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 59eadbbc9d2af4f288f11a478b858118 +folderAsset: yes +timeCreated: 1428198132 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Meshes/Materials/Teapot001Mat.mat b/unity/Assets/OBJ-IO/Examples/Meshes/Materials/Teapot001Mat.mat new file mode 100644 index 0000000..43c5780 --- /dev/null +++ b/unity/Assets/OBJ-IO/Examples/Meshes/Materials/Teapot001Mat.mat @@ -0,0 +1,145 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Teapot001Mat + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_CustomRenderQueue: -1 + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + data: + first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + data: + first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + data: + first: + name: _Cutoff + second: .5 + data: + first: + name: _SrcBlend + second: 1 + data: + first: + name: _DstBlend + second: 0 + data: + first: + name: _Parallax + second: .0199999996 + data: + first: + name: _ZWrite + second: 1 + data: + first: + name: _Glossiness + second: .5 + data: + first: + name: _BumpScale + second: 1 + data: + first: + name: _OcclusionStrength + second: 1 + data: + first: + name: _DetailNormalMapScale + second: 1 + data: + first: + name: _UVSec + second: 0 + data: + first: + name: _EmissionScaleUI + second: 0 + data: + first: + name: _Mode + second: 0 + data: + first: + name: _Metallic + second: 0 + m_Colors: + data: + first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + data: + first: + name: _Color + second: {r: .800000012, g: .800000012, b: .800000012, a: 1} + data: + first: + name: _EmissionColorUI + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/unity/Assets/OBJ-IO/Examples/Meshes/Materials/Teapot001Mat.mat.meta b/unity/Assets/OBJ-IO/Examples/Meshes/Materials/Teapot001Mat.mat.meta new file mode 100644 index 0000000..8efb914 --- /dev/null +++ b/unity/Assets/OBJ-IO/Examples/Meshes/Materials/Teapot001Mat.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5eaa93adc3a1147b1ae7ea26b8a46fcf +timeCreated: 1428198132 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Meshes/Teapot.obj.meta b/unity/Assets/OBJ-IO/Examples/Meshes/Teapot.obj.meta index 59c470a..65b2446 100644 --- a/unity/Assets/OBJ-IO/Examples/Meshes/Teapot.obj.meta +++ b/unity/Assets/OBJ-IO/Examples/Meshes/Teapot.obj.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 53158f4ed39ed53448df438bc212f7e8 +guid: 726e28207480a432ba2dcf770769eb61 ModelImporter: - serializedVersion: 16 + serializedVersion: 18 fileIDToRecycleName: 100000: //RootNode 100002: Teapot001 @@ -19,6 +19,7 @@ ModelImporter: legacyGenerateAnimations: 4 bakeSimulation: 0 optimizeGameObjects: 0 + motionNodeName: animationCompression: 1 animationRotationError: .5 animationPositionError: .5 @@ -37,11 +38,13 @@ ModelImporter: generateSecondaryUV: 0 useFileUnits: 1 optimizeMeshForGPU: 1 + keepQuads: 0 weldVertices: 1 secondaryUVAngleDistortion: 8 secondaryUVAreaDistortion: 15.000001 secondaryUVHardAngle: 88 secondaryUVPackMargin: 4 + useFileScale: 0 tangentSpace: normalSmoothAngle: 60 splitTangentsAcrossUV: 1 @@ -64,3 +67,5 @@ ModelImporter: animationType: 0 additionalBone: 0 userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Scenes.meta b/unity/Assets/OBJ-IO/Examples/Scenes.meta index 85f95e5..51862cd 100644 --- a/unity/Assets/OBJ-IO/Examples/Scenes.meta +++ b/unity/Assets/OBJ-IO/Examples/Scenes.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 141384ae82c22db4b8422ccbe172ef08 +guid: d837c72160cd14bfabf462529eaaac0a folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity b/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity index 156264d..9f63d45 100644 Binary files a/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity and b/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity differ diff --git a/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity.meta b/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity.meta index 48a2af6..268f08e 100644 --- a/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity.meta +++ b/unity/Assets/OBJ-IO/Examples/Scenes/Example.unity.meta @@ -1,4 +1,6 @@ fileFormatVersion: 2 -guid: 8573b7b1c7256de4896b3054d17de1b7 +guid: c325936dc7adc4f3bb77f962859b15d6 DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Scripts.meta b/unity/Assets/OBJ-IO/Examples/Scripts.meta index 76c47cf..23577c8 100644 --- a/unity/Assets/OBJ-IO/Examples/Scripts.meta +++ b/unity/Assets/OBJ-IO/Examples/Scripts.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 6f612615b304fd249886c72faee156e0 +guid: 3c0d90c5589af493180ad1fefa4f0153 folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Examples/Scripts/Example.cs.meta b/unity/Assets/OBJ-IO/Examples/Scripts/Example.cs.meta index 0575581..8ad4d89 100644 --- a/unity/Assets/OBJ-IO/Examples/Scripts/Example.cs.meta +++ b/unity/Assets/OBJ-IO/Examples/Scripts/Example.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: f3ab7cfdf40b84b41a7adc35c545c226 +guid: 1e2ec9d5ccff9412aacafe3f21598101 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/LICENSE b/unity/Assets/OBJ-IO/LICENSE new file mode 100644 index 0000000..e06d208 --- /dev/null +++ b/unity/Assets/OBJ-IO/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/unity/Assets/OBJ-IO/LICENSE.meta b/unity/Assets/OBJ-IO/LICENSE.meta new file mode 100644 index 0000000..7cac496 --- /dev/null +++ b/unity/Assets/OBJ-IO/LICENSE.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 01af7275c3b304df09fd1eff7782c52f +timeCreated: 1428198128 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins.meta b/unity/Assets/OBJ-IO/Plugins.meta index 4870cb1..efe2b60 100644 --- a/unity/Assets/OBJ-IO/Plugins.meta +++ b/unity/Assets/OBJ-IO/Plugins.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 0a5ac41a41be22246b94c47885410104 +guid: 516c0f372429c43a7a8749f40c66c91d folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension.meta b/unity/Assets/OBJ-IO/Plugins/Extension.meta index 5639c82..ab236ea 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 8c1f4314c6ab61442aeeb22e185f3614 +guid: 35f34ecbf995944519d1c3946461c536 folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/GameObjectExtension.cs.meta b/unity/Assets/OBJ-IO/Plugins/Extension/GameObjectExtension.cs.meta index 30e3794..c36c7ba 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/GameObjectExtension.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension/GameObjectExtension.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 35b132c59c7910c4b99e560a0f9baf95 +guid: 922ffbce745934bb28921ad83b9bbafb MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs b/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs index e8b117a..ab322fe 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs +++ b/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs @@ -163,7 +163,7 @@ public static OBJData EncodeOBJ(this Mesh lMesh) m_Vertices = new List(lMesh.vertices), m_UVs = new List(lMesh.uv), m_Normals = new List(lMesh.normals), - m_UV2s = new List(lMesh.uv1), + m_UV2s = new List(lMesh.uv2), m_Colors = new List(lMesh.colors) }; @@ -299,7 +299,7 @@ public static bool LoadBinary(this Mesh lMesh, byte[] lData) Marshal.Copy(lData, lDataOffset, lHandle.AddrOfPinnedObject(), lDeltaOffset); lHandle.Free(); lDataOffset += lDeltaOffset; - lMesh.uv1 = lUVs; + lMesh.uv2 = lUVs; Debug.Log("UV1 Count : " + lUVs.Length); lUVs = null; } @@ -463,7 +463,7 @@ public static byte[] EncodeBinary(this Mesh lMesh) lUVs = null; // UV Channel 1 - lUVs = lMesh.uv1; + lUVs = lMesh.uv2; if (lUVs.Length > 0) { lUV1Flag = true; diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs.meta b/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs.meta index c9ff685..9971f71 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension/MeshExtension.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: a643d266ae55c8845ac48528640b7e8e +guid: d29be4e9040d24c388a09c305e45cc89 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/StringExtensions.cs.meta b/unity/Assets/OBJ-IO/Plugins/Extension/StringExtensions.cs.meta index b911e8c..c18ae77 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/StringExtensions.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension/StringExtensions.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 5403d11ff2ec0124a9a20522559dfcfa +guid: df7a8256a715f4b82b30f994f88a5b84 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/Texture2DExtension.cs.meta b/unity/Assets/OBJ-IO/Plugins/Extension/Texture2DExtension.cs.meta index 9b0d439..fa08ae8 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/Texture2DExtension.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension/Texture2DExtension.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 9260066d99f960241b2a222401bcb685 +guid: da8ad03357fad477da9ebb4f7d39e1ed MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/TransformExtension.cs.meta b/unity/Assets/OBJ-IO/Plugins/Extension/TransformExtension.cs.meta index 6075523..709f986 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/TransformExtension.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension/TransformExtension.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: a8e76b9c1894ec743ae076720e775f49 +guid: a2e6c288a3dd0464aaf1927925a46e68 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/UnityExtension.cs.meta b/unity/Assets/OBJ-IO/Plugins/Extension/UnityExtension.cs.meta index 2d06f8a..127e4e4 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/UnityExtension.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension/UnityExtension.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 06a010ef6a1e94840a51827a2a02badc +guid: c0691a96323364f4393d63f3bcf6ed19 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Extension/VectorExtension.cs.meta b/unity/Assets/OBJ-IO/Plugins/Extension/VectorExtension.cs.meta index 6c446b2..3ecbfa4 100644 --- a/unity/Assets/OBJ-IO/Plugins/Extension/VectorExtension.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Extension/VectorExtension.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 18a26dda21abdf5468d5731a6dbd26c4 +guid: d0f0acfd31e1c422491ea1b7725d82d4 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh.meta b/unity/Assets/OBJ-IO/Plugins/Mesh.meta index 6d5a2e1..8476138 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: da432757bf963174d97e5319c45db1dc +guid: 0fd6f5349c3ae434493614537f2f5764 folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ.meta b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ.meta index 218f11f..6b0df79 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: f74fe5c4c28267845b900549b670af26 +guid: a3463bfaa762e4f2f8ba11a8ac40ab59 folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJData.cs.meta b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJData.cs.meta index e9c7d65..ab980b5 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJData.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJData.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 5c57f7fdab36a3f4d9d97f4785a884f6 +guid: 258a2ad8742224a6d874884fdb0f8b72 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFace.cs.meta b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFace.cs.meta index 2be93ac..4003757 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFace.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFace.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 07402f6cbfe2d0e40ab4d7363cb0ed64 +guid: fc4b69131377e461bbc1a54c5ed9aa2a MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs index b31a918..0ec2995 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs @@ -20,6 +20,6 @@ public override bool Equals(object obj) && m_UVIndex == faceVertex.m_UVIndex && m_UV2Index == faceVertex.m_UV2Index && m_NormalIndex == faceVertex.m_NormalIndex - && m_ColorIndex == m_ColorIndex; + && m_ColorIndex == faceVertex.m_ColorIndex; } -} \ No newline at end of file +} diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs.meta b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs.meta index 2278e77..e83c395 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJFaceVertex.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 1f5cff977d3365a4f9f33933bb603037 +guid: 780a1b02c15904ebe8e4a311d551a423 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJGroup.cs.meta b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJGroup.cs.meta index 7bafc0e..c8827c1 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJGroup.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJGroup.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 8508b6de42212c84ebaec559aed6c7b6 +guid: b73631cec7ae341e881eb11738ac682a MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs index 7d2d1dc..f746b88 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs @@ -38,26 +38,26 @@ public class OBJLoader }; //------------------------------------------------------------------------------------------------------------ - private static readonly Dictionary> m_ParseMTLActionDictionary = new Dictionary> - { - { "newmtl", PushOBJMaterial }, - { "Ka", (lEntry) => { m_CurrentMaterial.m_AmbientColor = Utils.ParseVector3String(lEntry).ToColor(); } }, - { "Kd", (lEntry) => { m_CurrentMaterial.m_DiffuseColor = Utils.ParseVector3String(lEntry).ToColor(); } }, - { "Ks", (lEntry) => { m_CurrentMaterial.m_SpecularColor = Utils.ParseVector3String(lEntry).ToColor(); } }, - { "Ns", (lEntry) => { m_CurrentMaterial.m_SpecularCoefficient = lEntry.ParseInvariantFloat(); } }, - { "d", (lEntry) => { m_CurrentMaterial.m_Transparency = lEntry.ParseInvariantFloat(); } }, - { "Tr", (lEntry) => { m_CurrentMaterial.m_Transparency = lEntry.ParseInvariantFloat(); } }, - { "illum", (lEntry) => { m_CurrentMaterial.m_IlluminationModel = lEntry.ParseInvariantInt(); } }, - { "map_Ka", (lEntry) => { m_CurrentMaterial.m_AmbientTextureMap = lEntry; } }, - { "map_Kd", (lEntry) => { m_CurrentMaterial.m_DiffuseTextureMap = lEntry; } }, - { "map_Ks", (lEntry) => { m_CurrentMaterial.m_SpecularTextureMap = lEntry; } }, - { "map_Ns", (lEntry) => { m_CurrentMaterial.m_SpecularHighlightTextureMap = lEntry; } }, - { "map_d", (lEntry) => { m_CurrentMaterial.m_AlphaTextureMap = lEntry; } }, - { "map_bump", (lEntry) => { m_CurrentMaterial.m_BumpMap = lEntry; } }, - { "bump", (lEntry) => { m_CurrentMaterial.m_BumpMap = lEntry; } }, - { "disp", (lEntry) => { m_CurrentMaterial.m_DisplacementMap = lEntry; } }, - { "decal",(lEntry) => { m_CurrentMaterial.m_StencilDecalMap = lEntry; } }, - }; + // private static readonly Dictionary> m_ParseMTLActionDictionary = new Dictionary> + // { + // { "newmtl", PushOBJMaterial }, + // { "Ka", (lEntry) => { m_CurrentMaterial.m_AmbientColor = Utils.ParseVector3String(lEntry).ToColor(); } }, + // { "Kd", (lEntry) => { m_CurrentMaterial.m_DiffuseColor = Utils.ParseVector3String(lEntry).ToColor(); } }, + // { "Ks", (lEntry) => { m_CurrentMaterial.m_SpecularColor = Utils.ParseVector3String(lEntry).ToColor(); } }, + // { "Ns", (lEntry) => { m_CurrentMaterial.m_SpecularCoefficient = lEntry.ParseInvariantFloat(); } }, + // { "d", (lEntry) => { m_CurrentMaterial.m_Transparency = lEntry.ParseInvariantFloat(); } }, + // { "Tr", (lEntry) => { m_CurrentMaterial.m_Transparency = lEntry.ParseInvariantFloat(); } }, + // { "illum", (lEntry) => { m_CurrentMaterial.m_IlluminationModel = lEntry.ParseInvariantInt(); } }, + // { "map_Ka", (lEntry) => { m_CurrentMaterial.m_AmbientTextureMap = lEntry; } }, + // { "map_Kd", (lEntry) => { m_CurrentMaterial.m_DiffuseTextureMap = lEntry; } }, + // { "map_Ks", (lEntry) => { m_CurrentMaterial.m_SpecularTextureMap = lEntry; } }, + // { "map_Ns", (lEntry) => { m_CurrentMaterial.m_SpecularHighlightTextureMap = lEntry; } }, + // { "map_d", (lEntry) => { m_CurrentMaterial.m_AlphaTextureMap = lEntry; } }, + // { "map_bump", (lEntry) => { m_CurrentMaterial.m_BumpMap = lEntry; } }, + // { "bump", (lEntry) => { m_CurrentMaterial.m_BumpMap = lEntry; } }, + // { "disp", (lEntry) => { m_CurrentMaterial.m_DisplacementMap = lEntry; } }, + // { "decal",(lEntry) => { m_CurrentMaterial.m_StencilDecalMap = lEntry; } }, + // }; #endregion @@ -216,4 +216,4 @@ private static void PushOBJFace(string lFaceLine) m_CurrentGroup.AddFace(face); } -} \ No newline at end of file +} diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs.meta b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs.meta index 8b6563d..2a50a63 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJLoader.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: bda02739f6fbaeb4c8c3da925164b8cf +guid: 8988b7765bc8848ad9cc014f2dc24dc1 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJMaterial.cs.meta b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJMaterial.cs.meta index 1498dc6..19cc575 100644 --- a/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJMaterial.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Mesh/OBJ/OBJMaterial.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: ceb2526c78b78c04592f312a4e65ec95 +guid: f48ae8c540e53442aa64567f17b19c4f MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Utils.meta b/unity/Assets/OBJ-IO/Plugins/Utils.meta index ea4d218..772ecae 100644 --- a/unity/Assets/OBJ-IO/Plugins/Utils.meta +++ b/unity/Assets/OBJ-IO/Plugins/Utils.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 94cd99f1df5fafa489e641d039f97273 +guid: 647b710cf66ab4166a87333ea326482a folderAsset: yes DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Plugins/Utils/Int32Converter.cs.meta b/unity/Assets/OBJ-IO/Plugins/Utils/Int32Converter.cs.meta index 641cf16..f189d54 100644 --- a/unity/Assets/OBJ-IO/Plugins/Utils/Int32Converter.cs.meta +++ b/unity/Assets/OBJ-IO/Plugins/Utils/Int32Converter.cs.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 2980235c1e3576a4ab7dca278af19308 +guid: e7cd059831df7451e9dca68dccc80a09 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/Assets/OBJ-IO/Readme.txt.meta b/unity/Assets/OBJ-IO/Readme.txt.meta index b1fc361..79f3e3a 100644 --- a/unity/Assets/OBJ-IO/Readme.txt.meta +++ b/unity/Assets/OBJ-IO/Readme.txt.meta @@ -1,4 +1,6 @@ fileFormatVersion: 2 -guid: e1f277bf041647445ac3bf5b643a46fe +guid: 98cadef99c27849dcb96875e62c7008c TextScriptImporter: userData: + assetBundleName: + assetBundleVariant: