Bug #1201

Asymmetry of modeling | Check for errors in x-symmetry in targets

Added by Aranuvir # over 1 year ago. Updated over 1 year ago.

Status:NewStart date:08/13/2017
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Modelling
Target version:MakeHuman 1.1.2

Description

This is a generalisation of #1105. I'm providing a script the detects symmetry errors in the x data of targets and prints out a list of targets in need of fixing. The script assumes to be placed in a subfolder in the same hierarchy level of blendertools and makehuman (otherwise some path variables need to be adopted)

"""This script scans for asymmetrical data in targets.

Naming convention for this script: 
mono targets are influencing left and right side of the human at the same time, leftright targets influence
each side independently and have corresponding targets starting with "l-" and "r-". Data symmetry in mono targets
is checked inside the target. Data symmetry for leftright targets is checked between r-target and l-target.

Targets from the asym folder are excluded.
""" 

import os
import io
import sys
sys.path.append('../blendertools/maketarget/')

try:
    from symmetry_map import *
except ImportError:
    print('Cannot import symmetry_map.py from MakeTarget')
    exit(1)

def StringToNumber(data):
    return [int(data[0]), [float(d) for d in data[1:4]]]

def loadMonoTarget(path, target):
    # Load data from mono targets and subdivide the data to left side and right side

    left = Left2Right.keys()
    right = Right2Left.keys()

    target_path = os.path.join(path, target)
    with io.open(target_path, 'rU') as fp:
        left_data = dict()
        right_data = dict()
        for line in fp.readlines():
            if line:
                data = line.split()
                if data:
                    if data[0] != '#' and len(data) == 4:
                        numdata = StringToNumber(data)
                        if numdata[0] in left:
                            left_data[numdata[0]] = numdata[1]
                        elif numdata[0] in right:
                            right_data[numdata[0]] = numdata[1]
    return left_data, right_data

def loadLeftRightTarget(path, target):
    # Load data from leftright targets. If a target contains vertices from the contralateral side print a
    # message and return empty data.

    left = Left2Right.keys()
    right = Right2Left.keys()

    l_target = os.path.join(path, 'l-' + target)
    r_target = os.path.join(path, 'r-' + target)

    left_data = dict()
    right_data = dict()

    with io.open(l_target, 'rU') as fp:
        for line in fp:
            if line:
                data = line.split()
                if data:
                    if data[0] != '#' and len(data) == 4:
                        numdata = StringToNumber(data)
                        if numdata[0] in left:
                            left_data[numdata[0]] = numdata[1]
                        elif numdata[0] in right:
                            print('Vertecies from right side in ', l_target)
                            return None, None

    with io.open(r_target, 'rU') as fp:
        for line in fp:
            if line:
                data = line.split()
                if data:
                    if data[0] != '#' and len(data) == 4:
                        numdata = StringToNumber(data)
                        if numdata[0] in right:
                            right_data[numdata[0]] = numdata[1]
                        elif numdata[0] in left:
                            print('Vertecies from left side in ', r_target)
                            return None, None

    return left_data, right_data

def compareDataSym(left_data, right_data):
    if left_data and right_data:
        if len(left_data) == len(right_data):
            for key, ldata in left_data.items():
                rdata = right_data.get(Left2Right.get(key))
                if not rdata:
                    return False
                if not rdata[0] == -1 * ldata[0] and rdata[1] == ldata[1] and rdata[2] == ldata[2]:
                    return False
            return True
        else:
            return False
    else:
        return False

def findTargetFiles(path):

    dirs = [d for d in os.listdir(path) if os.path.isdir(os.path.join(path, d)) and d != 'asym']

    mono_targets = dict()
    lr_targets = dict()

    for d in dirs:
        current_path = os.path.join(path, d)
        for file in os.listdir(current_path):
            if os.path.isfile(os.path.join(current_path, file)):
                if (file.startswith('l-') or file.startswith('r-')) and file.endswith('.target'):
                    if not file[2:] in lr_targets.keys():
                        lr_targets[file[2:]] = current_path
                else:
                    mono_targets[file] = current_path

    return mono_targets, lr_targets

def main():

    filepath = '../makehuman/data/targets'

    monoT, lrT = findTargetFiles(filepath)

    badTargets = []

    for target, path in monoT.items():
        l_data, r_data = loadMonoTarget(path, target)
        if not compareDataSym(l_data, r_data):
            badTargets.append(os.path.join(path, target))

    for target, path in lrT.items():
        l_data, r_data = loadLeftRightTarget(path, target)
        if not compareDataSym(l_data, r_data):
            badTargets.append(os.path.join(path, 'l-' + target))
            badTargets.append(os.path.join(path, 'r-' + target))

    badTargets.sort(key=lambda k: k.split('/')[4])

    for target in badTargets:
        print(target)

if __name__ == '__main__':
    main()

targsymtest.py Magnifier (5.41 KB) Rob Baer, 08/13/2017 09:47 PM


Related issues

Related to MakeHuman - Bug #1105: Assymmetry of Modeling | Measure | Bust Circumference Slider Accepted 01/28/2017

History

#1 Updated by Aranuvir # over 1 year ago

  • Related to Bug #1105: Assymmetry of Modeling | Measure | Bust Circumference Slider added

#2 Updated by Rob Baer over 1 year ago

The results 8-13-2017 of the script run on GIT-Makehuman"

/home/rwbaer/anaconda3/envs/python34/bin/python /home/rwbaer/PycharmProjects/makehuman/TargTester/targsymtest.py
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-depth-incr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-decr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-out.target
Vertecies from right side in  ../makehuman/data/targets/eyes/l-eye-trans-out.target
Vertecies from left side in  ../makehuman/data/targets/armslegs/r-leg-valgus-decr.target
Vertecies from right side in  ../makehuman/data/targets/eyes/l-eye-eyefold-convex.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-horiz-incr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-incr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-incr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-decr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-backward.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-forward.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-depth-decr.target
Vertecies from left side in  ../makehuman/data/targets/ears/r-ear-flap-incr.target
Vertecies from left side in  ../makehuman/data/targets/cheek/r-cheek-inner-incr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-depth-incr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-muscle-incr.target
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-fat-incr.target
../makehuman/data/targets/armslegs/upperlegs-height-decr.target
../makehuman/data/targets/armslegs/l-upperleg-scale-depth-incr.target
../makehuman/data/targets/armslegs/r-upperleg-scale-depth-incr.target
../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-decr.target
../makehuman/data/targets/armslegs/r-upperleg-scale-horiz-decr.target
../makehuman/data/targets/armslegs/l-hand-fingers-distance-decr.target
../makehuman/data/targets/armslegs/r-hand-fingers-distance-decr.target
../makehuman/data/targets/armslegs/l-foot-trans-out.target
../makehuman/data/targets/armslegs/r-foot-trans-out.target
../makehuman/data/targets/armslegs/l-foot-trans-up.target
../makehuman/data/targets/armslegs/r-foot-trans-up.target
../makehuman/data/targets/armslegs/l-lowerarm-scale-depth-decr.target
../makehuman/data/targets/armslegs/r-lowerarm-scale-depth-decr.target
../makehuman/data/targets/armslegs/l-foot-trans-down.target
../makehuman/data/targets/armslegs/r-foot-trans-down.target
../makehuman/data/targets/armslegs/l-leg-valgus-decr.target
../makehuman/data/targets/armslegs/r-leg-valgus-decr.target
../makehuman/data/targets/armslegs/l-leg-valgus-incr.target
../makehuman/data/targets/armslegs/r-leg-valgus-incr.target
../makehuman/data/targets/armslegs/l-lowerleg-scale-horiz-incr.target
../makehuman/data/targets/armslegs/r-lowerleg-scale-horiz-incr.target
../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-incr.target
../makehuman/data/targets/armslegs/r-upperleg-scale-horiz-incr.target
../makehuman/data/targets/armslegs/l-lowerleg-muscle-incr.target
../makehuman/data/targets/armslegs/r-lowerleg-muscle-incr.target
../makehuman/data/targets/armslegs/l-upperarm-scale-vert-decr.target
../makehuman/data/targets/armslegs/r-upperarm-scale-vert-decr.target
../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-incr.target
../makehuman/data/targets/armslegs/r-lowerleg-scale-vert-incr.target
../makehuman/data/targets/armslegs/l-upperarm-shoulder-muscle-decr.target
../makehuman/data/targets/armslegs/r-upperarm-shoulder-muscle-decr.target
../makehuman/data/targets/armslegs/l-lowerarm-scale-horiz-incr.target
../makehuman/data/targets/armslegs/r-lowerarm-scale-horiz-incr.target
../makehuman/data/targets/armslegs/l-upperarm-scale-horiz-decr.target
../makehuman/data/targets/armslegs/r-upperarm-scale-horiz-decr.target
../makehuman/data/targets/armslegs/l-hand-fingers-diameter-decr.target
../makehuman/data/targets/armslegs/r-hand-fingers-diameter-decr.target
../makehuman/data/targets/armslegs/l-foot-scale-depth-incr.target
../makehuman/data/targets/armslegs/r-foot-scale-depth-incr.target
../makehuman/data/targets/armslegs/l-upperarm-scale-vert-incr.target
../makehuman/data/targets/armslegs/r-upperarm-scale-vert-incr.target
../makehuman/data/targets/armslegs/l-lowerarm-scale-horiz-decr.target
../makehuman/data/targets/armslegs/r-lowerarm-scale-horiz-decr.target
../makehuman/data/targets/armslegs/l-foot-scale-depth-decr.target
../makehuman/data/targets/armslegs/r-foot-scale-depth-decr.target
../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-decr.target
../makehuman/data/targets/armslegs/r-lowerleg-scale-vert-decr.target
../makehuman/data/targets/armslegs/l-foot-trans-backward.target
../makehuman/data/targets/armslegs/r-foot-trans-backward.target
../makehuman/data/targets/armslegs/l-foot-trans-forward.target
../makehuman/data/targets/armslegs/r-foot-trans-forward.target
../makehuman/data/targets/armslegs/l-upperarm-muscle-decr.target
../makehuman/data/targets/armslegs/r-upperarm-muscle-decr.target
../makehuman/data/targets/armslegs/l-upperleg-scale-depth-decr.target
../makehuman/data/targets/armslegs/r-upperleg-scale-depth-decr.target
../makehuman/data/targets/armslegs/l-lowerarm-scale-depth-incr.target
../makehuman/data/targets/armslegs/r-lowerarm-scale-depth-incr.target
../makehuman/data/targets/armslegs/l-upperarm-fat-decr.target
../makehuman/data/targets/armslegs/r-upperarm-fat-decr.target
../makehuman/data/targets/armslegs/l-foot-trans-in.target
../makehuman/data/targets/armslegs/r-foot-trans-in.target
../makehuman/data/targets/armslegs/l-lowerarm-scale-vert-decr.target
../makehuman/data/targets/armslegs/r-lowerarm-scale-vert-decr.target
../makehuman/data/targets/armslegs/l-lowerarm-scale-vert-incr.target
../makehuman/data/targets/armslegs/r-lowerarm-scale-vert-incr.target
../makehuman/data/targets/armslegs/l-foot-scale-horiz-incr.target
../makehuman/data/targets/armslegs/r-foot-scale-horiz-incr.target
../makehuman/data/targets/armslegs/l-upperarm-fat-incr.target
../makehuman/data/targets/armslegs/r-upperarm-fat-incr.target
../makehuman/data/targets/armslegs/l-lowerleg-scale-horiz-decr.target
../makehuman/data/targets/armslegs/r-lowerleg-scale-horiz-decr.target
../makehuman/data/targets/armslegs/l-lowerleg-scale-depth-decr.target
../makehuman/data/targets/armslegs/r-lowerleg-scale-depth-decr.target
../makehuman/data/targets/armslegs/l-lowerarm-fat-incr.target
../makehuman/data/targets/armslegs/r-lowerarm-fat-incr.target
../makehuman/data/targets/armslegs/l-lowerleg-scale-depth-incr.target
../makehuman/data/targets/armslegs/r-lowerleg-scale-depth-incr.target
../makehuman/data/targets/armslegs/l-upperarm-scale-horiz-incr.target
../makehuman/data/targets/armslegs/r-upperarm-scale-horiz-incr.target
../makehuman/data/targets/armslegs/l-foot-scale-vert-incr.target
../makehuman/data/targets/armslegs/r-foot-scale-vert-incr.target
../makehuman/data/targets/armslegs/l-upperleg-muscle-incr.target
../makehuman/data/targets/armslegs/r-upperleg-muscle-incr.target
../makehuman/data/targets/armslegs/l-upperleg-fat-incr.target
../makehuman/data/targets/armslegs/r-upperleg-fat-incr.target
../makehuman/data/targets/armslegs/l-upperarm-scale-depth-decr.target
../makehuman/data/targets/armslegs/r-upperarm-scale-depth-decr.target
../makehuman/data/targets/armslegs/l-foot-scale-horiz-decr.target
../makehuman/data/targets/armslegs/r-foot-scale-horiz-decr.target
../makehuman/data/targets/armslegs/l-foot-scale-vert-decr.target
../makehuman/data/targets/armslegs/r-foot-scale-vert-decr.target
../makehuman/data/targets/armslegs/l-upperarm-scale-depth-incr.target
../makehuman/data/targets/armslegs/r-upperarm-scale-depth-incr.target
../makehuman/data/targets/breast/female-child-maxmuscle-minweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-old-averagemuscle-maxweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-maxweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-maxmuscle-averageweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-maxweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-maxmuscle-averageweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-averageweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-averageweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-minweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-old-maxmuscle-averageweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-maxweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-maxweight-maxcup-minfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-minweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-old-maxmuscle-maxweight-maxcup-minfirmness.target
../makehuman/data/targets/breast/female-old-minmuscle-minweight-maxcup-averagefirmness.target
../makehuman/data/targets/breast/female-child-maxmuscle-averageweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-maxweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-young-maxmuscle-averageweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-averageweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-averageweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-young-averagemuscle-maxweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-minweight-maxcup-minfirmness.target
../makehuman/data/targets/breast/female-old-maxmuscle-averageweight-mincup-maxfirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-averageweight-maxcup-minfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-maxweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-young-averagemuscle-maxweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-minweight-maxcup-averagefirmness.target
../makehuman/data/targets/breast/female-old-maxmuscle-averageweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-old-averagemuscle-maxweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-averageweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-old-averagemuscle-maxweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-old-averagemuscle-minweight-maxcup-minfirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-maxweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-child-maxmuscle-minweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-child-averagemuscle-averageweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-young-averagemuscle-maxweight-mincup-averagefirmness.target
../makehuman/data/targets/breast/female-child-minmuscle-minweight-mincup-minfirmness.target
../makehuman/data/targets/breast/female-child-maxmuscle-minweight-mincup-maxfirmness.target
../makehuman/data/targets/cheek/l-cheek-inner-decr.target
../makehuman/data/targets/cheek/r-cheek-inner-decr.target
../makehuman/data/targets/cheek/l-cheek-inner-incr.target
../makehuman/data/targets/cheek/r-cheek-inner-incr.target
../makehuman/data/targets/chin/chin-width-decr.target
../makehuman/data/targets/ears/l-ear-shape-triangle.target
../makehuman/data/targets/ears/r-ear-shape-triangle.target
../makehuman/data/targets/ears/l-ear-trans-down.target
../makehuman/data/targets/ears/r-ear-trans-down.target
../makehuman/data/targets/ears/l-ear-shape-round.target
../makehuman/data/targets/ears/r-ear-shape-round.target
../makehuman/data/targets/ears/l-ear-lobe-incr.target
../makehuman/data/targets/ears/r-ear-lobe-incr.target
../makehuman/data/targets/ears/l-ear-rot-forward.target
../makehuman/data/targets/ears/r-ear-rot-forward.target
../makehuman/data/targets/ears/l-ear-scale-depth-incr.target
../makehuman/data/targets/ears/r-ear-scale-depth-incr.target
../makehuman/data/targets/ears/l-ear-flap-decr.target
../makehuman/data/targets/ears/r-ear-flap-decr.target
../makehuman/data/targets/ears/l-ear-scale-depth-decr.target
../makehuman/data/targets/ears/r-ear-scale-depth-decr.target
../makehuman/data/targets/ears/l-ear-shape-square.target
../makehuman/data/targets/ears/r-ear-shape-square.target
../makehuman/data/targets/ears/l-ear-flap-incr.target
../makehuman/data/targets/ears/r-ear-flap-incr.target
../makehuman/data/targets/ears/l-ear-rot-backward.target
../makehuman/data/targets/ears/r-ear-rot-backward.target
../makehuman/data/targets/ears/l-ear-scale-vert-incr.target
../makehuman/data/targets/ears/r-ear-scale-vert-incr.target
../makehuman/data/targets/ears/l-ear-lobe-decr.target
../makehuman/data/targets/ears/r-ear-lobe-decr.target
../makehuman/data/targets/ears/l-ear-shape-pointed.target
../makehuman/data/targets/ears/r-ear-shape-pointed.target
../makehuman/data/targets/ears/l-ear-trans-up.target
../makehuman/data/targets/ears/r-ear-trans-up.target
../makehuman/data/targets/ears/l-ear-trans-backward.target
../makehuman/data/targets/ears/r-ear-trans-backward.target
../makehuman/data/targets/ears/l-ear-scale-incr.target
../makehuman/data/targets/ears/r-ear-scale-incr.target
../makehuman/data/targets/ears/l-ear-trans-forward.target
../makehuman/data/targets/ears/r-ear-trans-forward.target
../makehuman/data/targets/ears/l-ear-scale-vert-decr.target
../makehuman/data/targets/ears/r-ear-scale-vert-decr.target
../makehuman/data/targets/ears/l-ear-scale-decr.target
../makehuman/data/targets/ears/r-ear-scale-decr.target
../makehuman/data/targets/eyes/l-eye-trans-out.target
../makehuman/data/targets/eyes/r-eye-trans-out.target
../makehuman/data/targets/eyes/l-eye-push1-out.target
../makehuman/data/targets/eyes/r-eye-push1-out.target
../makehuman/data/targets/eyes/l-eye-eyefold-convex.target
../makehuman/data/targets/eyes/r-eye-eyefold-convex.target
../makehuman/data/targets/eyes/l-eye-trans-down.target
../makehuman/data/targets/eyes/r-eye-trans-down.target
../makehuman/data/targets/eyes/l-eye-height1-decr.target
../makehuman/data/targets/eyes/r-eye-height1-decr.target
../makehuman/data/targets/eyes/l-eye-bag-height-incr.target
../makehuman/data/targets/eyes/r-eye-bag-height-incr.target
../makehuman/data/targets/eyes/l-eye-corner1-down.target
../makehuman/data/targets/eyes/r-eye-corner1-down.target
../makehuman/data/targets/eyes/l-eye-trans-up.target
../makehuman/data/targets/eyes/r-eye-trans-up.target
../makehuman/data/targets/eyes/l-eye-epicanthus-out.target
../makehuman/data/targets/eyes/r-eye-epicanthus-out.target
../makehuman/data/targets/eyes/l-eye-height3-decr.target
../makehuman/data/targets/eyes/r-eye-height3-decr.target
../makehuman/data/targets/eyes/l-eye-trans-in.target
../makehuman/data/targets/eyes/r-eye-trans-in.target
../makehuman/data/targets/eyes/l-eye-push2-out.target
../makehuman/data/targets/eyes/r-eye-push2-out.target
../makehuman/data/targets/eyes/l-eye-push1-in.target
../makehuman/data/targets/eyes/r-eye-push1-in.target
../makehuman/data/targets/eyes/l-eye-eyefold-concave.target
../makehuman/data/targets/eyes/r-eye-eyefold-concave.target
../makehuman/data/targets/eyes/l-eye-scale-incr.target
../makehuman/data/targets/eyes/r-eye-scale-incr.target
../makehuman/data/targets/eyes/l-eye-corner2-up.target
../makehuman/data/targets/eyes/r-eye-corner2-up.target
../makehuman/data/targets/eyes/l-eye-corner2-down.target
../makehuman/data/targets/eyes/r-eye-corner2-down.target
../makehuman/data/targets/eyes/l-eye-height2-incr.target
../makehuman/data/targets/eyes/r-eye-height2-incr.target
../makehuman/data/targets/eyes/l-eye-height1-incr.target
../makehuman/data/targets/eyes/r-eye-height1-incr.target
../makehuman/data/targets/eyes/l-eye-push2-in.target
../makehuman/data/targets/eyes/r-eye-push2-in.target
../makehuman/data/targets/eyes/l-eye-bag-incr.target
../makehuman/data/targets/eyes/r-eye-bag-incr.target
../makehuman/data/targets/eyes/l-eye-corner1-up.target
../makehuman/data/targets/eyes/r-eye-corner1-up.target
../makehuman/data/targets/head/head-trans-out.target
../makehuman/data/targets/head/head-trans-in.target
../makehuman/data/targets/hip/hip-trans-in.target
../makehuman/data/targets/hip/hip-trans-out.target
../makehuman/data/targets/macrodetails/universal-male-child-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/universal-female-young-minmuscle-minweight.target
../makehuman/data/targets/macrodetails/universal-female-child-maxmuscle-maxweight.target
../makehuman/data/targets/macrodetails/universal-male-old-maxmuscle-maxweight.target
../makehuman/data/targets/macrodetails/universal-female-old-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/universal-female-baby-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/universal-female-child-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/universal-male-old-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/universal-female-child-maxmuscle-minweight.target
../makehuman/data/targets/macrodetails/universal-male-young-maxmuscle-maxweight.target
../makehuman/data/targets/macrodetails/universal-female-young-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/universal-male-young-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/african-female-old.target
../makehuman/data/targets/macrodetails/universal-male-baby-averagemuscle-averageweight.target
../makehuman/data/targets/macrodetails/caucasian-female-young.target
../makehuman/data/targets/measure/measure-bust-circ-decr.target
../makehuman/data/targets/measure/measure-hips-circ-incr.target
../makehuman/data/targets/measure/measure-upperleg-height-decr.target
../makehuman/data/targets/measure/measure-hips-circ-decr.target
../makehuman/data/targets/mouth/mouth-lowerlip-width-incr.target
../makehuman/data/targets/mouth/mouth-trans-out.target
../makehuman/data/targets/mouth/mouth-upperlip-width-decr.target
../makehuman/data/targets/mouth/mouth-upperlip-middle-down.target
../makehuman/data/targets/mouth/mouth-cupidsbow-decr.target
../makehuman/data/targets/mouth/mouth-upperlip-middle-up.target
../makehuman/data/targets/mouth/mouth-trans-forward.target
../makehuman/data/targets/mouth/mouth-laugh-lines-in.target
../makehuman/data/targets/mouth/mouth-lowerlip-middle-down.target
../makehuman/data/targets/mouth/mouth-trans-in.target
../makehuman/data/targets/mouth/mouth-trans-backward.target
../makehuman/data/targets/mouth/mouth-lowerlip-width-decr.target
../makehuman/data/targets/mouth/mouth-scale-vert-incr.target
../makehuman/data/targets/mouth/mouth-upperlip-ext-up.target
../makehuman/data/targets/mouth/mouth-lowerlip-height-decr.target
../makehuman/data/targets/mouth/mouth-scale-horiz-decr.target
../makehuman/data/targets/neck/neck-trans-in.target
../makehuman/data/targets/neck/neck-scale-horiz-decr.target
../makehuman/data/targets/neck/neck-trans-out.target
../makehuman/data/targets/nose/nose-trans-in.target
../makehuman/data/targets/nose/nose-point-up.target
../makehuman/data/targets/nose/nose-curve-convex.target
../makehuman/data/targets/nose/nose-curve-concave.target
../makehuman/data/targets/nose/nose-point-down.target
../makehuman/data/targets/nose/nose-volume-decr.target
../makehuman/data/targets/nose/nose-septumangle-incr.target
../makehuman/data/targets/nose/nose-trans-out.target
../makehuman/data/targets/stomach/stomach-tone-decr.target
../makehuman/data/targets/torso/torso-scale-depth-incr.target
../makehuman/data/targets/torso/torso-scale-depth-decr.target
../makehuman/data/targets/torso/torso-trans-out.target
../makehuman/data/targets/torso/torso-trans-in.target
../makehuman/data/targets/torso/torso-scale-vert-incr.target

Process finished with exit code 0

#3 Updated by Aranuvir # over 1 year ago

... based on the assumption the script is working correctly :)

#4 Updated by Rob Baer over 1 year ago

How are midline verts to be handled in target?

Could the first group be verts close to the center-line or perhaps even right on the centerline? To 3 decimal places they seem to have little displacement if I read thing right. Am I right that dropping them from the respective target set should have little effect?

Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-decr.target
[4425, [0.0, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-depth-decr.target
[4425, [0.0, 0.0, 0.0]]
Verticies from left side in  ../makehuman/data/targets/cheek/r-cheek-inner-incr.target
[6945, [0.0, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-fat-incr.target
[4362, [-0.001, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-out.target
[18522, [0.001, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-muscle-incr.target
[15605, [0.0, -0.005, -0.053]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-decr.target
[15487, [0.0, 0.0, 0.0]]
Verticies from left side in  ../makehuman/data/targets/ears/r-ear-flap-incr.target
[7565, [-0.005, -0.001, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/eyes/l-eye-trans-out.target
[120, [0.0, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-horiz-incr.target
[18557, [0.001, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-forward.target
[18522, [0.0, 0.0, 0.002]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-depth-incr.target
[18521, [0.0, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-depth-incr.target
[4425, [0.0, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-incr.target
[4446, [0.0, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-incr.target
[18549, [0.0, 0.0, 0.0]]
Vertecies from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-backward.target
[18522, [0.0, 0.0, -0.002]]
Vertecies from right side in  ../makehuman/data/targets/eyes/l-eye-eyefold-convex.target
[4, [0.0, 0.0, 0.0]]
Verticies from left side in  ../makehuman/data/targets/armslegs/r-leg-valgus-decr.target
[10995, [-0.001, 0.0, 0.0]]

#5 Updated by Aranuvir # over 1 year ago

The script uses the vertex numbers in the target file and checks if the number is in the keys set of Left2Right or Right2Left ordered dict to decide whether it is a left or right vertex. Vertex numbers from the right side shouldn't appear in a l-target and vice versa (in my opinion). The case that a vertex number belongs to the center is simply omitted/ignored...
So correctness of symmetry_map.py is crucial!

BTW, I think, if a target includes any center vertex, the x values of these vertices should be 0. I will include this test case in an updated version.

#6 Updated by Rob Baer over 1 year ago

So I engaged in 'ugly code' testing with your masterpiece,but I learned some things.

There are target failures that may not be related to x-symmetry but the test condition leading to the fail is not clear tome from what I did. logging these failure causes is needed.

It seems that the tolerance is 0.001 with text targets and this probably gets buggered in some places with their floating point representations. Leads to some probable false positives,

Below "worrisome" is abs(ldata + rdata) > 0.001. I suppose we could relax this further for machine rep but that should be about 1E-16 I think

One of the common problems with some subset of "bad targets" may be a dropped minus sign(e.g., female-old-averagemuscle-maxweight-mincup-averagefirmness.target):

Mono symmetry compare failed female-old-maxmuscle-averageweight-mincup-averagefirmness.target
Mono symmetry compare failed measure-hips-circ-decr.target
Mono symmetry compare failed torso-scale-depth-incr.target
Mono symmetry  compare failed universal-female-old-averagemuscle-averageweight.target
Right Target:  [0.01, -0.194, 0.4]
Left Target:  [-0.009, -0.194, 0.4]

 **** Worrisome differemce? **** 

Mono symmetry compare failed african-female-old.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-averageweight-mincup-maxfirmness.target
Mono symmetry compare failed female-child-averagemuscle-minweight-maxcup-minfirmness.target
Right Target:  [0.187, -0.647, 0.652]
Left Target:  [-0.188, -0.647, 0.652]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-old-minmuscle-minweight-maxcup-averagefirmness.target
Mono symmetry compare failed mouth-upperlip-middle-up.target
Mono symmetry compare failed female-old-averagemuscle-maxweight-mincup-averagefirmness.target
Right Target:  [0.5, 0.0, 0.0]
Left Target:  [0.5, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed torso-trans-out.target
Mono symmetry compare failed universal-female-child-maxmuscle-maxweight.target
Mono symmetry compare failed nose-volume-decr.target
Mono symmetry compare failed female-young-averagemuscle-maxweight-mincup-averagefirmness.target
Mono symmetry compare failed mouth-upperlip-width-decr.target
Mono symmetry compare failed torso-scale-depth-decr.target
Right Target:  [0.047, -0.002, -0.002]
Left Target:  [-0.048, -0.002, -0.002]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-minweight-mincup-minfirmness.target
Right Target:  [0.031, -0.898, 0.405]
Left Target:  [-0.032, -0.898, 0.405]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-averageweight-maxcup-minfirmness.target
Mono symmetry compare failed female-young-averagemuscle-maxweight-mincup-minfirmness.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-maxweight-mincup-minfirmness.target
Mono symmetry compare failed universal-male-baby-averagemuscle-averageweight.target
Right Target:  [0.011, -0.026, -0.031]
Left Target:  [-0.012, -0.026, -0.031]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-maxmuscle-averageweight-mincup-maxfirmness.target
Right Target:  [0.3, 0.0, 0.0]
Left Target:  [0.3, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed hip-trans-out.target
Mono symmetry compare failed mouth-laugh-lines-in.target
Mono symmetry compare failed nose-curve-convex.target
Right Target:  [0.055, -0.002, -0.026]
Left Target:  [-0.056, -0.002, -0.026]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-maxweight-mincup-maxfirmness.target
Right Target:  [-0.2, 0.0, 0.0]
Left Target:  [-0.2, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed head-trans-in.target
Mono symmetry compare failed mouth-trans-out.target
Mono symmetry compare failed mouth-cupidsbow-decr.target
Mono symmetry compare failed nose-trans-in.target
Mono symmetry compare failed chin-width-decr.target
Right Target:  [0.005, 0.0, -0.023]
Left Target:  [-0.006, 0.0, -0.023]
Mono symmetry compare failed female-child-maxmuscle-minweight-mincup-averagefirmness.target
Mono symmetry compare failed mouth-upperlip-middle-down.target
Right Target:  [0.002, 0.0, 0.0]
Left Target:  [0.0, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed mouth-scale-horiz-decr.target
Right Target:  [-0.086, 0.0, 0.0]
Left Target:  [-0.086, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed neck-trans-in.target
Right Target:  [0.041, 0.0, 0.0]
Left Target:  [0.041, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed neck-trans-out.target
Right Target:  [0.09, -0.101, 0.152]
Left Target:  [-0.091, -0.101, 0.152]

 **** Worrisome differemce? **** 

Mono symmetry compare failed universal-male-old-maxmuscle-maxweight.target
Mono symmetry compare failed universal-male-old-averagemuscle-averageweight.target
Mono symmetry compare failed nose-point-down.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-averageweight-mincup-minfirmness.target
Mono symmetry compare failed female-young-averagemuscle-maxweight-mincup-maxfirmness.target
Right Target:  [0.133, -0.261, 0.083]
Left Target:  [-0.134, -0.261, 0.083]

 **** Worrisome differemce? **** 

Mono symmetry compare failed universal-male-young-maxmuscle-maxweight.target
Right Target:  [-0.079, -0.017, -0.018]
Left Target:  [0.076, -0.017, -0.018]

 **** Worrisome differemce? **** 

Mono symmetry compare failed universal-female-child-maxmuscle-minweight.target
Right Target:  [-0.5, 0.0, 0.0]
Left Target:  [-0.5, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed torso-trans-in.target
Right Target:  [0.005, 0.0, -0.023]
Left Target:  [-0.006, 0.0, -0.023]
Mono symmetry compare failed female-child-maxmuscle-minweight-mincup-minfirmness.target
Right Target:  [-0.169, -0.206, 0.432]
Left Target:  [0.238, -0.206, 0.432]

 **** Worrisome differemce? **** 

Mono symmetry compare failed stomach-tone-decr.target
Mono symmetry compare failed nose-trans-out.target
Mono symmetry compare failed female-old-averagemuscle-minweight-maxcup-minfirmness.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-maxweight-mincup-averagefirmness.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-averageweight-mincup-averagefirmness.target
Right Target:  [0.136, -0.075, -0.108]
Left Target:  [-0.131, -0.075, -0.108]

 **** Worrisome differemce? **** 

Mono symmetry compare failed universal-female-young-minmuscle-minweight.target
Right Target:  [0.011, -0.026, -0.031]
Left Target:  [-0.012, -0.026, -0.031]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-maxmuscle-averageweight-mincup-averagefirmness.target
Mono symmetry compare failed female-old-maxmuscle-averageweight-mincup-maxfirmness.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-averageweight-mincup-averagefirmness.target
Right Target:  [0.047, -0.002, -0.002]
Left Target:  [-0.048, -0.002, -0.002]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-minweight-mincup-averagefirmness.target
Mono symmetry compare failed torso-scale-vert-incr.target
Mono symmetry compare failed mouth-scale-vert-incr.target
Mono symmetry compare failed female-old-maxmuscle-maxweight-maxcup-minfirmness.target
Mono symmetry compare failed measure-bust-circ-decr.target
Mono symmetry compare failed universal-male-young-averagemuscle-averageweight.target
Mono symmetry compare failed mouth-trans-forward.target
Right Target:  [0.011, -0.026, -0.031]
Left Target:  [-0.012, -0.026, -0.031]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-maxmuscle-averageweight-mincup-minfirmness.target
Mono symmetry compare failed mouth-trans-backward.target
Mono symmetry compare failed universal-female-young-averagemuscle-averageweight.target
Mono symmetry compare failed nose-septumangle-incr.target
Mono symmetry compare failed universal-female-child-averagemuscle-averageweight.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-averageweight-mincup-maxfirmness.target
Right Target:  [0.2, 0.0, 0.0]
Left Target:  [0.2, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed head-trans-out.target
Right Target:  [-0.3, 0.0, 0.0]
Left Target:  [-0.3, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed hip-trans-in.target
Mono symmetry compare failed female-old-averagemuscle-maxweight-mincup-maxfirmness.target
Right Target:  [0.136, -0.011, -0.14]
Left Target:  [-0.143, -0.011, -0.14]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-young-maxmuscle-averageweight-mincup-minfirmness.target
Right Target:  [0.047, -0.002, -0.002]
Left Target:  [-0.048, -0.002, -0.002]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-minweight-mincup-maxfirmness.target
Mono symmetry compare failed measure-hips-circ-incr.target
Mono symmetry compare failed mouth-upperlip-ext-up.target
Mono symmetry compare failed female-old-averagemuscle-maxweight-mincup-minfirmness.target
Mono symmetry compare failed mouth-lowerlip-middle-down.target
Mono symmetry compare failed nose-point-up.target
Mono symmetry compare failed universal-male-child-averagemuscle-averageweight.target
Mono symmetry compare failed nose-curve-concave.target
Right Target:  [-0.094, -0.185, 0.37]
Left Target:  [0.093, -0.185, 0.37]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-minweight-maxcup-averagefirmness.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-averageweight-mincup-minfirmness.target
Right Target:  [0.055, -0.002, -0.026]
Left Target:  [-0.056, -0.002, -0.026]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-maxweight-mincup-minfirmness.target
Mono symmetry compare failed mouth-lowerlip-height-decr.target
Right Target:  [0.055, 0.004, -0.03]
Left Target:  [-0.056, 0.004, -0.03]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-maxweight-mincup-maxfirmness.target
Right Target:  [0.002, 0.0, 0.0]
Left Target:  [0.0, 0.0, 0.0]

 **** Worrisome differemce? **** 

Mono symmetry compare failed neck-scale-horiz-decr.target
Right Target:  [0.03, -0.89, 0.403]
Left Target:  [-0.031, -0.89, 0.403]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-averagemuscle-maxweight-maxcup-minfirmness.target
Mono symmetry compare failed measure-upperleg-height-decr.target
Right Target:  [0.049, -0.576, 0.045]
Left Target:  [-0.048, -0.576, 0.045]

 **** Worrisome differemce? **** 

Mono symmetry compare failed caucasian-female-young.target
Mono symmetry compare failed mouth-lowerlip-width-incr.target
Mono symmetry compare failed upperlegs-height-decr.target
Mono symmetry compare failed mouth-trans-in.target
Mono symmetry compare failed female-old-maxmuscle-averageweight-mincup-minfirmness.target
Right Target:  [0.055, -0.002, -0.026]
Left Target:  [-0.056, -0.002, -0.026]

 **** Worrisome differemce? **** 

Mono symmetry compare failed female-child-minmuscle-maxweight-mincup-averagefirmness.target
Right Target:  [0.005, 0.0, -0.023]
Left Target:  [-0.006, 0.0, -0.023]
Mono symmetry compare failed female-child-maxmuscle-minweight-mincup-maxfirmness.target
Mono symmetry compare failed universal-female-baby-averagemuscle-averageweight.target
Mono symmetry compare failed mouth-lowerlip-width-decr.target
Two target symmetric compare failed l- & r- lowerarm-fat-incr.target
Two target symmetric compare failed l- & r- eye-push2-out.target
Two target symmetric compare failed l- & r- lowerarm-scale-vert-decr.target
Two target symmetric compare failed l- & r- eye-eyefold-concave.target
Two target symmetric compare failed l- & r- hand-fingers-distance-decr.target
Right Target:  [0.27, 0.089, 0.0]
Left Target:  [-0.268, 0.089, 0.0]

 **** Worrisome differemce? **** 

Two target symmetric compare failed l- & r- leg-valgus-incr.target
Two target symmetric compare failed l- & r- eye-corner1-down.target
Vertices from left side in  ../makehuman/data/targets/ears/r-ear-flap-incr.target
[7565, [-0.005, -0.001, 0.0]]
Two target symmetric compare failed l- & r- ear-flap-incr.target
Two target symmetric compare failed l- & r- upperarm-scale-vert-incr.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-backward.target
[18522, [0.0, 0.0, -0.002]]
Two target symmetric compare failed l- & r- foot-trans-backward.target
Two target symmetric compare failed l- & r- ear-trans-up.target
Vertices from right side in  ../makehuman/data/targets/eyes/l-eye-trans-out.target
[120, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- eye-trans-out.target
Two target symmetric compare failed l- & r- ear-lobe-incr.target
Two target symmetric compare failed l- & r- lowerarm-scale-vert-incr.target
Two target symmetric compare failed l- & r- eye-push1-out.target
Two target symmetric compare failed l- & r- lowerarm-scale-horiz-decr.target
Two target symmetric compare failed l- & r- upperarm-scale-depth-decr.target
Two target symmetric compare failed l- & r- foot-trans-in.target
Two target symmetric compare failed l- & r- lowerarm-scale-depth-incr.target
Two target symmetric compare failed l- & r- upperarm-scale-vert-decr.target
Two target symmetric compare failed l- & r- lowerleg-scale-depth-decr.target
Right Target:  [0.0, -0.008, -0.003]
Left Target:  [0.001, -0.008, -0.003]
Two target symmetric compare failed l- & r- hand-fingers-diameter-decr.target
Two target symmetric compare failed l- & r- ear-scale-depth-incr.target
Two target symmetric compare failed l- & r- ear-scale-vert-decr.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-incr.target
[4446, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- upperleg-scale-horiz-incr.target
Two target symmetric compare failed l- & r- ear-trans-backward.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-depth-incr.target
[4425, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- upperleg-scale-depth-incr.target
Two target symmetric compare failed l- & r- foot-scale-horiz-decr.target
Two target symmetric compare failed l- & r- eye-height2-incr.target
Two target symmetric compare failed l- & r- eye-corner2-up.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-depth-incr.target
[18521, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- lowerleg-scale-depth-incr.target
Two target symmetric compare failed l- & r- ear-shape-round.target
Two target symmetric compare failed l- & r- ear-shape-pointed.target
Two target symmetric compare failed l- & r- upperarm-fat-decr.target
Two target symmetric compare failed l- & r- ear-scale-decr.target
Two target symmetric compare failed l- & r- ear-scale-incr.target
Two target symmetric compare failed l- & r- eye-scale-incr.target
Two target symmetric compare failed l- & r- foot-trans-down.target
Two target symmetric compare failed l- & r- upperarm-scale-depth-incr.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-upperleg-muscle-incr.target
[15605, [0.0, -0.005, -0.053]]
Two target symmetric compare failed l- & r- upperleg-muscle-incr.target
Two target symmetric compare failed l- & r- foot-scale-vert-incr.target
Two target symmetric compare failed l- & r- eye-height1-incr.target
Two target symmetric compare failed l- & r- ear-rot-forward.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-horiz-incr.target
[18557, [0.001, 0.0, 0.0]]
Two target symmetric compare failed l- & r- lowerleg-scale-horiz-incr.target
Two target symmetric compare failed l- & r- eye-bag-incr.target
Two target symmetric compare failed l- & r- ear-shape-triangle.target
Two target symmetric compare failed l- & r- lowerleg-muscle-incr.target
Two target symmetric compare failed l- & r- eye-trans-up.target
Two target symmetric compare failed l- & r- upperarm-fat-incr.target
Vertices from right side in  ../makehuman/data/targets/eyes/l-eye-eyefold-convex.target
[4, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- eye-eyefold-convex.target
Two target symmetric compare failed l- & r- upperarm-muscle-decr.target
Two target symmetric compare failed l- & r- eye-corner1-up.target
Two target symmetric compare failed l- & r- ear-shape-square.target
Two target symmetric compare failed l- & r- foot-scale-horiz-incr.target
Two target symmetric compare failed l- & r- eye-push1-in.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-incr.target
[18549, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- lowerleg-scale-vert-incr.target
Two target symmetric compare failed l- & r- lowerarm-scale-horiz-incr.target
Two target symmetric compare failed l- & r- upperarm-scale-horiz-incr.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-upperleg-fat-incr.target
[4362, [-0.001, 0.0, 0.0]]
Two target symmetric compare failed l- & r- upperleg-fat-incr.target
Two target symmetric compare failed l- & r- ear-scale-vert-incr.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-out.target
[18522, [0.001, 0.0, 0.0]]
Two target symmetric compare failed l- & r- foot-trans-out.target
Two target symmetric compare failed l- & r- ear-flap-decr.target
Two target symmetric compare failed l- & r- upperarm-scale-horiz-decr.target
Two target symmetric compare failed l- & r- foot-scale-depth-incr.target
Two target symmetric compare failed l- & r- eye-trans-in.target
Two target symmetric compare failed l- & r- eye-trans-down.target
Vertices from left side in  ../makehuman/data/targets/cheek/r-cheek-inner-incr.target
[6945, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- cheek-inner-incr.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-lowerleg-scale-vert-decr.target
[15487, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- lowerleg-scale-vert-decr.target
Two target symmetric compare failed l- & r- ear-trans-down.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-foot-trans-forward.target
[18522, [0.0, 0.0, 0.002]]
Two target symmetric compare failed l- & r- foot-trans-forward.target
Two target symmetric compare failed l- & r- eye-epicanthus-out.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-depth-decr.target
[4425, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- upperleg-scale-depth-decr.target
Two target symmetric compare failed l- & r- eye-bag-height-incr.target
Two target symmetric compare failed l- & r- foot-scale-depth-decr.target
Two target symmetric compare failed l- & r- upperarm-shoulder-muscle-decr.target
Two target symmetric compare failed l- & r- ear-lobe-decr.target
Two target symmetric compare failed l- & r- ear-rot-backward.target
Two target symmetric compare failed l- & r- eye-push2-in.target
Two target symmetric compare failed l- & r- foot-trans-up.target
Two target symmetric compare failed l- & r- eye-corner2-down.target
Two target symmetric compare failed l- & r- eye-height3-decr.target
Two target symmetric compare failed l- & r- ear-scale-depth-decr.target
Vertices from right side in  ../makehuman/data/targets/armslegs/l-upperleg-scale-horiz-decr.target
[4425, [0.0, 0.0, 0.0]]
Two target symmetric compare failed l- & r- upperleg-scale-horiz-decr.target
Two target symmetric compare failed l- & r- eye-height1-decr.target
Two target symmetric compare failed l- & r- cheek-inner-decr.target
Two target symmetric compare failed l- & r- foot-scale-vert-decr.target
Two target symmetric compare failed l- & r- lowerleg-scale-horiz-decr.target
Vertices from left side in  ../makehuman/data/targets/armslegs/r-leg-valgus-decr.target
[10995, [-0.001, 0.0, 0.0]]
Two target symmetric compare failed l- & r- leg-valgus-decr.target
Two target symmetric compare failed l- & r- ear-trans-forward.target
Two target symmetric compare failed l- & r- lowerarm-scale-depth-decr.target

Process finished with exit code 0

#7 Updated by Rob Baer over 1 year ago

Wrong way to do this, but the patches that I used in the test output above are uploaded if you care.

FWIW I think you could appropriately add your script to the testsuite folder once you add some appropriate documentation to it. I think that folder even has the right level in the hierarchy :)

#8 Updated by Aranuvir # over 1 year ago

So I engaged in 'ugly code' testing with your masterpiece,but I learned some things.

Masterpiece? I've never said it was finished...

Wrong way to do this, but the patches that I used in the test output above are uploaded if you care.

Indeed I care and I really appreciate collaborative work.

Any reasons for being sarcastic?

Your proposal on being more verbose on the issues is a very good idea. And I must admit, some of the issues are negligible. The first version of that script was a "law and order control" with zero tolerance :D. Yet, the symmetry testing stops on the first issue in a target file, so we don't know what might come later...
The tolerance issues might be negligible, though I'm not sure if the issue could accumulate to a visible amount with multiple targets affecting the same vertex? Anyway, we could consider this minor issues that could automatically be fixed by the script. Different amount of vertices on both sides or vertices that should not belong to a target probably need fixing by hand.

And yes, we should commit the script to the buildscripts.

Unfortunately my appearance will be reduced again, until next weekend...

#9 Updated by Rob Baer over 1 year ago

@ Aranuvir
Sorry if I came across as sarcastic, i was intending what I said to be self-deprecating!

I really do think I made your nice code "more inelegant" with all those nasty print statements. Jonas used to berate Thomas for doing just the same kind of inelegant thing that I did to your code (and he was right if not too subtle about it :) ). I only dared share my code in an attempt to help, and I was feeling badly that it lacked acceptable coding style. So my comments were in NO WAY intended to be demeaning to you; I apologize if they came across that way. And I never doubted your collaborative nature. You are an important, selfless, and valued team member who is exceedingly easy to work with.

With "wrong way to do this" I was referring to my "sharing back code on the bug tracker" instead of putting it in the repository, but I wanted to let you be able to interpret what I'd done. I think your code IS important enough to move it to the codebase so we can collaborate the right way.

@ Everyone
Any way, to the topic at hand... Interesting point that the code only ID's the first vertex that it reports on. I guess we should iterate through the whole file and log all errors, with a flag for error type and severity.

As I understand your code you have picked out two error types: 1) vertex numbers in the contralateral file (R in L file or L in R file); and 2) asymmetries about the x axis. however, you seemed to test a few other things that might produce a FALSE return, and I couldn't quite understand what they were. Am I correct? If so, this should be flagged by type as well.

One question, do you know when the targets become 3 decimal digit text representations, and is that enough. Is coordinate space in MH at a decimeter level? If so, then 0.001 means movement of 0.1 mm. If coordinate space is in meters, then 0.1 is a whole mm. 0.001 dm should be enough resolution everywhere except perhaps some subtle facial/eye movements i would think. Not sure 1 mm would be enough. You are likely right about accumulation of errors in the face of multiple targets. Is there sense to carrying 1 more decimal place on targets?

#10 Updated by Aranuvir # over 1 year ago

@Rob: I was obviously to tired last night and got some semantics wrong, no problem :D.

As I said before, being more specific on the issues is a good idea, though we should avoid to get too verbose. Creating informative output for every line could quickly lead to a thousand lines of output. We will probably have to write some parsers to handle all the output.

In a first step the script loads target files one by one and starts to separate data into left and right side. If any of the targets that only influences one side of the mesh (=left/right target) contains vertex numbers of the other side, the loading function produces an error message. I'm not sure if it is true for all cases, since targets influencing body parts close to the center line should probably influence the center and even vertices from the other side, too. Probably there might be some false positives...

The loaded data of a target is stored in dictionaries for each side, with the vertex numbers as keys and [x,y,z] lists as items. In the compare symmetry function on a first global check it makes sure there are no empty dictionaries. On a second step it compares the length of data of the dictionaries, i.e. the number of vertices of both sides. If these checks are passed the function starts to iterate over the vertices of one side and tries to get the [x,y,z]-data of the corresponding vertex on the other side. And finally it does the real data comparison where x -1 x' and y y' and z == z'.

Maybe we could reduce the number of reported targets with some auto correction of targets that only show "tolerance issues", by using the greater |x| value on both sides.

#11 Updated by Rob Baer over 1 year ago

Helpful. So the other two checks I couldn't quite discern were:
1. No verts in a target -- unlikely, but important to know if it is so
2. Unequal verts on the left and right (is this check made even for non-sided targets? I guess it should)

Target files are "distance moved" files. I still am wondering at what point in the creation and use workflow they get the x.xxx format. Can we identify targets that are near the center from some criterion that is reproducible? We have the coordinate location of each vertex number on the base mesh and helpers. Could we use some x range to define "near the center" to good advantage?

#12 Updated by Aranuvir # over 1 year ago

1. This check should make sure the script does not crash, when loading of a target fails...
2. Yes (at least this was my intention)

Making things short (and hopefully I'm not doing a mistake here): All targets influencing the left and right side independently are those for arms, legs, cheeks, ears and eyes. IMHO, these targets shouldn't have vertices from the other side included...

Also available in: Atom