13 #include "GraphicsScriptingUtil.h"
15 namespace scriptable {
17 using ScriptableMeshes = QVector<scriptable::ScriptableMeshPointer>;
50 class ScriptableModel :
public ScriptableModelBase {
52 Q_PROPERTY(QUuid objectID MEMBER objectID CONSTANT)
53 Q_PROPERTY(glm::uint32 numMeshes READ getNumMeshes)
54 Q_PROPERTY(ScriptableMeshes meshes READ getMeshes)
55 Q_PROPERTY(scriptable::MultiMaterialMap materialLayers READ getMaterialLayers)
56 Q_PROPERTY(QVector<QString> materialNames READ getMaterialNames)
59 ScriptableModel(QObject* parent =
nullptr) : ScriptableModelBase(parent) {}
60 ScriptableModel(
const ScriptableModel& other) : ScriptableModelBase(other) {}
61 ScriptableModel(
const ScriptableModelBase& other) : ScriptableModelBase(other) {}
62 ScriptableModel& operator=(
const ScriptableModelBase& view) { ScriptableModelBase::operator=(view);
return *
this; }
64 operator scriptable::ScriptableModelBasePointer() {
65 return QPointer<scriptable::ScriptableModelBase>(qobject_cast<scriptable::ScriptableModelBase*>(
this));
67 ScriptableMeshes getMeshes();
68 const ScriptableMeshes getConstMeshes()
const;
70 scriptable::MultiMaterialMap getMaterialLayers() {
return materialLayers; }
71 QVector<QString> getMaterialNames() {
return materialNames; }
81 scriptable::ScriptableModelPointer cloneModel(
const QVariantMap& options = QVariantMap());
91 QString toString()
const;
94 glm::uint32 getNumMeshes() {
return meshes.size(); }
100 Q_DECLARE_METATYPE(scriptable::ScriptableModelPointer)
101 Q_DECLARE_METATYPE(QVector<scriptable::ScriptableModelPointer>)
102 Q_DECLARE_METATYPE(scriptable::ScriptableMaterial)
103 Q_DECLARE_METATYPE(scriptable::ScriptableMaterialLayer)
104 Q_DECLARE_METATYPE(scriptable::MultiMaterialMap)