Skip to content
Open
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
9 changes: 1 addition & 8 deletions fbx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ PRIVATE

target_link_libraries(usdFbx
PRIVATE
tf
sdf
usd
usdGeom
usdSkel
usdShade
usdUtils
arch
${PXR_LIBRARIES}
fileformatUtils
fbxsdk::fbxsdk
)
Expand Down
1 change: 1 addition & 0 deletions gltf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ find_package(TinyGLTF REQUIRED)
if(USD_FILEFORMATS_ENABLE_DRACO)
find_package(draco REQUIRED)
endif()
find_package(OpenGL REQUIRED)


add_subdirectory(src)
Expand Down
5 changes: 1 addition & 4 deletions gltf/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ PRIVATE

target_link_libraries(usdGltf
PRIVATE
usd
usdGeom
usdSkel
usdShade
${PXR_LIBRARIES}
tinygltf::tinygltf
Threads::Threads
fileformatUtils
Expand Down
7 changes: 1 addition & 6 deletions obj/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ PRIVATE

target_link_libraries(usdObj
PUBLIC
tf
sdf
usd
usdGeom
usdSkel
usdShade
${PXR_LIBRARIES}
fileformatUtils
fmt::fmt
FastFloat::fast_float
Expand Down
1 change: 1 addition & 0 deletions ply/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if(USD_FILEFORMATS_BUILD_TESTS)
find_package(GTest REQUIRED)
endif()
find_package(Happly REQUIRED)
find_package(OpenGL REQUIRED)


add_subdirectory(src)
Expand Down
7 changes: 1 addition & 6 deletions ply/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ PRIVATE

target_link_libraries(usdPly
PRIVATE
tf
sdf
usd
usdGeom
usdSkel
usdShade
${PXR_LIBRARIES}
happly::happly
fileformatUtils
)
Expand Down
4 changes: 2 additions & 2 deletions ply/src/plyExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ aggregateMeshInstance(PlyTotalMesh& totalMesh,
}

for (size_t i = 0; i < currentMeshPointsSize; i++) {
totalMesh.points[pointsOffset + i] = modelMatrix.Transform(mesh.points[i]);
totalMesh.points[pointsOffset + i] = PXR_NS::GfVec3f(modelMatrix.Transform(mesh.points[i]));
}
for (size_t i = 0; i < mesh.normals.values.size(); i++) {
totalMesh.normals[normalsOffset + i] = normalMatrix.TransformDir(mesh.normals.values[i]);
totalMesh.normals[normalsOffset + i] = PXR_NS::GfVec3f(normalMatrix.TransformDir(mesh.normals.values[i]));
totalMesh.normals[normalsOffset + i].Normalize();
}
for (size_t i = 0; i < mesh.uvs.values.size(); i++) {
Expand Down
12 changes: 2 additions & 10 deletions sbsar/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,8 @@ target_include_directories(

target_link_libraries(
${PLUGIN_NAME}
PUBLIC tf
sdf
usd
usdGeom
usdShade
usdLux
usdMedia
usdRender
vt
hio
PUBLIC
${PXR_LIBRARIES}
${SUBSTANCE_TARGETS}
fileformatUtils
)
Expand Down
1 change: 1 addition & 0 deletions stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ endif()
if(USD_FILEFORMATS_BUILD_TESTS)
find_package(GTest REQUIRED)
endif()
find_package(OpenGL REQUIRED)


add_subdirectory(src)
Expand Down
10 changes: 1 addition & 9 deletions stl/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@ PRIVATE

target_link_libraries(usdStl
PRIVATE
tf
vt
sdf
usd
usdGeom
usdSkel
usdShade
usdLux
usdUtils
${PXR_LIBRARIES}
fileformatUtils
)

Expand Down
2 changes: 1 addition & 1 deletion stl/src/stlExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ exportStl(const ExportStlOptions& options, const UsdData& usd, StlModel& stl)
const int vertex_index = meshIndices[i + j];
const PXR_NS::GfVec3f& vertex_data = mesh.points[vertex_index];
const PXR_NS::GfVec3f transformedPoint =
node.worldTransform.Transform(vertex_data);
PXR_NS::GfVec3f(node.worldTransform.Transform(vertex_data));
vertex.x = transformedPoint[0];
vertex.y = transformedPoint[1];
vertex.z = transformedPoint[2];
Expand Down
13 changes: 2 additions & 11 deletions utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if (NOT TARGET usd)
endif()
find_package(OpenImageIO REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenGL REQUIRED)
if(USD_FILEFORMATS_BUILD_TESTS)
find_package(GTest REQUIRED)
endif()
Expand Down Expand Up @@ -60,17 +61,7 @@ target_include_directories(fileformatUtils
target_link_libraries(fileformatUtils
PUBLIC
OpenImageIO::OpenImageIO
tf
sdf
usd
usdGeom
usdLux
usdRender
usdSkel
usdShade
usdUtils
usdVol
arch
${PXR_LIBRARIES}
ZLIB::ZLIB
)

Expand Down
6 changes: 3 additions & 3 deletions utils/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,21 +1132,21 @@ transformMesh(Mesh& mesh, const GfMatrix4d& modelMatrix)

unsigned int pointsSize = mesh.points.size();
for (unsigned int i = 0; i < pointsSize; i++) {
mesh.points[i] = modelMatrix.Transform(mesh.points[i]);
mesh.points[i] = PXR_NS::GfVec3f(modelMatrix.Transform(mesh.points[i]));
}
const GfMatrix3d rotMatrix = modelMatrix.ExtractRotationMatrix();
const GfMatrix3d normalMatrix = rotMatrix.GetInverse().GetTranspose();

unsigned int normalsSize = mesh.normals.values.size();
for (unsigned int i = 0; i < normalsSize; i++) {
mesh.normals.values[i] = normalMatrix * mesh.normals.values[i];
mesh.normals.values[i] = PXR_NS::GfVec3f(normalMatrix * mesh.normals.values[i]);
mesh.normals.values[i].Normalize();
}
unsigned int tangentsSize = mesh.tangents.values.size();
for (unsigned int i = 0; i < tangentsSize; i++) {
// tangent.w does not require transformation
GfVec4f& tangent = mesh.tangents.values[i];
GfVec3f tangentXYZ = rotMatrix * GfVec3f(tangent[0], tangent[1], tangent[2]);
GfVec3f tangentXYZ = PXR_NS::GfVec3f(rotMatrix * GfVec3f(tangent[0], tangent[1], tangent[2]));
tangentXYZ.Normalize();
tangent = GfVec4f(tangentXYZ[0], tangentXYZ[1], tangentXYZ[2], tangent[3]);
}
Expand Down