In barycentric coordinates - part 1 I showed a way to compute the barycentric coordinates for an interior point in a triangle, and described how the result could be used in a simple constraint example.
In part 2 I am going to show a python OpenMaya code example that could be used as the basis for some kind of data interpolation between meshes with differing topology.
Barycentric coordinates are useful when you want to transfer data between meshes that have different topology because they provide the basis for some simple interpolation. Take smooth skin binding for example. It is a commmon workflow, when painting weights, to start with a low resolution version of your mesh. When you are happy with the weighting you can use maya's copySkinWeights command to transfer those weights from the low resolution mesh to the detailed high resolution mesh, which may even be made up of several pieces. copySkinWeights interpolates the weights from the verts on the lo res mesh and copies the result to the hi res mesh. The smooth result you get with this workflow is usually something that would have been very difficult to achieve if you had tried to paint the weights directly on the hires mesh.
Since I don't get the time to update this blog much anymore, I thought I'd just drop in quickly to recommend a google groups mailing list that I have been contributing to for a while now. If you feel like some question/answer type discussions focused specifically on problem solving in maya this might be the place for you. There are a great bunch of knowledgeable people posting there already from time to time, but more will always be welcome. Just enter "maya he3d" in the google groups search.
Yesterday I wrote about my experiences with the OpenMaya modules for python in maya, and showed some code to get the closest vertex on a mesh from the position of a locator. Today I'm going to show the same code, rewritten to use the new Maya Python API 2.0, which, according to the intro in the manual, " is a new version of the Maya Python API which provides a more Pythonic workflow and improved performance." (more...)
Recently I was writing a python function where I needed to find the mesh vertex closest to a locator. I already knew how to get a list of vertices from my mesh, how to get their worldspace locations and how to iterate through them calculating the distance between each one and the locator to determine the closest. But the brute force approach would have been pretty slow on a dense mesh.
I'm not very familiar with the OpenMaya classes, but I was pretty sure one of them would have a method that would make this task much faster, so I began to google the problem.
Here is what I found... and what I had to do to get it to work. Advanced coders will probably find this trivial, but I'm guessing there are others like me that will find it interesting. (more...)
A few people have asked me if there is a way to use my uv layout script, djPFXUVs, on a paint FX mesh that is animating. The answer is "yes". Keep reading if you are interested in knowing how...
This mel script creates a renderLayer that can be used to quickly render mattes for selected objects or groups of objects with the VRay for Maya renderer.
As you can see from the screen shot, djVRayCreateMatteLayer.mel looks very similar to the mentalray mattePassMaker.mel script which I wrote about in my previous post. In fact djVRayCreateMatteLayer.mel is an attempt to emulate the mentalray matte pass functionality using "VRay Render Elements".
At this point in time I am fairly new to vray and vray is relatively new to maya so djVRayCreateMatteLayer.mel should be viewed as a work-in-progress, but one you may find useful if you ever need to create mattes using vray. (more...)
You can use this script to create black and white matte renders using mentalray's pass system which means that it takes no longer to render 100 mattes than it does to render one. And since the script makes it so easy to set up these passes you can render a separate matte for every object in your scene, if thats what you want, or for combinations of objects that you select or based on the materials that are assigned. (more...)
Here's a simple method you can use to add a bump map to the mi_car_paint_phen_x material without using custom shaders or complicated shading networks.
If the emails I get are any indication, then I'd say there is a fair amount of confusion around the subject of linear workflow in mentalray for maya. And over the past few years in my search for answers I have contributed my share of half truths and misinformation to the discussion. So, in the next few paragraphs I'm going to state simply and without detailed explanation how to achieve a linear workflow in mentalray for maya by doing two things. Simple! (more...)