diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-12 16:50:32 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-12 16:50:32 -0400 |
commit | a11538e034024efe2c6ebde2cbd2a211b55c9335 (patch) | |
tree | c49db495cbeffb1c20e87f57df3c7accc51b05f0 /scripts/content_tools | |
parent | 5cd545c40efa99c7c319baf3be2266b49f2b21e5 (diff) |
SL-455 - skel_tool.py check for avatar_lad.xml slider symmetries
Diffstat (limited to 'scripts/content_tools')
-rw-r--r-- | scripts/content_tools/skel_tool.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/scripts/content_tools/skel_tool.py b/scripts/content_tools/skel_tool.py index 9e413340aa..41546570e5 100644 --- a/scripts/content_tools/skel_tool.py +++ b/scripts/content_tools/skel_tool.py @@ -305,7 +305,31 @@ def validate_lad_tree(ladtree,skeltree,orig_ladtree): bone_offset = float_tuple(bone.get("offset","0 0 0")) param = bone.getparent().getparent() if bone_scale==(0, 0, 0) and bone_offset==(0, 0, 0): - print "no-op bone",bone.get("name"),"in param",param.get("id","-1") + print "no-op bone",bone_name,"in param",param.get("id","-1") + # check symmetry of sliders + if "Right" in bone.get("name"): + left_name = bone_name.replace("Right","Left") + left_bone = None + for b in skel_param.iter("bone"): + if b.get("name")==left_name: + left_bone = b + if left_bone is None: + print "left_bone not found",left_name,"in",param.get("id","-1") + else: + left_scale = float_tuple(left_bone.get("scale","0 0 0")) + left_offset = float_tuple(left_bone.get("offset","0 0 0")) + if left_scale != bone_scale: + print "scale mismatch between",bone_name,"and",left_name,"in param",param.get("id","-1") + param_id = int(param.get("id","-1")) + if param_id in [661]: # shear + expected_offset = tuple([bone_offset[0],bone_offset[1],-bone_offset[2]]) + elif param_id in [30656, 31663, 32663]: # shift + expected_offset = bone_offset + else: + expected_offset = tuple([bone_offset[0],-bone_offset[1],bone_offset[2]]) + if left_offset != expected_offset: + print "offset mismatch between",bone_name,"and",left_name,"in param",param.get("id","-1") + drivers = {} for driven_param in ladtree.iter("driven"): driver = driven_param.getparent().getparent() |