.. MASH Technical Documentation file, created by  by Ian Waters
   sphinx-quickstart on Wed Apr 19 16:21:02 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

The MASH API
************************
The MASH API is a series of helper scripts that can be used to automate the setup and manipulation of MASH networks.

Basic Example 1.
===================
Create a MASH network, add a couple of nodes, and print out some useful information.

.. code-block:: python

	import MASH.api as mapi
	import maya.cmds as cmds

	sphereToDistributeOn = cmds.polySphere(r=12)
	cmds.polyCube()

	# create a new MASH network
	mashNetwork = mapi.Network()
	mashNetwork.createNetwork(name="HelloWorld")
	# print out the default node names
	print mashNetwork.waiter
	print mashNetwork.distribute
	print mashNetwork.instancer
	# add a Signal node
	node = mashNetwork.addNode("MASH_Signal")
	# set the signal node to have some scale noise
	cmds.setAttr(node.name+".scaleX", 10)
	# print out the name of the signal node
	print node.name
	# add a Falloff to the Signal node
	falloff = node.addFalloff()
	# move the falloff
	falloffParent = cmds.listRelatives(falloff, p=True)[0]
	cmds.setAttr(falloffParent+".translateX", 8)
	# make it so the network distributes onto the surface of a mesh
	mashNetwork.meshDistribute(sphereToDistributeOn[0])
	# set the point count of the network
	mashNetwork.setPointCount(1000)
	# print all the nodes in the network
	nodes = mashNetwork.getAllNodesInNetwork()
	print "All nodes in network: "
	print nodes
	# find all the falloffs in the network
	for node in nodes:
	    mashNode = mapi.Node(node)
	    falloffs = mashNode.getFalloffs()
	    if falloffs:
	        print node+" has the following falloffs: " + str(falloffs)

Basic Example 2.
===================
Attach an existing network to Network class.

.. code-block:: python

	import MASH.api as mapi
	mashNetwork = mapi.Network("MASH1")
	print mashNetwork.waiter
	print mashNetwork.distribute
	print mashNetwork.instancer

See the MASH API Examples page for more examples.

========================================================

.. automodule:: api

The Network Class
===================

.. autoclass:: Network
    :members:

The Node Class
===================

.. autoclass:: Node
    :members: