2018-10-09

prClosestPoint.py making-of

A "new" Maya deformer that can be found here:
Direct file link:

Origin
Initially I just wanted to update my old prAttractNode from 2011 to work in Maya 2016+, for which I only had to update the envelope, inputGeom, outputGeom attributes (MPxGeometryFilter instead of MPxDeformerNode). But then I also added new attributes and changed the existing ones to make it more user-friendly, scalable, functional:
  • Added positions as target option 
  • Set all target type attributes to arrays 
  • Made all targets work simultaneously
  • Added on/off switch attributes
So almost every attribute changed and was not backwards compatible. Which is why I ended up giving the node a new name, that is also more suitable for the algorithm.

Usability
In production I mostly used prAttractNode when modeling. For sticky lips only once or twice. But that might be because of the kind of stylized projects I usually work on. It could be much more useful for visual programming, but many nodes are still missing for that in Maya. Python is also too slow for that, unless the affected vertex count is small enough. 

Code
I would have liked to switch to the Python API 2.0, but the deformer proxy class has not been ported yet.
For the mesh input I switched from MMeshIntersector to MFnMesh, which is slower. I was having issues getting the matrix for MMeshIntersector to work. I used it in the past (see prAttractNode) so it might be a new bug, or I just made a mistake. On the upside it is more user friendly to not require the matrix input for mesh shapes.

Thoughts
The past ~5 years I haven't written any deformers with the Maya API. I mostly used it in Python scripts to improve performance and to use API exclusive features.
I find it strange that basic classes like MPxDeformerNode are still missing in the Maya Python API 2.0 after having tried it for the first time in early 2013.
A visual programming / procedural node option like Softimage ICE, Fabric Engine, Houdini would be a much better fit for most of my deformer needs. I was anticipating something similar for Maya in 2011, but after so many years and seeing what happend with Softimage and Fabric I have no idea if / when it will ever happen.
The verbose low level nature of C++ Maya deformers only seemed to have increased with the new MPxGPUDeformer class. I haven't really looked into it yet, but the devkit example MPxoffsetNode.cpp has ~600 lines of code for a simple one line vector offset algorithm. That seems quite far away from production problem solving and applied math that I would like to focus on when creating a deformer.


New github account

I recently started putting repositories on github:
https://github.com/parzival-roethlein
The link is also in the sidebar

Purpose
  • One central spot for all my public tools. Easier access, support (opposed to creativecrash / highend3d where I used to upload them)
  • Code samples when applying for jobs
  • Get feedback from / collaborate with community

2017-03-03

2014-10-01

Harald rig breakdown


Harald rig breakdown from Parzival Roethlein on Vimeo.

In 2011 I worked on my last student short at Filmakademie called Harald: https://www.facebook.com/haraldfilm

I was responsible for the main character rigs (including blendshape and some meshflow modeling), animation scripts/support and animated one shot.

Final meshflow

At first I updated my PyMEL autorigger from 2010 and rigged the bodies with it. Both spine and the bendy limbs are modified ribbon setups (see older post: Joint chain rigging techniques). There are no (corrective-) blendshapes for the body, only skinning.
The faces use a standard blendshape + joint combination to match the expression sheet and allow for customization. Reverse wrap deformer for eye bulge in eyelid. Eyelid joints sliding on geometry. Rig performance had some priority and the finished rig showing the final deformation (one subdivision level) ran at over 20 fps.

I created some animation scripts for the project Maya shelf including a UI (first time using Qt) requested by the animators, which was supposed to be similar to the one they used in a previous Filmakademie short: Der Besuch

And finally I animated one shot because I always wanted to do that, even thou I am not an animator. My previous experience was very limited, so I had to learn most animation principles for the first time and it certainly was a fun exercise to use my own rigs.

2014-09-22

BabyDragon walkcycle rig breakdown


Baby Dragon walkcycle rig breakdown from Parzival Roethlein on Vimeo.

This is a personal project from early 2013.
When I saw a turntable of the dragon on Vimeo (https://vimeo.com/52581835), I contacted the modeler. And after I was done with the rig a co-worker / fellow student did the animation.

For the neck / spine / tail I used the curve/up-curve setup, described in an older post of mine, with one joint for each spike:
Joint chain rigging techniques

Credits:
Modeller/Surfacing: Angel Navarro angelnavarroart.com/
Character TD: Parzival Roethlein
Animator: Alexander Dietrich cargocollective.com/alexanderdietrich



Unrelated to this post, I recently updated an older post:
Maya naming conventions

2013-06-12

Harald Trailer

Here is the trailer for the last student short I worked on at Filmakademie. I was the Character/Animation TD and animated one shot.



Facebook page for the short:
https://www.facebook.com/haraldfilm

It recently got the SIGGRAPH 2013 Best Student Runners-Up award, yay!
https://siggraphmediablog.blogspot.de/2013/06/european-directors-win-majority-of.html
The Best Student award also went to a Filmakademie project called Rollin' Safari, all clips are online at: https://www.youtube.com/user/rollinsafari/videos

2013-05-02

Maya wrap deformer tips


Attributes:
  • After creating a wrap deformer the driver surface gets a dropoff and smoothness attribute. Usually the user can expect these attributes to be in the deformer ChannelBox/AttributeEditor. This has been changed for the wrap deformer for a case were there is one driver on multiple shapes, so the smoothness attribute gets connected to each wrap deformer. The smoothness only works with Falloff Mode: Volume and Exclusive Bind: off. As the name says it can help create smooth deformations. On the downside it moves unaffected neighbors of deformed vertices in the opposite direction, so that may be a reason not to use smoothness for some cases.
  • When enabled Exclusive Bind improves performance a lot, but may lead to bad deformation. Works especially well when driver and driven have a similar resolution. I used this setting a lot in the past.
  • I usually use Falloff Mode: Surface for smooth results, probably because my driver and driven object usually have a similar shape. The smoothness attribute requires Volume mode thou.
  • maxDistance 0.0 disables maxDistance
Use cases:
  • Deform highres geometry with easier to rig/cloth-simulate low-res geometry. For this case my tip is to output the lowres mesh into a separate mesh node and smooth/subdivide that and then use this highres version of the lowres mesh as wrap deformer driver on the actual highres mesh. The result is surprisingly fast when using exclusive bind etc and allows for much better deformation than using the wrap deformer the normal way and trying to adjust the wrap deformer attributes, which can never work properly (it's a non-barycentric binding) and gets really slow. As with many deformers in Maya, they are not very functional, but they are fast, so when making these procedural deformations you can compensate for the lack of features.
  • When the driving mesh just has a skinCluster I prefer to copy the skinCluster and weights to the highres, because it calculates faster than a wrap deformer and you also have the option of tweaking the weights further.
  • Use as partial blendshape, to be able to work on local area and with those patches drive the final one-piece mesh. Edit membership has to be used to avoid double transformation. Not a user friendly workflow. Exclusive Bind can be used to greatly improve speed (if meshflow is similar).
Example: