vtool.maya_lib.fx

Class Summary

CMuscle(muscle)

Function Summary

get_cache_folder(name[, dirpath])

export_maya_cache_group(source_group[, dirpath])

import_maya_cache_group(target_group[, ...])

export_maya_cache(geo[, name, dirpath])

import_maya_cache(geo[, name, dirpath, ...])

export_alembic(root_node, name[, dirpath, ...])

import_alembic(root_node, name[, dirpath, ...])

import_alembic_geo(name[, dirpath, ...])

refresh_maya_caches([maya_caches])

get_shapes_for_cache(geo)

create_nucleus([name])

Create a nucleus node.

create_hair_system([name, nucleus])

Create a hair system.

connect_hair_to_nucleus(hair_system, nucleus)

Connect a hair system to a nucleus.

create_follicle([name, hair_system, uv])

Create a follicle.

connect_follicle_to_hair(follicle, hair_system)

Connect a follicle to a hair system

make_curve_dynamic(curve[, hair_system, ...])

Replace a curve with a dynamic curve in a follicle.

create_follicle_from_curve(curve[, ...])

add_follicle_to_curve(curve[, hair_system, ...])

Add a follicle to a curve.

get_follicle_output_curve(follicle)

get_follicle_input_curve(follicle)

set_follicle_stiffness_based_on_length(...)

at min_length, max_stiffness will be set at max_length min_stiffness will be set inbetween is interpolated

add_passive_collider_to_mesh(mesh[, nucleus])

Make mesh into a passive collider.

add_passive_collider_to_duplicate_mesh(mesh)

add_passive_to_nucleus(passive_mesh, nucleus)

add_nCloth_to_mesh(mesh[, world])

set_active_nucleus(nucleus_name)

This sets a global variable that is used by maya to know what nucleus to perform commands on.

nConstrain_to_mesh(verts, mesh[, name, ...])

Constrain an ncloth to a passive collider.

nConstrain_verts(verts[, name, force_passive])

create_cloth_input_meshes(deform_mesh, ...)

add_muscle_to_mesh(mesh)

add_mesh_to_keep_out(mesh, keep_out)

create_keep_out([collide_transform, ...])

Collide a transform with a mesh.

get_attached_yeti_nodes(mesh)

create_yeti_texture_reference(mesh)

set_yeti_guide_rest(curve)

get_ziva_geo_names()

is_ziva_tissue(mesh)

is_ziva_bone(mesh)

rename_ziva_nodes_on_mesh(mesh)

copy_ziva(source_mesh, target_mesh)

find_empty_attachment_targets()

get_cache_folder(name, dirpath='')
export_maya_cache_group(source_group, dirpath='')
import_maya_cache_group(target_group, dirpath='', source_group=None)
export_maya_cache(geo, name='maya_cache', dirpath='')
import_maya_cache(geo, name='maya_cache', dirpath='', source_namespace=None)
export_alembic(root_node, name, dirpath=None, auto_sub_folders=True, min_value=None, max_value=None)
import_alembic(root_node, name, dirpath=None, auto_sub_folders=True)
import_alembic_geo(name, dirpath=None, auto_sub_folders=True, namespace=None)
refresh_maya_caches(maya_caches=[])
get_shapes_for_cache(geo)
create_nucleus(name=None)

Create a nucleus node. I’ve had cases where Maya insists on creating nucleus1 instead of using the last created nucleus. This can be fixed by restarting Maya.

Parameters

name (str) – The description for the nucleus. Final name = ‘nucleus_(name)’. If no name given, name = ‘nucleus’.

Returns

name of the nucleus.

Return type

str

create_hair_system(name=None, nucleus=None)

Create a hair system.

Parameters
  • name (str) – The description for the hair system. Final name = ‘hairSystem_(name)’. If no name given, name = ‘hairSystem’.

  • nucleus (str) – The name of a nucleus node to attach to the hairSystem.

Returns

[hair system, hair system shape]

Return type

list

connect_hair_to_nucleus(hair_system, nucleus)

Connect a hair system to a nucleus.

Parameters
  • hair_system (str) – The name of a hair system.

  • nucleus (str) – The name of a nucleus node.

create_follicle(name=None, hair_system=None, uv=[])

Create a follicle.

Parameters
  • name (str) – The description for the hair system. Final name = ‘follicle_(name)’. If no name given, name = ‘follicle’.

  • hair_system (str) – The name of a hair system to connect to.

Returns

[follicle name, follicle shape name]

Return type

list

connect_follicle_to_hair(follicle, hair_system)

Connect a follicle to a hair system

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

  • hair_system (str) – The name of a hair system.

make_curve_dynamic(curve, hair_system=None, mesh=None, curve_closest_samples=10)

Replace a curve with a dynamic curve in a follicle. Good for attaching to a spline ik, to make it dynamic. It will make a duplicate of the curve so that the dynamics of the follicle can be switched on/off.

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

  • hair_system (str) – The name of a hair system, that the created follicle should attach to.

Returns

The name of the follicle.

Return type

str

create_follicle_from_curve(curve, hair_system=None, attach_mesh=None, out_curve_parent=None, dynamic=True)
add_follicle_to_curve(curve, hair_system=None, switch_control=None, attribute_name='dynamic', blendshape=True, out_curve_parent=None, attach_mesh=None)

Add a follicle to a curve. Good for attaching to a spline ik, to make it dynamic. It will make a duplicate of the curve so that the dynamics of the follicle can be switched on/off.

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

  • hair_system (str) – The name of a hair system, that the created follicle should attach to.

  • switch_control (str) – The name of the control to add the switch attribute to.

  • attribute_name (str) – The name of the attribute on switch_control.

Returns

The name of the follicle.

Return type

str

get_follicle_output_curve(follicle)
get_follicle_input_curve(follicle)
set_follicle_stiffness_based_on_length(follicle, min_length, max_length, min_stiffness, max_stiffness, damp_scale=1)

at min_length, max_stiffness will be set at max_length min_stiffness will be set inbetween is interpolated

stiffness is achieved by setting the input curve attract

add_passive_collider_to_mesh(mesh, nucleus=None)

Make mesh into a passive collider.

Parameters

mesh (str) –

Returns

List of nodes in the passive collider.

Return type

list

add_passive_collider_to_duplicate_mesh(mesh)
add_passive_to_nucleus(passive_mesh, nucleus)
add_nCloth_to_mesh(mesh, world=False)
set_active_nucleus(nucleus_name)

This sets a global variable that is used by maya to know what nucleus to perform commands on.

nConstrain_to_mesh(verts, mesh, name=None, force_passive=False)

Constrain an ncloth to a passive collider.

Parameters
  • verts (list) – The list of verts to constrain on an nCloth mesh.

  • mesh (str) – The name of a mesh to constrain to.

  • force_passive (bool) – Wether to make mesh into a passive collider.

nConstrain_verts(verts, name=None, force_passive=False)
create_cloth_input_meshes(deform_mesh, cloth_mesh, parent, attribute)
class CMuscle(muscle)
rename(name)
create_attributes(node=None)
add_muscle_to_mesh(mesh)
add_mesh_to_keep_out(mesh, keep_out)
create_keep_out(collide_transform=None, collide_mesh=None, name=None)

Collide a transform with a mesh. It will generate a locator that can be used to drive an aim or an ik, or a set driven key

Parameters
  • collide_transform (str) – The transform that should collide with the mesh. This needs to be a point in space, generally at the edge of the object that needs to collide.

  • collide_mesh (str) – The mesh that should collide with collide_transform.

  • name (str) – the description to give the nodes generated.

Returns

[keep_out_node, keep_out_driven_locator]

Return type

list

get_attached_yeti_nodes(mesh)
create_yeti_texture_reference(mesh)
set_yeti_guide_rest(curve)
get_ziva_geo_names()
is_ziva_tissue(mesh)
is_ziva_bone(mesh)
rename_ziva_nodes_on_mesh(mesh)
copy_ziva(source_mesh, target_mesh)
find_empty_attachment_targets()