diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-03-01 13:21:16 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-03-01 13:41:42 +0200 |
commit | 97a103255e433629f13e2156aa307ca329cdcfc6 (patch) | |
tree | bf5de1cef5930647c4ab87a0cff7f88f0007832d /scripts/content_tools/dae_tool.py | |
parent | 92c302d6fba687f0921544b278e22b698d058646 (diff) | |
parent | 6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff) |
Merge branch 'master' (DRTVWR-557) into DRTVWR-546
# Conflicts:
# autobuild.xml
# doc/contributions.txt
# indra/cmake/GLOD.cmake
# indra/llcommon/tests/llprocess_test.cpp
# indra/newview/VIEWER_VERSION.txt
# indra/newview/lldrawpoolavatar.cpp
# indra/newview/llfloatermodelpreview.cpp
# indra/newview/llmodelpreview.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/llvovolume.cpp
# indra/newview/viewer_manifest.py
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) |