Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
assimpimporter_rt.cpp File Reference

(7b7db472caedb76f2d85b98cf414519bf971f97a)

#include "assimpimporter.h"
#include <assimputils.h>
#include <QtCore/qurl.h>
#include <QtCore/qbytearrayalgorithms.h>
#include <QtGui/QQuaternion>
#include <QtQml/QQmlFile>
#include <QtQuick3DAssetImport/private/qssgassetimporterfactory_p.h>
#include <QtQuick3DAssetImport/private/qssgassetimporter_p.h>
#include <QtQuick3DAssetUtils/private/qssgscenedesc_p.h>
#include <QtQuick3DAssetUtils/private/qssgsceneedit_p.h>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/Logger.hpp>
#include <assimp/DefaultLogger.hpp>
#include <assimp/postprocess.h>
#include <assimp/material.h>
#include <assimp/GltfMaterial.h>
#include <assimp/importerdesc.h>
#include <assimp/IOSystem.hpp>
#include <assimp/IOStream.hpp>
+ Include dependency graph for assimpimporter_rt.cpp:

Go to the source code of this file.

Classes

struct  NodeInfo
 
struct  TextureInfo
 
struct  TextureEntry
 
struct  SceneInfo
 
struct  SceneInfo::Options
 
struct  SceneInfo::skinData
 
class  ResourceIOStream
 
class  ResourceIOSystem
 

Macros

#define AI_GLTF_FILTER_NEAREST   0x2600
 
#define AI_GLTF_FILTER_LINEAR   0x2601
 
#define AI_GLTF_FILTER_NEAREST_MIPMAP_NEAREST   0x2700
 
#define AI_GLTF_FILTER_LINEAR_MIPMAP_NEAREST   0x2701
 
#define AI_GLTF_FILTER_NEAREST_MIPMAP_LINEAR   0x2702
 
#define AI_GLTF_FILTER_LINEAR_MIPMAP_LINEAR   0x2703
 
#define demonPostProcessPresets
 

Typedefs

using NodeMap = QHash<const aiNode *, NodeInfo>
 
using AnimationNodeMap = QHash<QByteArray, QSSGSceneDesc::Node *>
 
using MorphAttributes = QQuick3DMorphTarget::MorphTargetAttributes
 
using MorphProperty = QPair<MorphAttributes, float>
 

Functions

static Q_REQUIRED_RESULT QColor aiColorToQColor (const aiColor3D &color)
 
static Q_REQUIRED_RESULT QColor aiColorToQColor (const aiColor4D &color)
 
static QByteArray fromAiString (const aiString &string)
 
 Q_DECLARE_TYPEINFO (NodeInfo, Q_PRIMITIVE_TYPE)
 
static bool isEqual (const aiUVTransform &a, const aiUVTransform &b)
 
bool operator== (const TextureInfo &a, const TextureInfo &b)
 
size_t qHash (const TextureEntry &key, size_t seed)
 
bool operator== (const TextureEntry &a, const TextureEntry &b)
 
static void setNodeProperties (QSSGSceneDesc::Node &target, const aiNode &source, const SceneInfo &sceneInfo, aiMatrix4x4 *transformCorrection)
 
static void setTextureProperties (QSSGSceneDesc::Texture &target, const TextureInfo &texInfo, const SceneInfo &sceneInfo)
 
static void setMaterialProperties (QSSGSceneDesc::Material &target, const aiMaterial &source, const SceneInfo &sceneInfo, QSSGSceneDesc::Material::RuntimeType type)
 
static void setCameraProperties (QSSGSceneDesc::Camera &target, const aiCamera &source, const aiNode &sourceNode, const SceneInfo &sceneInfo)
 
static void setLightProperties (QSSGSceneDesc::Light &target, const aiLight &source, const aiNode &sourceNode, const SceneInfo &sceneInfo)
 
static QVector< MorphPropertygetMorphTargetProperties (const aiMesh &mesh)
 
static void setModelProperties (QSSGSceneDesc::Model &target, const aiNode &source, const SceneInfo &sceneInfo)
 
static QSSGSceneDesc::NodecreateSceneNode (const NodeInfo &nodeInfo, const aiNode &srcNode, QSSGSceneDesc::Node &parent, const SceneInfo &sceneInfo)
 
static void processNode (const SceneInfo &sceneInfo, const aiNode &source, QSSGSceneDesc::Node &parent, const NodeMap &nodeMap, AnimationNodeMap &animationNodes)
 
static QSSGSceneDesc::Animation::KeyPosition toAnimationKey (const aiVectorKey &key, qreal freq)
 
static QSSGSceneDesc::Animation::KeyPosition toAnimationKey (const aiQuatKey &key, qreal freq)
 
static QSSGSceneDesc::Animation::KeyPosition toAnimationKey (const aiMeshMorphKey &key, qreal freq, uint morphId)
 
static bool checkBooleanOption (const QString &optionName, const QJsonObject &options)
 
static qreal getRealOption (const QString &optionName, const QJsonObject &options)
 
static aiPostProcessSteps processOptions (const QJsonObject &optionsObject, std::unique_ptr< Assimp::Importer > &importer)
 
static SceneInfo::Options processSceneOptions (const QJsonObject &optionsObject)
 
static QString importImp (const QUrl &url, const QJsonObject &options, QSSGSceneDesc::Scene &targetScene)
 

Macro Definition Documentation

◆ AI_GLTF_FILTER_LINEAR

#define AI_GLTF_FILTER_LINEAR   0x2601

Definition at line 37 of file assimpimporter_rt.cpp.

◆ AI_GLTF_FILTER_LINEAR_MIPMAP_LINEAR

#define AI_GLTF_FILTER_LINEAR_MIPMAP_LINEAR   0x2703

Definition at line 41 of file assimpimporter_rt.cpp.

◆ AI_GLTF_FILTER_LINEAR_MIPMAP_NEAREST

#define AI_GLTF_FILTER_LINEAR_MIPMAP_NEAREST   0x2701

Definition at line 39 of file assimpimporter_rt.cpp.

◆ AI_GLTF_FILTER_NEAREST

#define AI_GLTF_FILTER_NEAREST   0x2600

Definition at line 36 of file assimpimporter_rt.cpp.

◆ AI_GLTF_FILTER_NEAREST_MIPMAP_LINEAR

#define AI_GLTF_FILTER_NEAREST_MIPMAP_LINEAR   0x2702

Definition at line 40 of file assimpimporter_rt.cpp.

◆ AI_GLTF_FILTER_NEAREST_MIPMAP_NEAREST

#define AI_GLTF_FILTER_NEAREST_MIPMAP_NEAREST   0x2700

Definition at line 38 of file assimpimporter_rt.cpp.

◆ demonPostProcessPresets

#define demonPostProcessPresets
Value:
( \
aiProcess_CalcTangentSpace | \
aiProcess_GenSmoothNormals | \
aiProcess_JoinIdenticalVertices | \
aiProcess_ImproveCacheLocality | \
aiProcess_RemoveRedundantMaterials | \
aiProcess_SplitLargeMeshes | \
aiProcess_Triangulate | \
aiProcess_GenUVCoords | \
aiProcess_SortByPType | \
aiProcess_FindDegenerates | \
aiProcess_FindInvalidData | \
0 )

Definition at line 1517 of file assimpimporter_rt.cpp.

Typedef Documentation

◆ AnimationNodeMap

◆ MorphAttributes

typedef QQuick3DMorphTarget::MorphTargetAttributes MorphAttributes = QQuick3DMorphTarget::MorphTargetAttributes

Definition at line 1197 of file assimpimporter_rt.cpp.

◆ MorphProperty

Definition at line 1198 of file assimpimporter_rt.cpp.

◆ NodeMap

typedef QHash< const aiNode *, NodeInfo > NodeMap = QHash<const aiNode *, NodeInfo>

Definition at line 68 of file assimpimporter_rt.cpp.

Function Documentation

◆ aiColorToQColor() [1/2]

static Q_REQUIRED_RESULT QColor aiColorToQColor ( const aiColor3D & color)
inlinestatic

Definition at line 43 of file assimpimporter_rt.cpp.

◆ aiColorToQColor() [2/2]

static Q_REQUIRED_RESULT QColor aiColorToQColor ( const aiColor4D & color)
inlinestatic

Definition at line 48 of file assimpimporter_rt.cpp.

◆ checkBooleanOption()

static bool checkBooleanOption ( const QString & optionName,
const QJsonObject & options )
static

Definition at line 1488 of file assimpimporter_rt.cpp.

◆ createSceneNode()

static QSSGSceneDesc::Node * createSceneNode ( const NodeInfo & nodeInfo,
const aiNode & srcNode,
QSSGSceneDesc::Node & parent,
const SceneInfo & sceneInfo )
static

Definition at line 1347 of file assimpimporter_rt.cpp.

References SceneInfo::scene.

◆ fromAiString()

static QByteArray fromAiString ( const aiString & string)
static

Definition at line 53 of file assimpimporter_rt.cpp.

◆ getMorphTargetProperties()

static QVector< MorphProperty > getMorphTargetProperties ( const aiMesh & mesh)
static

Definition at line 1200 of file assimpimporter_rt.cpp.

◆ getRealOption()

static qreal getRealOption ( const QString & optionName,
const QJsonObject & options )
static

Definition at line 1502 of file assimpimporter_rt.cpp.

◆ importImp()

static QString importImp ( const QUrl & url,
const QJsonObject & options,
QSSGSceneDesc::Scene & targetScene )
static

Definition at line 1676 of file assimpimporter_rt.cpp.

◆ isEqual()

static bool isEqual ( const aiUVTransform & a,
const aiUVTransform & b )
inlinestaticnodiscard

Definition at line 72 of file assimpimporter_rt.cpp.

◆ operator==() [1/2]

bool operator== ( const TextureEntry & a,
const TextureEntry & b )

Definition at line 116 of file assimpimporter_rt.cpp.

◆ operator==() [2/2]

bool operator== ( const TextureInfo & a,
const TextureInfo & b )

◆ processNode()

static void processNode ( const SceneInfo & sceneInfo,
const aiNode & source,
QSSGSceneDesc::Node & parent,
const NodeMap & nodeMap,
AnimationNodeMap & animationNodes )
static

Definition at line 1407 of file assimpimporter_rt.cpp.

References SceneInfo::scene.

◆ processOptions()

static aiPostProcessSteps processOptions ( const QJsonObject & optionsObject,
std::unique_ptr< Assimp::Importer > & importer )
static

Definition at line 1531 of file assimpimporter_rt.cpp.

◆ processSceneOptions()

◆ Q_DECLARE_TYPEINFO()

Q_DECLARE_TYPEINFO ( NodeInfo ,
Q_PRIMITIVE_TYPE  )

◆ qHash()

size_t qHash ( const TextureEntry & key,
size_t seed )

Definition at line 104 of file assimpimporter_rt.cpp.

◆ setCameraProperties()

static void setCameraProperties ( QSSGSceneDesc::Camera & target,
const aiCamera & source,
const aiNode & sourceNode,
const SceneInfo & sceneInfo )
static

Definition at line 1021 of file assimpimporter_rt.cpp.

References SceneInfo::Options::fbxMode, and SceneInfo::opt.

◆ setLightProperties()

static void setLightProperties ( QSSGSceneDesc::Light & target,
const aiLight & source,
const aiNode & sourceNode,
const SceneInfo & sceneInfo )
static

Definition at line 1097 of file assimpimporter_rt.cpp.

◆ setMaterialProperties()

static void setMaterialProperties ( QSSGSceneDesc::Material & target,
const aiMaterial & source,
const SceneInfo & sceneInfo,
QSSGSceneDesc::Material::RuntimeType type )
static

◆ setModelProperties()

◆ setNodeProperties()

static void setNodeProperties ( QSSGSceneDesc::Node & target,
const aiNode & source,
const SceneInfo & sceneInfo,
aiMatrix4x4 * transformCorrection )
static

◆ setTextureProperties()

static void setTextureProperties ( QSSGSceneDesc::Texture & target,
const TextureInfo & texInfo,
const SceneInfo & sceneInfo )
static

◆ toAnimationKey() [1/3]

static QSSGSceneDesc::Animation::KeyPosition toAnimationKey ( const aiMeshMorphKey & key,
qreal freq,
uint morphId )
static

Definition at line 1483 of file assimpimporter_rt.cpp.

◆ toAnimationKey() [2/3]

static QSSGSceneDesc::Animation::KeyPosition toAnimationKey ( const aiQuatKey & key,
qreal freq )
static

Definition at line 1478 of file assimpimporter_rt.cpp.

◆ toAnimationKey() [3/3]

static QSSGSceneDesc::Animation::KeyPosition toAnimationKey ( const aiVectorKey & key,
qreal freq )
static

Definition at line 1473 of file assimpimporter_rt.cpp.