I want to make an automatic animation program using python scripts. Now I have some problem when I use the automatic weights function:

bpy.ops.object.parent_set(type = 'ARMATURE_AUTO')

I have a mesh like as the following picture shows (I can make sure there is no problem with the armature)enter image description here

After executing the Automatic weights function, I pose the armature in pose mode. And some wired distortion happens as following pictures (After careful check, the mesh topology is correct including some sharp bump between the shanks)enter image description here enter image description here I wonder why the distortion happens and how to fix that using python instead of using weight paint by myself.

  • $\begingroup$ Hi Please use a title that reflects the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that users can at a glance understand what your post is about. Use the edit link below your post and avoid anything not strictly essential to the post. Remember, your title is the first thing potential visitors will see, and makes your question findable for future users. See "What is the problem with posting an image or link and asking “How do I do this?"" $\endgroup$ Commented Mar 23, 2023 at 12:41
  • $\begingroup$ uhm...just from looking at your image i would say: the mesh of that person looks like it it totally messed up...so i would retopologize that first and i would assume if you do a "manual" "automatic weight parenting" you will have the same problem $\endgroup$
    – Chris
    Commented Mar 23, 2023 at 13:02
  • $\begingroup$ Automatic weights isn't really capable of producing perfect weights to begin with. Unless you skin a stick figure, there's always some touch up to do manually somewhere, I'm not sure if this can be automated programmatically. Have you considered skinning using envelopes instead of weights? If you can figure out the shape of your model programmatically, you can set the envelopes accordingly and have them as binding to the Armature Deform modifier instead of vertex groups. See Deform — Blender Manual $\endgroup$
    – Lauloque
    Commented Mar 23, 2023 at 13:30


You must log in to answer this question.