Exemplo n.º 1
0
def force_recalculate(object_list):
    """Forces connection recalculation for given objects.

    :param object_list: list of the objects for which connection update should be triggered
    :type object_list: list of bpy.types.Object
    """
    _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], object_list)
Exemplo n.º 2
0
def force_recalculate(object_list):
    """Forces connection recalculation for given objects.

    :param object_list: list of the objects for which connection update should be triggered
    :type object_list: list of bpy.types.Object
    """
    _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], object_list)
Exemplo n.º 3
0
def _execute_draw():
    """Checks if connections should be drawn.
    """

    # exlude optimization drawing
    if not bpy.context.scene.scs_props.optimized_connections_drawing:
        _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], None)
        return True

    return _CACHE[_DATA_UP_TO_DATE]
Exemplo n.º 4
0
def _execute_draw():
    """Checks if connections should be drawn.
    """

    # exlude optimization drawing
    if not bpy.context.scene.scs_props.optimized_connections_drawing:
        _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], None)
        return True

    return _CACHE[_DATA_UP_TO_DATE]
Exemplo n.º 5
0
def update_for_redraw():
    """Recalculate connections, if they are not yet up to date.
    """
    # if initialization wasn't triggered yet, then skip switching to stall and wait until it gets initialised
    if _COLLECTION_NAME not in bpy.data.collections:
        return

    # if data was marked as updated
    if not _CACHE[_DATA_UP_TO_DATE]:
        # recalculate curves and lines whos locators were visibly changed
        _core.update_for_redraw(bpy.data.collections[_COLLECTION_NAME], None)

    _CACHE[_DATA_UP_TO_DATE] = True
Exemplo n.º 6
0
def switch_to_stall():
    """Switches state of connections drawing to stalling and will trigger check for connections recalculations
    if they are not yet up to date.
    NOTE: this will effect drawing only if optimized drawing is switched on
    """

    # if data was marked as updated
    if not _CACHE[_DATA_UP_TO_DATE]:
        # recalculate curves and lines whos locators were visiblly changed and force redraw
        _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], None)
        bpy.context.scene.unit_settings.system = bpy.context.scene.unit_settings.system

    _CACHE[_DATA_UP_TO_DATE] = True
Exemplo n.º 7
0
def _execute_draw(optimized_drawing):
    """Checks if connections should be drawn.

    :param optimized_drawing: optimized connections drawing property from SCS globals
    :type optimized_drawing: bool
    """

    # exclude optimization drawing
    if not optimized_drawing:
        _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], None)
        return True

    return _CACHE[_DATA_UP_TO_DATE]
Exemplo n.º 8
0
def _execute_draw(optimized_drawing):
    """Checks if connections should be drawn.

    :param optimized_drawing: optimized connections drawing property from SCS globals
    :type optimized_drawing: bool
    """

    # exclude optimization drawing
    if not optimized_drawing:
        _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], None)
        return True

    return _CACHE[_DATA_UP_TO_DATE]
Exemplo n.º 9
0
def switch_to_stall():
    """Switches state of connections drawing to stalling and will trigger check for connections recalculations
    if they are not yet up to date.
    NOTE: this will effect drawing only if optimized drawing is switched on
    """

    # if data was marked as updated
    if not _CACHE[_DATA_UP_TO_DATE]:
        # recalculate curves and lines whos locators were visiblly changed and force redraw
        _core.update_for_redraw(bpy.data.groups[_GROUP_NAME], None)
        bpy.context.scene.unit_settings.system = bpy.context.scene.unit_settings.system

    _CACHE[_DATA_UP_TO_DATE] = True