diff --git a/maya/.gitignore b/maya/.gitignore index ba0430d..7bfcd7a 100644 --- a/maya/.gitignore +++ b/maya/.gitignore @@ -1 +1,2 @@ -__pycache__/ \ No newline at end of file +__pycache__/ +*.pyc \ No newline at end of file diff --git a/maya/README.md b/maya/README.md index 830fe63..755e0f1 100644 --- a/maya/README.md +++ b/maya/README.md @@ -1,32 +1,38 @@ # Description -Plugin which add support for Draco files (.drc) in Autodesk Maya. +Plugin to add support for Draco files (.drc) in Autodesk Maya. # Features -The following feature are offered: +The following `features` are offered: * Support .drc format: TRIANGULAR MESH (no POINT CLOUD) -* Import .drc file into Maya by Import menu -* Import .drc file into Maya by Drag & Drop -* Export from Maya into .drc file by Export Selection menu +* Import .drc file into Maya by "Import menu" and "Drag & Drop" +* Export from Maya into .drc file by "Export Selection menu" -With the following contraints: -* Import attributes limited to: Vertices, Normals and Uvs +With the following `constraints`: +* Import feature is limited to attributes: Vertices, Normals and Uvs +* Export feature is limited to attributes: Vertices, Normals and Uvs +* Meshes has to be made of Triangular Polygons + +| Read [Release doc](./RELEASE.md) for details about what is implemented and what will be done next. # Supported OS / Maya Version -Currently the plugin works on the following OS: +Currently the plugin has been built for the following `OS`: * Windows x64 and tested against Maya versions: * Maya 2017 * Maya 2018 -# Installation -Copy the files draco_maya_plugin.py, draco_maya_wrapper.py and draco_maya_wrapper.dll in the appropriate maya folder -For example on Windows C:\Users\username\Documents\maya\2018\plug-ins for Maya 2018 +| Note: if you want you can build the plugin for your `OS / architecture`. Refer to `Build from Sources` section +# Installation +## On Windows +1. Copy the folder `draco_maya` under Maya pluging folder. +| E.g.: C:\Users\\Documents\maya\\plug-ins +2. Open Maya go to menu: `Windows -> Settings\Preferences -> Plug-in Manager` +3. Use `Browse` button, point to `draco_maya` folder and select `draco_maya_plugin.py` as plugin file # Usage -Use the regular Maya import/export functionalities - +Use the regular Maya Import/Export functionalities. # Build From Source You can build the plugins on your own for OSX/Win/Linux. Source code for the wrapper is here: [src/draco/maya/](../src/draco/maya). Following is detailed building instruction. diff --git a/maya/RELEASE.md b/maya/RELEASE.md new file mode 100644 index 0000000..960bad4 --- /dev/null +++ b/maya/RELEASE.md @@ -0,0 +1,15 @@ +# Next Features +* Add Support for Mesh Vertex Color attribute +* Add possibility to tweak Draco Export settings from Maya +* Include binaries for Mac OS +* Include binaries for Linux + +# Relase v0.0.1 +* Support .drc format: TRIANGULAR MESH (no POINT CLOUD) +* Import .drc file into Maya by "Import menu" and "Drag & Drop" +* Export from Maya into .drc file by "Export Selection menu" +* Export is done using default draco settings +* Handling Mesh made of Tringular Meshes +* Mesh attributes supported: Vertices, Normals and Uvs +* Plugin built for Windows x64 + diff --git a/maya/draco_maya_plugin.py b/maya/draco_maya/draco_maya_plugin.py similarity index 100% rename from maya/draco_maya_plugin.py rename to maya/draco_maya/draco_maya_plugin.py diff --git a/maya/draco_maya_wrapper.dll b/maya/draco_maya/draco_maya_wrapper.dll similarity index 100% rename from maya/draco_maya_wrapper.dll rename to maya/draco_maya/draco_maya_wrapper.dll diff --git a/maya/draco_maya_wrapper.py b/maya/draco_maya/draco_maya_wrapper.py similarity index 100% rename from maya/draco_maya_wrapper.py rename to maya/draco_maya/draco_maya_wrapper.py diff --git a/maya/test/draco_decoder.exe b/maya/draco_maya_tests/bin/draco_decoder.exe similarity index 100% rename from maya/test/draco_decoder.exe rename to maya/draco_maya_tests/bin/draco_decoder.exe diff --git a/maya/test/draco_encoder.exe b/maya/draco_maya_tests/bin/draco_encoder.exe similarity index 100% rename from maya/test/draco_encoder.exe rename to maya/draco_maya_tests/bin/draco_encoder.exe diff --git a/maya/test/draco_maya_wrapper_test.py b/maya/draco_maya_tests/draco_maya_wrapper_test.py similarity index 90% rename from maya/test/draco_maya_wrapper_test.py rename to maya/draco_maya_tests/draco_maya_wrapper_test.py index 881f64a..f37ad7f 100644 --- a/maya/test/draco_maya_wrapper_test.py +++ b/maya/draco_maya_tests/draco_maya_wrapper_test.py @@ -2,7 +2,7 @@ import unittest import os import sys dir_path = os.path.dirname(os.path.realpath(__file__)) -root_path = os.path.join(dir_path, '..') +root_path = os.path.join(dir_path, '../draco_maya') sys.path.insert(0, root_path) def file_del(file_path): @@ -18,7 +18,7 @@ class DracoTest(unittest.TestCase): self.drc = Draco() def test_decode_bunny_drc(self): - mesh = self.drc.decode(os.path.join(dir_path, 'bunny.drc')) + mesh = self.drc.decode(os.path.join(dir_path, 'res/bunny.drc')) # Faces check self.assertEqual(69451, mesh.faces_num, 'Number of faces') self.assertEqual(208353, mesh.faces_len,'Length of faces array precalculated') @@ -37,7 +37,7 @@ class DracoTest(unittest.TestCase): self.assertEqual(0, len(mesh.uvs),'Length of uvs array by len') def test_decode_trooper_drc(self): - mesh = self.drc.decode(os.path.join(dir_path, 'stormtrooper.drc')) + mesh = self.drc.decode(os.path.join(dir_path, 'res/stormtrooper.drc')) # Faces check self.assertEqual(6518, mesh.faces_num, 'Number of faces') self.assertEqual(19554, mesh.faces_len,'Length of faces array precalculated') @@ -56,7 +56,7 @@ class DracoTest(unittest.TestCase): self.assertEqual(10352, len(mesh.uvs), 'Length of uvs array by len') def test_decode_unexistent_drc(self): - self.assertRaises(Exception, self.drc.decode, 'unexistent.drc') + self.assertRaises(Exception, self.drc.decode, 'res/unexistent.drc') def test_encode_triangle_mesh(self): mesh = DrcMesh() @@ -79,7 +79,7 @@ class DracoTest(unittest.TestCase): mesh.faces_num = 1 mesh.vertices = [0, 0, 0, 1, 1, 1, 2, 2, 2] mesh.vertices_num = 3 - file = os.path.join(dir_path,'triangle.drc') + file = os.path.join(dir_path, 'res/triangle.drc') file_del(file) self.drc.encode(mesh, file) @@ -97,9 +97,9 @@ class DracoTest(unittest.TestCase): def test_decode_and_encode_stoormtrup_drc(self): # Step1: decode - mesh = self.drc.decode(os.path.join(dir_path, 'stormtrooper.drc')) + mesh = self.drc.decode(os.path.join(dir_path, 'res/stormtrooper.drc')) # Step2: encode - file = os.path.join(dir_path,'stormtrooper_copy.drc') + file = os.path.join(dir_path, 'res/stormtrooper_copy.drc') file_del(file) self.drc.encode(mesh, file) # Step3: re-decode and test diff --git a/maya/test/bunny.drc b/maya/draco_maya_tests/res/bunny.drc similarity index 100% rename from maya/test/bunny.drc rename to maya/draco_maya_tests/res/bunny.drc diff --git a/maya/test/bunny.obj b/maya/draco_maya_tests/res/bunny.obj similarity index 100% rename from maya/test/bunny.obj rename to maya/draco_maya_tests/res/bunny.obj diff --git a/maya/test/bunny_uv.drc b/maya/draco_maya_tests/res/bunny_uv.drc similarity index 100% rename from maya/test/bunny_uv.drc rename to maya/draco_maya_tests/res/bunny_uv.drc diff --git a/maya/test/bunny_uv.obj b/maya/draco_maya_tests/res/bunny_uv.obj similarity index 100% rename from maya/test/bunny_uv.obj rename to maya/draco_maya_tests/res/bunny_uv.obj diff --git a/maya/test/cube.drc b/maya/draco_maya_tests/res/cube.drc similarity index 100% rename from maya/test/cube.drc rename to maya/draco_maya_tests/res/cube.drc diff --git a/maya/test/cube.obj b/maya/draco_maya_tests/res/cube.obj similarity index 100% rename from maya/test/cube.obj rename to maya/draco_maya_tests/res/cube.obj diff --git a/maya/test/dragon.drc b/maya/draco_maya_tests/res/dragon.drc similarity index 100% rename from maya/test/dragon.drc rename to maya/draco_maya_tests/res/dragon.drc diff --git a/maya/test/dragon.obj b/maya/draco_maya_tests/res/dragon.obj similarity index 100% rename from maya/test/dragon.obj rename to maya/draco_maya_tests/res/dragon.obj diff --git a/maya/test/stormtrooper.drc b/maya/draco_maya_tests/res/stormtrooper.drc similarity index 100% rename from maya/test/stormtrooper.drc rename to maya/draco_maya_tests/res/stormtrooper.drc diff --git a/maya/test/stormtrooper.obj b/maya/draco_maya_tests/res/stormtrooper.obj similarity index 100% rename from maya/test/stormtrooper.obj rename to maya/draco_maya_tests/res/stormtrooper.obj diff --git a/maya/test/stormtrooper.png b/maya/draco_maya_tests/res/stormtrooper.png similarity index 100% rename from maya/test/stormtrooper.png rename to maya/draco_maya_tests/res/stormtrooper.png diff --git a/maya/test/trig.drc b/maya/draco_maya_tests/res/trig.drc similarity index 100% rename from maya/test/trig.drc rename to maya/draco_maya_tests/res/trig.drc diff --git a/maya/test/trig.obj b/maya/draco_maya_tests/res/trig.obj similarity index 100% rename from maya/test/trig.obj rename to maya/draco_maya_tests/res/trig.obj