Пример #1
0
def update_requires_clear_geometry(incoming_update: MeshProxy,
                                   existing_proxy: MeshProxy) -> bool:
    geometry_updates = _mesh_geometry_properties & set(
        incoming_update._data.keys())
    for k in geometry_updates:
        existing_length = existing_proxy._data[k].length
        incoming_soa = incoming_update.data(k)
        if incoming_soa:
            incoming_length = incoming_soa.length
            if existing_length != incoming_length:
                logger.debug("apply: length mismatch %s.%s ", existing_proxy,
                             k)
                return True
    return False
Пример #2
0
def proxy_requires_clear_geometry(incoming_proxy: MeshProxy,
                                  mesh: T.Mesh) -> bool:
    for k in _mesh_geometry_properties:
        soa = getattr(mesh, k)
        existing_length = len(soa)
        incoming_soa = incoming_proxy.data(k)
        if incoming_soa:
            incoming_length = incoming_soa.length
            if existing_length != incoming_length:
                logger.debug(
                    "need_clear_geometry: %s.%s (current/incoming) (%s/%s)",
                    mesh,
                    k,
                    existing_length,
                    incoming_length,
                )
                return True
    return False