Exemplo n.º 1
0
def get_log_level():
    value = scene_data.get_scene_data(
        const.SCENE_DATA_LOG_LEVEL
    )
    if value is None:
        value = const.SCENE_DATA_LOG_LEVEL_DEFAULT
    return value
Exemplo n.º 2
0
def get_refresh_viewport_state():
    value = scene_data.get_scene_data(
        const.SCENE_DATA_REFRESH_VIEWPORT
    )
    if value is None:
        value = const.SCENE_DATA_REFRESH_VIEWPORT_DEFAULT
    return value
Exemplo n.º 3
0
def get_active_collection():
    """
    Get the active collection object in the current scene file.

    :returns: The active Collection object, or None if no Collection
              is active.
    :rtype: Collection or None
    """
    uid = scene_data.get_scene_data(const.SCENE_DATA_ACTIVE_COLLECTION_UID)
    if uid is None:
        return None
    nodes = maya.cmds.ls(uid, long=True) or []
    col = None
    if len(nodes) > 0:
        col = mmapi.Collection(node=nodes[0])
    return col
Exemplo n.º 4
0
def get_state_bool(name, default_value):
    """
    Get State boolean from the scene settings.

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

    :param default_value: Fallback value, if 'name' cannot be found.
    :type default_value: bool

    :return: The queried value, or 'default_value'.
    :rtype: bool
    """
    value = scene_data.get_scene_data(name)
    if value is None:
        value = default_value
    return value
Exemplo n.º 5
0
def get_state_str(name, default_value):
    value = scene_data.get_scene_data(name)
    if value is None:
        value = default_value
    return value