diff options
author | Euclid Linden <euclid@lindenlab.com> | 2022-04-18 21:56:26 +0000 |
---|---|---|
committer | Euclid Linden <euclid@lindenlab.com> | 2022-04-18 21:56:26 +0000 |
commit | e71201ac125cab5f3d3cf7d6a30500253fc29d90 (patch) | |
tree | 270e46eb85dd46fb6962a36a9357dbf31c3afb29 /scripts/content_tools/dae_tool.py | |
parent | 2d63d2044e0a00d1969c3da254e016a6e520c0d5 (diff) | |
parent | 035b1996df3f357b5060e3eb778588da5b9e7b37 (diff) |
Merged in DV528-merge-6.5.5 (pull request #945)
DRTVWR-528 merge up to 6.5.5
Diffstat (limited to 'scripts/content_tools/dae_tool.py')
-rw-r--r-- | scripts/content_tools/dae_tool.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/scripts/content_tools/dae_tool.py b/scripts/content_tools/dae_tool.py index 823f69cb85..2454fafa46 100644 --- a/scripts/content_tools/dae_tool.py +++ b/scripts/content_tools/dae_tool.py @@ -1,4 +1,4 @@ -#!runpy.sh +#!/usr/bin/env python3 """\ @@ -35,14 +35,14 @@ from collada import * from lxml import etree def mesh_summary(mesh): - print "scenes",mesh.scenes + print("scenes",mesh.scenes) for scene in mesh.scenes: - print "scene",scene + print("scene",scene) for node in scene.nodes: - print "node",node + print("node",node) def mesh_lock_offsets(tree, joints): - print "mesh_lock_offsets",tree,joints + print("mesh_lock_offsets",tree,joints) for joint_node in tree.iter(): if "node" not in joint_node.tag: continue @@ -57,11 +57,11 @@ def mesh_lock_offsets(tree, joints): floats[7] += 0.0001 floats[11] += 0.0001 matrix_node.text = " ".join([str(f) for f in floats]) - print joint_node.get("name"),matrix_node.tag,"text",matrix_node.text,len(floats),floats + print(joint_node.get("name"),matrix_node.tag,"text",matrix_node.text,len(floats),floats) def mesh_random_offsets(tree, joints): - print "mesh_random_offsets",tree,joints + print("mesh_random_offsets",tree,joints) for joint_node in tree.iter(): if "node" not in joint_node.tag: continue @@ -73,13 +73,13 @@ def mesh_random_offsets(tree, joints): for matrix_node in list(joint_node): if "matrix" in matrix_node.tag: floats = [float(x) for x in matrix_node.text.split()] - print "randomizing",floats + print("randomizing",floats) if len(floats) == 16: floats[3] += random.uniform(-1.0,1.0) floats[7] += random.uniform(-1.0,1.0) floats[11] += random.uniform(-1.0,1.0) matrix_node.text = " ".join([str(f) for f in floats]) - print joint_node.get("name"),matrix_node.tag,"text",matrix_node.text,len(floats),floats + print(joint_node.get("name"),matrix_node.tag,"text",matrix_node.text,len(floats),floats) if __name__ == "__main__": @@ -96,24 +96,24 @@ if __name__ == "__main__": tree = None if args.infilename: - print "reading",args.infilename + print("reading",args.infilename) mesh = Collada(args.infilename) tree = etree.parse(args.infilename) if args.summary: - print "summarizing",args.infilename + print("summarizing",args.infilename) mesh_summary(mesh) if args.lock_offsets: - print "locking offsets for",args.lock_offsets + print("locking offsets for",args.lock_offsets) mesh_lock_offsets(tree, args.lock_offsets) if args.random_offsets: - print "adding random offsets for",args.random_offsets + print("adding random offsets for",args.random_offsets) mesh_random_offsets(tree, args.random_offsets) if args.outfilename: - print "writing",args.outfilename + print("writing",args.outfilename) f = open(args.outfilename,"w") - print >>f, etree.tostring(tree, pretty_print=True) #need update to get: , short_empty_elements=True) + print(etree.tostring(tree, pretty_print=True), file=f) #need update to get: , short_empty_elements=True) |