Parcourir la source

-Fixed BoneAttachment delay, closes #3966
-Fixed skeleton crash, probably fixes other issues

Juan Linietsky il y a 8 ans
Parent
commit
2a6cdfaf91
2 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 4 0
      scene/main/scene_tree.cpp
  2. 2 2
      servers/visual/visual_server_scene.cpp

+ 4 - 0
scene/main/scene_tree.cpp

@@ -540,6 +540,7 @@ bool SceneTree::iteration(float p_time) {
 	_notify_group_pause("fixed_process_internal", Node::NOTIFICATION_INTERNAL_FIXED_PROCESS);
 	_notify_group_pause("fixed_process", Node::NOTIFICATION_FIXED_PROCESS);
 	_flush_ugc();
+	MessageQueue::get_singleton()->flush(); //small little hack
 	_flush_transform_notifications();
 	call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds");
 	root_lock--;
@@ -566,6 +567,8 @@ bool SceneTree::idle(float p_time) {
 
 	emit_signal("idle_frame");
 
+	MessageQueue::get_singleton()->flush(); //small little hack
+
 	_flush_transform_notifications();
 
 	_notify_group_pause("idle_process_internal", Node::NOTIFICATION_INTERNAL_PROCESS);
@@ -581,6 +584,7 @@ bool SceneTree::idle(float p_time) {
 	}
 
 	_flush_ugc();
+	MessageQueue::get_singleton()->flush(); //small little hack
 	_flush_transform_notifications(); //transforms after world update, to avoid unnecessary enter/exit notifications
 	call_group_flags(GROUP_CALL_REALTIME, "_viewports", "update_worlds");
 

+ 2 - 2
servers/visual/visual_server_scene.cpp

@@ -880,13 +880,13 @@ void VisualServerScene::instance_attach_skeleton(RID p_instance, RID p_skeleton)
 		return;
 
 	if (instance->skeleton.is_valid()) {
-		VSG::storage->instance_remove_skeleton(p_skeleton, instance);
+		VSG::storage->instance_remove_skeleton(instance->skeleton, instance);
 	}
 
 	instance->skeleton = p_skeleton;
 
 	if (instance->skeleton.is_valid()) {
-		VSG::storage->instance_add_skeleton(p_skeleton, instance);
+		VSG::storage->instance_add_skeleton(instance->skeleton, instance);
 	}
 
 	_instance_queue_update(instance, true);