For some time now I've been reading up on the Maya API (this is how plug-ins are made for Maya), but never delving right in because it looked so daunting. Why? Well, learning the API and yet another language (C++) at the same time seemed just too much to take in.
Thankfully, it turns out that there are two Maya APIs, one in C++ (the original), and the other in Python (not to be confused with Python scripting in Maya, which is what I have been doing up until this point).
The main differences between the two is that C++ plugins run much faster than python plugins. However Python plugins don't need to be re-compiled for the many different versions of Maya on different operating systems; and as I'm more fammilliar with Python code is also much easier to read.
So what I have been working on is a custom deformer node with the Python API. I've called it ecs_Displace (prefixed with my initials), and what it does is it displaces geometry based off of a texture. In much the same way as using a displacement map at render time, this will deform the geometry directly, with visible results in the Maya viewport.
It can take any kind of image, including animated procedural textures, both 2D and 3D.
It can even be used to create simple bulging effects without a texture plugged in, using weight painting to isolate the effect.
Here is a demo.
Of course, I'm not the first person to do this though, as there are a couple of other plug-ins that do the same basic thing; iDisplace, SOuP (specificity the peak node, although not quite a simple to setup) and L3Deformer(which isn't free). In all these cases, they are C++ plug-ins, so they are much faster, but the code is inaccessible as they are compiled, and they do not provide the source code. Which of course means that if you need a specific compiled version and they don't have it, then your're a bit stuck.
Anyway, after spending the time to recreate this kind of deformer, I am very happy with what I have learnt, and maybe eventually, when I've had more experience with the API, I will attempt to convert my deformer to C++... and then multi-thread it! OK, I'm getting a bit ahead of myself!
Meanwhile, on the Scripting side of things, I am in the process of creating a base template UI for all my custom tools. Kind of like how all of the tools in Maya follow the same basic template, which is basicaly just a box with widgets in that is not dock-able, can be scaled to sizes that don't even fit the widgets, and can only have one tool open at a time! Mine will be better ;)
But more on that another day.
A Flock of Pixels
Wow! Very impressive!
ReplyDeleteIt certainly sounds impressive anyway! :)
ReplyDeleteInteresting work Ethan. I'm looking forward to seeing it progress.
ReplyDeleteAlso, I'm not sure if you've seen this before but take a look at the link below (banner).
http://www.soundinthecity.co.uk/plasma-screens-hire-london.html
Wow! My monk is famous... and somehow they managed to get a photo with me in on the next slide!
ReplyDelete