Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSSGQmlUtilities Namespace Reference

Classes

struct  OutputContext
 
class  PropertyMap
 
struct  QSSGQmlScopedIndent
 
struct  ValueToQmlResult
 

Typedefs

using NodeNameMap = QHash<const QSSGSceneDesc::Node *, QString>
 
using UniqueIdMap = QHash<QString, const QSSGSceneDesc::Node *>
 
using UniqueIdOthers = QSet<QString>
 
using NodeSet = QSet<QSSGSceneDesc::Node *>
 
typedef bool NodeFilter(QSSGSceneDesc::Node *)
 

Enumerations

enum  QMLBasicType {
  Bool , Double , Int , List ,
  Real , String , Url , Var ,
  Color , Date , Font , Mat44 ,
  Point , Quaternion , Rect , Size ,
  Vector2D , Vector3D , Vector4D , Unknown_Count
}
 

Functions

QString qmlComponentName (const QString &name)
 
QString colorToQml (const QColor &color)
 
QString variantToQml (const QVariant &variant)
 
QString sanitizeQmlId (const QString &id)
 
QString sanitizeQmlSourcePath (const QString &source, bool removeParentDirectory)
 
static PropertyMap::PropertiesMap getObjectPropertiesMap (QObject *object)
 
template<QSSGSceneDesc::Material::RuntimeType T>
const char * qmlElementName ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Node::RuntimeType::Node > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Material::RuntimeType::SpecularGlossyMaterial > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Material::RuntimeType::PrincipledMaterial > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Material::RuntimeType::CustomMaterial > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Material::RuntimeType::OrthographicCamera > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Material::RuntimeType::PerspectiveCamera > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Node::RuntimeType::Model > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Texture::RuntimeType::Image2D > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Texture::RuntimeType::ImageCube > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Texture::RuntimeType::TextureData > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Camera::RuntimeType::DirectionalLight > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Camera::RuntimeType::SpotLight > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Camera::RuntimeType::PointLight > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Joint::RuntimeType::Joint > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Skeleton::RuntimeType::Skeleton > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Node::RuntimeType::Skin > ()
 
template<>
const char * qmlElementName< QSSGSceneDesc::Node::RuntimeType::MorphTarget > ()
 
static const char * getQmlElementName (const QSSGSceneDesc::Node &node)
 
static QByteArrayView typeName (QMetaType mt)
 
static QString getIdForNode (const QSSGSceneDesc::Node &node)
 
static QString getIdForAnimation (const QByteArray &inName)
 
QString stripParentDirectory (const QString &filePath)
 
static const char * blockBegin ()
 
static const char * blockEnd ()
 
static const char * comment ()
 
static const char * indent ()
 
static QString indentString (OutputContext &output)
 
static QTextStreamindent (OutputContext &output)
 
static const char * blockBegin (OutputContext &output)
 
static const char * blockEnd (OutputContext &output)
 
static void writeImportHeader (OutputContext &output, bool hasAnimation=false)
 
static QString toQuotedString (const QString &text)
 
static QString getMeshFolder ()
 
static QString getMeshExtension ()
 
QString getMeshSourceName (const QString &name)
 
static QString getTextureFolder ()
 
static QString getAnimationFolder ()
 
static QString getAnimationExtension ()
 
QString getAnimationSourceName (const QString &id, const QString &property, qsizetype index)
 
QString asString (const QVariant &var)
 
QString builtinQmlType (const QVariant &var)
 
QString asString (QSSGSceneDesc::Animation::Channel::TargetProperty prop)
 
static std::pair< QString, QStringmeshAssetName (const QSSGSceneDesc::Scene &scene, const QSSGSceneDesc::Mesh &meshNode, const QDir &outdir)
 
static std::pair< QString, QStringcopyTextureAsset (const QUrl &texturePath, OutputContext &output)
 
static QStringList expandComponents (const QString &value, QMetaType mt)
 
static QStringList expandComponentsPartially (const QString &value, QMetaType mt)
 
static ValueToQmlResult valueToQml (const QSSGSceneDesc::Node &target, const QSSGSceneDesc::Property &property, OutputContext &output)
 
static void writeNodeProperties (const QSSGSceneDesc::Node &node, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Node &transform, OutputContext &output)
 
void writeQml (const QSSGSceneDesc::Material &material, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Model &model, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Camera &camera, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Texture &texture, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Skin &skin, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::MorphTarget &morphTarget, OutputContext &output)
 
QString getTextureSourceName (const QString &name, const QString &fmt)
 
static QString outputTextureAsset (const QSSGSceneDesc::TextureData &textureData, const QDir &outdir)
 
static void writeQml (const QSSGSceneDesc::TextureData &textureData, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Light &light, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Skeleton &skeleton, OutputContext &output)
 
static void writeQml (const QSSGSceneDesc::Joint &joint, OutputContext &output)
 
static void writeQmlForResourceNode (const QSSGSceneDesc::Node &node, OutputContext &output)
 
static void writeQmlForNode (const QSSGSceneDesc::Node &node, OutputContext &output)
 
void writeQmlForResources (const QSSGSceneDesc::Scene::ResourceNodes &resources, OutputContext &output)
 
static void generateKeyframeData (const QSSGSceneDesc::Animation::Channel &channel, QByteArray &keyframeData)
 
QPair< QString, QStringwriteQmlForAnimation (const QSSGSceneDesc::Animation &anim, qsizetype index, OutputContext &output, bool useBinaryKeyframes=true, bool generateTimelineAnimations=true)
 
void writeQml (const QSSGSceneDesc::Scene &scene, QTextStream &stream, const QDir &outdir, const QJsonObject &optionsObject)
 
void createTimelineAnimation (const QSSGSceneDesc::Animation &anim, QObject *parent, bool isEnabled, bool useBinaryKeyframes)
 
void writeQmlComponent (const QSSGSceneDesc::Node &node, QTextStream &stream, const QDir &outDir)
 
Q_REQUIRED_RESULT QString Q_QUICK3DASSETUTILS_EXPORT getMeshSourceName (const QByteArrayView &name)
 
static QSSGSceneDesc::Node::Type nodeTypeFromName (const QByteArrayView &typeName)
 
static void replaceReferencesToResource (QSSGSceneDesc::Node *node, QSSGSceneDesc::Node *resource, QSSGSceneDesc::Node *replacement)
 
static QSSGSceneDesc::NodefindNode (QSSGSceneDesc::Node *root, const QByteArrayView name, QSSGSceneDesc::Node::Type type, QSSGSceneDesc::Node **parent=nullptr)
 
static QSSGSceneDesc::NodefindResource (const QSSGSceneDesc::Scene *scene, const QByteArrayView &name, QSSGSceneDesc::Node::Type nodeType)
 
static NodeSet flattenTree (QSSGSceneDesc::Node *node, NodeFilter *excludeFunction=nullptr)
 
static void unlinkChild (QSSGSceneDesc::Node *child, QSSGSceneDesc::Node *parent)
 
static void removeFromAnimation (QSSGSceneDesc::Animation *animation, const NodeSet &nodes)
 
static void deleteTree (QSSGSceneDesc::Node *node)
 
static void removeProperty (QSSGSceneDesc::Node *node, const QByteArrayView &name)
 
static QSSGSceneDesc::NodenodeFromJson (const QSSGSceneDesc::Scene *scene, const QJsonObject &nodeRef)
 
static QSSGSceneDesc::NodeListnodeListFromJson (const QSSGSceneDesc::Scene *scene, const QJsonArray &array)
 
void setProperty (QSSGSceneDesc::Node *node, const QStringView propertyName, const QJsonValue &value)
 
QSSGSceneDesc::NodeaddResource (QSSGSceneDesc::Scene *scene, const QJsonObject &addition)
 
void applyEdit (QSSGSceneDesc::Scene *scene, const QJsonObject &changes)
 

Variables

static constexpr QByteArrayView qml_basic_types []
 
static const char * typeNames []
 
static constexpr qsizetype nNodeTypes = std::size(typeNames) - 1
 

Typedef Documentation

◆ NodeFilter

typedef bool QSSGQmlUtilities::NodeFilter(QSSGSceneDesc::Node *)

Definition at line 109 of file qssgsceneedit.cpp.

◆ NodeNameMap

◆ NodeSet

◆ UniqueIdMap

◆ UniqueIdOthers

Enumeration Type Documentation

◆ QMLBasicType

Enumerator
Bool 
Double 
Int 
List 
Real 
String 
Url 
Var 
Color 
Date 
Font 
Mat44 
Point 
Quaternion 
Rect 
Size 
Vector2D 
Vector3D 
Vector4D 
Unknown_Count 

Definition at line 465 of file qssgqmlutilities.cpp.

Function Documentation

◆ addResource()

QSSGSceneDesc::Node Q_QUICK3DASSETUTILS_EXPORT * QSSGQmlUtilities::addResource ( QSSGSceneDesc::Scene * scene,
const QJsonObject & addition )

Definition at line 222 of file qssgsceneedit.cpp.

References QSSGSceneDesc::addNode(), QSet< T >::constBegin(), QSet< T >::constEnd(), findResource(), it, nodeTypeFromName(), Q_ASSERT, qWarning, replaceReferencesToResource(), scene, QSSGSceneDesc::Node::scene, setProperty, and typeName.

Referenced by applyEdit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyEdit()

void Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::applyEdit ( QSSGSceneDesc::Scene * scene,
const QJsonObject & changes )

Definition at line 272 of file qssgsceneedit.cpp.

References addResource(), QSet< T >::constBegin(), QSet< T >::constEnd(), deleteTree(), edit, findNode(), findResource(), it, nodeTypeFromName(), qWarning, scene, setProperty, QJsonValue::toArray(), typeName, unlinkChild(), and QJsonObject::value().

Referenced by importImp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asString() [1/2]

QString QSSGQmlUtilities::asString ( const QVariant & var)

Definition at line 732 of file qssgqmlutilities.cpp.

References QVariant::toString(), and var.

Referenced by createTimelineAnimation(), valueToQml(), and writeQmlForAnimation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asString() [2/2]

◆ blockBegin() [1/2]

static const char * QSSGQmlUtilities::blockBegin ( )
static

Definition at line 658 of file qssgqmlutilities.cpp.

Referenced by blockBegin(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), and writeQml().

+ Here is the caller graph for this function:

◆ blockBegin() [2/2]

static const char * QSSGQmlUtilities::blockBegin ( OutputContext & output)
static

Definition at line 686 of file qssgqmlutilities.cpp.

References blockBegin(), and output.

+ Here is the call graph for this function:

◆ blockEnd() [1/2]

static const char * QSSGQmlUtilities::blockEnd ( )
static

Definition at line 659 of file qssgqmlutilities.cpp.

Referenced by blockEnd(), writeQml(), writeQmlComponent(), writeQmlForAnimation(), writeQmlForNode(), and writeQmlForResourceNode().

+ Here is the caller graph for this function:

◆ blockEnd() [2/2]

static const char * QSSGQmlUtilities::blockEnd ( OutputContext & output)
static

Definition at line 692 of file qssgqmlutilities.cpp.

References blockEnd(), output, and qMax().

+ Here is the call graph for this function:

◆ builtinQmlType()

QString QSSGQmlUtilities::builtinQmlType ( const QVariant & var)

Definition at line 737 of file qssgqmlutilities.cpp.

References colorToQml(), QMetaType::id(), QVariant::metaType(), QString::number(), QVariant::toString(), var, QVector4D::w(), QVector2D::x(), QVector3D::x(), QVector4D::x(), QVector2D::y(), QVector3D::y(), QVector4D::y(), QVector3D::z(), and QVector4D::z().

Referenced by valueToQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ colorToQml()

QString Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::colorToQml ( const QColor & color)

Definition at line 67 of file qssgqmlutilities.cpp.

References QColor::HexArgb.

Referenced by builtinQmlType(), and variantToQml().

+ Here is the caller graph for this function:

◆ comment()

static const char * QSSGQmlUtilities::comment ( )
static

Definition at line 660 of file qssgqmlutilities.cpp.

Referenced by copyTextureAsset(), and writeNodeProperties().

+ Here is the caller graph for this function:

◆ copyTextureAsset()

static std::pair< QString, QString > QSSGQmlUtilities::copyTextureAsset ( const QUrl & texturePath,
OutputContext & output )
static

Definition at line 837 of file qssgqmlutilities.cpp.

References comment(), QFile::copy(), QFile::exists(), getTextureFolder(), indent(), output, qDebug, QStringLiteral, and QDir::separator().

Referenced by valueToQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTimelineAnimation()

void Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::createTimelineAnimation ( const QSSGSceneDesc::Animation & anim,
QObject * parent,
bool isEnabled,
bool useBinaryKeyframes )

Definition at line 1655 of file qssgqmlutilities.cpp.

References asString(), channel, QSSGSceneDesc::Animation::channels, generateKeyframeData(), QSSGSceneDesc::Animation::length, QSSGSceneDesc::Animation::name, Q_ASSERT, and Q_UNUSED.

Referenced by QSSGRuntimeUtils::createScene().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteTree()

static void QSSGQmlUtilities::deleteTree ( QSSGSceneDesc::Node * node)
static

Definition at line 135 of file qssgsceneedit.cpp.

References animation, QSSGSceneDesc::Scene::animations, child, flattenTree(), removeFromAnimation(), and QSSGSceneDesc::Node::scene.

Referenced by applyEdit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expandComponents()

static QStringList QSSGQmlUtilities::expandComponents ( const QString & value,
QMetaType mt )
static

Definition at line 869 of file qssgqmlutilities.cpp.

References QLatin1StringView::at(), QMetaType::id(), match(), and Q_ASSERT.

Referenced by expandComponentsPartially(), and valueToQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expandComponentsPartially()

static QStringList QSSGQmlUtilities::expandComponentsPartially ( const QString & value,
QMetaType mt )
static

Definition at line 931 of file qssgqmlutilities.cpp.

References expandComponents(), and QMetaType::id().

Referenced by valueToQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findNode()

static QSSGSceneDesc::Node * QSSGQmlUtilities::findNode ( QSSGSceneDesc::Node * root,
const QByteArrayView name,
QSSGSceneDesc::Node::Type type,
QSSGSceneDesc::Node ** parent = nullptr )
static

Definition at line 77 of file qssgsceneedit.cpp.

References child, QSSGSceneDesc::Node::children, findNode(), QSSGSceneDesc::Node::name, QSSGSceneDesc::Node::nodeType, and ret.

Referenced by applyEdit(), findNode(), and nodeFromJson().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findResource()

static QSSGSceneDesc::Node * QSSGQmlUtilities::findResource ( const QSSGSceneDesc::Scene * scene,
const QByteArrayView & name,
QSSGSceneDesc::Node::Type nodeType )
static

Definition at line 96 of file qssgsceneedit.cpp.

References scene.

Referenced by addResource(), applyEdit(), and nodeFromJson().

+ Here is the caller graph for this function:

◆ flattenTree()

static NodeSet QSSGQmlUtilities::flattenTree ( QSSGSceneDesc::Node * node,
NodeFilter * excludeFunction = nullptr )
static

Definition at line 111 of file qssgsceneedit.cpp.

References child, QSSGSceneDesc::Node::children, flattenTree(), and ret.

Referenced by deleteTree(), and flattenTree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateKeyframeData()

static void QSSGQmlUtilities::generateKeyframeData ( const QSSGSceneDesc::Animation::Channel & channel,
QByteArray & keyframeData )
static

Definition at line 1446 of file qssgqmlutilities.cpp.

References channel, i, QEasingCurve::Linear, Q_UNUSED, and QSSGSceneDesc::Animation::KeyPosition::Quaternion.

Referenced by createTimelineAnimation(), and writeQmlForAnimation().

+ Here is the caller graph for this function:

◆ getAnimationExtension()

static QString QSSGQmlUtilities::getAnimationExtension ( )
inlinestatic

Definition at line 722 of file qssgqmlutilities.cpp.

References QStringLiteral.

Referenced by getAnimationSourceName().

+ Here is the caller graph for this function:

◆ getAnimationFolder()

static QString QSSGQmlUtilities::getAnimationFolder ( )
inlinestatic

Definition at line 721 of file qssgqmlutilities.cpp.

References QStringLiteral.

Referenced by getAnimationSourceName(), and writeQmlForAnimation().

+ Here is the caller graph for this function:

◆ getAnimationSourceName()

QString QSSGQmlUtilities::getAnimationSourceName ( const QString & id,
const QString & property,
qsizetype index )

Definition at line 723 of file qssgqmlutilities.cpp.

References extension(), getAnimationExtension(), getAnimationFolder(), QString::number(), property, and QStringLiteral.

Referenced by writeQmlForAnimation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdForAnimation()

static QString QSSGQmlUtilities::getIdForAnimation ( const QByteArray & inName)
static

Definition at line 629 of file qssgqmlutilities.cpp.

References QSet< T >::constEnd(), QSet< T >::constFind(), QString::fromUtf8(), QString::insert(), QString::isEmpty(), it, QStringLiteral, and sanitizeQmlId().

Referenced by writeQmlForAnimation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdForNode()

static QString QSSGQmlUtilities::getIdForNode ( const QSSGSceneDesc::Node & node)
static

Definition at line 587 of file qssgqmlutilities.cpp.

References QSet< T >::constEnd(), QSet< T >::constFind(), QString::fromLatin1(), QString::fromUtf8(), getQmlElementName(), QString::insert(), it, qMin(), QStringLiteral, sanitizeQmlId(), and typeNames.

Referenced by meshAssetName(), outputTextureAsset(), valueToQml(), writeNodeProperties(), writeQml(), and writeQmlForAnimation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMeshExtension()

static QString QSSGQmlUtilities::getMeshExtension ( )
inlinestatic

Definition at line 709 of file qssgqmlutilities.cpp.

References QStringLiteral.

Referenced by getMeshSourceName().

+ Here is the caller graph for this function:

◆ getMeshFolder()

static QString QSSGQmlUtilities::getMeshFolder ( )
inlinestatic

Definition at line 708 of file qssgqmlutilities.cpp.

References QStringLiteral.

Referenced by getMeshSourceName(), and meshAssetName().

+ Here is the caller graph for this function:

◆ getMeshSourceName() [1/2]

Q_REQUIRED_RESULT QString Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::getMeshSourceName ( const QByteArrayView & name)

◆ getMeshSourceName() [2/2]

QString QSSGQmlUtilities::getMeshSourceName ( const QString & name)

Definition at line 711 of file qssgqmlutilities.cpp.

References extension(), getMeshExtension(), and getMeshFolder().

Referenced by meshAssetName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectPropertiesMap()

static PropertyMap::PropertiesMap QSSGQmlUtilities::getObjectPropertiesMap ( QObject * object)
static

Definition at line 294 of file qssgqmlutilities.cpp.

References i, and metaObject().

+ Here is the call graph for this function:

◆ getQmlElementName()

static const char * QSSGQmlUtilities::getQmlElementName ( const QSSGSceneDesc::Node & node)
static

Definition at line 422 of file qssgqmlutilities.cpp.

References QSSGSceneDesc::Node::runtimeType.

Referenced by getIdForNode(), and valueToQml().

+ Here is the caller graph for this function:

◆ getTextureFolder()

static QString QSSGQmlUtilities::getTextureFolder ( )
inlinestatic

Definition at line 719 of file qssgqmlutilities.cpp.

References QStringLiteral.

Referenced by copyTextureAsset(), getTextureSourceName(), and outputTextureAsset().

+ Here is the caller graph for this function:

◆ getTextureSourceName()

QString QSSGQmlUtilities::getTextureSourceName ( const QString & name,
const QString & fmt )

Definition at line 1235 of file qssgqmlutilities.cpp.

References fmt, getTextureFolder(), and sanitizeQmlId().

Referenced by outputTextureAsset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ indent() [1/2]

static const char * QSSGQmlUtilities::indent ( )
static

Definition at line 661 of file qssgqmlutilities.cpp.

Referenced by copyTextureAsset(), indent(), indentString(), writeNodeProperties(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQmlComponent(), writeQmlForAnimation(), writeQmlForNode(), and writeQmlForResourceNode().

+ Here is the caller graph for this function:

◆ indent() [2/2]

static QTextStream & QSSGQmlUtilities::indent ( OutputContext & output)
static

Definition at line 679 of file qssgqmlutilities.cpp.

References i, indent(), output, and QSSGQmlUtilities::QSSGQmlScopedIndent::QSSG_INDENT.

+ Here is the call graph for this function:

◆ indentString()

static QString QSSGQmlUtilities::indentString ( OutputContext & output)
static

Definition at line 671 of file qssgqmlutilities.cpp.

References QString::fromLatin1(), i, indent(), output, QSSGQmlUtilities::QSSGQmlScopedIndent::QSSG_INDENT, and str.

Referenced by valueToQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ meshAssetName()

static std::pair< QString, QString > QSSGQmlUtilities::meshAssetName ( const QSSGSceneDesc::Scene & scene,
const QSSGSceneDesc::Mesh & meshNode,
const QDir & outdir )
static

Definition at line 808 of file qssgqmlutilities.cpp.

References QDir::exists(), file, getIdForNode(), getMeshFolder(), getMeshSourceName(), QDir::mkdir(), QFile::open(), QDir::path(), Q_ASSERT, qDebug, QStringLiteral, scene, QDir::separator(), and QIODeviceBase::WriteOnly.

Referenced by valueToQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nodeFromJson()

static QSSGSceneDesc::Node * QSSGQmlUtilities::nodeFromJson ( const QSSGSceneDesc::Scene * scene,
const QJsonObject & nodeRef )
static

Definition at line 157 of file qssgsceneedit.cpp.

References QSet< T >::constBegin(), QSet< T >::constEnd(), findNode(), findResource(), it, nodeTypeFromName(), and scene.

Referenced by nodeListFromJson(), and setProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nodeListFromJson()

static QSSGSceneDesc::NodeList * QSSGQmlUtilities::nodeListFromJson ( const QSSGSceneDesc::Scene * scene,
const QJsonArray & array )
static

Definition at line 170 of file qssgsceneedit.cpp.

References nodeFromJson(), qWarning, and scene.

Referenced by setProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nodeTypeFromName()

static QSSGSceneDesc::Node::Type QSSGQmlUtilities::nodeTypeFromName ( const QByteArrayView & typeName)
static

Definition at line 44 of file qssgsceneedit.cpp.

References i, nNodeTypes, typeName, and typeNames.

Referenced by addResource(), applyEdit(), and nodeFromJson().

+ Here is the caller graph for this function:

◆ outputTextureAsset()

static QString QSSGQmlUtilities::outputTextureAsset ( const QSSGSceneDesc::TextureData & textureData,
const QDir & outdir )
static

Definition at line 1246 of file qssgqmlutilities.cpp.

References QFileDevice::close(), QSSGSceneDesc::TextureData::data, QDir::exists(), file, QSSGSceneDesc::TextureData::flgs, QSSGSceneDesc::TextureData::fmt, QImage::Format_RGBA8888, QString::fromUtf8(), getIdForNode(), getTextureFolder(), getTextureSourceName(), QByteArray::isEmpty(), QDir::mkdir(), QFile::open(), QDir::path(), QDir::separator(), QSSGSceneDesc::TextureData::sz, QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by writeQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qmlComponentName()

QString Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::qmlComponentName ( const QString & name)

Definition at line 54 of file qssgqmlutilities.cpp.

References QStringLiteral, and sanitizeQmlId().

Referenced by AssimpImporter::import().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qmlElementName()

const char * QSSGQmlUtilities::qmlElementName ( )

Definition at line 398 of file qssgqmlutilities.cpp.

Referenced by valueToQml().

+ Here is the caller graph for this function:

◆ qmlElementName< QSSGSceneDesc::Camera::RuntimeType::DirectionalLight >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Camera::RuntimeType::DirectionalLight > ( )

Definition at line 413 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Camera::RuntimeType::PointLight >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Camera::RuntimeType::PointLight > ( )

Definition at line 415 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Camera::RuntimeType::SpotLight >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Camera::RuntimeType::SpotLight > ( )

Definition at line 414 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Joint::RuntimeType::Joint >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Joint::RuntimeType::Joint > ( )

Definition at line 417 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Material::RuntimeType::CustomMaterial >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Material::RuntimeType::CustomMaterial > ( )

Definition at line 403 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Material::RuntimeType::OrthographicCamera >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Material::RuntimeType::OrthographicCamera > ( )

Definition at line 404 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Material::RuntimeType::PerspectiveCamera >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Material::RuntimeType::PerspectiveCamera > ( )

Definition at line 405 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Material::RuntimeType::PrincipledMaterial >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Material::RuntimeType::PrincipledMaterial > ( )

Definition at line 402 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Material::RuntimeType::SpecularGlossyMaterial >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Material::RuntimeType::SpecularGlossyMaterial > ( )

Definition at line 401 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Node::RuntimeType::Model >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Node::RuntimeType::Model > ( )

Definition at line 407 of file qssgqmlutilities.cpp.

Referenced by writeQml().

+ Here is the caller graph for this function:

◆ qmlElementName< QSSGSceneDesc::Node::RuntimeType::MorphTarget >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Node::RuntimeType::MorphTarget > ( )

Definition at line 420 of file qssgqmlutilities.cpp.

Referenced by writeQml().

+ Here is the caller graph for this function:

◆ qmlElementName< QSSGSceneDesc::Node::RuntimeType::Node >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Node::RuntimeType::Node > ( )

Definition at line 399 of file qssgqmlutilities.cpp.

Referenced by writeQml().

+ Here is the caller graph for this function:

◆ qmlElementName< QSSGSceneDesc::Node::RuntimeType::Skin >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Node::RuntimeType::Skin > ( )

Definition at line 419 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Skeleton::RuntimeType::Skeleton >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Skeleton::RuntimeType::Skeleton > ( )

Definition at line 418 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Texture::RuntimeType::Image2D >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Texture::RuntimeType::Image2D > ( )

Definition at line 409 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Texture::RuntimeType::ImageCube >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Texture::RuntimeType::ImageCube > ( )

Definition at line 410 of file qssgqmlutilities.cpp.

◆ qmlElementName< QSSGSceneDesc::Texture::RuntimeType::TextureData >()

template<>
const char * QSSGQmlUtilities::qmlElementName< QSSGSceneDesc::Texture::RuntimeType::TextureData > ( )

Definition at line 411 of file qssgqmlutilities.cpp.

◆ removeFromAnimation()

static void QSSGQmlUtilities::removeFromAnimation ( QSSGSceneDesc::Animation * animation,
const NodeSet & nodes )
static

Definition at line 125 of file qssgsceneedit.cpp.

References animation, channel, and it.

Referenced by deleteTree().

+ Here is the caller graph for this function:

◆ removeProperty()

static void QSSGQmlUtilities::removeProperty ( QSSGSceneDesc::Node * node,
const QByteArrayView & name )
static

Definition at line 144 of file qssgsceneedit.cpp.

References QSet< T >::end(), QSet< T >::erase(), it, and QSSGSceneDesc::Node::properties.

Referenced by setProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replaceReferencesToResource()

static void QSSGQmlUtilities::replaceReferencesToResource ( QSSGSceneDesc::Node * node,
QSSGSceneDesc::Node * resource,
QSSGSceneDesc::Node * replacement )
static

Definition at line 55 of file qssgsceneedit.cpp.

References child, QSSGSceneDesc::Node::children, QList< T >::count(), QVariant::fromValue(), i, list, QSSGSceneDesc::Node::properties, and replaceReferencesToResource().

Referenced by addResource(), and replaceReferencesToResource().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sanitizeQmlId()

QString Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::sanitizeQmlId ( const QString & id)

Definition at line 117 of file qssgqmlutilities.cpp.

References i, keywords, QString::prepend(), QStringLiteral, and QString::remove().

Referenced by getIdForAnimation(), getIdForNode(), getTextureSourceName(), and qmlComponentName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sanitizeQmlSourcePath()

QString Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::sanitizeQmlSourcePath ( const QString & source,
bool removeParentDirectory )

Definition at line 252 of file qssgqmlutilities.cpp.

References QStringLiteral, and stripParentDirectory().

+ Here is the call graph for this function:

◆ setProperty()

void Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::setProperty ( QSSGSceneDesc::Node * node,
const QStringView propertyName,
const QJsonValue & value )

Definition at line 194 of file qssgsceneedit.cpp.

References QSSGRuntimeUtils::applyPropertyValue(), QVariant::fromValue(), nodeFromJson(), nodeListFromJson(), QSSGSceneDesc::Node::obj, property, removeProperty(), QSSGSceneDesc::Node::scene, QSSGSceneDesc::setProperty(), QStringView::toUtf8(), and var.

+ Here is the call graph for this function:

◆ stripParentDirectory()

QString Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::stripParentDirectory ( const QString & filePath)

Definition at line 651 of file qssgqmlutilities.cpp.

References QString::remove().

Referenced by sanitizeQmlSourcePath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toQuotedString()

static QString QSSGQmlUtilities::toQuotedString ( const QString & text)
static

Definition at line 706 of file qssgqmlutilities.cpp.

References QStringLiteral, and text.

Referenced by valueToQml(), writeQml(), and writeQmlForAnimation().

+ Here is the caller graph for this function:

◆ typeName()

static QByteArrayView QSSGQmlUtilities::typeName ( QMetaType mt)
static

Definition at line 513 of file qssgqmlutilities.cpp.

References Bool, Color, Date, Font, QMetaType::id(), Int, Mat44, Point, qml_basic_types, Quaternion, QMetaType::QVariant, Real, Rect, Size, String, Url, Var, Vector2D, Vector3D, and Vector4D.

+ Here is the call graph for this function:

◆ unlinkChild()

static void QSSGQmlUtilities::unlinkChild ( QSSGSceneDesc::Node * child,
QSSGSceneDesc::Node * parent )
static

Definition at line 120 of file qssgsceneedit.cpp.

References child, QSSGSceneDesc::Node::children, and QList< T >::removeOne().

Referenced by applyEdit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ valueToQml()

static ValueToQmlResult QSSGQmlUtilities::valueToQml ( const QSSGSceneDesc::Node & target,
const QSSGSceneDesc::Property & property,
OutputContext & output )
static

◆ variantToQml()

QString Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::variantToQml ( const QVariant & variant)

Definition at line 73 of file qssgqmlutilities.cpp.

References colorToQml(), QString::number(), QStringLiteral, QVariant::toDouble(), QVariant::toString(), QVariant::typeId(), QVariant::value(), and variant.

Referenced by writeQmlForAnimation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeImportHeader()

static void QSSGQmlUtilities::writeImportHeader ( OutputContext & output,
bool hasAnimation = false )
static

Definition at line 698 of file qssgqmlutilities.cpp.

References output.

Referenced by writeQml(), and writeQmlComponent().

+ Here is the caller graph for this function:

◆ writeNodeProperties()

static void QSSGQmlUtilities::writeNodeProperties ( const QSSGSceneDesc::Node & node,
OutputContext & output )
static

Definition at line 1119 of file qssgqmlutilities.cpp.

References comment(), QString::fromLocal8Bit(), QString::fromUtf8(), getIdForNode(), indent(), QSSGQmlUtilities::PropertyMap::instance(), it, QSSGSceneDesc::Node::name, output, properties, QSSGSceneDesc::Node::properties, property, qDebug, QSSGSceneDesc::Node::runtimeType, QByteArray::size(), QString::startsWith(), typeName, and valueToQml().

Referenced by writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), writeQml(), and writeQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQml() [1/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Camera & camera,
OutputContext & output )
static

Definition at line 1195 of file qssgqmlutilities.cpp.

References blockBegin(), camera, indent(), output, Q_ASSERT, and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [2/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Joint & joint,
OutputContext & output )
static

Definition at line 1322 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), output, Q_ASSERT, and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [3/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Light & light,
OutputContext & output )
static

Definition at line 1299 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), QSSGSceneDesc::Node::nodeType, output, Q_ASSERT, QSSGSceneDesc::Node::runtimeType, and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [4/12]

void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Material & material,
OutputContext & output )

Definition at line 1168 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), QSSGSceneDesc::Node::nodeType, output, Q_ASSERT, QSSGSceneDesc::Node::runtimeType, and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [5/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Model & model,
OutputContext & output )
static

Definition at line 1187 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), model, output, Q_ASSERT, qmlElementName< QSSGSceneDesc::Node::RuntimeType::Model >(), and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [6/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::MorphTarget & morphTarget,
OutputContext & output )
static

Definition at line 1227 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), output, Q_ASSERT, qmlElementName< QSSGSceneDesc::Node::RuntimeType::MorphTarget >(), and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [7/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Node & transform,
OutputContext & output )
static

Definition at line 1160 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), output, Q_ASSERT, qmlElementName< QSSGSceneDesc::Node::RuntimeType::Node >(), and writeNodeProperties().

Referenced by AssimpImporter::import(), writeQml(), writeQmlComponent(), writeQmlForNode(), and writeQmlForResourceNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQml() [8/12]

◆ writeQml() [9/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Skeleton & skeleton,
OutputContext & output )
static

Definition at line 1314 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), QSSGSceneDesc::Node::nodeType, output, Q_ASSERT, QSSGSceneDesc::Node::runtimeType, and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [10/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Skin & skin,
OutputContext & output )
static

Definition at line 1219 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), QSSGSceneDesc::Node::nodeType, output, Q_ASSERT, QSSGSceneDesc::Node::runtimeType, and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [11/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::Texture & texture,
OutputContext & output )
static

Definition at line 1208 of file qssgqmlutilities.cpp.

References blockBegin(), indent(), QSSGRenderGraphObject::isTexture(), output, Q_ASSERT, and writeNodeProperties().

+ Here is the call graph for this function:

◆ writeQml() [12/12]

static void QSSGQmlUtilities::writeQml ( const QSSGSceneDesc::TextureData & textureData,
OutputContext & output )
static

Definition at line 1280 of file qssgqmlutilities.cpp.

References QString::fromLatin1(), getIdForNode(), indent(), QSSGSceneDesc::Node::nodeType, output, outputTextureAsset(), Q_ASSERT, QSSGSceneDesc::Node::runtimeType, toQuotedString(), and writeProperty().

+ Here is the call graph for this function:

◆ writeQmlComponent()

void Q_QUICK3DASSETUTILS_EXPORT QSSGQmlUtilities::writeQmlComponent ( const QSSGSceneDesc::Node & node,
QTextStream & stream,
const QDir & outDir )

Definition at line 1705 of file qssgqmlutilities.cpp.

References blockEnd(), indent(), output, QSSG_ASSERT, QSSGQmlUtilities::OutputContext::Resource, QSSGSceneDesc::Scene::resources, QSSGSceneDesc::Node::runtimeType, QSSGSceneDesc::Node::scene, QSSGSceneDesc::Scene::sourceDir, writeImportHeader(), writeQml(), and writeQmlForResources().

+ Here is the call graph for this function:

◆ writeQmlForAnimation()

QPair< QString, QString > QSSGQmlUtilities::writeQmlForAnimation ( const QSSGSceneDesc::Animation & anim,
qsizetype index,
OutputContext & output,
bool useBinaryKeyframes = true,
bool generateTimelineAnimations = true )

Definition at line 1488 of file qssgqmlutilities.cpp.

References asString(), blockEnd(), channel, QSSGSceneDesc::Animation::channels, QFileDevice::close(), file, QSSGSceneDesc::Animation::framesPerSecond, QString::fromLocal8Bit(), generateKeyframeData(), getAnimationFolder(), getAnimationSourceName(), getIdForAnimation(), getIdForNode(), indent(), QByteArray::isEmpty(), QSSGSceneDesc::Animation::length, QSSGSceneDesc::Animation::name, QFile::open(), output, Q_ASSERT, qCeil(), QDir::separator(), toQuotedString(), variantToQml(), QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by writeQml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQmlForNode()

static void QSSGQmlUtilities::writeQmlForNode ( const QSSGSceneDesc::Node & node,
OutputContext & output )
static

Definition at line 1380 of file qssgqmlutilities.cpp.

References blockEnd(), QSSGSceneDesc::Node::children, indent(), QList< T >::isEmpty(), QSSGRenderGraphObject::isResource(), QSSGQmlUtilities::OutputContext::NodeTree, QSSGSceneDesc::Node::nodeType, output, processNode(), QSSGSceneDesc::Node::properties, QSSGQmlUtilities::OutputContext::Resource, QSSGSceneDesc::Node::runtimeType, writeQml(), and writeQmlForNode().

Referenced by writeQml(), and writeQmlForNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQmlForResourceNode()

static void QSSGQmlUtilities::writeQmlForResourceNode ( const QSSGSceneDesc::Node & node,
OutputContext & output )
static

Definition at line 1330 of file qssgqmlutilities.cpp.

References blockEnd(), indent(), QList< T >::isEmpty(), QSSGRenderGraphObject::isResource(), QSSGSceneDesc::Node::nodeType, output, processNode(), QSSGSceneDesc::Node::properties, Q_ASSERT, qWarning, QSSGQmlUtilities::OutputContext::Resource, QSSGSceneDesc::Node::runtimeType, and writeQml().

Referenced by writeQmlForResources().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQmlForResources()

void QSSGQmlUtilities::writeQmlForResources ( const QSSGSceneDesc::Scene::ResourceNodes & resources,
OutputContext & output )

Definition at line 1428 of file qssgqmlutilities.cpp.

References output, and writeQmlForResourceNode().

Referenced by writeQml(), and writeQmlComponent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ nNodeTypes

constexpr qsizetype QSSGQmlUtilities::nNodeTypes = std::size(typeNames) - 1
staticconstexpr

Definition at line 42 of file qssgsceneedit.cpp.

Referenced by nodeTypeFromName().

◆ qml_basic_types

constexpr QByteArrayView QSSGQmlUtilities::qml_basic_types[]
staticconstexpr
Initial value:
{
"bool",
"double",
"int",
"list",
"real",
"string",
"url",
"var",
"color",
"date",
"font",
"matrix4x4",
"point",
"quaternion",
"rect",
"size",
"vector2d",
"vector3d",
"vector4d"
}

Definition at line 489 of file qssgqmlutilities.cpp.

Referenced by typeName().

◆ typeNames

const char* QSSGQmlUtilities::typeNames[]
static
Initial value:
=
{
"Transform",
"Camera",
"Model",
"Texture",
"Material",
"Light",
"Mesh",
"Skin",
"Skeleton",
"Joint",
"MorphTarget",
"ERROR"
}

Definition at line 26 of file qssgsceneedit.cpp.

Referenced by getIdForNode(), and nodeTypeFromName().