summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-05-19 10:43:14 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-05-19 10:43:14 -0400
commit7efe727f266af2119d4cd6e33fdd6c26636c1a24 (patch)
tree62cce6d78c94b58205ce43bebd693303488ddace /scripts
parentffca94c0b89d9734fa16fde7751bd0e5785e5ea2 (diff)
parent5a70639b7992842a9f74ec81b11bac56608b8f2e (diff)
DRTVWR-558: Merge branch 'main' of secondlife/viewer into actions
Diffstat (limited to 'scripts')
-rw-r--r--scripts/content_tools/anim_tool.py9
-rw-r--r--scripts/content_tools/skel_tool.py17
-rwxr-xr-xscripts/template_verifier.py2
3 files changed, 26 insertions, 2 deletions
diff --git a/scripts/content_tools/anim_tool.py b/scripts/content_tools/anim_tool.py
index e7b86a88fa..4a0773951e 100644
--- a/scripts/content_tools/anim_tool.py
+++ b/scripts/content_tools/anim_tool.py
@@ -611,6 +611,7 @@ def main(*argv):
parser = argparse.ArgumentParser(description="process SL animations")
parser.add_argument("--verbose", help="verbose flag", action="store_true")
parser.add_argument("--dump", help="dump to stdout", action="store_true")
+ parser.add_argument("--use_aliases", help="use alias names for bones", action="store_true")
parser.add_argument("--rot", help="specify sequence of rotations", type=float_triple, nargs="+")
parser.add_argument("--rand_pos", help="request NUM random positions (default %(default)s)",
metavar="NUM", type=int, default=2)
@@ -637,6 +638,7 @@ def main(*argv):
parser.add_argument("--no_hud", help="omit hud joints from list of attachments", action="store_true")
parser.add_argument("--base_priority", help="set base priority", type=int)
parser.add_argument("--joint_priority", help="set joint priority for all joints", type=int)
+ parser.add_argument("--force_joints", help="don't check validity of joint names", action="store_true")
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")
args = parser.parse_args(argv)
@@ -661,7 +663,12 @@ def main(*argv):
if lad_tree is None:
raise Error("failed to parse " + args.lad)
if args.joints:
- joints = resolve_joints(args.joints, skel_tree, lad_tree, args.no_hud)
+ if args.force_joints:
+ joints = args.joints
+ else:
+ joints = resolve_joints(args.joints, skel_tree, lad_tree, args.no_hud)
+ if args.use_aliases:
+ joints = map(lambda name: "avatar_" + name, joints)
if args.verbose:
print("joints resolved to",joints)
for name in joints:
diff --git a/scripts/content_tools/skel_tool.py b/scripts/content_tools/skel_tool.py
index 449ecd6a6c..696e4e2923 100644
--- a/scripts/content_tools/skel_tool.py
+++ b/scripts/content_tools/skel_tool.py
@@ -72,6 +72,22 @@ def check_symmetry(name, field, vec1, vec2):
if vec1[2] != vec2[2]:
print(name,field,"z match fail")
+def enforce_alias_rules(tree, element, fix=False):
+ if element.tag != "bone":
+ return
+ alias_lis = []
+ aliases = element.get("aliases")
+ if aliases:
+ alias_lis = aliases.split(" ")
+ name = element.get("name")
+ if name:
+ std_alias = "avatar_" + name
+ if not std_alias in alias_lis:
+ print "missing expected alias",name,std_alias
+ for alias in alias_lis:
+ if alias.startswith("avatar_") and alias != std_alias:
+ print "invalid avatar_ alias",name,alias
+
def enforce_symmetry(tree, element, field, fix=False):
name = element.get("name")
if not name:
@@ -209,6 +225,7 @@ def validate_skel_tree(tree, ogtree, reftree, fix=False):
unfixable += 1
fix_name(element)
+ enforce_alias_rules(tree, element, fix)
enforce_precision_rules(element)
for field in ["pos","pivot"]:
enforce_symmetry(tree, element, field, fix)
diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py
index 4c6449954b..ee8492db5e 100755
--- a/scripts/template_verifier.py
+++ b/scripts/template_verifier.py
@@ -232,7 +232,7 @@ http://wiki.secondlife.com/wiki/Template_verifier.py
""")
parser.add_option(
'-u', '--master_url', type='string', dest='master_url',
- default='https://bitbucket.org/lindenlab/master-message-template-git/raw/master/message_template.msg',
+ default='https://github.com/secondlife/master-message-template/raw/master/message_template.msg',
help="""The url of the master message template.""")
parser.add_option(
'-c', '--cache_master', action='store_true', dest='cache_master',