Model.get_node() --> Model.get_node_or_null() - #148
Conversation
|
I believe the Godot VRM addon may always add a "secondary" node to model loaded through it. However, it uses if vrm_extension.has("secondaryAnimation") and (vrm_extension["secondaryAnimation"].get("colliderGroups", []).size() > 0 or vrm_extension["secondaryAnimation"].get("boneGroups", []).size() > 0):
var secondary_node: Node = root_node.get_node("secondary")
if secondary_node == null:
secondary_node = Node3D.new()
root_node.add_child(secondary_node, true)
secondary_node.set_owner(root_node)
secondary_node.set_name("secondary")This piece of code results in the following error to be printed:
If you're attempting to fix that, this PR would not help. Should be PR'd to the Godot VRM repo instead. Otherwise, could you explain what problem this PR is supposed to fix? |
|
In my setup Main.gd and ModelController.gd both throw the |
|
Okay, I suppose your model has neither animation nor colliders so it doesn't generate the |
Changed this function in main and modelcontroller so it won't throw errors when the secondary model is not there.