Home Website Youtube GitHub

Spine & Neck Max Stretch issues - need help please

I ran a quick test with “force uniform scaling” on and it looks like it works for the spine stretch issues.
Thanks Miguel.

2 Likes

Hi Miquel.
Did you ever get around to writing that script?
I am not a coder but I am trying to write my own script.
I am putting a group above each joints, then moving all the connections from the joint to the group.
It gets rid of the shearing.

The problem I am facing now is that some of the joints have joint orient values which I don’t know how to transfer to the group above the joint (the incoming connections that used to go to the joints seem to override anything I try), so the shoulders and hips where the joint orients change don’t rotate in the correct axis.

Is there a plan to fix this other than using uniform scaling?

Thanks for any info as to how I can approach this!

Hi Zan, what version of Maya you are using? Did you try to use uniform scaling? Are you still seeing shearing problems after using uniform scaling?

Here is a script I wrote that forces uniform scaling on joints. I wrote this for a completely separate problem, so there is no guarantee this is going to help you or even run properly. It queries which connection is coming in for the scaling, and then connects one single attribute to all 3 scale attributes. So for example, if it is a scaleConstraint, then the scaleX output of the constraint will connect to X, Y, and Z.

(If the connection is coming from a compound attribute, then I imagine this will fail. eg. .scale instead of .scaleX)

To use it, select the bones you want to force to be uniform scaling, then run the script.

import pymel.core as pm
# Force uniform scaling. Sample the scale connections
# And then connect all 3 to one single attribute.
attrs = ['sx', 'sy', 'sz']

bonesToFix = pm.selected(type='joint')
for each in bonesToFix:
    # First, skip any that are not connected at all
    if any([each.attr(scaleAttr).inputs() for scaleAttr in attrs]):
        scaleAttrs = [each.attr(scaleAttr) for scaleAttr in attrs]
        
        scaleInputs = [
                [scaleAttr, scaleAttr.inputs(plugs=True)]
                for scaleAttr in scaleAttrs
                if scaleAttr.inputs(plugs=True)
                ]
        
        firstScaleInput = [x[1] for x in scaleInputs if x[1] != []][0][0]
        for scaleAttr in scaleAttrs:
            firstScaleInput.connect(scaleAttr, force=True)

5 Likes

Hi Chris!
You are always first to help :slight_smile:
Im using maya 2020.
Uniform scaling works fine.
I want to have some controls to be able to scale in one axis only, so I was trying to script what jerome said would solve it, bit cant seem to quite get what I want. The main problem are the joints that have a different orientation so hips shoulders etc.