Skip to content

Commit

Permalink
Use full paths again to get nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Dec 8, 2019
1 parent f2280a9 commit 8a2bb09
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5132,9 +5132,8 @@ void GLTFDocument::_convert_animation(GLTFState &state, AnimationPlayer *ap, Str
const Vector<String> node_suffix = String(orig_track_path).split(":");
const String node = node_suffix[0];
const NodePath node_path = node;
const String skeleton_name = node_path.get_name(node_path.get_name_count() - 1);
const String suffix = node_suffix[1];
Node *godot_node = ap->get_owner()->find_node(skeleton_name);
Node *godot_node = ap->get_owner()->get_node_or_null(node_path);
Skeleton *skeleton = Object::cast_to<Skeleton>(godot_node);
if (!skeleton) {
continue;
Expand Down Expand Up @@ -5163,8 +5162,7 @@ void GLTFDocument::_convert_animation(GLTFState &state, AnimationPlayer *ap, Str
const String node = node_suffix[0];
const String suffix = node_suffix[1];
const NodePath path = node;
const String mesh_name = path.get_name(path.get_name_count() - 1);
Node *godot_node = ap->get_owner()->find_node((mesh_name);
Node *godot_node = ap->get_owner()->get_node_or_null(node);
MeshInstance *mi = Object::cast_to<MeshInstance>(godot_node);
if (!mi) {
continue;
Expand Down

0 comments on commit 8a2bb09

Please sign in to comment.