From 5adc782341fd2de7a791f989c991c07d3060b862 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 13 Apr 2016 16:53:17 -0400
Subject: [PATCH] SL-353 - improved handling of skeleton and lad options in
 anim_tool.py

---
 scripts/content_tools/anim_tool.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/content_tools/anim_tool.py b/scripts/content_tools/anim_tool.py
index 08706074dd8..05fe6357b62 100644
--- a/scripts/content_tools/anim_tool.py
+++ b/scripts/content_tools/anim_tool.py
@@ -2,7 +2,9 @@
 
 """\
 
-This module contains tools for manipulating the .anim files supported for Second Life animation upload. Note that this format is unrelated to any non-Second Life formats of the same name.
+This module contains tools for manipulating the .anim files supported
+for Second Life animation upload. Note that this format is unrelated
+to any non-Second Life formats of the same name.
 
 $LicenseInfo:firstyear=2016&license=viewerlgpl$
 Second Life Viewer Source Code
@@ -508,8 +510,8 @@ def resolve_joints(names, skel_tree, lad_tree):
     parser.add_argument("--delete_joints", help="specify joints to be deleted", nargs="+")
     parser.add_argument("--joints", help="specify joints to be added or modified", nargs="+")
     parser.add_argument("--summary", help="print summary of the output animation", action="store_true")
-    parser.add_argument("--skel", help="name of the avatar_skeleton file")
-    parser.add_argument("--lad", help="name of the avatar_lad file")
+    parser.add_argument("--skel", help="name of the avatar_skeleton file", default="avatar_skeleton.xml")
+    parser.add_argument("--lad", help="name of the avatar_lad file", default="avatar_lad.xml")
     parser.add_argument("--set_version", nargs=2, type=int, help="set version and sub-version to specified values")
     parser.add_argument("infilename", help="name of a .anim file to input")
     parser.add_argument("outfilename", nargs="?", help="name of a .anim file to output")
@@ -529,8 +531,14 @@ def resolve_joints(names, skel_tree, lad_tree):
         joints = []
         if args.skel:
             skel_tree = etree.parse(args.skel)
+            if skel_tree is None:
+                print "failed to parse",args.skel
+                exit(1)
         if args.lad:
             lad_tree = etree.parse(args.lad)
+            if lad_tree is None:
+                print "failed to parse",args.lad
+                exit(1)
         if args.joints:
             joints = resolve_joints(args.joints, skel_tree, lad_tree)
             if args.verbose:
-- 
GitLab