Hubs-Foundation / hubs-blender-exporter

The Hubs Blender Add-on enables artists to export their creations to the immersive web with Hubs
Mozilla Public License 2.0
165 stars 50 forks source link

Fix gather_joint_property error in Blender 3.2+ when getting the vnode. #171

Closed Exairnous closed 1 year ago

Exairnous commented 1 year ago

Fixes #170

When looking for the equivalent vnode for the bone being referenced, check the vnode's blender_bone, rather than the joint attribute which isn't present in Blender 3.2+.

While working on this, I noticed that the code to get the vnode in both gather_joint_property and gather_node_property would most likely fail if the vnode wasn't found, so I think it should either be changed to use vtree.nodes.get(...), so that it'll safely fall back to None, or the vnode should be assumed to be present and the None fallback removed in next(...) and then just do node = vnode.node and forget the whole or gather part.