Bone Weight Copy addon

Trolling? Despite the rudeness, I’ll post the lines that need to be corrected.

Line 77:
WSTargetVertsCo = [v.co*targetObject.matrix_world for v in targetObject.data.vertices]
Change to:
WSTargetVertsCo = [targetObject.matrix_world * v.co for v in targetObject.data.vertices]

Line 106:
v.co = v.co * baseObj.matrix_world
Change to:
v.co = baseObj.matrix_world * v.co

Worked like a champ, thank you my friend.

@ashsselkayi
sorry about the rudeness !!! I didn´t mean to, man. I put a smile in there right? :stuck_out_tongue:
well let´s see, if I can do this thing, sorry if I was rude dude, peace and prosperity.

it worked, so ashamed of me…next time I´ll be more careful with my words…

Welcome :slight_smile:

@Antholocousse : No worries. Glad it worked for you.

the line that you wrote is exactly the same line as the original script,

@Antholocousse: you’re right and i didn’t even notice it! :eyebrowlift2:

The fact is the script works for me with 2.59 without any correction when increasing ‘interpolation’ value to 1 or more. Weird but that works…

And then if you decrease the value to 0 it still works!

hi all.
I have also taken a look into this very valuable and usefull script. I found one code glitch in it, which sometimes yields a program error. I fixed it after talking to one of the core blender coders, who explained to me what was going wrong and how to do it right.
I also added a little bit of functionality which may be interesting for some people.

You can find my modified version of the script on the machinimatrix website: http://blog.machinimatrix.org/bone-weight-copy-for-blender-2-59/

Special thanks to Luke. I hope i referred to you as the original author in the correct way.

Have fun,
Gaia

Useful additions, thanks!

Excellent, thanks!

wow, works beautifully!!!

nice to see this script back, bravo !

here’s a snippet, for simple weight copy from a meshA to meshB, when vertcount is the same and when vertorder is the same. this is fast and 1:1, only in some case (I use it a lot personnaly in complement of the 2.49 copy weight and now yours asap !) for sure it’s a simple code.
maybe that can be useful in your addon as an option ?

import bpy 

src = bpy.context.active_object
for tgt in bpy.context.selected_objects :
    if tgt != src :
        # prepare tgt 
        #groupnames = tgt.vertex_groups.keys() # looks ok.. ?
        for groupname in tgt.vertex_groups.keys() : # groupnames
            group = tgt.vertex_groups[groupname]
            tgt.vertex_groups.remove(group)
        
        # copy vertexgroup from src to tgt 
        for groupname in src.vertex_groups.keys() :
            tgt.vertex_groups.new(groupname)
    
        # fill tgt
        for vi,v in enumerate(src.data.vertices) :
            for gr in v.groups :
                groupid = gr.group
                tgt.vertex_groups[groupid].add(index=[vi], weight=gr.weight, type='ADD')

i fixed a problem with for latest trunk space_view3d_copy_bone_weights_enhanced.zip (2.42 KB)

thanks for sergey- from irc channel for giving me some help:D

For those who can´t make it work on 2.62 there is a version that does…
http://blog.machinimatrix.org/bone-weight-copy-in-blender-2-52-6/comment-page-1/#comment-119478

Kromar, I think that there is a bug I couldn’t run it on blender 64 bit 2.72b.
Here comes the error:


Tested also with blender 2.71 32 bit I get the same error and I couldn’t activate the addon after installing it.

OK - thanks for the PM. I’ve had a look and think I’ve found and fixed the bug. It was caused by an API change in 2.66, see http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Addons#Restricted_Context if interested.

However none of the GUI stuff was in the script when I wrote it (which was for 2.49!) and it’s been extensively improved since then by other people (which is good) so I’ve not carried out detailed checking to see if it all works - simply fixed the bug.

Updated version is here:
Dropbox link

Thanks a lot, Jester!!!:slight_smile:

I hate to necro a thread on my first post ever, but I’ve been looking for a current version of this tool compatible with blender 2.75 64bit. This would be great or at least an equivalent functioning feature in blender or add-on.

No problem to start with … (for me) … but tell please what goes wrong and where you found which version :yes:, then on can check more easily and can try to solve problems for you.

from above taken
initSceneProperties(bpy.context.scene) #PKHG>9sep15 is this one offending line at your version too?

copy it after the comment of def main …
then remove it (above)

Then loading errors are away if you know what to do further … and I got the menu for it
4 rows:
interpolation …
Only…
copy…
and button: Copy Bone Weight
:wink:

Sorry, but i don’t really get your solution PKHG. Im not that much into python. I’m pretty new to blender and i still get this traceback error here:



I also tried the script in the upcoming 2.77 blender version, but it’s the same error, just a different line.