mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Replace many uses of is_class with derives_from.
This commit is contained in:
@@ -5445,12 +5445,12 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) {
|
||||
ERR_FAIL_NULL(node);
|
||||
NodePath path_to = root->get_path_to(node, true);
|
||||
|
||||
if (adding_track_type == Animation::TYPE_BLEND_SHAPE && !node->is_class("MeshInstance3D")) {
|
||||
if (adding_track_type == Animation::TYPE_BLEND_SHAPE && !node->derives_from<MeshInstance3D>()) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Blend Shape tracks only apply to MeshInstance3D nodes."));
|
||||
return;
|
||||
}
|
||||
|
||||
if ((adding_track_type == Animation::TYPE_POSITION_3D || adding_track_type == Animation::TYPE_ROTATION_3D || adding_track_type == Animation::TYPE_SCALE_3D) && !node->is_class("Node3D")) {
|
||||
if ((adding_track_type == Animation::TYPE_POSITION_3D || adding_track_type == Animation::TYPE_ROTATION_3D || adding_track_type == Animation::TYPE_SCALE_3D) && !node->derives_from<Node3D>()) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Position/Rotation/Scale 3D tracks only apply to 3D-based nodes."));
|
||||
return;
|
||||
}
|
||||
@@ -5509,7 +5509,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) {
|
||||
|
||||
} break;
|
||||
case Animation::TYPE_ANIMATION: {
|
||||
if (!node->is_class("AnimationPlayer")) {
|
||||
if (!node->derives_from<AnimationPlayer>()) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Animation tracks can only point to AnimationPlayer nodes."));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user