vtool.maya_lib.api

Class Summary

ApiObject()

A wrapper object for MObjects.

MayaObject([mobject])

Wrapper for Api MObject

MayaIterator([mobject])

MayaFunction([mobject])

DoubleArray()

PointArray()

Point([x, y, z, w])

FloatPoint([x, y, z, w])

Matrix([matrix_list])

Quaternion([angle, vector])

TransformationMatrix(matrix)

SelectionList()

TransformFunction([mobject])

JointFunction([mobject])

MeshFunction([mobject])

MeshIntersector([mobject])

NurbsSurfaceFunction([mobject])

NurbsCurveFunction([mobject])

SkinClusterFunction([mobject])

IterateCurveCV([mobject])

IterateGeometry([mobject])

IterateEdges([mobject])

IteratePolygonFaces([mobject])

KeyframeFunction([mobject])

DagNode([mobject])

Function Summary

exists(name)

start_check_after_save(function)

remove_check_after_save()

attribute_to_plug(attribute_name)

nodename_to_mobject(object_name)

Initialize an MObject of the named node.

create_mesh_from_mesh(mesh, target_transform)

Create a mesh from the shape node of another mesh, without duplicating.

duplicate(node)

Api duplicate.

get_current_camera()

set_current_camera(camera_name)

get_object(name)

get_object_name(mobject)

get_plug(attribute_name)

get_mesh_points(name)

get_distance(three_value_list1, ...)

get_triangle_ids(mesh, face_id, triangle_id)

get_border_edges(mesh)

get_skin_weights_dict(skin_cluster[, vert_ids])

get_identity_matrix()

multiply_matrix(matrix1, matrix2)

matrix1 and matrix2 are just the list of numbers of a 4x4 matrix.

get_inverse_matrix()

get_joint_orient_matrix(joint)

get_scale_from_matrix(matrix)

get_face_vertices(mesh, index)

get_surrounding_vertex_indices(mesh, index)

get_vert_count(mesh)

get_connected_verts(mesh, index[, iterator])

get_vertex_islands(mesh)

get_skin_influence_names(skin_cluster[, ...])

get_skin_influence_indices(skin_cluster)

get_skin_influence_dict(skin_cluster[, ...])

get_vector_rotation(target_vector[, ...])

get_geometry_filter(deformer)

get_skin_components(skin_cluster, index)

get_components(indices)

set_skin_weights(skin_cluster[, weights, ...])

set_skin_blend_weights(skin_cluster, ...)

set_weights(attr_name, weights)

exists(name)
start_check_after_save(function)
remove_check_after_save()
attribute_to_plug(attribute_name)
nodename_to_mobject(object_name)

Initialize an MObject of the named node.

create_mesh_from_mesh(mesh, target_transform)

Create a mesh from the shape node of another mesh, without duplicating.

Parameters
  • mesh (str) – The name of a mesh.

  • target_transform (str) – The transform where the newly created mesh should live.

duplicate(node)

Api duplicate. Faster than cmds.duplicate, but no undo in python script.

get_current_camera()
set_current_camera(camera_name)
class ApiObject

A wrapper object for MObjects.

get_api_object()
get()
class MayaObject(mobject=None)

Wrapper for Api MObject

set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

get()
get_api_object()
class MayaIterator(mobject=None)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class MayaFunction(mobject=None)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class DoubleArray
get()
get_api_object()
class PointArray
get()
set(positions)
length()
get_api_object()
class Point(x=0, y=0, z=0, w=1)
get()
get_as_vector()
get_api_object()
class FloatPoint(x=0, y=0, z=0, w=1)
get()
get_as_vector()
get_api_object()
class Matrix(matrix_list=None)
set_matrix_from_list(matrix_list)
get()
get_api_object()
class Quaternion(angle=None, vector=None)
rotation()
get()
get_api_object()
class TransformationMatrix(matrix)
translation(open_maya_space=None)
rotation()
get()
get_api_object()
class SelectionList
create_by_name(name)
get_at_index(index=0)
get_deg_path(index)
get()
get_api_object()
class TransformFunction(mobject=None)
get_transformation_matrix()
get_matrix()
get_vector_matrix_product(vector)

Not working as expected, need to work on it.

get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class JointFunction(mobject=None)
get_orient_matrix(as_list=False)
get_inverse_orient_matrix(as_list=False)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class MeshFunction(mobject=None)
get_vertex_positions()
set_vertex_positions(positions)
get_uv_at_point(vector)
get_closest_face(vector)
get_closest_position(source_vector)
get_closest_normal(source_vector, at_source_position=False)
source_vector is the position to find the normal closest at_source_position just means to add that

source_vector to the normal vector, so it is returned relative to the source vector

get_closest_intersection(source_vector, direction_vector)
get_closest_intersection_face(source_vector, direction_vector, max_distance=10000)
refresh_mesh()
copy(source_mesh, transform)
get_number_of_vertices()
get_number_of_edges()
get_number_of_faces()
get_number_of_uvs()
get_number_of_triangles()
get_triangle_ids()
get_quad_ids()
get_non_tri_quad_ids()
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class MeshIntersector(mobject=None)
get_closest_point_barycentric(source_vector)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class NurbsSurfaceFunction(mobject=None)
get_closest_parameter(vector)
get_closest_normal(source_vector, at_source_position=False)
get_position_from_parameter(u_value, v_value)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class NurbsCurveFunction(mobject=None)
get_degree()
get_cv_count()
get_cv_positions()
set_cv_positions(positions)
get_form()
get_knot_count()
get_span_count()
get_knot_values()
get_position_at_parameter(param)
get_closest_position(three_value_list)
get_parameter_at_position(three_value_list)
get_parameter_at_length(double)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class SkinClusterFunction(mobject=None)
get_influence_dag_paths()
get_influence_names(short_name=False)
get_influence_indices()
get_influence_dict(short_name=False)
get_index_at_influence(influence_name)
get_skin_weights_dict()
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class IterateCurveCV(mobject=None)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class IterateGeometry(mobject=None)
get_points()
set_points(points)
get_points_as_list()
get_points_as_flat_list()
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class IterateEdges(mobject=None)
set_edge(edge_id)
get_connected_vertices(edge_id)
get_connected_faces(edge_id)
get_connected_edges(edge_id)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class IteratePolygonFaces(mobject=None)
is_done()
index()
next()
reset()
count()
get_area(face_id=None)
get_face_center_vectors()
get_closest_face(vector)
get_edges(face_id)
get_center(face_id=None)
get_normal(face_id=None)
get_normal_tangent(face_id=None)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class KeyframeFunction(mobject=None)
constant = None
linear = None
cycle = None
cycle_relative = None
oscillate = None
set_post_infinity(infinity_type)
set_pre_infinity(infinity_type)
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

class DagNode(mobject=None)
duplicate()
get_name()
get_long_name()
get()
get_api_object()
set_node_as_mobject(node_name)

set the MObject from a node name.

Parameters

node_name (str) – The name of a node.

get_object(name)
get_object_name(mobject)
get_plug(attribute_name)
get_mesh_points(name)
get_distance(three_value_list1, three_value_list2)
get_triangle_ids(mesh, face_id, triangle_id)
get_border_edges(mesh)
get_skin_weights_dict(skin_cluster, vert_ids=None)
get_identity_matrix()
multiply_matrix(matrix1, matrix2)
matrix1 and matrix2 are just the list of numbers of a 4x4 matrix.

This can be had with cmds.getAttr(“transform.worldMatrix” or something)

get_inverse_matrix()
get_joint_orient_matrix(joint)
get_scale_from_matrix(matrix)
get_face_vertices(mesh, index)
get_surrounding_vertex_indices(mesh, index)
get_vert_count(mesh)
get_connected_verts(mesh, index, iterator=None)
get_vertex_islands(mesh)
get_skin_influence_names(skin_cluster, short_name=False)
get_skin_influence_indices(skin_cluster)
get_skin_influence_dict(skin_cluster, short_name=False)
get_vector_rotation(target_vector, start_vector=None, factor=1)
get_geometry_filter(deformer)
get_skin_components(skin_cluster, index)
get_components(indices)
set_skin_weights(skin_cluster, weights=0, index=0, components=None, influence_array=None)
set_skin_blend_weights(skin_cluster, weights, index)
set_weights(attr_name, weights)