mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-11 17:09:01 +08:00
Reviewed README, added RELEASE, and refactored project structure
This commit is contained in:
parent
c46c5c9a5d
commit
ade1bc6793
1
maya/.gitignore
vendored
1
maya/.gitignore
vendored
@ -1 +1,2 @@
|
||||
__pycache__/
|
||||
*.pyc
|
@ -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.
|
||||
|
15
maya/RELEASE.md
Normal file
15
maya/RELEASE.md
Normal 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
|
||||
|
@ -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
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
Loading…
x
Reference in New Issue
Block a user