Exemple #1
0
def get_neighbours(loc_obj):
    """Gets all neigbours of given locator.

    :param loc_obj: SCS locator object for which neighbours should be found
    :type loc_obj: bpy.types.Object
    :return: list of neighbour locator names
    :rtype: list
    """
    conns_entries = _core.get_connections(
        bpy.data.collections[_COLLECTION_NAME], loc_obj.name)

    neighbours = []

    if loc_obj.scs_props.locator_prefab_type in ("Map Point", "Trigger Point"):

        for conn_entry in conns_entries.values():

            # check validity of connection; if not valid don't add neighbour
            if conn_entry[_core.VALID]:

                # detect oposite
                if loc_obj.name == conn_entry[_core.IN]:
                    neighbours.append(conn_entry[_core.OUT])
                else:
                    neighbours.append(conn_entry[_core.IN])

    return neighbours
Exemple #2
0
def get_neighbours(loc_obj):
    """Gets all neigbours of given locator.

    :param loc_obj: SCS locator object for which neighbours should be found
    :type loc_obj: bpy.types.Object
    :return: list of neighbour locator names
    :rtype: list
    """

    conns_entries = _core.get_connections(bpy.data.groups[_GROUP_NAME], loc_obj.name)

    neighbours = []

    if loc_obj.scs_props.locator_prefab_type in ("Map Point", "Trigger Point"):

        for conn_entry in conns_entries.values():

            # check validity of connection; if not valid don't add neighbour
            if conn_entry[_core.VALID]:

                # detect oposite
                if loc_obj.name == conn_entry[_core.IN]:
                    neighbours.append(conn_entry[_core.OUT])
                else:
                    neighbours.append(conn_entry[_core.IN])

    return neighbours