Skip to content

Commit

Permalink
Added draco compression format by extending tiny-gltf
Browse files Browse the repository at this point in the history
  • Loading branch information
toshiks committed Sep 14, 2019
1 parent 46d316a commit 1418220
Show file tree
Hide file tree
Showing 16 changed files with 1,094 additions and 309 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "GLTFKit"]
path = GLTFKit
url = https://github.com/warrenm/GLTFKit.git
[submodule "tinygltf"]
path = tinygltf
url = https://github.com/syoyo/tinygltf.git
1 change: 0 additions & 1 deletion GLTFKit
Submodule GLTFKit deleted from 0f4b7c
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,35 @@
![status](https://img.shields.io/badge/glTF-2%2E0-green.svg?style=flat)
[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/toshiks/glTF-quicklook/blob/master/LICENSE)

Simple QuickLook plugin for previewing gltf-files on macOS
Simple QuickLook plugin for previewing gltf-files on macOS.

## Status

v1.0 release(3 Dec, 2018)
v1.1 release(14 Sep, 2019)

## Features
* glTF specification v2.0.0
* Draco compression format
* Animations (not for Draco compression format)
* Textures

## System Requirements

- macOS 10.13 (High Sierra) or later
- installed [Draco compression library](https://github.com/google/draco)

## Install

### Manually

1. Download **glTF-qucklook_vX.X.zip** from [Releases](https://github.com/toshiks/glTF-quicklook/releases/latest).
2. Put **glTF-qucklook.qlgenerator** from zip file into
1. In terminal run command: brew install draco@1.3.5
2. Download **glTF-qucklook_vX.X.zip** from [Releases](https://github.com/toshiks/glTF-quicklook/releases/latest).
3. Put **glTF-qucklook.qlgenerator** from zip file into
1. `/Library/QuickLook` - for all users;
2. `~/Library/QuickLook` - only for the logged-in user.
3. Run `qlmanage -r` command to reload QuickLook plugins.
4. Run `qlmanage -r` command to reload QuickLook plugins.



## Licenses

Expand Down
128 changes: 43 additions & 85 deletions glTF-quicklook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,22 @@
2744673121B1F39100E8338E /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744673021B1F39100E8338E /* GenerateThumbnailForURL.m */; };
2744673321B1F39100E8338E /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744673221B1F39100E8338E /* GeneratePreviewForURL.m */; };
2744673521B1F39100E8338E /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 2744673421B1F39100E8338E /* main.c */; };
2744674C21B1F95A00E8338E /* GLTF.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2744674521B1F94300E8338E /* GLTF.framework */; };
2744674D21B1F95F00E8338E /* GLTFSCN.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2744674B21B1F95100E8338E /* GLTFSCN.framework */; };
2744674F21B1FA1900E8338E /* GLTFSCN.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2744674B21B1F95100E8338E /* GLTFSCN.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2744675021B1FA1900E8338E /* GLTF.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2744674521B1F94300E8338E /* GLTF.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
27C37BC421B367FE008CF713 /* GLTFErrorCheckerByJSON.mm in Sources */ = {isa = PBXBuildFile; fileRef = 27C37BC221B367FE008CF713 /* GLTFErrorCheckerByJSON.mm */; };
27C37BC521B367FE008CF713 /* GLTFErrorCheckerByJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 27C37BC321B367FE008CF713 /* GLTFErrorCheckerByJSON.h */; };
27C37BD421B38688008CF713 /* GLTFErrorCheckerByScenes.h in Headers */ = {isa = PBXBuildFile; fileRef = 27C37BD221B38688008CF713 /* GLTFErrorCheckerByScenes.h */; };
27C37BD521B38688008CF713 /* GLTFErrorCheckerByScenes.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C37BD321B38688008CF713 /* GLTFErrorCheckerByScenes.m */; };
27BDD5C7232D26F400D0A2F1 /* TinyGLTFSCN.h in Headers */ = {isa = PBXBuildFile; fileRef = 27BDD5C5232D26F400D0A2F1 /* TinyGLTFSCN.h */; };
27BDD5C8232D26F400D0A2F1 /* TinyGLTFSCN.mm in Sources */ = {isa = PBXBuildFile; fileRef = 27BDD5C6232D26F400D0A2F1 /* TinyGLTFSCN.mm */; };
27BDD5CC232D292800D0A2F1 /* libdracodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27BDD5C9232D292700D0A2F1 /* libdracodec.a */; };
27BDD5CD232D292800D0A2F1 /* libdraco.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27BDD5CA232D292700D0A2F1 /* libdraco.a */; };
27BDD5CE232D292800D0A2F1 /* libdracoenc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27BDD5CB232D292800D0A2F1 /* libdracoenc.a */; };
27BDD5D1232D31E000D0A2F1 /* GLTFSCNAnimationTargetPair.h in Headers */ = {isa = PBXBuildFile; fileRef = 27BDD5CF232D31E000D0A2F1 /* GLTFSCNAnimationTargetPair.h */; };
27BDD5D4232D6EB900D0A2F1 /* GLTFSCNAnimationTargetPair.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BDD5D3232D6EB900D0A2F1 /* GLTFSCNAnimationTargetPair.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
2744674421B1F94300E8338E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2744674021B1F94300E8338E /* GLTF.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 83D6FF481F48BB3A00F71E0C;
remoteInfo = GLTF;
};
2744674A21B1F95100E8338E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2744674621B1F95100E8338E /* GLTFSCN.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 83A2D6E91F9961AC00FB8874;
remoteInfo = GLTFSCN;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
2744674E21B1FA1100E8338E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
2744674F21B1FA1900E8338E /* GLTFSCN.framework in CopyFiles */,
2744675021B1FA1900E8338E /* GLTF.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -79,25 +59,27 @@
2744673221B1F39100E8338E /* GeneratePreviewForURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GeneratePreviewForURL.m; sourceTree = "<group>"; };
2744673421B1F39100E8338E /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
2744673621B1F39100E8338E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2744674021B1F94300E8338E /* GLTF.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GLTF.xcodeproj; path = GLTFKit/Framework/GLTF/GLTF.xcodeproj; sourceTree = "<group>"; };
2744674621B1F95100E8338E /* GLTFSCN.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GLTFSCN.xcodeproj; path = GLTFKit/Framework/GLTFSCN/GLTFSCN.xcodeproj; sourceTree = "<group>"; };
27C37BC221B367FE008CF713 /* GLTFErrorCheckerByJSON.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GLTFErrorCheckerByJSON.mm; sourceTree = "<group>"; };
27C37BC321B367FE008CF713 /* GLTFErrorCheckerByJSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLTFErrorCheckerByJSON.h; sourceTree = "<group>"; };
27C37BD221B38688008CF713 /* GLTFErrorCheckerByScenes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLTFErrorCheckerByScenes.h; sourceTree = "<group>"; };
27C37BD321B38688008CF713 /* GLTFErrorCheckerByScenes.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GLTFErrorCheckerByScenes.m; sourceTree = "<group>"; };
27BDD5C5232D26F400D0A2F1 /* TinyGLTFSCN.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TinyGLTFSCN.h; sourceTree = "<group>"; };
27BDD5C6232D26F400D0A2F1 /* TinyGLTFSCN.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TinyGLTFSCN.mm; sourceTree = "<group>"; };
27BDD5C9232D292700D0A2F1 /* libdracodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdracodec.a; path = ../../../../usr/local/Cellar/draco/1.3.5/lib/libdracodec.a; sourceTree = "<group>"; };
27BDD5CA232D292700D0A2F1 /* libdraco.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdraco.a; path = ../../../../usr/local/Cellar/draco/1.3.5/lib/libdraco.a; sourceTree = "<group>"; };
27BDD5CB232D292800D0A2F1 /* libdracoenc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdracoenc.a; path = ../../../../usr/local/Cellar/draco/1.3.5/lib/libdracoenc.a; sourceTree = "<group>"; };
27BDD5CF232D31E000D0A2F1 /* GLTFSCNAnimationTargetPair.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLTFSCNAnimationTargetPair.h; sourceTree = "<group>"; };
27BDD5D3232D6EB900D0A2F1 /* GLTFSCNAnimationTargetPair.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GLTFSCNAnimationTargetPair.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
2744672A21B1F39100E8338E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
27BDD5CC232D292800D0A2F1 /* libdracodec.a in Frameworks */,
27BDD5CD232D292800D0A2F1 /* libdraco.a in Frameworks */,
27BDD5CE232D292800D0A2F1 /* libdracoenc.a in Frameworks */,
2707800821B5C9140081C27D /* json.hpp in Frameworks */,
2707800921B5C9140081C27D /* stb_image.h in Frameworks */,
2707800A21B5C9140081C27D /* stb_image_write.h in Frameworks */,
2707800B21B5C9140081C27D /* tiny_gltf.h in Frameworks */,
2744674D21B1F95F00E8338E /* GLTFSCN.framework in Frameworks */,
2744674C21B1F95A00E8338E /* GLTF.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -133,14 +115,11 @@
2744672F21B1F39100E8338E /* glTF-quicklook */ = {
isa = PBXGroup;
children = (
27BDD5C2232D26AA00D0A2F1 /* TinyGLTFSCN */,
2744673021B1F39100E8338E /* GenerateThumbnailForURL.m */,
2744673221B1F39100E8338E /* GeneratePreviewForURL.m */,
2744673421B1F39100E8338E /* main.c */,
2744673621B1F39100E8338E /* Info.plist */,
27C37BC221B367FE008CF713 /* GLTFErrorCheckerByJSON.mm */,
27C37BC321B367FE008CF713 /* GLTFErrorCheckerByJSON.h */,
27C37BD221B38688008CF713 /* GLTFErrorCheckerByScenes.h */,
27C37BD321B38688008CF713 /* GLTFErrorCheckerByScenes.m */,
27077F9321B58C0D0081C27D /* SceneGenerator.h */,
27077F9421B58C0D0081C27D /* SceneGenerator.m */,
27077FCF21B5AE330081C27D /* ThumbnailGenerator.h */,
Expand All @@ -154,30 +133,26 @@
2744673F21B1F94300E8338E /* Frameworks */ = {
isa = PBXGroup;
children = (
27BDD5CA232D292700D0A2F1 /* libdraco.a */,
27BDD5C9232D292700D0A2F1 /* libdracodec.a */,
27BDD5CB232D292800D0A2F1 /* libdracoenc.a */,
2707800421B5C9140081C27D /* json.hpp */,
2707800621B5C9140081C27D /* stb_image_write.h */,
2707800521B5C9140081C27D /* stb_image.h */,
2707800721B5C9140081C27D /* tiny_gltf.h */,
2744674621B1F95100E8338E /* GLTFSCN.xcodeproj */,
2744674021B1F94300E8338E /* GLTF.xcodeproj */,
);
name = Frameworks;
sourceTree = "<group>";
};
2744674121B1F94300E8338E /* Products */ = {
isa = PBXGroup;
children = (
2744674521B1F94300E8338E /* GLTF.framework */,
);
name = Products;
sourceTree = "<group>";
};
2744674721B1F95100E8338E /* Products */ = {
27BDD5C2232D26AA00D0A2F1 /* TinyGLTFSCN */ = {
isa = PBXGroup;
children = (
2744674B21B1F95100E8338E /* GLTFSCN.framework */,
27BDD5C5232D26F400D0A2F1 /* TinyGLTFSCN.h */,
27BDD5C6232D26F400D0A2F1 /* TinyGLTFSCN.mm */,
27BDD5CF232D31E000D0A2F1 /* GLTFSCNAnimationTargetPair.h */,
27BDD5D3232D6EB900D0A2F1 /* GLTFSCNAnimationTargetPair.m */,
);
name = Products;
path = TinyGLTFSCN;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand All @@ -187,10 +162,10 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
27C37BD421B38688008CF713 /* GLTFErrorCheckerByScenes.h in Headers */,
27077FD121B5AE330081C27D /* ThumbnailGenerator.h in Headers */,
27C37BC521B367FE008CF713 /* GLTFErrorCheckerByJSON.h in Headers */,
27BDD5D1232D31E000D0A2F1 /* GLTFSCNAnimationTargetPair.h in Headers */,
27077FCD21B5A20C0081C27D /* SceneGenerator.h in Headers */,
27BDD5C7232D26F400D0A2F1 /* TinyGLTFSCN.h in Headers */,
27077FD521B5B24B0081C27D /* SCNScene+BoundingBox.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -242,40 +217,13 @@
mainGroup = 2744672321B1F39100E8338E;
productRefGroup = 2744672E21B1F39100E8338E /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 2744674121B1F94300E8338E /* Products */;
ProjectRef = 2744674021B1F94300E8338E /* GLTF.xcodeproj */;
},
{
ProductGroup = 2744674721B1F95100E8338E /* Products */;
ProjectRef = 2744674621B1F95100E8338E /* GLTFSCN.xcodeproj */;
},
);
projectRoot = "";
targets = (
2744672C21B1F39100E8338E /* glTF-quicklook */,
);
};
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
2744674521B1F94300E8338E /* GLTF.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GLTF.framework;
remoteRef = 2744674421B1F94300E8338E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2744674B21B1F95100E8338E /* GLTFSCN.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GLTFSCN.framework;
remoteRef = 2744674A21B1F95100E8338E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
2744672B21B1F39100E8338E /* Resources */ = {
isa = PBXResourcesBuildPhase;
Expand All @@ -295,11 +243,11 @@
27077FCE21B5A20C0081C27D /* SceneGenerator.m in Sources */,
2744673121B1F39100E8338E /* GenerateThumbnailForURL.m in Sources */,
27077FD221B5AE330081C27D /* ThumbnailGenerator.m in Sources */,
27C37BC421B367FE008CF713 /* GLTFErrorCheckerByJSON.mm in Sources */,
27BDD5D4232D6EB900D0A2F1 /* GLTFSCNAnimationTargetPair.m in Sources */,
2744673321B1F39100E8338E /* GeneratePreviewForURL.m in Sources */,
27077FD621B5B24B0081C27D /* SCNScene+BoundingBox.m in Sources */,
2744673521B1F39100E8338E /* main.c in Sources */,
27C37BD521B38688008CF713 /* GLTFErrorCheckerByScenes.m in Sources */,
27BDD5C8232D26F400D0A2F1 /* TinyGLTFSCN.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -428,13 +376,18 @@
CLANG_MODULES_DISABLE_PRIVATE_WARNING = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 2G28BM99HR;
DEVELOPMENT_TEAM = 9K99AL2M82;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = /usr/local/Cellar/draco/1.3.5/include;
INFOPLIST_FILE = "$(SRCROOT)/glTF-quicklook/Info.plist";
INSTALL_PATH = /Library/QuickLook;
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks/";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
/usr/local/Cellar/draco/1.3.5/lib,
);
ONLY_ACTIVE_ARCH = YES;
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = "com.ITS.glTF-quicklook";
Expand All @@ -452,13 +405,18 @@
CLANG_MODULES_DISABLE_PRIVATE_WARNING = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 2G28BM99HR;
DEVELOPMENT_TEAM = 9K99AL2M82;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = /usr/local/Cellar/draco/1.3.5/include;
INFOPLIST_FILE = "$(SRCROOT)/glTF-quicklook/Info.plist";
INSTALL_PATH = /Library/QuickLook;
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks/";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
/usr/local/Cellar/draco/1.3.5/lib,
);
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = "com.ITS.glTF-quicklook";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
19 changes: 0 additions & 19 deletions glTF-quicklook/GLTFErrorCheckerByJSON.h

This file was deleted.

Loading

0 comments on commit 1418220

Please sign in to comment.