Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ AppPackages/
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
out/
*.diff
8 changes: 4 additions & 4 deletions IO-glTF/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

set (IOGLTF_MAJOR_VERSION 0)
set (IOGLTF_MINOR_VERSION 1)
set (IOGLTF_MAJOR_VERSION 1)
set (IOGLTF_MINOR_VERSION 0)
set (IOGLTF_PATCH_VERSION 0)
set (IOGLTF_VERSION ${IOGLTF_MAJOR_VERSION}.${IOGLTF_MINOR_VERSION}.${IOGLTF_PATCH_VERSION})

Expand All @@ -24,11 +24,11 @@ target_link_libraries (

# Support Files
file (
COPY ${CMAKE_CURRENT_SOURCE_DIR}/glTF-0-8-defaults.json
COPY ${CMAKE_CURRENT_SOURCE_DIR}/glTF-1-0-defaults.json
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
)
file (
COPY ${CMAKE_CURRENT_SOURCE_DIR}/glTF-0-8.json
COPY ${CMAKE_CURRENT_SOURCE_DIR}/glTF-1-0.json
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
)

Expand Down
12 changes: 10 additions & 2 deletions IO-glTF/IO-glTF.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</Link>
<PostBuildEvent>
<Command>copy "$(ProjectDir)*.json" "$(TargetDir)" &gt; nul
copy D:\__sdk\FBX\2015.1\lib\vs2013\x64\debug\libfbxsdk.* "$(TargetDir)" &gt; nul</Command>
copy "$(FBX_SDK)\lib\vs2013\x64\debug\libfbxsdk.*" "$(TargetDir)" &gt; nul</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -96,15 +96,17 @@ copy D:\__sdk\FBX\2015.1\lib\vs2013\x64\debug\libfbxsdk.* "$(TargetDir)" &gt; nu
</Link>
<PostBuildEvent>
<Command>copy "$(ProjectDir)*.json" "$(TargetDir)" &gt; nul
copy D:\__sdk\FBX\2015.1\lib\vs2013\x64\release\libfbxsdk.* "$(TargetDir)" &gt; nul</Command>
copy "$(FBX_SDK)\lib\vs2013\x64\release\libfbxsdk.*" "$(TargetDir)" &gt; nul</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="glslShader.h" />
<ClInclude Include="glTF.h" />
<ClInclude Include="gltfReader.h" />
<ClInclude Include="gltfWriter.h" />
<ClInclude Include="gltfwriterVBO.h" />
<ClInclude Include="IOglTF.h" />
<ClInclude Include="JsonPrettify.h" />
<ClInclude Include="memoryStream.h" />
<ClInclude Include="ns_exports.h" />
<ClInclude Include="StdAfx.h" />
Expand All @@ -122,6 +124,8 @@ copy D:\__sdk\FBX\2015.1\lib\vs2013\x64\release\libfbxsdk.* "$(TargetDir)" &gt;
</ClCompile>
<ClCompile Include="glslShader.cpp" />
<ClCompile Include="gltfReader.cpp" />
<ClCompile Include="gltfWriter-Line.cpp" />
<ClCompile Include="gltfWriter-Shaders.cpp" />
<ClCompile Include="gltfWriter-Asset.cpp" />
<ClCompile Include="gltfWriter-Buffer.cpp" />
<ClCompile Include="gltfWriter-Camera.cpp" />
Expand All @@ -134,7 +138,9 @@ copy D:\__sdk\FBX\2015.1\lib\vs2013\x64\release\libfbxsdk.* "$(TargetDir)" &gt;
<ClCompile Include="gltfWriter-Technique.cpp" />
<ClCompile Include="gltfWriter-Texture.cpp" />
<ClCompile Include="gltfWriter.cpp" />
<ClCompile Include="gltfWriterVBO.cpp" />
<ClCompile Include="IOglTF.cpp" />
<ClCompile Include="JsonPrettify.cpp" />
<ClCompile Include="StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
Expand All @@ -143,6 +149,8 @@ copy D:\__sdk\FBX\2015.1\lib\vs2013\x64\release\libfbxsdk.* "$(TargetDir)" &gt;
<ItemGroup>
<None Include="glTF-0-8-defaults.json" />
<None Include="glTF-0-8.json" />
<None Include="glTF-1-0-defaults.json" />
<None Include="glTF-1-0.json" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
24 changes: 24 additions & 0 deletions IO-glTF/IO-glTF.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
<ClInclude Include="memoryStream.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="gltfwriterVBO.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="JsonPrettify.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
Expand Down Expand Up @@ -98,6 +104,18 @@
<ClCompile Include="IOglTF.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gltfWriterVBO.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gltfWriter-Shaders.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="JsonPrettify.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gltfWriter-Line.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="glTF-0-8-defaults.json">
Expand All @@ -107,5 +125,11 @@
<Filter>Source Files</Filter>
</None>
<None Include="packages.config" />
<None Include="glTF-1-0.json">
<Filter>Source Files</Filter>
</None>
<None Include="glTF-1-0-defaults.json">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>
53 changes: 51 additions & 2 deletions IO-glTF/IOglTF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool IOglTF::SpecificInitialize () {
//-----------------------------------------------------------------------------

/*static*/ const char *IOglTF::PLUGIN_NAME ="IO-glTF" ;
/*static*/ const char *IOglTF::PLUGIN_VERSION ="0.1.0" ;
/*static*/ const char *IOglTF::PLUGIN_VERSION ="1.0.0" ;

#ifdef __APPLE__
/*static*/ const unsigned int IOglTF::BYTE ;
Expand Down Expand Up @@ -109,6 +109,7 @@ bool IOglTF::SpecificInitialize () {
/*static*/ const utility::char_t *IOglTF::szMAT2 =U("MAT2") ;
/*static*/ const utility::char_t *IOglTF::szMAT3 =U("MAT3") ;
/*static*/ const utility::char_t *IOglTF::szMAT4 =U("MAT4") ;
/*static*/ const utility::char_t *IOglTF::szSAMPLER_2D =U("sampler2D") ;
#ifdef __APPLE__
/*static*/ const unsigned int IOglTF::ARRAY_BUFFER ;
/*static*/ const unsigned int IOglTF::ELEMENT_ARRAY_BUFFER ;
Expand Down Expand Up @@ -189,7 +190,7 @@ void *_gltfFormatInfo (FbxWriter::EInfoRequest pRequest, int pId) {
return (0) ;
}

/*static*/ const utility::char_t *IOglTF::glslType (unsigned int glType) {
/*static*/ const utility::char_t *IOglTF::glslAccessorType (unsigned int glType) {
switch ( glType ) {
case FLOAT:
case INT:
Expand All @@ -200,10 +201,12 @@ void *_gltfFormatInfo (FbxWriter::EInfoRequest pRequest, int pId) {
case FLOAT_VEC2:
case INT_VEC2:
case BOOL_VEC2:
case SAMPLER_2D:
return (szVEC2) ;
case FLOAT_VEC3:
case INT_VEC3:
case BOOL_VEC3:
case SAMPLER_CUBE:
return (szVEC3) ;
case FLOAT_VEC4:
case INT_VEC4:
Expand All @@ -219,6 +222,52 @@ void *_gltfFormatInfo (FbxWriter::EInfoRequest pRequest, int pId) {
return (U("")) ;
}

/*static*/ const utility::string_t IOglTF::glslShaderType (unsigned int glType) {
utility::string_t szType ;
switch ( glType ) {
case FLOAT:
szType =szFLOAT ;
break ;
case INT:
case BOOL:
case UNSIGNED_SHORT:
case UNSIGNED_INT:
szType =szSCALAR ;
break ;
case FLOAT_VEC2:
case INT_VEC2:
case BOOL_VEC2:
szType =szVEC2 ;
break ;
case FLOAT_VEC3:
case INT_VEC3:
case BOOL_VEC3:
case SAMPLER_CUBE:
szType =szVEC3 ;
break ;
case FLOAT_VEC4:
case INT_VEC4:
case BOOL_VEC4:
szType =szVEC4 ;
break ;
case FLOAT_MAT2:
szType =szMAT2 ;
break ;
case FLOAT_MAT3:
szType =szMAT3 ;
break ;
case FLOAT_MAT4:
szType =szMAT4 ;
break ;
case SAMPLER_2D:
return (szSAMPLER_2D) ;
default:
break ;
}
std::transform (szType.begin (), szType.end (), szType.begin (), ::tolower) ;
return (szType) ;
}

/*static*/ const utility::char_t *IOglTF::mimeType (const utility::char_t *szFilename) {
utility::string_t contentType =U("application/octet-stream") ;
FbxString ext =FbxPathUtils::GetExtensionName (utility::conversions::to_utf8string (szFilename).c_str ()) ;
Expand Down
4 changes: 3 additions & 1 deletion IO-glTF/IOglTF.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class IOglTF : public FbxPlugin {
static const utility::char_t *szMAT2 ;
static const utility::char_t *szMAT3 ;
static const utility::char_t *szMAT4 ;
static const utility::char_t *szSAMPLER_2D ;
// bufferView::Target (https://github.com/KhronosGroup/glTF/blob/master/specification/bufferView.schema.json)
static const unsigned int ARRAY_BUFFER =34962 ;
static const unsigned int ELEMENT_ARRAY_BUFFER =34963 ;
Expand Down Expand Up @@ -135,7 +136,8 @@ class IOglTF : public FbxPlugin {
template<class T>
static const utility::char_t *accessorType (int size, int dim =1) ;
static unsigned int techniqueParameters (const utility::char_t *szType, int compType =FLOAT) ;
static const utility::char_t *glslType (unsigned int glType) ;
static const utility::char_t *glslAccessorType (unsigned int glType) ;
static const utility::string_t glslShaderType (unsigned int glType) ;
static const utility::char_t *mimeType (const utility::char_t *szFilename) ;
// Online uri generator: http://bran.name/dump/data-uri-generator/
static const utility::string_t dataURI (const utility::string_t fileName) ;
Expand Down
Loading