Mostrando entradas con la etiqueta Programming. Mostrar todas las entradas
Mostrando entradas con la etiqueta Programming. Mostrar todas las entradas

MAYA - First maya plugin in C++



I recently started playing around with C++ the Maya API.
I am not new to Maya, so it hasn't been that difficult to begin this process. The hardest part was probably to change my mindset from Python to C++, and try to find the equivalent functions from one to the other.
Another difficulty I found was to move the gizmo from my first Legacy Viewport implementation (which by the way, it was fairly straight forward) to the Viewport 2.0 classes, which are way wider but less intuitive.

The plugin consists of 3 classes:
  • The Locator Node (shape and transform), which for a given vertex index, a meshShape and a transform node, it outputs the world space transforms of the vertex, and draws a gizmo with the pivot point axis. This transform is calculated by getting the average normal of the vertex and casting a look at function. It takes the Y axis as UP vector so there is an arbitrary roll there, but this can be fixed with a transform rotation offset.
  • The Viewport 2.0 DrawOverride Class, which just draws the 3 lines that represent the pivot point in object space.
  • The Command Class, which essentially passes on the selected object and index to the main class (DG Node Class). It also creates the connections in the DG which are:
    • Out mesh from mesh node to the inMesh of the Plugin DG node.
    • World transform matrix from the mesh to the inMatrix of the Plugin DG node.
    • The out values of the Locator Shape into the Locator Transform.

What was left to do:
  • Adding the offset for the roll and passing the world scale.
  • Getting programatically the world space matrix from the meshShape node istead of getting it from its world mesh plug. I already did this, but it wasn't being called dirty if the mesh was moved. I thing that if I set the meshIn attribute as  setAffectsWorldSpace, this can be fixed.
Anyhow I will add an update in the future and perhaps translate it into a python plugin.
Thanks for reading,




MAYA - Connect Animation Tool


Sometimes in a production environment I have found that procedures were either not followed or not even established in the first place. Many times I have found a lack of a good technical supervision, which ended up leading to many problems further down the line.

Some of the issues I have found in the Animation industry using Maya are:
  • Referenced animation rigs with prefixes instead of namespaces.
  • Wrong distribution of the DAG hierachy.
  • Redundant keyframes
  • Parent constraints that over-complicate an animation.
  • No compatible rig versions for a very same prop.
  • Undesired reference edits in animation files (like shaders/textures overwrites).
Many times reimporting a brand new copy a referenced rig was the quickest solution. For making this task faster and less painful I have put together a bunch of scripts I wrote in the past and re-implemented them in a tool using PySide2 in Maya. The main point of the tool is to transfer animations between referenced rigs.

The tool is fully dockable and remembers position and data between sessions for a given user.
In this video I show how it works. I have already proven it in a production environment and it works nicely, but there is still room for improvement.

For two given referenced rigs, this tool redirects the animation curves from one rig into the other, having in the end both with the same keyframes.

I have added additional options like:
  • Bake: this bakes the animation curves before transferring them, this allows to have parent constraints in the input rig without passing them into the output rig.
  • Color feedback: it will tell you which controls are compatible.
  • It automatically creates a key at the firt frame of a given control if it has no keyframes at all (for when someone forgets to add a key but yet modifies any transformation value).
  • Optimize: deletes reduntant keys, for when several keyframes in a row have the same value (like after baking an animation). This can take a long time for big scenes with complex animations, so I will have to refactor the script.
  • Use long name: sometimes two same maya objects have the same short name due to a bad workflow with namespaces and DAG. This allows to overcome this issue.
  • It automatically bypasses whether the input/output have a prefix isntead of a namespace. The tool will just detect it and make the necesary string manipulation to copy the animation.
  • It has a progress bar which allows the user to cancel the process by pressing the Cancel button.
This was a great practice for me to learn the PySide2 library and extend some of its classes.

Kind regards,

Plotting a function in openGL



I remember being intrigued back in the day about how did the Graph Plotter node in Unreal Engine worked.
I always saw that due to the uneven UVs aspect ratio it created glitches, stretching the plotting line.
This is obviously a minor issue, but I tried to research how to avoid this.

It turns out that using the gradient of the function can fix this, because it creates a "height map" following the line of biggest grow.
The maths behind this require a good background in algebra and it is very nicely explained in the following link at Iñigo Quilez website (a great source of computer graphics knowledge).

https://iquilezles.org/www/articles/distance/distance.htm

He also implemented it very nicely in this link:
https://www.iquilezles.org/apps/graphtoy

I will have a look in the future at filly implementing this in Unity.

Have a great rest of your day,

UNITY - Gerstner Waves in Unity


I have implemented a Gerstner system in Unity. This was done with the help of several tutorials I found on the internet. I am quite happy with the result. I guess the next step is to add a proper water shader!

The waves are generated in the shader directly and it supports up to 3 waves added together.
Another thing I would like to have a look in the future is to calculate this in the CPU and movingthe verteces directly in the CPU.

Kind regards,

UNITY - SDF in Unity



So just to continue with my SDF and Ray marching adventure I implemented it inside unity, using a very similar shader. This was done with the help of all the great people on theinternet!




First Ray Marcher

I  have been wanted to have a look at this for a while and I finally found the time to do it.
This is a very interesting subject for me because this simple concept can develop into much more complex ideas, like generate a beautiful looking cloud system.


UE4 - Tech Art Demo 2018

This is a brief summary of some of the tools and utilities I developed during my work at Holosphere VR.
Most of it was done using UE4.



Kind regards,


UNITY - Unity game

This is a game I did during a Unity course (provided by WalkerBoys Studio) in order to learn this awesome game engine. You can find the full free course here: http://www.walkerboystudio.com/wbstudio/learn-unity/

You can also play my game here: https://sites.google.com/site/dontmovestudio/games/02_shooter (unity webplayer is necesary). Enjoy it!

I also did a super cool Super Mario Clone but unfortunately all the files went missing :( It had a much better UI (because of the new unity UI system) and far more cool graphics (because of the sprites provided by WBS). R.I.P. Super Mario Clone…

Season 4 of Talking Tom and Friends Finale is here!!

We have finally launched the last episode for this season! I am very happy to be working with such an amazing team with people coming...