Esempio n. 1
0
def get_connected_object_sets(object_name=""):
    """
    grabs the connected blendShape node.
    :param object_name:
    :return: <tuple> array of object set objects.
    """
    return object_utils.get_connected_nodes(get_fn_shape(object_name),
                                            find_node_type='set',
                                            up_stream=True,
                                            down_stream=False)
Esempio n. 2
0
def get_connected_mesh_shape(blend_node=""):
    """
    gets the connected mesh this blend shape is acting on.
    :param blend_node:
    :return:
    """
    return object_utils.get_connected_nodes(blend_node,
                                            find_node_type='mesh',
                                            down_stream=True,
                                            up_stream=False)
Esempio n. 3
0
def get_connected_blendshape(mesh_obj):
    """
    get connected blendshape from this mesh
    :param mesh_obj:
    :return:
    """
    return object_utils.get_connected_nodes(mesh_obj,
                                            find_node_type='blendShape',
                                            down_stream=False,
                                            up_stream=True)
Esempio n. 4
0
def get_connected_skin_cluster(shape_name=""):
    """
    gets the connected skin cluster name.
    :param shape_name: <str> the object name to start the search frOpenMaya.
    :return: <str> skin cluster node name.
    """
    return object_utils.get_connected_nodes(
        shape_name,
        find_node_type=OpenMaya.MFn.kSkinClusterFilter,
        down_stream=False,
        up_stream=True,
        as_strings=True)
Esempio n. 5
0
def get_skin_cluster(source_obj=None):
    """
    Grabs the  skin cluster from the node specified.
    :param source_obj: <OpenMaya.MObject> start iteration from this source node.
    :return: <str> skin cluster node name. <False> for failure.
    """
    mesh_shapes = object_utils.get_shape_obj(source_obj)
    for mesh_shape in mesh_shapes:
        skin_obj = object_utils.get_connected_nodes(mesh_shape,
                                                    find_node_type='skinCluster',
                                                    up_stream=True, depth=True)
        print object_utils.get_m_object_name(mesh_shape), skin_obj
        if skin_obj:
            return OpenMayaAnim.MFnSkinCluster(skin_obj[0]), OpenMaya.MFnDependencyNode(skin_obj[0]).name()
    return False, False
Esempio n. 6
0
def get_connected_skincluster_nodes(object_name="", as_strings=True):
    """
    grabs the connected blendShape node.
    :param object_name: <str>
    :param as_strings: <bool>
    :return: <tuple> connected skin cluster objects
    """
    collection = []
    for m_set in get_connected_object_sets(object_name):
        skin_node = object_utils.get_connected_nodes(
            m_set,
            find_node_type=OpenMaya.MFn.kSkinClusterFilter,
            up_stream=1,
            down_stream=0,
            as_strings=as_strings)
        if skin_node:
            collection.append(skin_node[0])
    return tuple(collection)
Esempio n. 7
0
def get_connected_blendshape_nodes(object_name="", as_strings=True):
    """
    grabs all the connected blendShape nodes.
    :param object_name: <str>
    :param as_strings: <bool>
    :return: <tuple> connected blend shape objects
    """
    collection = []
    for m_set in get_connected_object_sets(object_name):
        blend_node = object_utils.get_connected_nodes(
            m_set,
            find_node_type=OpenMaya.MFn.kBlendShape,
            up_stream=True,
            down_stream=False,
            as_strings=as_strings)
        if blend_node:
            collection.append(blend_node[0])
    return tuple(collection)