Reviewed README, added RELEASE, and refactored project structure

This commit is contained in:
Federico De Felici 2018-05-19 10:52:04 +02:00
parent c46c5c9a5d
commit ade1bc6793
22 changed files with 43 additions and 21 deletions

3
maya/.gitignore vendored
View File

@ -1 +1,2 @@
__pycache__/ __pycache__/
*.pyc

View File

@ -1,32 +1,38 @@
# Description # Description
Plugin which add support for Draco files (.drc) in Autodesk Maya. Plugin to add support for Draco files (.drc) in Autodesk Maya.
# Features # Features
The following feature are offered: The following `features` are offered:
* Support .drc format: TRIANGULAR MESH (no POINT CLOUD) * Support .drc format: TRIANGULAR MESH (no POINT CLOUD)
* Import .drc file into Maya by Import menu * Import .drc file into Maya by "Import menu" and "Drag & Drop"
* Import .drc file into Maya by Drag & Drop * Export from Maya into .drc file by "Export Selection menu"
* Export from Maya into .drc file by Export Selection menu
With the following contraints: With the following `constraints`:
* Import attributes limited to: Vertices, Normals and Uvs * 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 # Supported OS / Maya Version
Currently the plugin works on the following OS: Currently the plugin has been built for the following `OS`:
* Windows x64 * Windows x64
and tested against Maya versions: and tested against Maya versions:
* Maya 2017 * Maya 2017
* Maya 2018 * Maya 2018
# Installation | Note: if you want you can build the plugin for your `OS / architecture`. Refer to `Build from Sources` section
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
# Installation
## On Windows
1. Copy the folder `draco_maya` under Maya pluging folder.
| E.g.: C:\Users\<USER>\Documents\maya\<VERSION>\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 # Usage
Use the regular Maya import/export functionalities Use the regular Maya Import/Export functionalities.
# Build From Source # 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. 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.

15
maya/RELEASE.md Normal file
View File

@ -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

View File

@ -2,7 +2,7 @@ import unittest
import os import os
import sys import sys
dir_path = os.path.dirname(os.path.realpath(__file__)) 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) sys.path.insert(0, root_path)
def file_del(file_path): def file_del(file_path):
@ -18,7 +18,7 @@ class DracoTest(unittest.TestCase):
self.drc = Draco() self.drc = Draco()
def test_decode_bunny_drc(self): 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 # Faces check
self.assertEqual(69451, mesh.faces_num, 'Number of faces') self.assertEqual(69451, mesh.faces_num, 'Number of faces')
self.assertEqual(208353, mesh.faces_len,'Length of faces array precalculated') 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') self.assertEqual(0, len(mesh.uvs),'Length of uvs array by len')
def test_decode_trooper_drc(self): 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 # Faces check
self.assertEqual(6518, mesh.faces_num, 'Number of faces') self.assertEqual(6518, mesh.faces_num, 'Number of faces')
self.assertEqual(19554, mesh.faces_len,'Length of faces array precalculated') 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') self.assertEqual(10352, len(mesh.uvs), 'Length of uvs array by len')
def test_decode_unexistent_drc(self): 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): def test_encode_triangle_mesh(self):
mesh = DrcMesh() mesh = DrcMesh()
@ -79,7 +79,7 @@ class DracoTest(unittest.TestCase):
mesh.faces_num = 1 mesh.faces_num = 1
mesh.vertices = [0, 0, 0, 1, 1, 1, 2, 2, 2] mesh.vertices = [0, 0, 0, 1, 1, 1, 2, 2, 2]
mesh.vertices_num = 3 mesh.vertices_num = 3
file = os.path.join(dir_path,'triangle.drc') file = os.path.join(dir_path, 'res/triangle.drc')
file_del(file) file_del(file)
self.drc.encode(mesh, file) self.drc.encode(mesh, file)
@ -97,9 +97,9 @@ class DracoTest(unittest.TestCase):
def test_decode_and_encode_stoormtrup_drc(self): def test_decode_and_encode_stoormtrup_drc(self):
# Step1: decode # 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 # Step2: encode
file = os.path.join(dir_path,'stormtrooper_copy.drc') file = os.path.join(dir_path, 'res/stormtrooper_copy.drc')
file_del(file) file_del(file)
self.drc.encode(mesh, file) self.drc.encode(mesh, file)
# Step3: re-decode and test # Step3: re-decode and test

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB