Aim Constraint with nodes
INTRODUCTION
With the extra time in this pandemic I have taken the opportunity to start optimizing my rigs.
The first step I have taken has been to eliminate the cycles that maya's own constraint creates (in this case I have started with the aim constraint)
Feature list:
- Rotation of the eye on its X axis
- Aim constrain be moving the aim control like the eye itself
- Avoid cycles as much as possible
AIM CONSTRUCTION
The idea is to create 2 vectors (aim, up) and a third vector from these two.
We can calculate the two initial vectors from the position in worldSpace by decomposing it and using the VectorProduct node.
Thanks to the different methods included in this node we can easily calculate the result of two vectors .
Once we do that we can crossProduct both vector to get the third one and compose them again in a 4 * 4 matrix
We will get a clean outliner and a clean node editor of cycles
PERFORMANCE
I use Maya 2018 Evaluation toolkit to Run a performance test, which gives us info about the performance in the different evaluation methods .
In this case, I built the two setups in separate files and then I ran the tests on 50 imported setups.
Vectors constraint
Aim constraint maya
As you can see even with the extended graph we are still getting an increase by using the vectors constraint and dont forget a cleaner outliner.
Nodilus Co-Founder / Senior Generalist Technical Animator at Larian Studios
4 年Hey Jose. Beware that Maya's aim contraint for what you are doing can be heavily optimise to just 4 connections and it will perform faster than the numbers you are showing. Don't know how much faster but will still be faster.