Skip to content

Commit

Permalink
Reviewed README, added RELEASE, and refactored project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
fdefelici committed May 19, 2018
1 parent c46c5c9 commit ade1bc6
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 21 deletions.
3 changes: 2 additions & 1 deletion maya/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__/
__pycache__/
*.pyc
32 changes: 19 additions & 13 deletions maya/README.md
Original file line number Diff line number Diff line change
@@ -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\<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
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.
Expand Down
15 changes: 15 additions & 0 deletions maya/RELEASE.md
Original file line number Diff line number Diff line change
@@ -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

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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):
Expand All @@ -18,7 +18,7 @@ def setUp(self):
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')
Expand All @@ -37,7 +37,7 @@ def test_decode_bunny_drc(self):
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')
Expand All @@ -56,7 +56,7 @@ def test_decode_trooper_drc(self):
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()
Expand All @@ -79,7 +79,7 @@ def test_encode_and_decode_triangle_mesh(self):
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)

Expand All @@ -97,9 +97,9 @@ def test_encode_and_decode_triangle_mesh(self):

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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit ade1bc6

Please sign in to comment.