diff --git a/Source/Engine/Graphics/Models/Mesh.h b/Source/Engine/Graphics/Models/Mesh.h
index 7cda9031f..efeb5cfd8 100644
--- a/Source/Engine/Graphics/Models/Mesh.h
+++ b/Source/Engine/Graphics/Models/Mesh.h
@@ -23,8 +23,6 @@ API_CLASS(NoSpawn) class FLAXENGINE_API Mesh : public MeshBase
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(Mesh, MeshBase);
protected:
- int32 _index;
- int32 _lodIndex;
bool _hasLightmapUVs;
GPUBuffer* _vertexBuffers[3];
GPUBuffer* _indexBuffer;
@@ -60,26 +58,9 @@ public:
return (Model*)_model;
}
- ///
- /// Gets the mesh parent LOD index.
- ///
- FORCE_INLINE int32 GetLODIndex() const
- {
- return _lodIndex;
- }
-
- ///
- /// Gets the mesh index.
- ///
- FORCE_INLINE int32 GetIndex() const
- {
- return _index;
- }
-
///
/// Gets the index buffer.
///
- /// The buffer.
FORCE_INLINE GPUBuffer* GetIndexBuffer() const
{
return _indexBuffer;
diff --git a/Source/Engine/Graphics/Models/MeshBase.h b/Source/Engine/Graphics/Models/MeshBase.h
index 7a17630c7..61f76fa59 100644
--- a/Source/Engine/Graphics/Models/MeshBase.h
+++ b/Source/Engine/Graphics/Models/MeshBase.h
@@ -20,12 +20,14 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(MeshBase);
protected:
ModelBase* _model;
- bool _use16BitIndexBuffer;
BoundingBox _box;
BoundingSphere _sphere;
+ int32 _index;
+ int32 _lodIndex;
uint32 _vertices;
uint32 _triangles;
int32 _materialSlotIndex;
+ bool _use16BitIndexBuffer;
explicit MeshBase(const SpawnParams& params)
: PersistentScriptingObject(params)
@@ -37,11 +39,27 @@ public:
///
/// Gets the model owning this mesh.
///
- FORCE_INLINE ModelBase* GetModelBase() const
+ API_PROPERTY() FORCE_INLINE ModelBase* GetModelBase() const
{
return _model;
}
+ ///
+ /// Gets the mesh parent LOD index.
+ ///
+ API_PROPERTY() FORCE_INLINE int32 GetLODIndex() const
+ {
+ return _lodIndex;
+ }
+
+ ///
+ /// Gets the mesh index.
+ ///
+ API_PROPERTY() FORCE_INLINE int32 GetIndex() const
+ {
+ return _index;
+ }
+
///
/// Gets the triangle count.
///
diff --git a/Source/Engine/Graphics/Models/SkinnedMesh.h b/Source/Engine/Graphics/Models/SkinnedMesh.h
index 61ea497c6..a337fbd98 100644
--- a/Source/Engine/Graphics/Models/SkinnedMesh.h
+++ b/Source/Engine/Graphics/Models/SkinnedMesh.h
@@ -19,8 +19,6 @@ API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedMesh : public MeshBase
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(SkinnedMesh, MeshBase);
protected:
- int32 _index;
- int32 _lodIndex;
GPUBuffer* _vertexBuffer;
GPUBuffer* _indexBuffer;
mutable Array _cachedIndexBuffer;
@@ -52,14 +50,6 @@ public:
return (SkinnedModel*)_model;
}
- ///
- /// Gets the mesh index.
- ///
- FORCE_INLINE int32 GetIndex() const
- {
- return _index;
- }
-
///
/// Determines whether this mesh is initialized (has vertex and index buffers initialized).
///