Creation Platform: Tutorial 02: Custom Maya Locator
Hey folks.
In this tutorial we will accomplish the implementation of a custom Maya locator node in python from start to finish. To utilize some of the previously collected knowledge we will use the FabricLIDAR extension to load a lidar point data set and render it into the Maya viewport using Creation Platform.
This tutorial is based on the 1.0.29-beta branch of Creation Platform. Please ensure to have the right Creation Platform branch installed and pulled through Git.
Here’s the source code of the maya plugin implementing the LidarLocator:
The steps of the implementation include:
- Setup basic Maya plugin (with initialize and uninitialize callbacks.
- Create an empty maya MPxLocator node.
- Create a scene on construction and close it on destruction of the locator.
- Create a lidar parser and load a file based on a maya string attribute.
- Implement an Emulated Viewport SceneGraphNode which holds Maya’s camera matrices
- Test the drawing with a flat shaded cuboid first
- Recenter the bbox of the lidar data to be able to see it in the Maya viewport.
The locator could of course be extended with additional attributes, for example a list of matrices to allow direct manipulation of objects, float attributes for certain factors. The same way the camera matrices are pushed into Fabric Engine each frame, the same could be done for additional settings to synchronize the Maya scene with the Fabric Engine scene.
Let me know what you think!
Twitter
Facebook
LinkedIn
Vimeo
Google +