Rename fbx folder to model-serializers

This commit is contained in:
Julian Groß 2021-04-15 19:26:10 +02:00
parent 43983e3df6
commit ecb7c47f1a
33 changed files with 156 additions and 167 deletions

View file

@ -12,7 +12,7 @@ setup_thread_debugger()
# link in the shared libraries
link_hifi_libraries(
audio avatars octree gpu graphics shaders fbx hfm entities
audio avatars octree gpu graphics shaders model-serializers hfm entities
networking animation recording shared script-engine embedded-webserver
controllers physics plugins midi image
material-networking model-networking ktx shaders

View file

@ -219,7 +219,7 @@ endif()
# link required hifi libraries
link_hifi_libraries(
shared workload task octree ktx gpu gl procedural graphics graphics-scripting render
pointers recording hfm fbx networking material-networking
pointers recording hfm model-serializers networking material-networking
model-networking model-baker entities avatars
audio audio-client animation script-engine physics
render-utils entities-renderer avatars-renderer ui qml auto-updater midi

View file

@ -1,6 +1,6 @@
set(TARGET_NAME animation)
setup_hifi_library(Network Script)
link_hifi_libraries(shared graphics fbx)
link_hifi_libraries(shared graphics model-serializers)
include_hifi_library_headers(networking)
include_hifi_library_headers(gpu)
include_hifi_library_headers(hfm)

View file

@ -1,7 +1,7 @@
set(TARGET_NAME baking)
setup_hifi_library(Concurrent)
link_hifi_libraries(shared shaders graphics networking procedural graphics-scripting ktx image fbx model-baker task)
link_hifi_libraries(shared shaders graphics networking procedural graphics-scripting ktx image model-serializers model-baker task)
include_hifi_library_headers(gpu)
include_hifi_library_headers(hfm)
include_hifi_library_headers(material-networking)

View file

@ -1,4 +1,4 @@
set(TARGET_NAME graphics-scripting)
setup_hifi_library()
link_hifi_libraries(shared networking graphics fbx image material-networking model-networking script-engine)
link_hifi_libraries(shared networking graphics model-serializers image material-networking model-networking script-engine)
include_hifi_library_headers(gpu)

View file

@ -1,6 +1,6 @@
set(TARGET_NAME model-networking)
setup_hifi_library()
link_hifi_libraries(shared shaders networking graphics fbx procedural model-baker)
link_hifi_libraries(shared shaders networking graphics model-serializers procedural model-baker)
include_hifi_library_headers(hfm)
include_hifi_library_headers(task)
include_hifi_library_headers(gpu)

View file

@ -1,4 +1,4 @@
set(TARGET_NAME fbx)
set(TARGET_NAME model-serializers)
setup_hifi_library()
link_hifi_libraries(shared graphics networking image hfm)

View file

@ -1,6 +1,6 @@
//
// FBX.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Ryan Huffman on 9/5/17.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXSerializer.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Andrzej Kapolka on 9/18/13.
// Copyright 2013 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXSerializer.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Andrzej Kapolka on 9/18/13.
// Copyright 2013 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXSerializer_Material.cpp
// interface/src/fbx
// libraries/model-serializers/src
//
// Created by Sam Gateau on 8/27/2015.
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXSerializer_Mesh.cpp
// interface/src/fbx
// libraries/model-serializers/src
//
// Created by Sam Gateau on 8/27/2015.
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXSerializer_Node.cpp
// interface/src/fbx
// libraries/model-serializers/src
//
// Created by Sam Gateau on 8/27/2015.
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXToJSON.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Simon Walton on 5/4/2018.
// Copyright 2018 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXToJSON.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Simon Walton on 5/4/2018.
// Copyright 2018 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXWriter.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Ryan Huffman on 9/5/17.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// FBXWriter.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Ryan Huffman on 9/5/17.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// GLTFSerializer.cpp
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Luis Cuenca on 8/30/17.
// Copyright 2017 High Fidelity, Inc.
@ -1863,7 +1863,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const GLTFMaterial& mat
template<typename T, typename L>
bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int count,
QVector<L>& outarray, int accessorType, bool normalized) {
QVector<L>& outarray, int accessorType) {
QDataStream blobstream(bin);
blobstream.setByteOrder(QDataStream::LittleEndian);
@ -1899,22 +1899,12 @@ bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int c
blobstream.setDevice(nullptr);
return false;
}
float scale = 1.0f; // Normalized output values should always be floats.
if (normalized) {
scale = (float)(std::numeric_limits<T>::max)();
}
for (int i = 0; i < count; ++i) {
for (int j = 0; j < bufferCount; ++j) {
if (!blobstream.atEnd()) {
T value;
blobstream >> value;
if (normalized) {
outarray.push_back(std::max((float)value / scale, -1.0f));
} else {
outarray.push_back(value);
}
outarray.push_back(value);
} else {
blobstream.setDevice(nullptr);
return false;
@ -1927,24 +1917,24 @@ bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int c
}
template<typename T>
bool GLTFSerializer::addArrayOfType(const hifi::ByteArray& bin, int byteOffset, int count,
QVector<T>& outarray, int accessorType, int componentType, bool normalized) {
QVector<T>& outarray, int accessorType, int componentType) {
switch (componentType) {
case GLTFAccessorComponentType::BYTE: {}
case GLTFAccessorComponentType::UNSIGNED_BYTE: {
return readArray<uchar>(bin, byteOffset, count, outarray, accessorType, normalized);
return readArray<uchar>(bin, byteOffset, count, outarray, accessorType);
}
case GLTFAccessorComponentType::SHORT: {
return readArray<short>(bin, byteOffset, count, outarray, accessorType, normalized);
return readArray<short>(bin, byteOffset, count, outarray, accessorType);
}
case GLTFAccessorComponentType::UNSIGNED_INT: {
return readArray<uint>(bin, byteOffset, count, outarray, accessorType, normalized);
return readArray<uint>(bin, byteOffset, count, outarray, accessorType);
}
case GLTFAccessorComponentType::UNSIGNED_SHORT: {
return readArray<ushort>(bin, byteOffset, count, outarray, accessorType, normalized);
return readArray<ushort>(bin, byteOffset, count, outarray, accessorType);
}
case GLTFAccessorComponentType::FLOAT: {
return readArray<float>(bin, byteOffset, count, outarray, accessorType, normalized);
return readArray<float>(bin, byteOffset, count, outarray, accessorType);
}
}
return false;
@ -1961,11 +1951,11 @@ bool GLTFSerializer::addArrayFromAccessor(GLTFAccessor& accessor, QVector<T>& ou
int accBoffset = accessor.defined["byteOffset"] ? accessor.byteOffset : 0;
success = addArrayOfType(buffer.blob, bufferview.byteOffset + accBoffset, accessor.count, outarray, accessor.type,
accessor.componentType, accessor.normalized);
accessor.componentType);
} else {
for (int i = 0; i < accessor.count; ++i) {
T value;
memset(&value, 0, sizeof(T)); // Make sure the dummy array is initialized to zero.
memset(&value, 0, sizeof(T)); // Make sure the dummy array is initalised to zero.
outarray.push_back(value);
}
}
@ -1981,7 +1971,7 @@ bool GLTFSerializer::addArrayFromAccessor(GLTFAccessor& accessor, QVector<T>& ou
success = addArrayOfType(sparseIndicesBuffer.blob, sparseIndicesBufferview.byteOffset + accSIBoffset,
accessor.sparse.count, out_sparse_indices_array, GLTFAccessorType::SCALAR,
accessor.sparse.indices.componentType, false);
accessor.sparse.indices.componentType);
if (success) {
QVector<T> out_sparse_values_array;
@ -1991,8 +1981,7 @@ bool GLTFSerializer::addArrayFromAccessor(GLTFAccessor& accessor, QVector<T>& ou
int accSVBoffset = accessor.sparse.values.defined["byteOffset"] ? accessor.sparse.values.byteOffset : 0;
success = addArrayOfType(sparseValuesBuffer.blob, sparseValuesBufferview.byteOffset + accSVBoffset,
accessor.sparse.count, out_sparse_values_array, accessor.type, accessor.componentType,
accessor.normalized);
accessor.sparse.count, out_sparse_values_array, accessor.type, accessor.componentType);
if (success) {
for (int i = 0; i < accessor.sparse.count; ++i) {

View file

@ -1,6 +1,6 @@
//
// GLTFSerializer.h
// libraries/fbx/src
// libraries/model-serializers/src
//
// Created by Luis Cuenca on 8/30/17.
// Copyright 2017 High Fidelity, Inc.
@ -527,7 +527,7 @@ struct GLTFAccessor {
int componentType; //required
int count; //required
int type; //required
bool normalized { false };
bool normalized{ false };
QVector<double> max;
QVector<double> min;
GLTFAccessorSparse sparse;
@ -832,11 +832,11 @@ private:
template<typename T, typename L>
bool readArray(const hifi::ByteArray& bin, int byteOffset, int count,
QVector<L>& outarray, int accessorType, bool normalized);
QVector<L>& outarray, int accessorType);
template<typename T>
bool addArrayOfType(const hifi::ByteArray& bin, int byteOffset, int count,
QVector<T>& outarray, int accessorType, int componentType, bool normalized);
QVector<T>& outarray, int accessorType, int componentType);
template <typename T>
bool addArrayFromAccessor(GLTFAccessor& accessor, QVector<T>& outarray);

View file

@ -1,6 +1,6 @@
//
// OBJSerializer.cpp
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 3/7/15.
// Copyright 2013 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// OBJSerializer.h
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 3/6/15.
// Copyright 2015 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// OBJWriter.cpp
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 2017-1-27.
// Copyright 2017 High Fidelity, Inc.

View file

@ -1,6 +1,6 @@
//
// OBJWriter.h
// libraries/fbx/src/
// libraries/model-serializers/src
//
// Created by Seth Alves on 2017-1-27.
// Copyright 2017 High Fidelity, Inc.

View file

@ -3,7 +3,7 @@ set(TARGET_NAME render-utils)
# pull in the resources.qrc file
qt5_add_resources(QT_RESOURCES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/res/fonts/fonts.qrc")
setup_hifi_library(Gui Network Qml Quick Script)
link_hifi_libraries(shared task ktx gpu shaders graphics graphics-scripting material-networking model-networking render animation fbx image procedural)
link_hifi_libraries(shared task ktx gpu shaders graphics graphics-scripting material-networking model-networking render animation model-serializers image procedural)
include_hifi_library_headers(audio)
include_hifi_library_headers(networking)
include_hifi_library_headers(octree)

View file

@ -7,7 +7,7 @@ if (NOT ANDROID)
target_quazip()
endif ()
link_hifi_libraries(shared networking shaders material-networking model-networking recording avatars fbx entities controllers animation audio midi)
link_hifi_libraries(shared networking shaders material-networking model-networking recording avatars model-serializers entities controllers animation audio midi)
include_hifi_library_headers(gl)
include_hifi_library_headers(hfm)
include_hifi_library_headers(gpu)

View file

@ -12,7 +12,7 @@ if ((WIN32 OR UNIX AND NOT APPLE) AND NOT USE_GLES)
setup_hifi_plugin(Gui Qml Multimedia)
link_hifi_libraries(shared task gl qml networking controllers ui
plugins display-plugins ui-plugins input-plugins script-engine
audio-client render-utils graphics shaders gpu render material-networking model-networking model-baker hfm fbx ktx image procedural ${PLATFORM_GL_BACKEND})
audio-client render-utils graphics shaders gpu render material-networking model-networking model-baker hfm model-serializers ktx image procedural ${PLATFORM_GL_BACKEND})
include_hifi_library_headers(octree)
target_openvr()

View file

@ -2,7 +2,7 @@ set(TARGET_NAME oven)
setup_hifi_project(Widgets Gui Concurrent)
link_hifi_libraries(shared shaders image gpu ktx fbx hfm baking graphics networking procedural material-networking model-baker task)
link_hifi_libraries(shared shaders image gpu ktx model-serializers hfm baking graphics networking procedural material-networking model-baker task)
setup_memory_debugger()
setup_thread_debugger()

View file

@ -2,6 +2,6 @@ set(TARGET_NAME skeleton-dump)
setup_hifi_project(Core)
setup_memory_debugger()
setup_thread_debugger()
link_hifi_libraries(shared fbx hfm graphics gpu gl animation)
link_hifi_libraries(shared model-serializers hfm graphics gpu gl animation)
include_hifi_library_headers(image)

View file

@ -1,6 +1,6 @@
set(TARGET_NAME vhacd-util)
setup_hifi_project(Core)
link_hifi_libraries(shared fbx hfm graphics gpu gl)
link_hifi_libraries(shared model-serializers hfm graphics gpu gl)
include_hifi_library_headers(image)