<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:g-custom="http://base.google.com/cns/1.0" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
  <channel>
    <title>Francesco Gioia - 3D RIgging, CFX, Coding blog</title>
    <link>https://www.francescogioia.it</link>
    <description>In this blog, you can find articles related to 3D Character rigging, cfx, muscle simulation, pipeline, and coding.</description>
    <atom:link href="https://www.francescogioia.it/feed/rss2" type="application/rss+xml" rel="self" />
    <item>
      <title>Aim constraint. How does it work?</title>
      <link>https://www.francescogioia.it/aim-constraint-how-does-it-work</link>
      <description />
      <content:encoded>&lt;h3&gt;&#xD;
  
         DCC agnostic aim constraint maths
        &#xD;
&lt;/h3&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  
         We all love aim constraints. They are easy to set up and pretty powerful, if we know how to use them. 
         &#xD;
  &lt;div&gt;&#xD;
    
          But how is an aim constraint really working? That is actually a pretty simple logic, but exploring it is very interesting and will surely give you a good visual exercise for vector maths.
          &#xD;
    &lt;div&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      
           First of all, to properly set up an aim constraint, we need
           &#xD;
      &lt;b&gt;&#xD;
        
            three vectors
           &#xD;
      &lt;/b&gt;&#xD;
      
           :
          &#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      
           - Our
           &#xD;
      &lt;b&gt;&#xD;
        
            base object vector
           &#xD;
      &lt;/b&gt;&#xD;
      
           . 
          &#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      
           - An
           &#xD;
      &lt;b&gt;&#xD;
        
            aim vector
           &#xD;
      &lt;/b&gt;&#xD;
      
           .
          &#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      
           - An
           &#xD;
      &lt;b&gt;&#xD;
        
            up vector
           &#xD;
      &lt;/b&gt;&#xD;
      
           , in most of the 3D softwares the up vector, if not specified, is the y axis. 
          &#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      
           The reason why we need an up vector is that when we are using
           &#xD;
      &lt;b&gt;&#xD;
        
            euler angles
           &#xD;
      &lt;/b&gt;&#xD;
      
           (the x, y, z rotation system that we use every day to manipulate our objects) after 180 degrees, since the angle considered is always the smallest one, 
           &#xD;
      &lt;b&gt;&#xD;
        
            the other side is considered
           &#xD;
      &lt;/b&gt;&#xD;
      
           (essentially, if we are rotating 270 degrees for instance, the angle calculated would actually be the remaining 90°).
          &#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      
           Without going too complex to that,
           &#xD;
      &lt;b&gt;&#xD;
        
            this leads to flipping
           &#xD;
      &lt;/b&gt;&#xD;
      
           , and setting an up vector essentially sets in which cases our object will flip. Relying on a custom up vector is useful because we can use for instance an object in our rig that is connected to the rest of the rig, so the up vector is changing every time the rig is transformed an this helps to reduce flipping.
          &#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/div&gt;&#xD;
    &lt;div&gt;&#xD;
      
           This is why the more complex system of
           &#xD;
      &lt;b&gt;&#xD;
        
            quaternions
           &#xD;
      &lt;/b&gt;&#xD;
      
           was introduced. I won't cover quaternions in this article, as they are definitely on a more advanced side, but they are essentially
           &#xD;
      &lt;b&gt;&#xD;
        
            4 floats vectors
           &#xD;
      &lt;/b&gt;&#xD;
      
           . where 3 of the 4 components are
           &#xD;
      &lt;b&gt;&#xD;
        
            not real numbers
           &#xD;
      &lt;/b&gt;&#xD;
      
           , but
           &#xD;
      &lt;b&gt;&#xD;
        
            imaginary ones
           &#xD;
      &lt;/b&gt;&#xD;
      
           , that are not affected by the issue that I described above (and neither others, for instance gimbal lock, under certain circumstances).
          &#xD;
    &lt;/div&gt;&#xD;
  &lt;/div&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/aimConstraint1.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           fig. 1 We start from the base, aim and up vector.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/aimConstraint2.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            fig. 2 We are now finding the (up - base) vector and the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           new aim
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           , which is essentially the vector we are going to use to aim the object.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/aimConstraint3.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            fig. 3 Doing the cross product between the new aim and the (up - base) allow us to find the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           normal vector
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , which will be used as a
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            side
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            vector for our aim constraint. Notice that the cross product points inward/outward depending  on the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           right hand rule
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            . It is a good idea to
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            normalize
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           our cross product (dividing it by its magnitude to get the same vector but with the magnitude of the unit vector).
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/aimConstraint4.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            fig. 4 Doing now the cross product between the side and the new aim (and normalizing) will give us a perpendicular
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           up vector
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           .
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/aimConstraint5.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            fig. 5 We now have
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            3 perpendicular vectors
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           (it may be a good idea to normalize the new aim as well) and we can compose a
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            4 by 4 matrix
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           .
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            The last row represents the transform and since in an aim constraint that doesn't need to change we can set it back to the obj's base coordinates.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           What if we want to add an offset to this aim constraint
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           ? This is extremely easy. When we apply an aim constraint with the "mantain offset" option turned on, for instance in Maya, it basically just stores the three base rotation values of the object to a 3 float attribute and adds them to the result rotation of the decomposed matrix.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;</content:encoded>
      <pubDate>Tue, 20 Sep 2022 10:41:55 GMT</pubDate>
      <guid>https://www.francescogioia.it/aim-constraint-how-does-it-work</guid>
      <g-custom:tags type="string" />
      <media:content medium="image" url="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/aimConstraint4.jpg">
        <media:description>thumbnail</media:description>
      </media:content>
      <media:content medium="image" url="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/aimConstraint5.jpg">
        <media:description>main image</media:description>
      </media:content>
    </item>
    <item>
      <title>Bison rig and simulations</title>
      <link>https://www.francescogioia.it/bison-rig-and-simulations-study</link>
      <description />
      <content:encoded>&lt;h3&gt;&#xD;
  
         Bison rig and simulations
        &#xD;
&lt;/h3&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  
         This is a pretty old project that I finally had the time to finalize. My goal was to create a walking shot with muscles, fat and skin sim. I already did a lot of muscle sims in the  past, but I must say that I am pretty happy with this one.
         &#xD;
  &lt;div&gt;&#xD;
    
          I will publish soon a full article showing the breakdown of the process!
         &#xD;
  &lt;/div&gt;&#xD;
  &lt;div&gt;&#xD;
    &lt;br/&gt;&#xD;
  &lt;/div&gt;&#xD;
  &lt;div&gt;&#xD;
    
          CREDITS: 
         &#xD;
  &lt;/div&gt;&#xD;
  &lt;div&gt;&#xD;
    
          Animation - Stefano Colombo
          &#xD;
    &lt;a href="https://www.instagram.com/coste999/"&gt;&#xD;
      
           https://www.instagram.com/coste999/
          &#xD;
    &lt;/a&gt;&#xD;
  &lt;/div&gt;&#xD;
  &lt;div&gt;&#xD;
    
          Modeling and texturing - Nicolas Morel
          &#xD;
    &lt;a href="https://nicolasmorel.gumroad.com/"&gt;&#xD;
      
           https://nicolasmorel.gumroad.com/
          &#xD;
    &lt;/a&gt;&#xD;
  &lt;/div&gt;&#xD;
&lt;/div&gt;</content:encoded>
      <pubDate>Mon, 11 Jul 2022 11:58:43 GMT</pubDate>
      <guid>https://www.francescogioia.it/bison-rig-and-simulations-study</guid>
      <g-custom:tags type="string" />
    </item>
    <item>
      <title>Anatomical study of the upper torso: Automatic clavicle-scapula rigging system</title>
      <link>https://www.francescogioia.it/anatomical-study-of-the-upper-torso-an-automatic-clavicle-scapula-rigging-system</link>
      <description />
      <content:encoded>&lt;h3&gt;&#xD;
  
         Introduction
        &#xD;
&lt;/h3&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           In this post, I would like to give an introduction on the upper torso anatomy, as well as showing my favourite rigging system for this part of the body. In particular, I will demonstrate the setup on a skeleton model, and the best application is to rig skeletons for muscle simulations, such as in Ziva. Having a good skeleton rig really helps a lot to have stable simulations and proper bony landmarks.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           This doesn't mean that you can't use this setup to achieve better deformations as well as some fake-scapula sliding in your skinned models.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Anatomical Study
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           In this post, I am going to describe the appearance and functionality of three main bone structures: Clavicles, Scapulas, and ribs.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           The clavicle (also known as the 
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           collarbone
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            ) connects the top part of the sternum (also know as manubrium) to a scapula process called
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           acromion.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           The scapula connects the humerus with the clavicle. It has no direct bone connection to the ribs, but it rather slides over them, and the connection area is usually referred as scapulothoracic joint.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Rigging these parts, we have to take into account both the sliding behavior of the scapula and the pivot of the clavicle.
           &#xD;
      &lt;span&gt;&#xD;
        
            ﻿
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Kinesiology
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           In terms of movements, we can identify 8 main scenarios:
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;ul&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             Adduction
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            - Clavicles rotate inward, the scapulas get closer.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Abduction
           &#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             - Clavicles rotate outward, the scapulas get farther.
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             Elevation
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            - Clavicles rotate upward, the scapulas elevate in a vertical path.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             Depression
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            - Clavicles rotate downward, the scapulas drop in a vertical path.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             Upward Rotation
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             - This happens when raising the humerus after a certain angle (usually 70 to 90 degrees depending from person to person), the clavicles rotate upward and the scapula both raises and rotates outward.
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             Downward Rotation
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            - Opposite to the upward rotation.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Protraction
           &#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             - Clavicles rotate outward, vertebrae bend forward slightly, the scapulas abduct and there is a tilt in the anterior part.
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
    &lt;li&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Retraction
           &#xD;
      &lt;/span&gt;&#xD;
      &lt;span&gt;&#xD;
        &lt;span&gt;&#xD;
          
             - Opposite to the protraction.
            &#xD;
        &lt;/span&gt;&#xD;
      &lt;/span&gt;&#xD;
    &lt;/li&gt;&#xD;
  &lt;/ul&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;a href="/"&gt;&#xD;
      
           Deformation tips
          &#xD;
    &lt;/a&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            I won't cover much of the deformation side here, but I will give some quick tips about the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           main muscles
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            bony landmarks
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            visible from outside.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            In terms of bony landmarks,
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            acromiom
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            is probably the most visible, as well as the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           spine of the scapula
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           inferior margin
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , and the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            medial border
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           in adduction. The clavicle itself is all pretty visible even with high fat percentages.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            In terms of muscles, it depends on the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           fat percentage
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            level of hypertrophy
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            of the muscle itself. Of course, the two main muscles of the back are the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            trapezius
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           latissimus dorsi
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           , but I would say that on a trained person it is easy to see the
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            posterior delt
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           teres major
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and even the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            infraspinatus
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           .
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Notice that the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           posterior delt is usually underdeveloped
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           , compared to the other deltoids, this is mainly because most of the training programs privilege front and side delt, as well as press exercises, therefore keep in mind that the posterior delt will be usually a bit smaller then expected on a pretty muscular person.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/anatomy.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Base Photo by ShotPot - pexels.com
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Rigging Approach
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Range of motion test
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            ﻿
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;a href="https://www.youtube.com/watch?v=rRIz6oOA0Vs&amp;amp;t=8s" target="_blank"&gt;&#xD;
      
           Reference video
          &#xD;
    &lt;/a&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;</content:encoded>
      <pubDate>Sun, 29 May 2022 23:09:50 GMT</pubDate>
      <guid>https://www.francescogioia.it/anatomical-study-of-the-upper-torso-an-automatic-clavicle-scapula-rigging-system</guid>
      <g-custom:tags type="string" />
      <media:content medium="image" url="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/copertina1.jpg">
        <media:description>thumbnail</media:description>
      </media:content>
      <media:content medium="image" url="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/copertina1.jpg">
        <media:description>main image</media:description>
      </media:content>
    </item>
    <item>
      <title>Different approaches in creating a custom blendshape deformer in Maya API, Bifrost, Blender and Houdini using VEX, Python and C++</title>
      <link>https://www.francescogioia.it/different-approaches-in-creating-a-custom-blendshape-deformer-in-maya-blender-bifrost-and-houdini</link>
      <description />
      <content:encoded>&lt;h3&gt;&#xD;
  
         Understanding BlendShapes
        &#xD;
&lt;/h3&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Blendshape nodes are among the most important deformers used in Maya (and not just there! Similar nodes are implemented in
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           almost every 3D software
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           ).
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Different types of behaviors can be implemented, usually, the most common approach is the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           vertex order-based
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            one, but
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           UVs can be used as well
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           .
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           In this post, I will go for the vertex order-based one.
           &#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Software agnostic blendShape math
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            The formula to get the final position of each point is rather simple, let's take a look at
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           fig.1
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           .
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Given
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            two geometries
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            (SOURCE MESH, TARGET MESH), we can identify
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           m1
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           m2
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            as the respective transform
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           matrices
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , and
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            pos1
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            pos2
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            as the respective
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           positions
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           .
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            To calculate the distance from the source and destination points, first of all, we will need to put them in the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           same space
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , this can mean that the target mesh can go to the source space (m2 to m1), source mesh can go to target space (m1 to m2) or they can both go to a third space (like world space for instance, in this case m3).
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           fig.2.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Finally, we can simply
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            subtract
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            pos1 from pos2 for each point, this will be the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            increment
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            needed to blend from the source to the target position. The source geometry is then brought back to its
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           original space. fig.3.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/blendshapeMath1-33b00ecd.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/blendshapeMath2-3f80958e.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/blendshapeMath3-46446a85.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Houdini
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Creating a blendShape behavior in Houdini is extremely easy with
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           wrangle
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           nodes
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           . The Point wrangle node is iterating through each point in the mesh, so we don't need to implement any kind of complex setup.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Given two geometries with the same topology, and a point wrangle node with the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           source object plugged at pos 0
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
             and the
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            destination object plugged at position 1
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           , the following VEX code will blend between the two positions:
           &#xD;
      &lt;span&gt;&#xD;
        
            ﻿
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            The
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           @paintedWeight attribute
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            is optional and is added using an
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           attribute paint node
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            if you want to make the deformer paintable.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Notice that we could also use this kind of approach:
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           v@P = lerp(@P, v@targetP, (@blendWeight*@paintedweight));
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            // that linearly interpolates the two positions
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/houdini.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Bifrost
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Implementing the setup in Bifrost is simple. As Houdini does with the wrangle node, Bifrost does all the geometry iteration for us. We will just have to reuse the same equation:
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           newP = baseP + (targetP - baseP)*blendWeight
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/bifrost.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Blender
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            The approach I used in Blender, using geometry nodes, is probably the easiest one. More vector math-based ways could be used as well, but this already gives us a pretty decent result. Also, unlike the Houdini solution, this one does take into account the transforms of the geometries. I won't cover here how to implement a setup that takes into account the transforms in these cases where it is not automatically done (eg. Maya MPxDeformerNode deform method already does this for us, and also has an MMatrix&amp;amp; argument that represents the geometry's world space transformation matrix) as it is a bit more tricky and would require some research.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Just to give a quick tip, the main logic that I would implement to achieve that is to use matrix multiplication to have the same space for both the geometries and then use the inverse matrix to send it back after the deformation calculation.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Notice that I used
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            mixRGB
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            to blend between the two positions. At the end of the day,
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            vectors3
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            are just arrays of
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           3 floats
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , so color nodes will usually be able to handle vectors in most cases.
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            ﻿
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div&gt;&#xD;
  &lt;img src="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/blender.jpg" alt=""/&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Advanced: Maya API - Python prototype
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            To create a custom deformer node, we are going to create a child of the class 
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Maya.OpenMayaMPx.MPxDeformerNode
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            . Please consider that Maya
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            python API 2.0 is not suitable
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           to create deformers.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           I will prototype the node in python and then will convert it to C++.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            As this is a custom python plugin, it will need to be
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           loaded as a plugin
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            . Let's implement the base class and the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            initializePlugin
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            uninitializePlugin
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           methods (these are built-in functions that Maya calls when we try to load/unload a plugin).
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            creator
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            initialize
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            are two methods that are needed to
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           register a new node
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            and to
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           create the desired attributes
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            on that. Let's now fill the initialize method
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            At this point, we can start implementing the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            deform
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            method, which is the one called to deform the mesh. It has four arguments, an
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           MDataBlock&amp;amp;
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            , which is used to query the values of the attributes from the node, a
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           MItGeometry&amp;amp;
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            that loops around each point of the mesh, an
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           MMatrix&amp;amp;
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            which is the world space matrix of the geometry, and an integer which is the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           index of the geometry plugged
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            in the inputs of the node. Refer to the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;a href="https://download.autodesk.com/us/maya/2009help/API/class_m_px_deformer_node.html" target="_blank"&gt;&#xD;
      
           documentation
          &#xD;
    &lt;/a&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           to know more about that.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           First of all, we will need to query a few argument values from the data block, also, I will create an MPointArray which contains all the points of the target mesh.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            At this point, we are ready to iterate through the points of the base mesh and to implement the deformation,
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Finally, I added a few lines to make the deformation paintable, here is the final code.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            At this point, you will just have to
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           save it as a .py file and load it as a plugin
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           , then select the source geo, run the `
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           deformer -type "BsDeformer"
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           ` line in the mel tab, and plug the outMesh of the target geo into the blendMesh plug.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;h3&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Advanced: Maya API - C++
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/h3&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           The conversion to c++ is pretty straightforward but requires a bit more Maya API knowledge as soon as some foundations on how to compile Maya plugins.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           I won't go very in-depth since it is a pretty advanced topic, but I leave here the code, I tried to comment it as much as I could.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;br/&gt;&#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            I usually add 3 files:
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           An header file
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            where I define the node class,
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           a cpp file
          &#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            where I describe the overwritten methods, and a
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            pluginMain.cpp
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           file where I add the initializePlugin and uninitializePlugin functions.
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      
           Here is the header:
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Here is the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           customBlendShapeDeformer.cpp
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;div data-rss-type="text"&gt;&#xD;
  &lt;p&gt;&#xD;
    &lt;span&gt;&#xD;
      &lt;span&gt;&#xD;
        
            Finally, here is the
           &#xD;
      &lt;/span&gt;&#xD;
    &lt;/span&gt;&#xD;
    &lt;span&gt;&#xD;
      
           pluginMain.cpp:
          &#xD;
    &lt;/span&gt;&#xD;
  &lt;/p&gt;&#xD;
&lt;/div&gt;</content:encoded>
      <pubDate>Thu, 12 May 2022 22:31:17 GMT</pubDate>
      <guid>https://www.francescogioia.it/different-approaches-in-creating-a-custom-blendshape-deformer-in-maya-blender-bifrost-and-houdini</guid>
      <g-custom:tags type="string" />
      <media:content medium="image" url="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/bifrost.jpg">
        <media:description>thumbnail</media:description>
      </media:content>
      <media:content medium="image" url="https://cdn.website-editor.net/s/5002dc5302164881aa435e62efba0131/dms3rep/multi/bifrost.jpg">
        <media:description>main image</media:description>
      </media:content>
    </item>
  </channel>
</rss>
