Use masks as part of materials in cycles Intro:

Ok, so I'm new to blender and have looked all over the internet, and blender is not working as expected (and all the usual that seems to be the required greeting on this site...)

Question.

I can use masks created in the movie clip editor (or the UV/Image editor) in the compositor to combine elements. 



How can I use masks to combine shaders and textures?

I could render the mask as an image sequence ,and plug the images as a texture in the material editor. But then every new adjustment  that has to be made in the mask means that the sequence has to be re-rendered. Not the best workflow. Masks being vectors have so many advantages over pixel based files, on top of that it is easy to rotoscope using tracking tools, also they are quite easy to animate and allow fine control when it comes to feathering.

Is there some python amazing script, animation node, add-on, or secret menu for the initiated that allows the mask information to be used interactively on the material editor?
No, the MCE or UV/Image editor's masks will not translate upwards to the 3D view. 

They occur in the post phase of Blenders sequence of operations. Also I am told that its to hard to make a rasteriser for arbitrary material parameters. I guess they would have to operate at screen space?
You can see a more thorough breakdown of this at my blog.

The work around is to use Curve objects edited to an appropriate shape. You can use the tracker to map Hook objects in the camera view, these can be used to distort the curve object. Then project your texture onto the object as required.



Use an empty to control all dimensions.


You might notice that you cannot have a feathered edge for the same non rasterising reason. You can place a beveled glass object above then use its transmission ray to to fake a falloff, but you will be stuck with the shape of that object not your mask.