Building complex(?) transferable muscle rig, need help with stretch, pulling hairs out

Hello all, I’m building a muscle rig that will be able to be moved between models so you won’t have to create a new muscle rig for each character. Similar to this. https://zivadynamics.com/resources/anatomy-transfer

The goal is to animate in Blender and move to Houdini where I will have an Muscle rig HDA(using their new vellum muscle system) that deals with the simulations side of the muscles, skin, and fat. Which because it’s procedural, after building the asset you/I won’t have to make that many tweaks! Eventually, I plan on releasing the rig for free(with donations) or charge only 5-10 dollars for it.(I can charge more, but I want it cheap because my past self would want something mess with.)
On top of that will be skin deform bones so you can animation both the bones and character mesh at the same time, with a mesh deform cage on top to better match the muscles

I was able to build the rig with everything, the bones to deform the mesh, the bones to correction move the skeleton, but the main issue I’m having is after setting up all the constraints, IK’s scapula rotation, bones movement, etc. Setting up deform bones with stretch(ik and stretch to) completely overrides any other constraint and parents on the bones.

For example, if I have IK on the forearm and if I add an stretch constraint to the humerus, it invalidates the IK, even if it’s off. Adding stretch is the final thing I need to do for this rig and I nearly threw my computer out the window last night trying to get it to work.

Another issue I’m having is the clavicle-humerus rotation, I can get the scapula to follow the correct rotation using a transformation constraint which follows the rotation of the humerus, but I think because the humerus needs to be connected to the clavicle(or at least I think it does with my limited knowledge, especially when it comes to stretch) I can’t create the same relationship.

My hierarchy is skeleton deform bones(adding stretch is causing issues) → mesh deform bones(bones have relationships with the skeleton deform bones) → Animation bones(ik’s, twist, etc)–> mesh deform cage(for matching muscle to mesh).

I’ve been banging this out for the last few days and this is the last step before I can move onto dealing with the muscles. Any help would be greatly appreciated!!

Here’s an basic file of just the shoulder and arm, in my main file the radius and ulna rotate correct, this is just to help with the constraints - https://drive.google.com/drive/folders/1q0CGYUOFA7CjQcuhM5s-dKc5BFgVwKmv?usp=sharing

One workaround I was think it making to rigs, have the stretch bones on one rig and everything else on the other. And when done stretching, apply the stretchy bone rig and then activate the other rig and it’s constraints, but the issue with that is it’s really destructive and if the file corrupts or you lose data then you will lose the stretchy bone portion.

1 Like

You use multiple layers of bones. You IK the leg, then you stretch-to from a bone parented to thigh to, say, a bone parented to calf. I’m not seeing any bones that should stretch in your file, just bones associated with literal bones, which should not stretch.

Clavicle, humerus, scapula all articulate with each other. There’s no right way to do it, and scapula rotation is not fully defined from either clavicle or humerus (any more than clavicle is fully defined from humerus-- to do it right, you need animation data, not just constraints.) Bones do not need “connected” quality in Blender almost ever. Last in-depth skeletal/muscle system I made, I parented scapula to clavicle and then damped tracked a point parented to upper thorax and locked tracked a point parented to lower thorax, which isn’t quite right (like I said, there’s no automatic solution) but was good enough for me. I’m not a fan of transformation constraints because of their dependency on Euler order and the issues that go along with that, but of course if it works for you, go for it.

That is a weird thing to say. Your computer shouldn’t be corrupting files on a regular basis. When it does, it doesn’t matter whether something is in two rigs or one rig. When it does, you revert to backup. I suspect that you’ve been running into some other problem that you decided was due to file corruption even though it wasn’t. Because of how muscle systems work, my first suspicion would be that you were seeing dependency loops.

However, you don’t need two rigs to do this. You can put all the bones in a single armature.

You use multiple layers of bones. You IK the leg, then you stretch-to from a bone parented to thigh to, say, a bone parented to calf. I’m not seeing any bones that should stretch in your file, just bones associated with literal bones, which should not stretch.

I don’t think you understood my post, I’m build a rig that is transferable so it NEEDS stretch to match different body types. Stretch is essential for what I’m trying to do.

You’re right and I think I might have found a way to fix it way too late last night and have yet to try it out yet. My humerus isn’t connected but currently it’s moving/parented with the clavicle for animation friendly reasons as that’s how it’s connected in a traditional rig. And the Clavicle, Humerus, and scapula all articulate each other but the majority of it is driven by the humerus in the Scapulohumeral rhythm. The scapula moves to accommodate the movement of the humerus and the clavicle moves once the humerus rotates a certain amount, which is why I thought it would be a good idea to have them drive each other. But I can’t get the humerus to drive the scapula which in turn drives the clavicle, when I also need to clavicle to move the humerus. But like I said, I think I found a way similar to what you said, I gotta give it a try after work.

I’ve been using blender since 2016. In terms of programs crashing the most, it’s Maya first, then Houdini(a lot from running too complex sims but also really random sometimes, but they are very good at responding to fixes and pushing fixes if it’s not too complex.), and then Blender in last place. BUT, Blender has a far more likely hood to corrupt the file and the back-up file. I’ve lost enough projects because Blender decided to crash and some how get rid of or mess up the backups some how. So, please don’t try to tell me question my knowledge on that.

I was thinking of doing this rig in Houdini as I think it would give me less problems, especially with the awesome Kinefx, but Blender is still my main for animation

I probably don’t. Stretch-to constraints change the posed position of the armature. To re-use your model between multiple different proportions, you need to change the rest position. (And once you do, any stretch-to constraints will need to be recalculated.) If you want, you can apply pose as rest, but you’re still going to need a marker to mark where (say) the elbow is, and then, probably via script, scale an IK bone via its transform values, not constraint.

Still not it. I know what rest poses are. The goal is to have the stretch is to move the constraints along with the bones. Then once the rig is in the right place. Apply the stretch constraints and apply the rest poses. Then everything is will be the same. That’s transferable part.

And then, delete the stretch constraints? What is the IK for in this setup portion?

Given an arm length (which can be established with empties, or bone markers, or anything), you can use a driver for the stretch-- use distance->Y scale-- which will work with IK unlike constraints, even though I’m sure that I don’t understand your entire plan.

I’m at work but I’ll give a better more detailed explanation of the whole project afterwards. This is for hyper realistic rigs for muscles and humans.
I also think I found a solution but if that doesn’t work, I’ll give the driver for stretch you mentioned a try.
Also thanks for the help even though it’s probably not coming across in my post