summaryrefslogtreecommitdiff
path: root/scene/3d/mesh_instance.cpp
diff options
context:
space:
mode:
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;