mirror of
https://github.com/Relintai/mesh_data_resource.git
synced 2024-11-12 10:15:21 +01:00
Implement _add_textures_into after the PropData api cleanup.
This commit is contained in:
parent
601cabc63f
commit
172b7afd6c
@ -52,6 +52,14 @@ void PropDataMesh::set_snap_axis(Vector3 value) {
|
||||
_snap_axis = value;
|
||||
}
|
||||
|
||||
#if TEXTURE_PACKER_PRESENT
|
||||
void PropDataMesh::_add_textures_into(Ref<TexturePacker> texture_packer) {
|
||||
if (get_texture().is_valid()) {
|
||||
texture_packer->add_texture(get_texture());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
PropDataMesh::PropDataMesh() {
|
||||
_snap_to_mesh = false;
|
||||
_snap_axis = Vector3(0, 1, 0);
|
||||
@ -77,6 +85,10 @@ void PropDataMesh::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_snap_axis"), &PropDataMesh::get_snap_axis);
|
||||
ClassDB::bind_method(D_METHOD("set_snap_axis", "value"), &PropDataMesh::set_snap_axis);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "snap_axis"), "set_snap_axis", "get_snap_axis");
|
||||
|
||||
#if TEXTURE_PACKER_PRESENT
|
||||
ClassDB::bind_method(D_METHOD("_add_textures_into", "texture_packer"), &PropDataMesh::_add_textures_into);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@ -32,6 +32,10 @@ SOFTWARE.
|
||||
|
||||
#include "../mesh_data_resource.h"
|
||||
|
||||
#if TEXTURE_PACKER_PRESENT
|
||||
#include "../../texture_packer/texture_packer.h"
|
||||
#endif
|
||||
|
||||
class PropDataMesh : public PropDataEntry {
|
||||
GDCLASS(PropDataMesh, PropDataEntry);
|
||||
|
||||
@ -48,6 +52,10 @@ public:
|
||||
Vector3 get_snap_axis();
|
||||
void set_snap_axis(Vector3 value);
|
||||
|
||||
#if TEXTURE_PACKER_PRESENT
|
||||
void _add_textures_into(Ref<TexturePacker> texture_packer);
|
||||
#endif
|
||||
|
||||
PropDataMesh();
|
||||
~PropDataMesh();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user