Physically based Muscle Simulation

so far so good…


The goal is to create complete character with simulated skin driven by muscle deformations.
More information how it’s done can be found here:

Comments on the current stage of work:
Skin can be created from the scratch or made from the existing model. In this case second option is used which requires further adjustments. First stage is to match all the bones’ joints and skeletal proportions to fit the model precisely. Next stage will be muscle scaling and finally binding the muscles to the skin. All of these actions are taken on single side of the system only and X-Mirrored when finished.

Best Regards!
Albert

I can’t wait to see the progression in here!


I started from matching the model and skeleton to be compatible. This wouldn’t happened if I only chose my character before I created rigged skeleton but the same matching is required when started with the skeleton template rig/model.

Now it’s time to match the muscles to the character. And because in this case skeleton and muscles are using the same type of armature (rigify) whole operation should take no longer than just a second by transferring the armature data from one rig to another.

The goal is to have muscles, skeleton and character model controlled by single rig.

Best Regards!
Albert

PS
Updated skeleton will be available for download in an anatomy bundle.

Decomposition of the systems:


  • Skeletal system
  • Muscle system
  • Skin system

Muscles are automatically adjusted after transferring data between the armatures.

Next step is to adjust muscle sizes to match the character as well as possible.

Best Regards!
Albert

Really interesting, and looks strait forward if you now what you are doing (with I don’t) I didn’t know you can transfer data, it is that vertex data for deformation?
It will be posible to have a custom skeletom or muscles to work like that? I mean for extreme realism?

Yes, add-on is designed to work with custom muscles and rigs. It is its main purpose to use it with own rigs. The anatomy bundle is just a bonus for quick, easy start and tutorials. Once again, the idea of the add-on is to use it with own rigs and create own muscles. Character I make is 100% X-Muscle System based only.

Realism is the target. The simulation is the goal, so at the final stage with the final touch I will add muscle tensions in case of movement and lifting objects.

It is ridiculously simple and can be achieved with few different methods:

  • by drivers which is the most accurate
  • by animating GUI parameters with keyframes
    there are many different parameters supported which can be used for simulating tension:
  • adding shape keys to muscles (driver/animation)
  • changing jiggling physics parameters (driver/animation)
  • changing muscle parameters (driver/animation)

Best Regards!
Albert

Today I merged all three “characters” rigs to one with the smallest effort possible. Usually you would like to work on single rig from the very beginning especially when you start from the scratch but I decided to choose some existing ones from my library.

The “characters” I am using as a templates were created on separate armatures. Each of these armatures had different settings and proportions so moving model with keeping all the Vertex Groups from one armature to another was not straightforward. To merge skeleton, muscles and skin, I generated the new common template rigify Armature and I changed the data for the rest armatures to use this as a reference. I wanted to keep the original armature to which muscles are attached as the to as the final one, and move other meshes (skeleton and skin) to this armature.

So generally speaking the skeleton, muscle and skin at this point were set to using the new rig data but that was not enough for perfect match. Rigify has a lot of constraints so to make it work I had to reset all ‘stretch to’ constraints. I wrote a script for that:

import bpy
context = bpy.context
def reset_constraints():
constraint_to_reset = ‘STRETCH_TO’
dt_bones = []
# Store the names of all the bones that has the relevant constraint
for b in context.object.pose.bones:
if constraint_to_reset in [ c.type for c in b.constraints ]:
dt_bones.append( b.name )
# Iterate over the bones we need to reset
for bname in dt_bones:
bone = context.object.data.bones[ bname ]

                 # Select and activate the current bone
                  bpy.ops.pose.select_all(action='DESELECT')
                  bone.select = True
                  context.object.data.bones.active = bone        
                  # Reset the stretch-to constraint
                  for c in context.object.pose.bones[bname].constraints:
                      if c.type == 'STRETCH_TO':
                          print (c.name)
                          ctx = context.copy()
                          ctx["constraint"] = c
                          bpy.ops.constraint.stretchto_reset(ctx, constraint = c.name, owner = 'BONE')

reset_constraints()

To make it work I had to set the armature in the pose mode, show all 32 bone layers and run it. This should make the final armature to look exactly the same in POSE POSITION as in REST POSITION.

After this operation I can easily reparent skeleton and skin meshes to the single, common rig and preserve their original proportions and previously weightpainted Vertex Groups . :slight_smile:

Now I am happy with everything merged into the one rig

Best Regards!
Albert


This is the very last time before binding the muscles to the skin. Next stage is adjusting each muscle size to match the model’s proportions.

At the current stage the skeleton’s and character’s weightpainting have been corrected and details like nails and eyes added to the model.

Best Regards!
Albert


Here is an example of the visible quaternion interpolation. It is visible especially in the leg region where the model’s mesh is a bit off during the extreme poses. This will be compensated with the valid volume by the muscle system.

Albert


some brief glance at three models matched after muscle fit to model. Adjustment of the muscular system was done on T-Pose and this is the last step before binding the muscles to the skin.

Best Regards!
Albert

This is first seconds after binding character’s skin with the X-Muscle System. I am pretty happy with the automatic results. Note that all microControllers are turned off for rendering (but not disabled) and will be corrected during the manual weight-painting, muscle by muscle and only selected microControllers enabled for the best visual effects. The whole painting and optimization process takes only one side of the character and will be mirrored automatically during the painting thanks to the x-mirror mechanism. This is one of the last steps in the creation pipeline. Regarding the complexity of the model this task can take couple of hours. After that there will be some physics parameters adjustments and animation ahead.


Best Regards!
Albert

very fast comparison straight after muscle binding:


X-Muscle System disabled


X-Muscle System with muscles enabled

Note that microControllers are turned off and will be turned on at the final stage of fine-tuning. Turning on microControllers will allow even more enhancements of the muscles and body jiggling on animation with muscle physics simulation turned on.

Best Regards!
Albert


Some random graphics here because can’t delete duplicated post…

Best Regards!
Albert

Hey,

here’s this fast OpenGL render arm demo

Technology used:

  • skin deformation
  • micro Skin Controllers…
  • muscle pins
    No physics simulation has been enabled yet.

Will update this topic with some other detailed previews before final full character demo will be released

Best Regards!
Albert

Impressive stuff!!:eek:

Impressive stuf, the anatomy is a bit of, but I can see the potential! Keep it up!

Hey!
As long as muscles stay in contact with the skin and they deform it, they do their job :slight_smile: I don’t want to overexpose the effect or… should I? :slight_smile:

Best Regards!
Albert

Just one quick shot with Cycles


Best Regards!
Albert

My GPU has broken and I can not continue my work. High GPUs prices rised by cryptocurrency miners don’t allow me to afford new GPU. I know that it’s funny but it’s not. :slight_smile:

Best Regards!
Albert

Damn, what a big job you are doing, I look forward to further developments, congratulations for your project.