summaryrefslogtreecommitdiffstats
path: root/scene/3d/mesh_instance.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-12-16 13:00:30 -0300
committerJuan Linietsky <reduzio@gmail.com>2019-12-16 13:00:30 -0300
commit21dec856f2a7482fc69e18ffc60f64e90e10fcc5 (patch)
tree96b68ebeded4ee9f9a3a9ad400a28a0daf2a2feb /scene/3d/mesh_instance.cpp
parent817165b96cd04adb29e4eef797f9dcc6dd9d022f (diff)
downloadredot-engine-21dec856f2a7482fc69e18ffc60f64e90e10fcc5.tar.gz
Use an internal skin unless one is supplied by user, fixes #32766
Even though this fixes the issue, the broken Skin resource in the inherited scene mesh will remain, it needs to be erased manually.
Diffstat (limited to 'scene/3d/mesh_instance.cpp')
-rw-r--r--scene/3d/mesh_instance.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index 50ca466df3..493806fc78 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -154,10 +154,10 @@ void MeshInstance::_resolve_skeleton_path() {
if (!skeleton_path.is_empty()) {
Skeleton *skeleton = Object::cast_to<Skeleton>(get_node(skeleton_path));
if (skeleton) {
- new_skin_reference = skeleton->register_skin(skin);
- if (skin.is_null()) {
+ new_skin_reference = skeleton->register_skin(skin_internal);
+ if (skin_internal.is_null()) {
//a skin was created for us
- skin = new_skin_reference->get_skin();
+ skin_internal = new_skin_reference->get_skin();
_change_notify();
}
}
@@ -173,6 +173,7 @@ void MeshInstance::_resolve_skeleton_path() {
}
void MeshInstance::set_skin(const Ref<Skin> &p_skin) {
+ skin_internal = p_skin;
skin = p_skin;
if (!is_inside_tree())
return;