corrective shape key script for 2.5

very cool, thanks Loolarge

thanks for the updates.
Blender Projects Page
Extensions Svn
will move to Extensions Release soon.
Please contact me on IRC freenode #blenderpython
thanks.

Updated the script again, works with revision 31214. Link: http://www.ivogrigull.com/blender25/add_corrective_shape.py

Updated again. I fixed a bug in the fast method where it would get confused with non-bone vertex groups that altered/smashed the result. Works much more pleasant now.

thanks again for the update Loolarge

Sorry, i was on holiday for a while :smiley: The script works now with revision 32345 (latest)

nice!!! Thank you :slight_smile:

Could you please update? When I use the script in revision 32738 I get this effect:

http://img408.imageshack.us/img408/2355/capturenfr.png

What is the latest revision that this works with? I have tried several, going all the way back to Alpha 1, but I can’t seem to find a build that works…

Anyone know what build this works with?

That should be 32345.

I am sorry, i looked into the brokeness yesterday but was unable to fix it. It is related to some changes on the matrix things in blender.

I’m sad now…

EDIT: See next post

OK… sorry… I shouldn’t post while experimenting… but this does not appear to be working for me.

Everything runs… but my shape keys don’t seem to be correct. I run the “copy and apply” then I modify my new mesh with the shape I want. I select the new mesh, then the original one… I click the down arrow and apply the new shape as a shape key.

And the new Shape key shows up in the original mesh… but when I change the value, no shape key shows up.

When I look at the console window, I see this error:

Traceback (most recent call last):
File “C:\PROGRA~1\BLENDE~1\Blender\2.54\scripts\addons\CorrectiveShape254.py”,
line 236, in execute
func_add_corrective_pose_shape( source, target)
File “C:\PROGRA~1\BLENDE~1\Blender\2.54\scripts\addons\CorrectiveShape254.py”,
line 151, in func_add_corrective_pose_shape
ob_1.show_only_shape_key = True
AttributeError: ‘Object’ object has no attribute ‘show_only_shape_key’

Any thoughts?

Hooray, i fixed it. Works with r33213. Please try re-downloading the script.

Mark: Yeah this was some rna-renaming madness happening in the python API. The script keeps breaking, but that is to be expected because of beta-ness.

Plyczkowski: Wow, love the artworks on your homepage!

Yeah, my hats off to you for sticking with this.

The 2.5 API is such a moving target, I gave up on trying to do anything until code freeze. You are a much braver man than I am! Thanks!

Well, the new script didn’t work for me.

Here’s a shot of what happened:

http://www.digitalartistguild.com/Tests/addshapekey.png

As usual, I couldn’t find the exact build you are using. I tried it on 32738 and on 33196. Same result on both builds.

What would probably be best, if you are inclined, would be to make sure it worked on the official builds. In other words, the one you download from Blender.org

That might be the simplest way of making sure that whatever build you are testing on is a build we can actually get. Just a thought…

EDIT: I went back and tried it again. I chose the “Slow” method, and this time it does seem to work OK. I probably need to experiment with it more. One difference this time is that I didn’t do any sculpting (which sort of defeats the purpose, I know… but…) I will play with it some more and see if it makes a difference using the “Create SLOW” method…

Mark i understand your frustration and i am sorry. Please check some things:

Your target mesh must have no translation/rotation/scaling at object level.
In the armature modifier ensure that Bone Envelopes and Preserve Volume (was quaternion) are disabled.
I will let the script do that automatically in the next iteration.

Yes you are right, i should make a seperate version for the official build. However, i usually write the build revision in my posts so you don’t need to wonder what revision it is for. Last one was r33213, as i posted. I will make a version for the official 2.55 however, as soon i have time. If you want to, you can send me the file to double check it as well. I do compile my own builds and i reckon you often cannot find that exact revision on graphicall.org.

Loolarge, Thank you for sticking with me on this!

As I said in my EDIT, I think it did work when I went to the “slow” creation. Although I need to test it some more, I think I am good (using the latest official release, btw.)

I have a question though about where to go from here, and was wondering if I could get your input.

I am using this for corrective blend shapes. In other words, I bend a knee, and then fix the distortion in the extreme pose. That works fine as a starting point. But what I need to do next is:

  1. Isolate the shapekey so it only affects the area I need to correct (ie the knee area).
    2.) Mirror the shapekey to the other side
    3.) Move on to the next joint area.

I have a sense of how to do this, but not completely.

All of the shape keys are based on the basis… so is there anyway I can limit their scope? Is there a way to assign verts to a shapekey like there is for a bone deformation group, in other words?

As for the mirroring, I see that it is built in to Blender now. I assume I can simply select the shapeky, copy it, and mirror it… right?

Finally, suppose I want to do three deformation corrections: The Bicep, the Shoulder, and the Back Lat muscle. Is it best to simple “Apply and copy” three times, to three different meshes, and then scult each one separately and apply them one at a time using your script? Is that the suggested workflow?

Thanks!

Ok, here is the version for official beta 2.55 : http://www.ivogrigull.com/blender25/add_corrective_shape_official_255.py

And my silly test blend: http://www.ivogrigull.com/blender25/corrective_shape_test.blend

For mirroring yes, you can use a combination of mirroring and “Blend from shape” for the selected vertices ( Ctrl+V), it let’s you transfer points between shapes.

Yes, the workflow is that you create each corrective shape seperately (“Apply and copy” each time, for each extreme pose) and connect the shape via drivers to some bone rotation, translation or simply animate it manually. That is your creative freedom.

You can control the influence of a shapekey on per vertex-basis by specifieng a vertex group to blend with. (in the Shape Keys panel on the right side beneath the value-slider, under the text “Blend:”)

Please confirm whether the official 2.55 script is working as expected (it does for me).

YES! That worked fine for me in the official beta 2.55!

Thanks for that… now I have much to experiment with…