forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merge pull request PixarAnimationStudios#499 from shassard/dev switch libtiff to http download * Update CHANGELOG.md for 0.8.5a release (Internal change: 1858057) * Initial version of Draco plugin for USD. * Fixing copyright date. * Fixing more copyright dates. * Renaming Draco CMake option in USD build script. * Addressing Ondrej's comments. * Fixing attribute indices with polygon recovery and refactoring. * Checking quantization bits option range, zero indicates no quantization. * Adding compression level option. * Resolving code review comments. * Resolving code review comments. * Changing hole_faces and added_edges attribute types to uint8_t. * Deleting Draco decoder before mesh translation starts. * Finding Draco library and making it available as a build variable. * Updating copyright headers. * Updating Draco plugin version to match Draco release version.
- Loading branch information
1 parent
94ed3bc
commit 1e99f83
Showing
28 changed files
with
2,706 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# Copyright 2019 Pixar | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
# with the following modification; you may not use this file except in | ||
# compliance with the Apache License and the following modification to it: | ||
# Section 6. Trademarks. is deleted and replaced with: | ||
# | ||
# 6. Trademarks. This License does not grant permission to use the trade | ||
# names, trademarks, service marks, or product names of the Licensor | ||
# and its affiliates, except as required to comply with Section 4(c) of | ||
# the License and to reproduce the content of the NOTICE file. | ||
# | ||
# You may obtain a copy of the Apache License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the Apache License with the above modification is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the Apache License for the specific | ||
# language governing permissions and limitations under the Apache License. | ||
# | ||
# Find Draco Compression Library using DRACO_ROOT as a hint location and | ||
# provides the result by defining variable DRACO_LIBRARY. | ||
# | ||
|
||
find_library(DRACO_LIBRARY libdraco.a ${DRACO_ROOT}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
set(PXR_PREFIX pxr/usd) | ||
set(PXR_PACKAGE usdDraco) | ||
|
||
pxr_plugin(${PXR_PACKAGE} | ||
LIBRARIES | ||
tf | ||
gf | ||
sdf | ||
usd | ||
usdGeom | ||
${DRACO_LIBRARY} | ||
|
||
INCLUDE_DIRS | ||
${Boost_INCLUDE_DIRS} | ||
${PYTHON_INCLUDE_DIRS} | ||
|
||
CPPFILES | ||
attributeDescriptor.cpp | ||
exportTranslator.cpp | ||
fileFormat.cpp | ||
importTranslator.cpp | ||
writer.cpp | ||
|
||
PYTHON_CPPFILES | ||
moduleDeps.cpp | ||
|
||
PYMODULE_CPPFILES | ||
module.cpp | ||
wrapDraco.cpp | ||
|
||
PYMODULE_FILES | ||
__init__.py | ||
|
||
RESOURCE_FILES | ||
plugInfo.json | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# Copyright 2019 Pixar | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
# with the following modification; you may not use this file except in | ||
# compliance with the Apache License and the following modification to it: | ||
# Section 6. Trademarks. is deleted and replaced with: | ||
# | ||
# 6. Trademarks. This License does not grant permission to use the trade | ||
# names, trademarks, service marks, or product names of the Licensor | ||
# and its affiliates, except as required to comply with Section 4(c) of | ||
# the License and to reproduce the content of the NOTICE file. | ||
# | ||
# You may obtain a copy of the Apache License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the Apache License with the above modification is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the Apache License for the specific | ||
# language governing permissions and limitations under the Apache License. | ||
# | ||
import _usdDraco | ||
from pxr import Tf | ||
Tf.PrepareModule(_usdDraco, locals()) | ||
del Tf | ||
|
||
try: | ||
import __DOC | ||
__DOC.Execute(locals()) | ||
del __DOC | ||
except Exception: | ||
try: | ||
import __tmpDoc | ||
__tmpDoc.Execute(locals()) | ||
del __tmpDoc | ||
except: | ||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
// | ||
// Copyright 2019 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
// with the following modification; you may not use this file except in | ||
// compliance with the Apache License and the following modification to it: | ||
// Section 6. Trademarks. is deleted and replaced with: | ||
// | ||
// 6. Trademarks. This License does not grant permission to use the trade | ||
// names, trademarks, service marks, or product names of the Licensor | ||
// and its affiliates, except as required to comply with Section 4(c) of | ||
// the License and to reproduce the content of the NOTICE file. | ||
// | ||
// You may obtain a copy of the Apache License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the Apache License with the above modification is | ||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the Apache License for the specific | ||
// language governing permissions and limitations under the Apache License. | ||
// | ||
|
||
#include "attributeDescriptor.h" | ||
|
||
#include "pxr/pxr.h" | ||
#include "pxr/usd/sdf/types.h" | ||
#include "pxr/usd/usdGeom/tokens.h" | ||
|
||
|
||
PXR_NAMESPACE_OPEN_SCOPE | ||
|
||
|
||
const std::string UsdDracoAttributeDescriptor::METADATA_NAME_KEY = "name"; | ||
|
||
UsdDracoAttributeDescriptor::UsdDracoAttributeDescriptor( | ||
draco::GeometryAttribute::Type attributeType, | ||
TfToken name, | ||
const std::string &metadataName, | ||
draco::DataType dataType, | ||
SdfValueTypeName valueType, | ||
bool isPrimvar, | ||
size_t numComponents) : | ||
attributeType(attributeType), | ||
name(name), | ||
metadataName(metadataName), | ||
dataType(dataType), | ||
valueType(valueType), | ||
isPrimvar(isPrimvar), | ||
numComponents(numComponents) { | ||
} | ||
|
||
|
||
namespace attributedescriptor { | ||
|
||
UsdDracoAttributeDescriptor ForPositions() { | ||
return UsdDracoAttributeDescriptor( | ||
draco::GeometryAttribute::POSITION, | ||
UsdGeomTokens->points, | ||
"", /* metadataName */ | ||
draco::DT_FLOAT32, | ||
SdfValueTypeNames->Float3Array, | ||
false, /* isPrimvar */ | ||
3 /* numComponents */); | ||
} | ||
|
||
UsdDracoAttributeDescriptor ForTexCoords() { | ||
return UsdDracoAttributeDescriptor( | ||
draco::GeometryAttribute::TEX_COORD, | ||
TfToken("Texture_uv"), | ||
"", /* metadataName */ | ||
draco::DT_FLOAT32, | ||
SdfValueTypeNames->Float2Array, | ||
true, /* isPrimvar */ | ||
2 /* numComponents */); | ||
} | ||
|
||
UsdDracoAttributeDescriptor ForNormals() { | ||
return UsdDracoAttributeDescriptor( | ||
draco::GeometryAttribute::NORMAL, | ||
UsdGeomTokens->normals, | ||
"", /* metadataName */ | ||
draco::DT_FLOAT32, | ||
SdfValueTypeNames->Float3Array, | ||
true, /* isPrimvar */ | ||
3 /* numComponents */); | ||
} | ||
|
||
UsdDracoAttributeDescriptor ForHoleFaces() { | ||
return UsdDracoAttributeDescriptor( | ||
draco::GeometryAttribute::GENERIC, | ||
TfToken(), | ||
"hole_faces", | ||
draco::DT_UINT8, | ||
SdfValueTypeName(), | ||
false, /* isPrimvar */ | ||
1 /* numComponents */); | ||
} | ||
|
||
UsdDracoAttributeDescriptor ForAddedEdges() { | ||
return UsdDracoAttributeDescriptor( | ||
draco::GeometryAttribute::GENERIC, | ||
TfToken(), | ||
"added_edges", | ||
draco::DT_UINT8, | ||
SdfValueTypeName(), | ||
false, /* isPrimvar */ | ||
1 /* numComponents */); | ||
} | ||
|
||
UsdDracoAttributeDescriptor ForPosOrder() { | ||
return UsdDracoAttributeDescriptor( | ||
draco::GeometryAttribute::GENERIC, | ||
TfToken(), | ||
"point_order", | ||
draco::DT_UINT32, | ||
SdfValueTypeName(), | ||
false, /* isPrimvar */ | ||
1 /* numComponents */); | ||
} | ||
|
||
} // namespace attributedescriptor | ||
|
||
PXR_NAMESPACE_CLOSE_SCOPE |
Oops, something went wrong.