summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/basis_universal/register_types.cpp4
-rw-r--r--modules/gltf/doc_classes/GLTFState.xml11
-rw-r--r--modules/gltf/gltf_state.cpp11
-rw-r--r--modules/gltf/gltf_state.h4
4 files changed, 2 insertions, 28 deletions
diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp
index c5db9b9933..f7bdaf389e 100644
--- a/modules/basis_universal/register_types.cpp
+++ b/modules/basis_universal/register_types.cpp
@@ -74,7 +74,7 @@ static Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::
params.m_source_images.push_back(buimg_image);
}
basisu::vector<basisu::image> images;
- for (int32_t mip_map_i = 1; mip_map_i < image->get_mipmap_count(); mip_map_i++) {
+ for (int32_t mip_map_i = 1; mip_map_i <= image->get_mipmap_count(); mip_map_i++) {
Ref<Image> mip_map = image->get_image_from_mipmap(mip_map_i);
Vector<uint8_t> mip_map_vec = mip_map->get_data();
basisu::image buimg_mipmap(mip_map->get_width(), mip_map->get_height());
@@ -247,7 +247,7 @@ static Ref<Image> basis_universal_unpacker_ptr(const uint8_t *p_data, int p_size
dst[i] = 0x00;
}
uint32_t mip_count = Image::get_image_required_mipmaps(info.m_orig_width, info.m_orig_height, imgfmt);
- for (uint32_t level_i = 0; level_i < mip_count; level_i++) {
+ for (uint32_t level_i = 0; level_i <= mip_count; level_i++) {
basist::basisu_image_level_info level;
tr.get_image_level_info(ptr, size, level, 0, level_i);
int ofs = Image::get_image_mipmap_offset(info.m_width, info.m_height, imgfmt, level_i);
diff --git a/modules/gltf/doc_classes/GLTFState.xml b/modules/gltf/doc_classes/GLTFState.xml
index b322c07cec..33b92f37c8 100644
--- a/modules/gltf/doc_classes/GLTFState.xml
+++ b/modules/gltf/doc_classes/GLTFState.xml
@@ -91,11 +91,6 @@
<description>
</description>
</method>
- <method name="get_skeleton_to_node">
- <return type="Dictionary" />
- <description>
- </description>
- </method>
<method name="get_skeletons">
<return type="GLTFSkeleton[]" />
<description>
@@ -196,12 +191,6 @@
<description>
</description>
</method>
- <method name="set_skeleton_to_node">
- <return type="void" />
- <param index="0" name="skeleton_to_node" type="Dictionary" />
- <description>
- </description>
- </method>
<method name="set_skeletons">
<return type="void" />
<param index="0" name="skeletons" type="GLTFSkeleton[]" />
diff --git a/modules/gltf/gltf_state.cpp b/modules/gltf/gltf_state.cpp
index b7b7113a97..b493e498f1 100644
--- a/modules/gltf/gltf_state.cpp
+++ b/modules/gltf/gltf_state.cpp
@@ -82,8 +82,6 @@ void GLTFState::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_unique_animation_names", "unique_animation_names"), &GLTFState::set_unique_animation_names);
ClassDB::bind_method(D_METHOD("get_skeletons"), &GLTFState::get_skeletons);
ClassDB::bind_method(D_METHOD("set_skeletons", "skeletons"), &GLTFState::set_skeletons);
- ClassDB::bind_method(D_METHOD("get_skeleton_to_node"), &GLTFState::get_skeleton_to_node);
- ClassDB::bind_method(D_METHOD("set_skeleton_to_node", "skeleton_to_node"), &GLTFState::set_skeleton_to_node);
ClassDB::bind_method(D_METHOD("get_create_animations"), &GLTFState::get_create_animations);
ClassDB::bind_method(D_METHOD("set_create_animations", "create_animations"), &GLTFState::set_create_animations);
ClassDB::bind_method(D_METHOD("get_animations"), &GLTFState::get_animations);
@@ -117,7 +115,6 @@ void GLTFState::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_names", "get_unique_names"); // Set<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_animation_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_animation_names", "get_unique_animation_names"); // Set<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "skeletons", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_skeletons", "get_skeletons"); // Vector<Ref<GLTFSkeleton>>
- ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "skeleton_to_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_skeleton_to_node", "get_skeleton_to_node"); // RBMap<GLTFSkeletonIndex,
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "create_animations"), "set_create_animations", "get_create_animations"); // bool
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "animations", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_animations", "get_animations"); // Vector<Ref<GLTFAnimation>>
ADD_PROPERTY(PropertyInfo(Variant::INT, "handle_binary_image", PROPERTY_HINT_ENUM, "Discard All Textures,Extract Textures,Embed As Basis Universal,Embed as Uncompressed", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_handle_binary_image", "get_handle_binary_image"); // enum
@@ -315,14 +312,6 @@ void GLTFState::set_skeletons(TypedArray<GLTFSkeleton> p_skeletons) {
GLTFTemplateConvert::set_from_array(skeletons, p_skeletons);
}
-Dictionary GLTFState::get_skeleton_to_node() {
- return GLTFTemplateConvert::to_dict(skeleton_to_node);
-}
-
-void GLTFState::set_skeleton_to_node(Dictionary p_skeleton_to_node) {
- GLTFTemplateConvert::set_from_dict(skeleton_to_node, p_skeleton_to_node);
-}
-
bool GLTFState::get_create_animations() {
return create_animations;
}
diff --git a/modules/gltf/gltf_state.h b/modules/gltf/gltf_state.h
index b6979ca48e..f2036fca1e 100644
--- a/modules/gltf/gltf_state.h
+++ b/modules/gltf/gltf_state.h
@@ -89,7 +89,6 @@ class GLTFState : public Resource {
HashSet<String> unique_animation_names;
Vector<Ref<GLTFSkeleton>> skeletons;
- HashMap<GLTFSkeletonIndex, GLTFNodeIndex> skeleton_to_node;
Vector<Ref<GLTFAnimation>> animations;
HashMap<GLTFNodeIndex, Node *> scene_nodes;
HashMap<GLTFNodeIndex, ImporterMeshInstance3D *> scene_mesh_instances;
@@ -198,9 +197,6 @@ public:
TypedArray<GLTFSkeleton> get_skeletons();
void set_skeletons(TypedArray<GLTFSkeleton> p_skeletons);
- Dictionary get_skeleton_to_node();
- void set_skeleton_to_node(Dictionary p_skeleton_to_node);
-
bool get_create_animations();
void set_create_animations(bool p_create_animations);