Fix is done ...
if we merge the branch new_weighting, then this fix is also included. Do not wonder, most of the files changed, since maketarget uses the shortest possible form to generate values.
And yes I worked with a script but inside make-target.
I used two vectors of the left knee (vertex 11225 and 11261) and calculated the destination position by simply calculating the ratio in x/y/z dimension. Do not wonder Blender Vector does not allow multiplication or division like python native does, so I did the steps for the components. The 8 vertices of the cube are recalculated and in the end the left side was simply mirrored.
Here is the code-snippet:
- Code: Select all
def execute(self, context):
obj = context.active_object
sks = obj.data.shape_keys
primtarget = obj.MhPrimaryTargetName
bt = sks.key_blocks["Basis"]
pt = sks.key_blocks[primtarget]
B1 = bt.data[11225].co;
B2 = bt.data[11261].co;
P1 = pt.data[11225].co;
P2 = pt.data[11261].co;
BD = B2 - B1
PD = P2 - P1
Q = Vector ((PD[0] / BD[0], PD[1] / BD[1], PD[2] / BD[2]))
print (Q)
for v_num in [13838, 13839, 13840, 13841, 13842, 13843, 13844, 13845]:
B = bt.data[v_num].co - B1
E = Vector ((Q[0] * B[0], Q[1] * B[1], Q[2] * B[2]))
P = E + P1
pt.data[v_num].co = P
(b, name) = MirrorByTable(obj, pt, "l")
self.report({'INFO'}, "changed" )
return {'FINISHED'}