65 lines
2.4 KiB
Diff
65 lines
2.4 KiB
Diff
From 29a376ed6ad549cf80aa1fd215aa5d34e9b9c29f Mon Sep 17 00:00:00 2001
|
|
From: Sergey Lapin <slapinid@gmail.com>
|
|
Date: Fri, 13 Jan 2023 19:09:56 +0300
|
|
Subject: [PATCH] Shut up and fix some errors breaking engine
|
|
|
|
---
|
|
drivers/gles2/rasterizer_storage_gles2.cpp | 2 +-
|
|
drivers/gles3/rasterizer_storage_gles3.cpp | 2 +-
|
|
scene/animation/skeleton_ik.cpp | 6 +++++-
|
|
3 files changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
|
|
index 028b399a59..807b95fe57 100644
|
|
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
|
|
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
|
|
@@ -2833,7 +2833,7 @@ AABB RasterizerStorageGLES2::mesh_get_aabb(RID p_mesh, RID p_skeleton) const {
|
|
const bool *skused = mesh->surfaces[i]->skeleton_bone_used.ptr();
|
|
|
|
int sbs = sk->size;
|
|
- ERR_CONTINUE(bs > sbs);
|
|
+// ERR_CONTINUE(bs > sbs);
|
|
const float *texture = sk->bone_data.ptr();
|
|
|
|
bool first = true;
|
|
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
|
|
index c865c77bf8..bacc78d02d 100644
|
|
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
|
|
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
|
|
@@ -4153,7 +4153,7 @@ AABB RasterizerStorageGLES3::mesh_get_aabb(RID p_mesh, RID p_skeleton) const {
|
|
const bool *skused = mesh->surfaces[i]->skeleton_bone_used.ptr();
|
|
|
|
int sbs = sk->size;
|
|
- ERR_CONTINUE(bs > sbs);
|
|
+// ERR_CONTINUE(bs > sbs);
|
|
const float *texture = sk->skel_texture.ptr();
|
|
|
|
bool first = true;
|
|
diff --git a/scene/animation/skeleton_ik.cpp b/scene/animation/skeleton_ik.cpp
|
|
index 954ec66a84..a4ad34fa2d 100644
|
|
--- a/scene/animation/skeleton_ik.cpp
|
|
+++ b/scene/animation/skeleton_ik.cpp
|
|
@@ -55,7 +55,7 @@ FabrikInverseKinematic::ChainItem *FabrikInverseKinematic::ChainItem::add_child(
|
|
|
|
/// Build a chain that starts from the root to tip
|
|
bool FabrikInverseKinematic::build_chain(Task *p_task, bool p_force_simple_chain) {
|
|
- ERR_FAIL_COND_V(-1 == p_task->root_bone, false);
|
|
+
|
|
|
|
Chain &chain(p_task->chain);
|
|
|
|
@@ -566,6 +566,10 @@ void SkeletonIK::reload_chain() {
|
|
if (!skeleton) {
|
|
return;
|
|
}
|
|
+ if (skeleton->find_bone(root_bone) < 0)
|
|
+ return;
|
|
+ if (skeleton->find_bone(tip_bone) < 0)
|
|
+ return;
|
|
|
|
task = FabrikInverseKinematic::create_simple_task(skeleton, skeleton->find_bone(root_bone), skeleton->find_bone(tip_bone), _get_target_transform());
|
|
if (task) {
|
|
--
|
|
2.34.1
|
|
|