def _make_node_mesh(self, parent_node, name, obj=None, can_merge=False):
        """
        Make glTF-node - glTF-mesh pair for chosen Blender object.
        """
        gltf_node = {
            'name': name,
            'extras': {},
        }

        gltf_mesh = None
        need_mesh = False
        if can_merge:
            need_mesh = True
        else:
            if obj.rigid_body is None:
                need_mesh = True
            elif obj.rigid_body.collision_shape == 'MESH':
                need_mesh = True

        if need_mesh:
            gltf_mesh = {
                'name': name,
                'primitives': [],
                'extras': {
                    'targetNames': [],
                },
            }
            self._root['meshes'].append(gltf_mesh)
            gltf_node['mesh'] = len(self._root['meshes']) - 1

        armature = obj and get_armature(obj)
        if armature:
            for i, gltf_skin in enumerate(self._root['skins']):
                if gltf_skin['name'] == armature.name:
                    gltf_node['skin'] = i
                    break

        self._setup_node(gltf_node, obj, can_merge=can_merge)
        self._add_child(parent_node, gltf_node)

        if obj.type == 'MESH':
            for material in obj.data.materials:
                if material and material.node_tree:  # not and empty slot and have nodes tree
                    for node in material.node_tree.nodes:
                        if node.type == 'ATTRIBUTE':
                            gltf_node['extras'][node.attribute_type.lower()] = node.attribute_name

        return gltf_node, gltf_mesh

        Make glTF-node - glTF-mesh pair for chosen Blender object.
        
metadrive/third_party/kitsunetsuki/exporter/gltf/__init__.py