 So, I will just quickly go over Maya V2, this is going to be very quick, so I am not really going to get into the nitty-gritty, I have shown you many demos already of Maya V2, showing you the editor, the fact that you can create things on the fly, the fact that you can plug it in, maybe I will show you one demo, but that is about it. Basically it is built on top of traits, TBTK and envisage, so you get the power of all of these tools when you use Maya V2. And because of the fact that I am using these powerful tools underneath, when I wrote, when the code was built, you can just basically focus on building that model right, so you just focus on getting a Maya V thing that is easy to use, scriptable and satisfies what people are generally looking at, it is not perfect, but because it was using these tools it made it a lot easier to build it. Lot of the UI related stuff was not there, I did not have to deal with UI generation issues because traits dealt with most of that and envisage did the rest of the part. As you see it is an envisage plugin and it uses the TBTK scene plugin in order to actually do the visualizations. It uses an MVC based design, though actually the V and the C are kind of combined, actually even the M and the V and the C are combined, but you can separate it out, the view is separatable, so it is not embedded completely in the object model. It uses a simple persistence engine in order to save out visualizations, but I am not happy with that, so there are lots of problems that I see with that and this is something which hopefully in the future will be improved. The general structure of a Maya V window is as follows, you have a scene on the right which you have seen before, which actually does the rendering, you have a python shell on the bottom, on the left you have what is called the tree view, the tree view is basically the world view of Maya V and the way that works is as follows, you have an engine, a Maya V engine which is actually a UOL in envisage world, so you can actually get the Maya V engine from anywhere if you have an envisage application and script it. Now the engine basically manages a bunch of TVTK scenes, a scene is stuff on which the things are rendered, the scene itself contains a bunch of sources and each source can be filtered, so it is a kind of semi inverted VTK pipeline, so you have sources that are filtered, that are in turn visualized, this whole pipeline is sitting inside a scene, that scene is sitting inside the Maya V engine, so that is the kind of framework, you have the engine inside which you have a bunch of scenes, inside which you have a bunch of sources, the sources then go into what are called filters which are filtered, so if you want to contouring the contour would be a filter and then you have something called a module manager which manages a bunch of modules, each module is responsible for doing visualization, so if you see a contour or cut plane or something like that it is a module, the module is hooked up to a source, the source is sitting inside a scene and that is basically the world view, this what you see on the left is a list, a tree like representation of that, so on the top you see a VTK scene, below that you have a file source here, underneath which you have a bunch of modules, one of which is an outline, then you have a streamline and you have an isosurface, the bottom view here is an object editor which means if you click on one of these it will let you edit the properties of any of these objects, and further as I demonstrated earlier you can click and drag on one of these and drop them onto the shell here and script it interactively from Python, that's the big picture from 40,000 feet, so as I told you there's an engine, there's a Maya V engine which contains a bunch of scenes, so if you go back to Eric's talk on trait lists, the way this is done in Maya V2 is scenes is an attribute of the engine which is a list of scene objects, it's a trait list, an engine in addition to this trait has a bunch of methods like start, start the engine which means they're ready for visualization, shut it down, don't do anything, add a source, add a filter or add a model, that's the API, so the engine API is extremely simple, you have scenes that you manage, you start, stop, you can add sources, add filters and add models, the engine contains a list of sources, scenes, the scene in turn contains a list of sources, so scene derives from one, an object called Maya V dot objects dot base, the base object basically has a scene instance, so each object knows to which scene it is rendering into and each of these can be started, stopped and you can add children into these, so if I have a source, source can have a child inside it, so the scene object derives from the base, it contains a scene and has a list of source objects which is again a trait list, so now you can imagine how I'd program it, I just say here is it, here is a list of sources, here is a source, I just push that back into the list of sources, then internally I have handlers which say oh somebody's added a source, set up the pipeline, do things appropriately, in addition you have something called a pipeline base which basically manages all the objects in the, which is the base class for most of the objects in the Maya V pipeline and it does some event handling things like that, from the pipeline base basically I derive the sources, filters, modules and what are called components, so when you look at a visualization module, module basically consists of a bunch of components, so each component will do something, for example an actor, a TBTK actor is responsible for managing the graphics primitive generated by a mapper, it also is responsible for the properties in the texture, so an actor is an ideal component, every module is going to require an actor, so instead of having to rewrite that over and over again, we create a component called an actor component and every module simply uses that, so reusability comes in many forms here, so you have modules, filters and components, the components are the reusable pieces that you put together in order to construct a module, now each of these filters, modules and components has three methods called set up pipeline, update pipeline and update data, so set up pipeline basically sets it up, so let's say I have a data set where I am taking a slice and then doing contours, so I have some data on which I am going to take a section and then I am going to put contours on that, so I need to create a component which does the slicing and then a component which takes the output of the slice data and generates contours, so this setting up of this pipeline is done by the set up pipeline method, now supposing the user goes in and changes some of the data or upstream of this object he changes the pipeline, you have to make sure that the rest of the pipeline executes, so what is done is when you want, when the pipeline has to be executed these methods are called, update pipeline is called whenever the pipeline has changed, whenever the pipeline's data has changed, update data changes and that's it, so you fill out these three methods to do setting up the pipeline, updating the pipeline and updating the data and you are pretty much done with respect to creating a myaV module or component or filter and then you just put these together and you have your visualization, so the pipeline is it's kind of like a simplified VTK pipeline and that's it, so basically engine contains scenes, scenes contain sources, sources are what manage your file reading, your sources which are going to give it as a VTK object, source then manages contains a bunch of filters or modules and that's basically the architecture, so you can actually find get each of these objects, script them, you can move up the hierarchy, come down the hierarchy, so given a VTK, some myaV object, you can always figure out where you are on the pipeline and do interactive things with it from Python, now because it's written in Python and it's from the get go it's designed to be scriptable, you can script myaV in many ways, you can script it by drag and drop which I showed you, drag a node, drop it on the scene on the Python shell and you can actually script that or on the shell, so over here for example I am going to go here and change this to arrows, you see it changed to arrows, now let's say I want to script it, I am going to grab the vectors from here, drop it here, so it drops it into a variable called drag, I am going to just say V is equal to the drag, so now I can say V dot glyph dot glyph source and that's the actual object which is using a glyph source 2D and I could change properties of that, I could also say V dot actor property say color, it's not going to work, so I can say V dot actor, mapper dot scalar visibility equals false, it changed, so I was right, so basically as you can see I can actually script these objects live, you can also generate these as standalone Python scripts, so all of the stuff I showed you just here is doing just that, so this is the source which actually took the data that I generated up front and visualized it with Maya, it says here is a source object, import the code for the source, create a new Maya we seen, say SRC is VTK data source which is this and pass it the data that I built and then add the source to Maya, so basically on the interpreter that you see here, over here the name Maya V is defined already and that's actually done using a runnable, so if you don't remember what a runnable is and this is the engine, Maya V scene engine, as I said you have a bunch of scenes and that's a list, each element on that scene, on that list of scenes is a scene which contains sources and filters and modules, so this is one way of scripting it, you just write a Python file which says add source then add a module, surface enable contours to any property setting you want and vectors and the result is what we saw somewhere here, yeah this one, so it shows you contours inside that tetrahedron and vectors that we change the colors for here, so scripting can be done like this and the methods of use are what you have already seen, new scene, so you can get the Maya V object, say Maya V new scene, add source, add filter, add module, you can also save and load a visualization and that's pretty much it, here's a simple scripting example, I have already shown you many of those and just more details on how you can write standalone scripts, the examples you see here, so for example, so if you look at the structured grid example, I generated the data and this is the function that does the view, okay, so this is just a Python file, so now I can do Maya V2-x as grid.py, Maya V2 will start and then interpret all of this code in its own sweet time, you just do what you do normally on the interpreter over here, cut paste that, put that into an editor, put it in a file and do Maya V2-x scripting, the other is of course a more formal way where you subclass the application and then do things, so I am not going to cover that here, this is a lot easier and I recommend using this approach to scripting and as you saw before the MLAB, Maya VMLAB demo as I showed on ipython-w thread, so all of this actually does work on an interactive live ipython session and that's it.