An alternate to D14839, implemented in Python and relying on bpy.data.user_map(). That function gives us a mapping of what ID is referenced by what set of IDs. The inverse of this would also be useful, which is now available from bpy_extras.id_map_utils.get_id_reference_map(). From there, we can use get_all_referenced_ids() to get a set of all IDs referenced by a given ID either directly or indirectly. To get only the direct references, we can simply pass the ID of interest as a key to the dictionary returned from get_id_reference_map(). Reviewed By: mont29 Differential Revision: https://developer.blender.org/D14843
21 lines
330 B
Python
21 lines
330 B
Python
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# <pep8-80 compliant>
|
|
|
|
"""
|
|
Utility modules associated with the bpy module.
|
|
"""
|
|
|
|
__all__ = (
|
|
"anim_utils",
|
|
"asset_utils",
|
|
"object_utils",
|
|
"io_utils",
|
|
"image_utils",
|
|
"keyconfig_utils",
|
|
"mesh_utils",
|
|
"node_utils",
|
|
"view3d_utils",
|
|
"id_map_utils",
|
|
)
|