summaryrefslogtreecommitdiff
path: root/scripts/content_tools/anim_tool.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/content_tools/anim_tool.py')
-rw-r--r--scripts/content_tools/anim_tool.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/content_tools/anim_tool.py b/scripts/content_tools/anim_tool.py
index 0cb1e1022e..9b795f45fd 100644
--- a/scripts/content_tools/anim_tool.py
+++ b/scripts/content_tools/anim_tool.py
@@ -29,6 +29,7 @@ $/LicenseInfo$
"""
import sys
+import os
import struct
import StringIO
import math
@@ -511,6 +512,11 @@ def resolve_joints(names, skel_tree, lad_tree):
if __name__ == "__main__":
+ # default search location for config files is defined relative to
+ # the script location; assuming they live in the same viewer repo
+ pathname = os.path.dirname(sys.argv[0])
+ path_to_skel = os.path.join(os.path.abspath(pathname),"..","..","indra","newview","character")
+
parser = argparse.ArgumentParser(description="process SL animations")
parser.add_argument("--verbose", help="verbose flag", action="store_true")
parser.add_argument("--dump", help="dump to specified file")
@@ -518,11 +524,12 @@ if __name__ == "__main__":
parser.add_argument("--rand_pos", help="request random positions", action="store_true")
parser.add_argument("--reset_pos", help="request original positions", action="store_true")
parser.add_argument("--pos", help="specify sequence of positions", type=float_triple, nargs="+")
+ parser.add_argument("--num_pos", help="number of positions to create", type=int, default=2)
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", default="avatar_skeleton.xml")
- parser.add_argument("--lad", help="name of the avatar_lad file", default="avatar_lad.xml")
+ parser.add_argument("--skel", help="name of the avatar_skeleton file", default= os.path.join(path_to_skel,"avatar_skeleton.xml"))
+ parser.add_argument("--lad", help="name of the avatar_lad file", default= os.path.join(path_to_skel,"avatar_lad.xml"))
parser.add_argument("--set_version", nargs=2, type=int, help="set version and sub-version to specified values")
parser.add_argument("--no_hud", help="omit hud joints from list of attachments", action="store_true")
parser.add_argument("infilename", help="name of a .anim file to input")
@@ -566,7 +573,7 @@ if __name__ == "__main__":
anim.add_pos(joints, args.pos)
if joints and args.rand_pos:
for joint in joints:
- pos_array = list(tuple(random.uniform(-1,1) for i in xrange(3)) for j in xrange(2))
+ pos_array = list(tuple(random.uniform(-1,1) for i in xrange(3)) for j in xrange(args.num_pos))
pos_array.append(pos_array[0])
anim.add_pos([joint], pos_array)
if joints and args.reset_pos: