Beispiel #1
0
def set_log_level(value):
    if isinstance(value, basestring) is False:
        msg = 'value cannot be %r; %r is not a string'
        raise TypeError(msg % (type(value), value))
    scene_data.set_scene_data(
        const.SCENE_DATA_LOG_LEVEL,
        value
    )
    return
Beispiel #2
0
def set_refresh_viewport_state(value):
    if isinstance(value, bool) is False:
        msg = 'value cannot be %r; %r is not bool'
        raise TypeError(msg % (type(value), value))
    scene_data.set_scene_data(
        const.SCENE_DATA_REFRESH_VIEWPORT,
        value
    )
    return
def set_state_bool(name, value):
    """
    Get a boolean stored in the scene settings.

    :param name: Name of the state boolean variable.
    :type name: str

    :param value: Value to set.
    :type value: bool
    """
    if isinstance(value, bool) is False:
        msg = 'Value cannot be %r; %r is not bool, name=%r'
        raise TypeError(msg % (type(value), value, name))
    scene_data.set_scene_data(name, value)
    return
Beispiel #4
0
def set_state_str(name, value):
    """
    Get a string stored in the scene settings.

    :param name: Name of the state string variable.
    :type name: str

    :param value: Value to set.
    :type value: str
    """
    if isinstance(value, pycompat.TEXT_TYPE) is False:
        msg = 'Value cannot be %r; %r is not a string, name=%r'
        raise TypeError(msg % (type(value), value, name))
    scene_data.set_scene_data(name, value)
    return
def set_active_collection(col):
    """
    Set the Maya scene's active collection.

    There may only be 1 active collection in a Maya scene.

    :param col: The Collection to make active, or None to set no
                active collection.
    :type col: Collection or None

    :rtype: None
    """
    uid = None
    if col is not None:
        uid = col.get_node_uid()
    if uid is None:
        return
    scene_data.set_scene_data(const.SCENE_DATA_ACTIVE_COLLECTION_UID, uid)
    return
Beispiel #6
0
def set_state_str(name, value):
    if isinstance(value, basestring) is False:
        msg = 'Value cannot be %r; %r is not a string, name=%r'
        raise TypeError(msg % (type(value), value, name))
    scene_data.set_scene_data(name, value)
    return