Vinyeh commited on
Commit
799e188
·
verified ·
1 Parent(s): fa6aaa6

Add pinned source: behavior-1k-bddl (part 3)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +8 -0
  2. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/spherify.py +24 -0
  3. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/switch_loose.py +61 -0
  4. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/switch_metalink.py +54 -0
  5. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/three_room_assignment.py +66 -0
  6. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/toggle_meta_visibility.py +24 -0
  7. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/translate_ig_dataset.py +66 -0
  8. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/triangulate.py +19 -0
  9. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/two_room_assignment.py +60 -0
  10. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/unify_legacy.py +492 -0
  11. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/unify_non_legacy.py +236 -0
  12. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/validate_collision.py +178 -0
  13. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/view_complaints.py +60 -0
  14. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/wensi_resolve_complaints.py +78 -0
  15. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/wensi_view_complaints.py +67 -0
  16. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/mesh_tree.py +403 -0
  17. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/model_rename.yml +1216 -0
  18. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/object_inventory.py +167 -0
  19. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/object_positioning_data_for_r1_plot.py +515 -0
  20. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/object_to_stl_urdfpy.py +36 -0
  21. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/pack_dataset.py +151 -0
  22. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/patch_sampled.sh +64 -0
  23. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/physics_test.py +77 -0
  24. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/qa_viewer.py +314 -0
  25. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/qa_viewer_og.py +547 -0
  26. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/reflection_analysis.py +75 -0
  27. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/repeated-repro.ps1 +4 -0
  28. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/run_stages.py +76 -0
  29. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/sync_sheets.py +127 -0
  30. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/HumanFemale.keepAlive.usd +0 -0
  31. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/HumanFemale.usd +245 -0
  32. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/HumanFemale.walk.usd +0 -0
  33. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/LICENSE.txt +48 -0
  34. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/README.md +88 -0
  35. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full.blendshapes.usd +3 -0
  36. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full.usd +54 -0
  37. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full_payload.usd +3 -0
  38. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low.blendshapes.usd +3 -0
  39. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low.usd +48 -0
  40. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low_payload.usd +3 -0
  41. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium.blendshapes.usd +3 -0
  42. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium.usd +54 -0
  43. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium_payload.usd +3 -0
  44. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.rig.usd +52 -0
  45. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/background.jpg +3 -0
  46. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/category_qa.py +1327 -0
  47. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/category_qa_josiah.py +1494 -0
  48. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/compare_position.py +82 -0
  49. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/urdfpy/__init__.py +56 -0
  50. source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/urdfpy/urdf.py +0 -0
.gitattributes CHANGED
@@ -207,3 +207,11 @@ source_data/pinned/dmn-tck/commit-1e349176e5ae/docs/fonts/OpenSans-SemiboldItali
207
  source_data/pinned/dmn-tck/commit-1e349176e5ae/docs/fonts/fontawesome-webfont.ttf filter=lfs diff=lfs merge=lfs -text
208
  source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/7za.exe filter=lfs diff=lfs merge=lfs -text
209
  source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/7zzs filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
207
  source_data/pinned/dmn-tck/commit-1e349176e5ae/docs/fonts/fontawesome-webfont.ttf filter=lfs diff=lfs merge=lfs -text
208
  source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/7za.exe filter=lfs diff=lfs merge=lfs -text
209
  source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/7zzs filter=lfs diff=lfs merge=lfs -text
210
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full.blendshapes.usd filter=lfs diff=lfs merge=lfs -text
211
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full_payload.usd filter=lfs diff=lfs merge=lfs -text
212
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low.blendshapes.usd filter=lfs diff=lfs merge=lfs -text
213
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low_payload.usd filter=lfs diff=lfs merge=lfs -text
214
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium.blendshapes.usd filter=lfs diff=lfs merge=lfs -text
215
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium_payload.usd filter=lfs diff=lfs merge=lfs -text
216
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/vhacd1.exe filter=lfs diff=lfs merge=lfs -text
217
+ source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/vhacd2.exe filter=lfs diff=lfs merge=lfs -text
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/spherify.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pymxs
2
+
3
+ rt = pymxs.runtime
4
+
5
+
6
+ def spherify(obj):
7
+ if rt.classOf(obj) == rt.VolumeHelper:
8
+ assert obj.volumeType == 1, f"{obj.name} is not a sphere."
9
+ s = rt.Sphere()
10
+ s.position = obj.position
11
+ s.name = obj.name
12
+ s.radius = obj.size / 2.0 if rt.classOf(obj) == rt.VolumeHelper else 20
13
+ s.layer = obj.layer
14
+ s.parent = obj.parent
15
+ rt.delete(obj)
16
+ return s
17
+
18
+
19
+ def main():
20
+ rt.select([spherify(x) for x in rt.selection])
21
+
22
+
23
+ if __name__ == "__main__":
24
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/switch_loose.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+
3
+ sys.path.append(r"D:\BEHAVIOR-1K\asset_pipeline")
4
+
5
+ import pymxs
6
+
7
+ rt = pymxs.runtime
8
+
9
+ from b1k_pipeline.utils import parse_name
10
+
11
+
12
+ def main():
13
+ # Find groups of visible objects
14
+ parsed_names = [parse_name(x.name) for x in rt.objects if not x.isHidden]
15
+ groups = {
16
+ x.group("category")
17
+ for x in parsed_names
18
+ if x is not None and int(x.group("instance_id")) == 0
19
+ }
20
+ assert len(groups) == 1, "Multiple object groups are visible"
21
+
22
+ # Find objects corresponding to the next remaining group's instance zero
23
+ (this_group,) = groups
24
+ this_group_objects = []
25
+ current_prefix = ""
26
+ for obj in rt.objects:
27
+ n = parse_name(obj.name)
28
+ if n is None:
29
+ continue
30
+ if n.group("category") != this_group:
31
+ continue
32
+ this_group_objects.append(obj)
33
+ current_prefix = n.group("loose")
34
+
35
+ # Decide which way to go
36
+ if current_prefix == "L-": # Loose nonclutter -> Loose clutter
37
+ prefix = "C-"
38
+ message = "Switched to clutter"
39
+ elif current_prefix == "C-": # Loose clutter -> Fixed
40
+ prefix = ""
41
+ message = "Switched to fixed"
42
+ else: # Fixed -> Loose nonluuter
43
+ prefix = "L-"
44
+ message = "Switched to loose nonclutter"
45
+
46
+ # Apply the prefix
47
+ for obj in this_group_objects:
48
+ n = parse_name(obj.name)
49
+ bad = n.group("bad") or ""
50
+ randomization_disabled = n.group("randomization_disabled") or ""
51
+ before = f"{bad}{randomization_disabled}"
52
+ after = obj.name[n.start("category") :]
53
+ new_name = before + prefix + after
54
+ assert parse_name(obj.name), f"Almost generated invalid name {new_name}"
55
+ obj.name = new_name
56
+
57
+ print(message)
58
+
59
+
60
+ if __name__ == "__main__":
61
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/switch_metalink.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+
3
+ sys.path.append(r"D:\BEHAVIOR-1K\asset_pipeline")
4
+
5
+ from b1k_pipeline.utils import parse_name
6
+
7
+
8
+ import pymxs
9
+
10
+ rt = pymxs.runtime
11
+
12
+
13
+ def switch_metalink():
14
+ metalinks = list(rt.selection)
15
+
16
+ for obj in metalinks:
17
+ n = parse_name(obj.name)
18
+ if n is None:
19
+ continue
20
+ current_metatype = n.group("meta_type")
21
+
22
+ if current_metatype == "togglebutton":
23
+ new_metatype = "slicer"
24
+ elif current_metatype == "slicer":
25
+ new_metatype = "fillable"
26
+ elif current_metatype == "fillable":
27
+ new_metatype = "fluidsink"
28
+ elif current_metatype == "fluidsink":
29
+ new_metatype = "fluidsource"
30
+ elif current_metatype == "fluidsource":
31
+ new_metatype = "heatsource"
32
+ elif current_metatype == "heatsource":
33
+ new_metatype = "particleapplier"
34
+ elif current_metatype == "particleapplier":
35
+ new_metatype = "togglebutton"
36
+
37
+ before = obj.name[: n.start("meta_type")]
38
+ after = obj.name[n.end("meta_type") :]
39
+ new_name = before + new_metatype + after
40
+ assert parse_name(obj.name), f"Almost generated invalid name {new_name}"
41
+ obj.name = new_name
42
+
43
+
44
+ def switch_metalink_button():
45
+ try:
46
+ switch_metalink()
47
+ except AssertionError as e:
48
+ # Print message
49
+ rt.messageBox(str(e))
50
+ return
51
+
52
+
53
+ if __name__ == "__main__":
54
+ switch_metalink_button()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/three_room_assignment.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import itertools
2
+
3
+ import pymxs
4
+
5
+ rt = pymxs.runtime
6
+
7
+
8
+ def three_room_assignment(assignment_objects, target1, target2, target3):
9
+ # Check that targets are in layers that have single-room names (e.g. no comma)
10
+ layers = []
11
+ for target in [target1, target2, target3]:
12
+ assert (
13
+ "," not in target.layer.name and target.layer.name != "0"
14
+ ), f"Target object {target.name} is in layer {target.layer.name} which does not have a single-room name"
15
+ layers.append(target.layer)
16
+
17
+ # Check if the layermanager has the combined layer in any of the permutations
18
+ layers.sort(key=lambda layer: layer.name)
19
+ canonical_combined_layer_name = ",".join(layer.name for layer in layers)
20
+ permutation_names = [",".join(p) for p in itertools.permutations(layer.name for layer in layers)]
21
+ existing_layers = [
22
+ (name, rt.LayerManager.getLayerFromName(name))
23
+ for name in permutation_names
24
+ ]
25
+ existing_layers = [(name, layer) for name, layer in existing_layers if layer]
26
+ assert len(existing_layers) <= 1, (
27
+ f"Multiple combined layers exist: {[name for name, _ in existing_layers]}, which is unexpected"
28
+ )
29
+
30
+ # If the layer does not exist, create it using the canonical sorted name.
31
+ if not existing_layers:
32
+ combined_layer = rt.LayerManager.NewLayerFromName(canonical_combined_layer_name)
33
+ else:
34
+ combined_layer = existing_layers[0][1]
35
+
36
+ # Move the assignment objects to the combined layer
37
+ for obj in assignment_objects:
38
+ combined_layer.addNode(obj)
39
+
40
+ print(f"Moved {len(assignment_objects)} objects to layer {combined_layer.name}")
41
+
42
+
43
+ def select_and_three_room_assignment():
44
+ assignment_objects = list(rt.selection)
45
+
46
+ # Ask the user to pick three target objects
47
+ target1 = rt.pickobject()
48
+ target2 = rt.pickobject()
49
+ target3 = rt.pickobject()
50
+
51
+ # Merge the collision objects
52
+ three_room_assignment(assignment_objects, target1, target2, target3)
53
+
54
+
55
+ def three_room_assignment_button():
56
+ try:
57
+ select_and_three_room_assignment()
58
+ # rt.messageBox("Success!")
59
+ except AssertionError as e:
60
+ # Print message
61
+ rt.messageBox(str(e))
62
+ return
63
+
64
+
65
+ if __name__ == "__main__":
66
+ three_room_assignment_button()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/toggle_meta_visibility.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pymxs
2
+
3
+ rt = pymxs.runtime
4
+
5
+ import sys
6
+
7
+ sys.path.append(r"D:\BEHAVIOR-1K\asset_pipeline")
8
+
9
+ from b1k_pipeline.utils import parse_name
10
+
11
+
12
+ def main():
13
+ meta_links = [
14
+ x
15
+ for x in rt.objects
16
+ if parse_name(x.name) and parse_name(x.name).group("meta_type")
17
+ ]
18
+ hidden = all(x.isHidden for x in meta_links)
19
+ for x in meta_links:
20
+ x.isHidden = not hidden
21
+
22
+
23
+ if __name__ == "__main__":
24
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/translate_ig_dataset.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+ import re
3
+ import string
4
+ from collections import defaultdict
5
+
6
+ import pymxs
7
+ import yaml
8
+
9
+ rt = pymxs.runtime
10
+
11
+ PATTERN = re.compile(
12
+ r"^(?P<bad>B-)?(?P<randomization_disabled>F-)?(?P<loose>L-)?(?P<category>[a-z_]+)-(?P<model_id>[A-Za-z0-9_]+)-(?P<instance_id>[0-9]+)(?:-(?P<link_name>[a-z0-9_]+))?(?:-(?P<parent_link_name>[A-Za-z0-9_]+)-(?P<joint_type>[RP])-(?P<joint_side>lower|upper))?(?:-L(?P<light_id>[0-9]+))?(?:-M(?P<meta_type>[a-z]+)_(?P<meta_id>[0-9]+))?$"
13
+ )
14
+
15
+
16
+ def parse_name(name):
17
+ return PATTERN.fullmatch(name)
18
+
19
+
20
+ def translate_names():
21
+ with open(r"D:\BEHAVIOR-1K\asset_pipeline\scripts\model_rename.yml") as f:
22
+ mapping = yaml.load(f, Loader=yaml.FullLoader)
23
+
24
+ for obj in rt.objects:
25
+ if rt.classOf(obj) != rt.Editable_Poly:
26
+ continue
27
+
28
+ result = parse_name(obj.name)
29
+ assert result is not None, "{} does not match naming convention".format(
30
+ obj.name
31
+ )
32
+
33
+ category, model_id, is_bad = (
34
+ result.group("category"),
35
+ result.group("model_id"),
36
+ result.group("bad"),
37
+ )
38
+ key = f"{category}/{model_id}"
39
+ if key not in mapping:
40
+ continue
41
+
42
+ assert is_bad, f"Object {category}-{model_id} found in mapping but is not bad."
43
+
44
+ new_category, new_model_id = mapping[key].split("/")
45
+ old_str = "-".join([category, model_id])
46
+ new_str = "-".join([new_category, new_model_id])
47
+ new_name = obj.name.replace(old_str, new_str)
48
+
49
+ print(f"Replacing {obj.name} with {new_name}.")
50
+ obj.name = new_name
51
+
52
+
53
+ def translate_names_safe():
54
+ try:
55
+ translate_names()
56
+ except AssertionError as e:
57
+ # Print message
58
+ rt.messageBox(str(e))
59
+ return
60
+
61
+ # Print message
62
+ rt.messageBox("Names translated!")
63
+
64
+
65
+ if __name__ == "__main__":
66
+ translate_names_safe()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/triangulate.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pymxs import runtime as rt
2
+
3
+
4
+ def triangulate(obj):
5
+ # Triangulate
6
+ ttp = rt.Turn_To_Poly()
7
+ ttp.limitPolySize = True
8
+ ttp.maxPolySize = 3
9
+ rt.addmodifier(obj, ttp)
10
+ rt.maxOps.collapseNodeTo(obj, 1, True)
11
+
12
+
13
+ def main():
14
+ for obj in rt.selection:
15
+ triangulate(obj)
16
+
17
+
18
+ if __name__ == "__main__":
19
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/two_room_assignment.py ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pymxs
2
+
3
+ rt = pymxs.runtime
4
+
5
+
6
+ def two_room_assignment(assignment_objects, target1, target2):
7
+ # Check that target1 and target2 are in layers that have single-room names (e.g. no comma)
8
+ layers = []
9
+ for target in [target1, target2]:
10
+ assert (
11
+ "," not in target.layer.name and target.layer.name != "0"
12
+ ), f"Target object {target.name} is in layer {target.layer.name} which does not have a single-room name"
13
+ layers.append(target.layer)
14
+
15
+ # Check if the layermanager has the combined layer in either formation
16
+ layers.sort(key=lambda layer: layer.name)
17
+ combined_layer_name1 = f"{layers[0].name},{layers[1].name}"
18
+ combined_layer_name2 = f"{layers[1].name},{layers[0].name}"
19
+ combined_layer_1 = rt.LayerManager.getLayerFromName(combined_layer_name1)
20
+ combined_layer_2 = rt.LayerManager.getLayerFromName(combined_layer_name2)
21
+ assert not (combined_layer_1 and combined_layer_2), f"Both combined layers {combined_layer_name1} and {combined_layer_name2} exist, which is unexpected"
22
+
23
+ # If the layer does not exist, create it.
24
+ if not combined_layer_1 and not combined_layer_2:
25
+ combined_layer = rt.LayerManager.NewLayerFromName(combined_layer_name1)
26
+ elif combined_layer_1:
27
+ combined_layer = combined_layer_1
28
+ else:
29
+ combined_layer = combined_layer_2
30
+
31
+ # Move the assignment objects to the combined layer
32
+ for obj in assignment_objects:
33
+ combined_layer.addNode(obj)
34
+
35
+ print(f"Moved {len(assignment_objects)} objects to layer {combined_layer.name}")
36
+
37
+
38
+ def select_and_two_room_assignment():
39
+ assignment_objects = list(rt.selection)
40
+
41
+ # Ask the user to pick two target objects
42
+ target1 = rt.pickobject()
43
+ target2 = rt.pickobject()
44
+
45
+ # Merge the collision objects
46
+ two_room_assignment(assignment_objects, target1, target2)
47
+
48
+
49
+ def two_room_assignment_button():
50
+ try:
51
+ select_and_two_room_assignment()
52
+ # rt.messageBox("Success!")
53
+ except AssertionError as e:
54
+ # Print message
55
+ rt.messageBox(str(e))
56
+ return
57
+
58
+
59
+ if __name__ == "__main__":
60
+ two_room_assignment_button()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/unify_legacy.py ADDED
@@ -0,0 +1,492 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import glob
2
+ import os
3
+ import shutil
4
+ import numpy as np
5
+
6
+ import tqdm
7
+
8
+ import pymxs
9
+
10
+ rt = pymxs.runtime
11
+
12
+ MARGIN = 500 # mm, or 50 centimeters
13
+ from b1k_pipeline.max.new_sanity_check import SanityCheck
14
+
15
+
16
+ bins = [
17
+ {"bottom_cabinet", "pop", "apple"},
18
+ {"swivel_chair", "straight_chair", "lid", "bathtub"},
19
+ {"toy", "breakfast_table", "armchair", "table_lamp", "board_game", "alarm"},
20
+ {"bed", "jar", "picture", "desk", "pot_plant", "dishwasher"},
21
+ {
22
+ "bottom_cabinet_no_top",
23
+ "toilet",
24
+ "top_cabinet",
25
+ "trash_can",
26
+ "bowl",
27
+ "coffee_table",
28
+ "pop_case",
29
+ "bean",
30
+ },
31
+ {
32
+ "video_game",
33
+ "door",
34
+ "oven",
35
+ "shelf",
36
+ "window",
37
+ "gym_shoe",
38
+ "sofa",
39
+ "basket",
40
+ "bench",
41
+ "almond",
42
+ },
43
+ {
44
+ "sink",
45
+ "medicine",
46
+ "standing_tv",
47
+ "stove",
48
+ "walker",
49
+ "floor_lamp",
50
+ "notebook",
51
+ "pencil",
52
+ "shampoo",
53
+ "spoon",
54
+ "canned_food",
55
+ "dryer",
56
+ "fridge",
57
+ "microwave",
58
+ },
59
+ {
60
+ "pillow",
61
+ "tape",
62
+ "washer",
63
+ "cereal",
64
+ "cup",
65
+ "foot_rule",
66
+ "pedestal_table",
67
+ "platter",
68
+ "sandal",
69
+ "stool",
70
+ "bell_pepper",
71
+ "briefcase",
72
+ "chopping_board",
73
+ "console_table",
74
+ "dishtowel",
75
+ "guitar",
76
+ "hat",
77
+ "kettle",
78
+ "paint",
79
+ "potato",
80
+ "protein_powder",
81
+ "bath_towel",
82
+ },
83
+ {
84
+ "range_hood",
85
+ "vidalia_onion",
86
+ "bucket",
87
+ "carving_knife",
88
+ "chaise_longue",
89
+ "chestnut",
90
+ "chives",
91
+ "coconut",
92
+ "cord",
93
+ "folding_chair",
94
+ "glove",
95
+ "grandfather_clock",
96
+ "grape",
97
+ "heater",
98
+ "ink_cartridge",
99
+ "olive_oil",
100
+ "piano",
101
+ "pineapple",
102
+ "pomegranate",
103
+ "rail_fence",
104
+ "rocking_chair",
105
+ "shower",
106
+ "speaker_system",
107
+ "stand",
108
+ "towel_rack",
109
+ "vacuum",
110
+ "wall_mounted_tv",
111
+ "wine_bottle",
112
+ "zucchini",
113
+ "apricot",
114
+ "blender",
115
+ "bulletin_board",
116
+ "burner",
117
+ "chest",
118
+ "artichoke",
119
+ },
120
+ {
121
+ "chili",
122
+ "coat",
123
+ "coffee_pouch",
124
+ "detergent",
125
+ "folder",
126
+ "glass",
127
+ "hard_drive",
128
+ "highchair",
129
+ "jeans",
130
+ "kitchen_analog_scale",
131
+ "kiwi",
132
+ "lemon",
133
+ "loudspeaker",
134
+ "monitor",
135
+ "mushroom",
136
+ "olive",
137
+ "orange",
138
+ "package",
139
+ "painting",
140
+ "peach",
141
+ "pear",
142
+ "pen",
143
+ "pencil_box",
144
+ "plum",
145
+ "pomelo",
146
+ "pumpkin",
147
+ "radish",
148
+ "rag",
149
+ "roller",
150
+ "scarf",
151
+ "scissors",
152
+ "screwdriver",
153
+ "soup_ladle",
154
+ "straw",
155
+ "strawberry",
156
+ "sunglass",
157
+ "sweater",
158
+ "tablefork",
159
+ "table_knife",
160
+ "tile",
161
+ "toasting_fork",
162
+ "tomato",
163
+ "toothbrush",
164
+ "treadmill",
165
+ "umbrella",
166
+ "wall_clock",
167
+ "walnut",
168
+ "watermelon",
169
+ "atomizer",
170
+ "backpack",
171
+ "bagel",
172
+ "baguette",
173
+ },
174
+ {
175
+ "ball",
176
+ "banana",
177
+ "baseboard",
178
+ "basil",
179
+ "beef",
180
+ "beer",
181
+ "beet",
182
+ "bell",
183
+ "bow",
184
+ "bracelet",
185
+ "broccoli",
186
+ "broom",
187
+ "bulldog_clip",
188
+ "butter",
189
+ "calculator",
190
+ "caliper",
191
+ "candle",
192
+ "candy_cane",
193
+ "cantaloup",
194
+ "carafe",
195
+ "carpet",
196
+ "carpet_sweeper",
197
+ "carrot",
198
+ "carton",
199
+ "casserole",
200
+ "catsup",
201
+ "cauldron",
202
+ "celery",
203
+ "cheese",
204
+ "cherry",
205
+ "chicken",
206
+ "chip",
207
+ "chocolate_box",
208
+ "chopstick",
209
+ "christmas_tree",
210
+ "christmas_tree_decorated",
211
+ "cinnamon",
212
+ "clout_nail",
213
+ "clove",
214
+ "coatrack",
215
+ "coffee_cup",
216
+ "coffee_maker",
217
+ "colander",
218
+ "cologne",
219
+ "comb",
220
+ "conditioner",
221
+ "container_cranberry",
222
+ "container_date",
223
+ "cookie",
224
+ "countertop",
225
+ "cpu_board",
226
+ "crab",
227
+ "cracker_box",
228
+ "cream",
229
+ "cream_pitcher",
230
+ "crib",
231
+ "cruet",
232
+ "crumb",
233
+ "cucumber",
234
+ "cupcake",
235
+ "dart",
236
+ "dartboard",
237
+ "dental_floss",
238
+ "digital_scale",
239
+ "dinner_napkin",
240
+ "dipper",
241
+ "dish_rack",
242
+ "document",
243
+ "dress",
244
+ "drill",
245
+ "drumstick",
246
+ "duffel_bag",
247
+ "dustpan",
248
+ "egg",
249
+ "eggplant",
250
+ "envelope",
251
+ "eraser",
252
+ "facsimile",
253
+ "fillet",
254
+ "fish",
255
+ "flour",
256
+ "folderal",
257
+ "frying_pan",
258
+ "gaming_table",
259
+ "ginger",
260
+ "gingerbread",
261
+ "gooseberry",
262
+ "grater",
263
+ "green_onion",
264
+ "green_onion_chopped",
265
+ "griddle",
266
+ "grill",
267
+ "guacamole",
268
+ "hairbrush",
269
+ "hamburger",
270
+ "hammer",
271
+ "hand_towel",
272
+ "hanger",
273
+ "hardback",
274
+ "headset",
275
+ },
276
+ {
277
+ "head_cabbage",
278
+ "highlighter",
279
+ "hinge",
280
+ "honing_steel",
281
+ "hook",
282
+ "hose",
283
+ "ice_cube",
284
+ "iron",
285
+ "jam",
286
+ "jewel",
287
+ "juice",
288
+ "keyboard",
289
+ "ladder",
290
+ "laptop",
291
+ "lasagna",
292
+ "lawn_mower",
293
+ "lettuce",
294
+ "light_bulb",
295
+ "lime",
296
+ "lipstick",
297
+ "lollipop",
298
+ "lotion",
299
+ "magazine",
300
+ "martini",
301
+ "mat",
302
+ "mayonnaise",
303
+ "milk",
304
+ "mirror",
305
+ "modem",
306
+ "mouse",
307
+ "mousetrap",
308
+ "muffin",
309
+ "mug",
310
+ "necklace",
311
+ "newspaper",
312
+ "oatmeal",
313
+ "paintbrush",
314
+ "pajamas",
315
+ "paper_bag",
316
+ "paper_clip",
317
+ "paper_towel",
318
+ "paper_towel_holder",
319
+ "parsley",
320
+ "pasta",
321
+ "pea",
322
+ "pegboard",
323
+ "pepper_grinder",
324
+ "perfume",
325
+ "pistachio",
326
+ "plate",
327
+ "plywood",
328
+ "pocketknife",
329
+ "pool",
330
+ "pool_table",
331
+ "pork",
332
+ "powder_bottle",
333
+ "pretzel",
334
+ "printer",
335
+ "prosciutto",
336
+ "puree",
337
+ "rake",
338
+ "raspberry",
339
+ "razor",
340
+ "rib",
341
+ "ribbon",
342
+ "ring",
343
+ "rosehip",
344
+ "router",
345
+ "salad",
346
+ "salt",
347
+ "saucepan",
348
+ "sausage",
349
+ "saw",
350
+ "scanner",
351
+ "scraper",
352
+ "scrub_brush",
353
+ "sheet",
354
+ "shoulder_bag",
355
+ "soap",
356
+ "sock",
357
+ "soup",
358
+ "spaghetti_sauce",
359
+ "spatula",
360
+ "spinach",
361
+ "steak",
362
+ "sticky_note",
363
+ "stocking",
364
+ "straight_pin",
365
+ "sugar_jar",
366
+ "sunscreen",
367
+ "sushi",
368
+ "sweet_corn",
369
+ "tart",
370
+ "teapot",
371
+ "tea_bag",
372
+ "thumbtack",
373
+ "tinsel",
374
+ "toaster",
375
+ "tongs",
376
+ "toothpaste",
377
+ },
378
+ {
379
+ "toothpick",
380
+ "tray",
381
+ "trowel",
382
+ "turnip",
383
+ "t_shirt",
384
+ "underwear",
385
+ "vinegar",
386
+ "wall_socket",
387
+ "watch",
388
+ "water",
389
+ "whiteboard",
390
+ "wrapped_gift",
391
+ "wreath",
392
+ "yogurt",
393
+ },
394
+ ]
395
+
396
+
397
+ def max_path_to_cat(target):
398
+ dirname = os.path.basename(os.path.dirname(target))
399
+ legacy_part, _ = dirname.split("-")
400
+ assert legacy_part.startswith("legacy_")
401
+ return legacy_part.replace("legacy_", "")
402
+
403
+
404
+ def bin_files():
405
+ max_files = glob.glob(
406
+ r"D:\BEHAVIOR-1K\asset_pipeline\cad\objects\legacy_*\processed.max"
407
+ )
408
+
409
+ # Check if any of the files are empty
410
+ # for f in tqdm.tqdm(max_files):
411
+ # if len(rt.getMAXFileObjectNames(f, quiet=True)) == 0:
412
+ # print("Empty file", f)
413
+
414
+ for i, cats in enumerate(bins):
415
+ # Create an empty file
416
+ rt.resetMaxFile(rt.name("noPrompt"))
417
+
418
+ # Create the directory
419
+ file_root = os.path.join(
420
+ r"D:\BEHAVIOR-1K\asset_pipeline\cad\objects\legacy_batch-%02d" % i
421
+ )
422
+ max_path = os.path.join(file_root, "processed.max")
423
+ if os.path.exists(max_path):
424
+ continue
425
+
426
+ print("Starting file", i)
427
+ os.makedirs(file_root, exist_ok=True)
428
+
429
+ textures_dir = os.path.join(file_root, "textures")
430
+ os.makedirs(textures_dir, exist_ok=True)
431
+
432
+ # Get the files that match this bin
433
+ files = [x for x in max_files if max_path_to_cat(x) in cats]
434
+
435
+ # Merge in each file
436
+ current_x_coordinate = 0
437
+ for f in tqdm.tqdm(files):
438
+ # Load everything in
439
+ success, meshes = rt.mergeMaxFile(
440
+ f,
441
+ rt.Name("select"),
442
+ rt.Name("autoRenameDups"),
443
+ rt.Name("renameMtlDups"),
444
+ quiet=True,
445
+ mergedNodes=pymxs.byref(None),
446
+ )
447
+ assert success, f"Could not merge {f}"
448
+ assert len(meshes) > 0, f"No objects found in file {f}"
449
+
450
+ # Unhide everything
451
+ for x in meshes:
452
+ x.isHidden = False
453
+
454
+ # Take everything in the selection and place them appropriately
455
+ bb_min = np.min([x.min for x in meshes], axis=0)
456
+ bb_max = np.max([x.max for x in meshes], axis=0)
457
+ bb_size = bb_max - bb_min
458
+
459
+ # Calculate the offset that everything needs to move by for the minimum to be at current_x_coordinate, 0, 0
460
+ offset = np.array([current_x_coordinate, 0, 0]) - bb_min
461
+ offset = offset.tolist()
462
+
463
+ # Move everything by the offset amount
464
+ for x in meshes:
465
+ if x.parent:
466
+ continue
467
+ x.position += rt.Point3(*offset)
468
+
469
+ # Increment the current x position
470
+ current_x_coordinate += bb_size[0] + MARGIN
471
+
472
+ # Copy over the textures
473
+ print("Copying textures")
474
+ textures = glob.glob(os.path.join(os.path.dirname(f), "textures", "*"))
475
+ for t in textures:
476
+ target_path = os.path.join(textures_dir, os.path.basename(t))
477
+ assert not os.path.exists(target_path), f"Texture {target_path} exists"
478
+ shutil.copy(t, target_path)
479
+
480
+ # After loading everything, run a sanity check
481
+ sc = SanityCheck().run()
482
+ if sc["ERROR"]:
483
+ raise ValueError(f"Sanity check failed for {i}:\n{sc['ERROR']}")
484
+
485
+ # Save the output file.
486
+ rt.saveMaxFile(max_path, quiet=True)
487
+
488
+ print("Done!")
489
+
490
+
491
+ if __name__ == "__main__":
492
+ bin_files()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/unify_non_legacy.py ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from collections import defaultdict, Counter
2
+ import filecmp
3
+ import glob
4
+ import hashlib
5
+ import os
6
+ import pathlib
7
+ import random
8
+ import shutil
9
+ import numpy as np
10
+
11
+ import tqdm
12
+
13
+ import pymxs
14
+
15
+ rt = pymxs.runtime
16
+
17
+ MARGIN = 500 # mm, or 50 centimeters
18
+ from b1k_pipeline.max.new_sanity_check import SanityCheck
19
+
20
+ PRECHECK_COLLISION = False
21
+ PRECHECK_EMPTY = False
22
+
23
+
24
+ def bin_files():
25
+ max_files = glob.glob(r"D:\BEHAVIOR-1K\asset_pipeline\cad\objects\*\processed.max")
26
+ max_files = sorted(
27
+ [pathlib.Path(x) for x in max_files if "legacy_" not in x and "batch-" not in x]
28
+ )
29
+
30
+ # Deterministic shuffle
31
+ random.seed(1337)
32
+ random.shuffle(max_files)
33
+
34
+ print(len(max_files), "files found")
35
+
36
+ batch_size = 50
37
+ bins = [
38
+ set(max_files[start : start + batch_size])
39
+ for start in range(0, len(max_files), batch_size)
40
+ ]
41
+
42
+ # Apply displacements to avoid texture collisions
43
+ displacements = {
44
+ "curtain-fh": 2,
45
+ "toaster_oven-kf": 7,
46
+ "food_processor-ht": 8,
47
+ "hockey_stick-ja": 6,
48
+ "jewelry_cleaner-bh": 5,
49
+ "tequilla-jo": 4,
50
+ "baby_bottle-hv": 13,
51
+ "coconut_milk-oq": 11,
52
+ "log-da": 12,
53
+ }
54
+ for d, tgt in displacements.items():
55
+ # Convert d to its path form
56
+ p = (
57
+ pathlib.Path(r"D:\BEHAVIOR-1K\asset_pipeline\cad\objects")
58
+ / d
59
+ / "processed.max"
60
+ )
61
+
62
+ # Remove d from the bin it shows up in
63
+ for bin in bins:
64
+ if p in bin:
65
+ bin.remove(p)
66
+ break
67
+ else:
68
+ raise ValueError("Could not find displaced path" + str(p))
69
+
70
+ # Add it to its new bin
71
+ bins[tgt].add(p)
72
+
73
+ # Identify any texture collisions
74
+ if PRECHECK_COLLISION:
75
+ any_collision = False
76
+ texture_hashes = {}
77
+ hash_to_file = {}
78
+ for i, files in enumerate(tqdm.tqdm(bins)):
79
+ texture_hashes[i] = defaultdict(set)
80
+ hash_to_file[i] = defaultdict(set)
81
+ for f in files:
82
+ texture_dir = f.parent / "textures"
83
+ if texture_dir.exists():
84
+ textures = list(texture_dir.rglob("*"))
85
+
86
+ # First check for collision within the same file
87
+ c = Counter([t.name.lower() for t in textures])
88
+ for k, v in c.items():
89
+ if v > 1:
90
+ print("Texture collision for", k, "within file", f)
91
+ any_collision = True
92
+
93
+ for t in textures:
94
+ # Skip directories & flatten them
95
+ if t.is_dir() or t.name == "Thumbs.db":
96
+ continue
97
+
98
+ with open(t, "rb") as f:
99
+ f_hash = hashlib.md5(f.read()).hexdigest()
100
+ texture_hashes[i][t.name.lower()].add(f_hash)
101
+ hash_to_file[i][(t.name.lower(), f_hash)].add(t)
102
+
103
+ needs_removal = set()
104
+ for basename, hashes in texture_hashes[i].items():
105
+ if len(hashes) > 1:
106
+ providers = [
107
+ x for h in hashes for x in hash_to_file[i][(basename, h)]
108
+ ]
109
+ print(
110
+ "Texture collision for",
111
+ basename,
112
+ "between",
113
+ providers,
114
+ "in bin",
115
+ i,
116
+ )
117
+ for provider in providers[1:]:
118
+ relpath = provider.relative_to(
119
+ r"D:\BEHAVIOR-1K\asset_pipeline\cad\objects"
120
+ )
121
+ needs_removal.add(relpath.parts[0])
122
+ any_collision = True
123
+
124
+ for r in needs_removal:
125
+ print("Remove", r, ":", i)
126
+
127
+ if any_collision:
128
+ return
129
+
130
+ # Check if any of the files are empty
131
+ if PRECHECK_EMPTY:
132
+ any_empty = False
133
+ for f in tqdm.tqdm(max_files):
134
+ if len(rt.getMAXFileObjectNames(f, quiet=True)) == 0:
135
+ print("Empty file", f)
136
+ any_empty = True
137
+
138
+ if any_empty:
139
+ return
140
+
141
+ for i, files in enumerate(bins):
142
+ # Create an empty file
143
+ rt.resetMaxFile(rt.name("noPrompt"))
144
+
145
+ # Create the directory
146
+ file_root = pathlib.Path(
147
+ r"D:\BEHAVIOR-1K\asset_pipeline\cad\objects\batch-%02d" % i
148
+ )
149
+ max_path = file_root / "processed.max"
150
+ if max_path.exists():
151
+ continue
152
+
153
+ print("Starting file", i)
154
+ file_root.mkdir(exist_ok=True, parents=True)
155
+
156
+ textures_dir = file_root / "textures"
157
+ textures_dir.mkdir(exist_ok=True, parents=True)
158
+
159
+ # Merge in each file
160
+ current_x_coordinate = 0
161
+ for p in tqdm.tqdm(files):
162
+ f = str(p)
163
+
164
+ # Load everything in
165
+ success, meshes = rt.mergeMaxFile(
166
+ f,
167
+ rt.Name("select"),
168
+ rt.Name("autoRenameDups"),
169
+ rt.Name("renameMtlDups"),
170
+ quiet=True,
171
+ mergedNodes=pymxs.byref(None),
172
+ )
173
+ assert success, f"Could not merge {f}"
174
+ assert len(meshes) > 0, f"No objects found in file {f}"
175
+
176
+ # Unhide everything
177
+ for x in meshes:
178
+ x.isHidden = False
179
+
180
+ # Take everything in the selection and place them appropriately
181
+ bb_min = np.min([x.min for x in meshes], axis=0)
182
+ bb_max = np.max([x.max for x in meshes], axis=0)
183
+ bb_size = bb_max - bb_min
184
+
185
+ # Calculate the offset that everything needs to move by for the minimum to be at current_x_coordinate, 0, 0
186
+ offset = np.array([current_x_coordinate, 0, 0]) - bb_min
187
+ offset = offset.tolist()
188
+
189
+ # Move everything by the offset amount
190
+ for x in meshes:
191
+ if x.parent:
192
+ continue
193
+ x.position += rt.Point3(*offset)
194
+
195
+ # Increment the current x position
196
+ current_x_coordinate += bb_size[0] + MARGIN
197
+
198
+ # Copy over the textures
199
+ texture_dir = p.parent / "textures"
200
+ if texture_dir.exists():
201
+ for t in texture_dir.rglob("*"):
202
+ # Skip directories & flatten them
203
+ if t.is_dir() or t.name == "Thumbs.db":
204
+ continue
205
+
206
+ target_path = textures_dir / t.name
207
+ if target_path.exists():
208
+ # Check if the file contents are equal
209
+ with (
210
+ open(t, "rb") as t_file,
211
+ open(target_path, "rb") as target_path_file,
212
+ ):
213
+ t_hash = hashlib.md5(t_file.read()).hexdigest()
214
+ target_path_hash = hashlib.md5(
215
+ target_path_file.read()
216
+ ).hexdigest()
217
+ assert (
218
+ t_hash == target_path_hash
219
+ ), f"Two different texture files including {t} want to be copied to {target_path}"
220
+ continue
221
+
222
+ shutil.copy(t, target_path)
223
+
224
+ # After loading everything, run a sanity check
225
+ sc = SanityCheck().run()
226
+ if sc["ERROR"]:
227
+ raise ValueError(f"Sanity check failed for {i}:\n{sc['ERROR']}")
228
+
229
+ # Save the output file.
230
+ rt.saveMaxFile(str(max_path), quiet=True)
231
+
232
+ print("Done!")
233
+
234
+
235
+ if __name__ == "__main__":
236
+ bin_files()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/validate_collision.py ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import traceback
2
+ from pymxs import runtime as rt
3
+ import trimesh
4
+ import numpy as np
5
+
6
+ import sys
7
+
8
+ sys.path.append(r"D:\BEHAVIOR-1K\asset_pipeline")
9
+
10
+ from b1k_pipeline.utils import parse_name
11
+
12
+
13
+ def get_verts_for_obj(obj):
14
+ return np.array(
15
+ [
16
+ rt.polyop.getVert(obj.baseObject, i + 1)
17
+ for i in range(rt.polyop.GetNumVerts(obj))
18
+ ]
19
+ )
20
+
21
+
22
+ def get_faces_for_obj(obj):
23
+ try:
24
+ return (
25
+ np.array(
26
+ rt.polyop.getFacesVerts(
27
+ obj.baseObject, rt.execute("#{1..%d}" % rt.polyop.GetNumFaces(obj))
28
+ )
29
+ )
30
+ - 1
31
+ )
32
+ except:
33
+ raise ValueError(f"Error getting faces for {obj.name}. Did you triangulate?")
34
+
35
+
36
+ def validate_collision_mesh(obj, max_elements=40, max_vertices_per_element=60):
37
+ # Check that the name can be parsed correctly and that it contains the correct meta type
38
+ # and no meta ID or sub ID
39
+ parsed_name = parse_name(obj.name)
40
+ assert parsed_name, f"{obj.name} has an invalid name."
41
+ assert parsed_name.group("meta_type") in (
42
+ "collision",
43
+ "fillable",
44
+ "openfillable",
45
+ ), f"{obj.name} has an invalid meta type ({parsed_name.group('meta_type')})."
46
+ assert (
47
+ parsed_name.group("meta_id") is None
48
+ ), f"{obj.name} has a meta ID ({parsed_name.group('meta_id')}). Remove it."
49
+ assert (
50
+ parsed_name.group("meta_subid") is None
51
+ ), f"{obj.name} has a meta sub ID ({parsed_name.group('meta_subid')}). Remove it."
52
+
53
+ # Check that it has a parent and the parent has the same mesh basename.
54
+ assert obj.parent, f"{obj.name} has no parent."
55
+ parent_parsed_name = parse_name(obj.parent.name)
56
+ assert parent_parsed_name, f"{obj.parent.name} has an invalid name."
57
+ assert parsed_name.group("mesh_basename") == parent_parsed_name.group(
58
+ "mesh_basename"
59
+ ), f"{obj.name} and {obj.parent.name} have different mesh basenames ({parsed_name.group('mesh_basename')} vs {parent_parsed_name.group('mesh_basename')})."
60
+
61
+ # Check that the parent is not bad and is not an upper side
62
+ assert not parent_parsed_name.group(
63
+ "bad"
64
+ ), f"Bad object {obj.parent.name} does not need a collision mesh."
65
+ assert (
66
+ parent_parsed_name.group("joint_side") != "upper"
67
+ ), f"Upper side {obj.parent.name} does not need a collision mesh. Put one on the lower side if needed."
68
+
69
+ # Expect that collision meshes do not share instances in the scene
70
+ assert not [
71
+ x for x in rt.objects if x.baseObject == obj.baseObject and x != obj
72
+ ], f"{obj.name} should not have instances."
73
+
74
+ # Check that there are no dead elements
75
+ assert (
76
+ rt.polyop.GetHasDeadStructs(obj) == 0
77
+ ), f"{obj.name} has dead structs. Apply the Triangulate script."
78
+
79
+ # Get vertices and faces into numpy arrays for conversion
80
+ verts = get_verts_for_obj(obj)
81
+ faces = get_faces_for_obj(obj)
82
+ assert len(faces) > 0, f"{obj.name} has no faces."
83
+ assert all(
84
+ len(f) == 3 for f in faces
85
+ ), f"{obj.name} has non-triangular faces. Apply the Triangulate script."
86
+
87
+ assert not any(x < 0 for x in obj.scale), (
88
+ f"{obj.name} has negative scale, probably because you mirrored it. Apply the Reset Xform button from the Utilities tab of the right-side menu. "
89
+ "Then return to the Modify tab, right click on the Xform modifier in the modifier stack and select Collapse To."
90
+ )
91
+
92
+ # Split the faces into elements
93
+ faces_not_yet_found = np.zeros(faces.shape[0], dtype=bool)
94
+ elems = []
95
+ while not np.all(faces_not_yet_found):
96
+ next_not_found_face = int(np.where(~faces_not_yet_found)[0][0])
97
+ elem = np.array(rt.polyop.GetElementsUsingFace(obj, [next_not_found_face + 1]))
98
+ assert elem[next_not_found_face], "Searched face not found in element."
99
+ elems.append(elem)
100
+ faces_not_yet_found[elem] = True
101
+ elems = np.array(elems)
102
+ assert not np.any(
103
+ np.sum(elems.astype(int), axis=0) > 1
104
+ ), f"{obj.name} has same face appear in multiple elements"
105
+
106
+ elems_by_volume = []
107
+
108
+ # Iterate through the elements
109
+ for i, elem in enumerate(elems):
110
+ # Load the mesh into trimesh and assert convexity
111
+ relevant_faces = faces[elem]
112
+ m = trimesh.Trimesh(vertices=verts, faces=relevant_faces, process=False)
113
+ m.remove_unreferenced_vertices()
114
+ if max_vertices_per_element is not None:
115
+ assert (
116
+ len(m.vertices) <= max_vertices_per_element
117
+ ), f"{obj.name} element {i} has too many vertices ({len(m.vertices)} > {max_vertices_per_element})"
118
+ if not m.is_volume:
119
+ # Get the element faces (True indices in `elem`) and select them in 3ds Max
120
+ element_faces = (np.where(elem)[0] + 1).tolist()
121
+ rt.polyop.setFaceSelection(obj, element_faces)
122
+ raise ValueError(
123
+ f"{obj.name} element {i} is not a volume. It's now selected for your viewing."
124
+ )
125
+ elems_by_volume.append((elem, m.volume))
126
+
127
+ try:
128
+ try:
129
+ hull = m.convex_hull
130
+ except:
131
+ raise ValueError(
132
+ f"{obj.name} element {i} convex hull could not be computed, which likely indicates a problem with the mesh."
133
+ )
134
+
135
+ assert (
136
+ hull.volume > 0
137
+ ), f"{obj.name} element {i} has non-positive volume convex hull, which likely indicates a problem with the mesh."
138
+ volume_ratio = m.volume / hull.volume
139
+ assert (
140
+ volume_ratio > 0.99
141
+ ), f"{obj.name} element {i} has volume {m.volume} that is very different from the volume of its convex hull {hull.volume} (ratio {volume_ratio}), which indicates that the mesh is not close to convex."
142
+
143
+ assert (
144
+ len(m.split()) == 1
145
+ ), f"{obj.name} element {i} has elements trimesh still finds splittable e.g. are not watertight / connected"
146
+ except Exception as e:
147
+ print(
148
+ f"Error validating {obj.name} element {i}: {str(e)}. Selecting the element for your viewing, and stopping."
149
+ )
150
+ element_faces = (np.where(elem)[0] + 1).tolist()
151
+ rt.polyop.setFaceSelection(obj, element_faces)
152
+ raise
153
+
154
+ if max_elements is not None:
155
+ if len(elems) > max_elements:
156
+ # Select the smallest element
157
+ elems_by_volume.sort(key=lambda x: x[1])
158
+ elem, volume = elems_by_volume[0]
159
+ element_faces = (np.where(elem)[0] + 1).tolist()
160
+ rt.polyop.setFaceSelection(obj, element_faces)
161
+
162
+ raise ValueError(
163
+ f"{obj.name} should not have more than {max_elements} elements. Has {len(elems)} elements. Selected the smallest element."
164
+ )
165
+
166
+
167
+ if __name__ == "__main__":
168
+ # assert len(rt.selection) == 1, "Please select a single object."
169
+ objs = list(rt.selection)
170
+ if not objs:
171
+ objs = [x for x in rt.objects if "Mcollision" in x.name]
172
+ for obj in objs:
173
+ try:
174
+ validate_collision_mesh(obj)
175
+ print("Collision mesh is VALID:", obj.name)
176
+ except Exception as e:
177
+ print("Collision mesh is INVALID:", obj.name)
178
+ print(traceback.format_exc())
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/view_complaints.py ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+
3
+ sys.path.append(r"D:\BEHAVIOR-1K\asset_pipeline")
4
+
5
+ import b1k_pipeline.utils
6
+
7
+ import json
8
+ import pathlib
9
+ import pymxs
10
+ import textwrap
11
+
12
+ rt = pymxs.runtime
13
+
14
+
15
+ def should_get_complaint(complaint):
16
+ if complaint["processed"]:
17
+ return False
18
+
19
+ if complaint["type"] in ("material", "clothappearance"):
20
+ return False
21
+
22
+ return True
23
+
24
+
25
+ def main():
26
+ current_max_dir = pathlib.Path(rt.maxFilePath).resolve()
27
+ complaint_path = current_max_dir / "complaints.json"
28
+
29
+ if not complaint_path.exists():
30
+ print("No complaints!")
31
+ return
32
+
33
+ selected_objs = list(rt.selection) if len(rt.selection) > 0 else list(rt.objects)
34
+ selected_names = [obj.name for obj in selected_objs]
35
+ selected_obj_matches = [
36
+ b1k_pipeline.utils.parse_name(name) for name in selected_names
37
+ ]
38
+ selected_keys = {
39
+ match.group("model_id") for match in selected_obj_matches if match is not None
40
+ }
41
+
42
+ with open(complaint_path, "r") as f:
43
+ all_complaints = json.load(f)
44
+
45
+ complaints = [
46
+ complaint
47
+ for complaint in all_complaints
48
+ if complaint["object"].split("-")[-1] in selected_keys
49
+ and should_get_complaint(complaint)
50
+ ]
51
+ if len(complaints) == 0:
52
+ print("No complaints for objects", ", ".join(selected_keys))
53
+ else:
54
+ for complaint in complaints:
55
+ print("\n".join(textwrap.wrap(str(complaint))))
56
+ print("")
57
+
58
+
59
+ if __name__ == "__main__":
60
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/wensi_resolve_complaints.py ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ import sys
3
+
4
+ sys.path.append(r"D:\BEHAVIOR-1K\asset_pipeline")
5
+
6
+ import b1k_pipeline.utils
7
+
8
+ import json
9
+ import pathlib
10
+ import pymxs
11
+
12
+ rt = pymxs.runtime
13
+
14
+
15
+ def should_get_complaint(complaint):
16
+ if complaint["processed"]:
17
+ return False
18
+
19
+ if complaint["type"] not in (
20
+ "centerofmass",
21
+ "joint",
22
+ "metalink",
23
+ "softbody",
24
+ "substanceness",
25
+ "unknown",
26
+ ):
27
+ return False
28
+
29
+ return True
30
+
31
+
32
+ def main():
33
+ current_max_dir = pathlib.Path(rt.maxFilePath).resolve()
34
+ complaint_path = current_max_dir / "complaints.json"
35
+
36
+ if not complaint_path.exists():
37
+ print("No complaints found!")
38
+ return
39
+
40
+ with open(complaint_path, "r") as f:
41
+ x = json.load(f)
42
+
43
+ selected_objs = list(
44
+ rt.selection
45
+ ) # if len(rt.selection) > 0 else list(rt.objects)
46
+ selected_names = [obj.name for obj in selected_objs]
47
+ selected_obj_matches = [
48
+ b1k_pipeline.utils.parse_name(name) for name in selected_names
49
+ ]
50
+ selected_keys = {
51
+ match.group("model_id") for match in selected_obj_matches if match is not None
52
+ }
53
+
54
+ # Stop if all processed
55
+ if not any(
56
+ not c["processed"] for c in x if c["object"].split("-")[-1] in selected_keys
57
+ ):
58
+ print("No unresolved complaints found!")
59
+ return
60
+
61
+ # Mark as processed
62
+ for complaint in x:
63
+ if complaint["object"].split("-")[
64
+ -1
65
+ ] not in selected_keys or not should_get_complaint(complaint):
66
+ continue
67
+
68
+ complaint["processed"] = True
69
+
70
+ # Save
71
+ with open(complaint_path, "w") as f:
72
+ json.dump(x, f, indent=4)
73
+
74
+ print("Complaints resolved!")
75
+
76
+
77
+ if __name__ == "__main__":
78
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/max/wensi_view_complaints.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+
3
+ sys.path.append(r"D:\BEHAVIOR-1K\asset_pipeline")
4
+
5
+ import b1k_pipeline.utils
6
+
7
+ import json
8
+ import pathlib
9
+ import pymxs
10
+ import textwrap
11
+
12
+ rt = pymxs.runtime
13
+
14
+
15
+ def should_get_complaint(complaint):
16
+ if complaint["processed"]:
17
+ return False
18
+
19
+ if complaint["type"] not in (
20
+ "centerofmass",
21
+ "joint",
22
+ "metalink",
23
+ "softbody",
24
+ "substanceness",
25
+ "unknown",
26
+ ):
27
+ return False
28
+
29
+ return True
30
+
31
+
32
+ def main():
33
+ current_max_dir = pathlib.Path(rt.maxFilePath).resolve()
34
+ complaint_path = current_max_dir / "complaints.json"
35
+
36
+ if not complaint_path.exists():
37
+ print("No complaints!")
38
+ return
39
+
40
+ selected_objs = list(rt.selection) if len(rt.selection) > 0 else list(rt.objects)
41
+ selected_names = [obj.name for obj in selected_objs]
42
+ selected_obj_matches = [
43
+ b1k_pipeline.utils.parse_name(name) for name in selected_names
44
+ ]
45
+ selected_keys = {
46
+ match.group("model_id") for match in selected_obj_matches if match is not None
47
+ }
48
+
49
+ with open(complaint_path, "r") as f:
50
+ all_complaints = json.load(f)
51
+
52
+ complaints = [
53
+ complaint
54
+ for complaint in all_complaints
55
+ if complaint["object"].split("-")[-1] in selected_keys
56
+ and should_get_complaint(complaint)
57
+ ]
58
+ if len(complaints) == 0:
59
+ print("No complaints for objects", ", ".join(selected_keys))
60
+ else:
61
+ for complaint in complaints:
62
+ print("\n".join(textwrap.wrap(str(complaint))))
63
+ print("")
64
+
65
+
66
+ if __name__ == "__main__":
67
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/mesh_tree.py ADDED
@@ -0,0 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import csv
2
+ import json
3
+ import os
4
+ import re
5
+
6
+ import networkx as nx
7
+ import numpy as np
8
+ import tqdm
9
+ import trimesh
10
+ import fs.path
11
+ from fs.zipfs import ZipFS
12
+ from scipy.spatial.transform import Rotation as R
13
+
14
+ from b1k_pipeline.utils import parse_name, load_mesh, load_points, PipelineFS
15
+
16
+ SCALE_FACTOR = 0.001
17
+ SCALE_MATRIX = trimesh.transformations.scale_matrix(0.001)
18
+
19
+ PARTICLE_APPLIER_CONE_LENGTH = 0.3
20
+
21
+ CONVEX_MESH_TYPES = {"collision", "fillable", "openfillable"}
22
+ NON_COLLISION_CONVEX_MESH_TYPES = CONVEX_MESH_TYPES - {"collision"}
23
+
24
+ # Load the rename file
25
+ RENAMES = {}
26
+ with PipelineFS().open("metadata/object_renames.csv") as f:
27
+ for row in csv.DictReader(f):
28
+ key = (row["Original category (auto)"], row["ID (auto)"])
29
+ RENAMES[key] = row["New Category"]
30
+
31
+ # Load the deletion file
32
+ DELETION_QUEUE = set()
33
+ with PipelineFS().open("metadata/deletion_queue.csv", "r") as f:
34
+ for row in csv.DictReader(f):
35
+ DELETION_QUEUE.add(row["Object"].strip().split("-")[1])
36
+
37
+
38
+ def maybe_rename_category(cat, model):
39
+ if (cat, model) in RENAMES:
40
+ return RENAMES[(cat, model)]
41
+ return cat
42
+
43
+
44
+ def build_mesh_tree(
45
+ target,
46
+ load_upper=True,
47
+ load_bad=True,
48
+ load_nonzero=True,
49
+ load_meshes=True,
50
+ filter_nodes=None,
51
+ show_progress=False,
52
+ ):
53
+ G = nx.DiGraph()
54
+
55
+ pipeline_fs = PipelineFS()
56
+ target_output_fs = pipeline_fs.target_output(target)
57
+
58
+ # Open the mesh filesystems
59
+ mesh_fs = ZipFS(target_output_fs.open("meshes.zip", "rb"))
60
+
61
+ # Load the object list for the file
62
+ with target_output_fs.open("object_list.json", "r") as f:
63
+ object_list = json.load(f)
64
+
65
+ # Get the mesh list and bboxes
66
+ mesh_list = object_list["meshes"]
67
+ object_bounding_boxes = object_list["bounding_boxes"]
68
+
69
+ # Invert the bbox rotations and update their scales
70
+ # TODO: Remove .inv() after fixing the object_list wrong rotation.
71
+ for model_id, instances in object_bounding_boxes.items():
72
+ for instance_id, bbox in instances.items():
73
+ bbox["rotation"] = R.from_quat(bbox["rotation"]).inv().as_quat().tolist()
74
+ bbox["extent"] = (np.array(bbox["extent"]) * SCALE_FACTOR).tolist()
75
+ bbox["position"] = (np.array(bbox["position"]) * SCALE_FACTOR).tolist()
76
+
77
+ pbar = tqdm.tqdm(mesh_list) if show_progress else mesh_list
78
+ for mesh_name in pbar:
79
+ if show_progress:
80
+ pbar.set_description(mesh_name)
81
+ match = parse_name(mesh_name)
82
+ is_broken = match.group("bad")
83
+ is_randomization_fixed = match.group("randomization_disabled")
84
+ is_loose = match.group("loose")
85
+ obj_model = match.group("model_id")
86
+ obj_cat = maybe_rename_category(match.group("category"), obj_model)
87
+ obj_inst_id = match.group("instance_id")
88
+ link_name = match.group("link_name")
89
+ parent_link_name = match.group("parent_link_name")
90
+ joint_type = match.group("joint_type")
91
+ joint_side = match.group("joint_side")
92
+ tags_str = match.group("tag")
93
+
94
+ if obj_model in DELETION_QUEUE:
95
+ continue
96
+
97
+ if joint_side == "upper" and not load_upper:
98
+ continue
99
+
100
+ if is_broken and not load_bad:
101
+ continue
102
+
103
+ if int(obj_inst_id) != 0 and not load_nonzero:
104
+ continue
105
+
106
+ link_name = "base_link" if link_name is None else link_name
107
+
108
+ tags = []
109
+ if tags_str:
110
+ tags = sorted([x[1:] for x in tags_str.split("-") if x])
111
+
112
+ node_key = (obj_cat, obj_model, obj_inst_id, link_name)
113
+
114
+ if filter_nodes is not None and node_key not in filter_nodes:
115
+ continue
116
+
117
+ if node_key not in G.nodes:
118
+ G.add_node(node_key)
119
+ G.nodes[node_key]["is_broken"] = is_broken
120
+ G.nodes[node_key]["is_loose"] = is_loose
121
+ G.nodes[node_key]["is_randomization_fixed"] = is_randomization_fixed
122
+ G.nodes[node_key]["tags"] = tags
123
+
124
+ should_load_data = not is_broken and int(obj_inst_id) == 0
125
+
126
+ if should_load_data:
127
+ # Get the path for the mesh
128
+ mesh_dir = mesh_fs.opendir(mesh_name)
129
+ mesh_fn = f"{mesh_name}.obj"
130
+ with mesh_dir.open(f"{mesh_name}.json", "r") as metadata_file:
131
+ metadata = json.load(metadata_file)
132
+
133
+ # Rename parts
134
+ renamed_parts = []
135
+ for part_name in metadata["parts"]:
136
+ part_name_parsed = parse_name(part_name)
137
+ part_cat = part_name_parsed.group("category")
138
+ part_model = part_name_parsed.group("model_id")
139
+ part_name_renamed = part_name.replace(
140
+ part_cat, maybe_rename_category(part_cat, part_model)
141
+ )
142
+ renamed_parts.append(part_name_renamed)
143
+ metadata["parts"] = renamed_parts
144
+
145
+ # Grab orientation from metadata
146
+ canonical_orientation = metadata["orientation"]
147
+ del metadata["orientation"]
148
+
149
+ # Grab meta links from metadata and delete original to avoid confusion
150
+ meta_links = metadata["meta_links"]
151
+ del metadata["meta_links"]
152
+
153
+ # Apply the scaling factor.
154
+ for meta_type, meta_link_id_to_subid in meta_links.items():
155
+ for meta_link_subid_to_link in meta_link_id_to_subid.values():
156
+ for meta_link in meta_link_subid_to_link:
157
+ meta_link["position"] = (
158
+ np.array(meta_link["position"]) * SCALE_FACTOR
159
+ )
160
+
161
+ # TODO: Remove this after it's fixed in export_meshes
162
+ # Fix inverted meta link orientations
163
+ meta_link["orientation"] = (
164
+ R.from_quat(meta_link["orientation"])
165
+ .inv()
166
+ .as_quat()
167
+ .tolist()
168
+ )
169
+
170
+ if "length" in meta_link:
171
+ meta_link["length"] *= SCALE_FACTOR
172
+ if "width" in meta_link:
173
+ meta_link["width"] *= SCALE_FACTOR
174
+ if "size" in meta_link:
175
+ meta_link["size"] = (
176
+ np.asarray(meta_link["size"]) * SCALE_FACTOR
177
+ ).tolist()
178
+
179
+ # Fix any negative sizes.
180
+ z_negative = meta_link["size"][2] < 0
181
+ meta_link["size"] = np.abs(meta_link["size"]).tolist()
182
+ if z_negative and meta_link["type"] in (
183
+ "box",
184
+ "cylinder",
185
+ "cone",
186
+ ):
187
+ # These objects are not symmetrical around the Z axis & need to be rotated
188
+ new_orientation = R.from_quat(
189
+ meta_link["orientation"]
190
+ ) * R.from_euler("x", np.pi)
191
+ meta_link["orientation"] = new_orientation.as_quat()
192
+
193
+ # TODO: Remove this once it is moved to a better place
194
+ # Apply the meta link scaling rules here
195
+ if meta_type == "particleapplier":
196
+ coefficient = (
197
+ PARTICLE_APPLIER_CONE_LENGTH / meta_link["size"][2]
198
+ )
199
+
200
+ if coefficient > 1:
201
+ meta_link["size"] = (
202
+ np.asarray(meta_link["size"]) * coefficient
203
+ ).tolist()
204
+
205
+ # Add the data for the position onto the node.
206
+ if joint_side == "upper":
207
+ assert (
208
+ "upper_points" not in G.nodes[node_key]
209
+ ), f"Found two upper meshes for {node_key}"
210
+ if load_meshes:
211
+ upper_points = load_points(mesh_dir, mesh_fn)
212
+ G.nodes[node_key]["upper_points"] = (
213
+ trimesh.transformations.transform_points(
214
+ upper_points, SCALE_MATRIX
215
+ )
216
+ )
217
+ else:
218
+ G.nodes[node_key]["metadata"] = metadata
219
+ G.nodes[node_key]["meta_links"] = meta_links
220
+ G.nodes[node_key]["canonical_orientation"] = canonical_orientation
221
+
222
+ if load_meshes:
223
+ assert (
224
+ "lower_mesh" not in G.nodes[node_key]
225
+ ), f"Found two lower meshes for {node_key}"
226
+ lower_mesh = load_mesh(
227
+ mesh_dir, mesh_fn, process=False, force="mesh"
228
+ )
229
+ lower_mesh.apply_transform(SCALE_MATRIX)
230
+ G.nodes[node_key]["lower_mesh"] = lower_mesh
231
+
232
+ lower_points = load_points(mesh_dir, mesh_fn)
233
+ G.nodes[node_key]["lower_points"] = (
234
+ trimesh.transformations.transform_points(
235
+ lower_points, SCALE_MATRIX
236
+ )
237
+ )
238
+
239
+ # Load the texture map paths and convert them to absolute paths
240
+ G.nodes[node_key]["material_maps"] = {}
241
+ bakery_fs = pipeline_fs.target(target).opendir("bakery")
242
+ for channel, path_rel_to_bakery in metadata[
243
+ "material_maps"
244
+ ].items():
245
+ # TODO: Remove this once it is corrected.
246
+ if channel == "Transparency Color Map":
247
+ channel = "Transparency Map"
248
+ G.nodes[node_key]["material_maps"][channel] = (
249
+ bakery_fs.getsyspath(path_rel_to_bakery)
250
+ )
251
+
252
+ # Load convexmesh meta links
253
+ for cm_type in CONVEX_MESH_TYPES:
254
+ # Check if a collision mesh exist in the same directory
255
+ pattern_str = (
256
+ r"^.*-M" + cm_type + r"(?:_[A-Za-z0-9]+)?-(\d+).obj$"
257
+ )
258
+ selection_matching_pattern = re.compile(pattern_str)
259
+ cm_filenames = [
260
+ x
261
+ for x in mesh_dir.listdir("/")
262
+ if selection_matching_pattern.fullmatch(x)
263
+ ]
264
+
265
+ if cm_filenames:
266
+ # Match the files
267
+ selection_matches = [
268
+ (selection_matching_pattern.fullmatch(x), x)
269
+ for x in cm_filenames
270
+ ]
271
+ indexed_matches = {
272
+ int(match.group(1)): fn
273
+ for match, fn in selection_matches
274
+ if match
275
+ }
276
+ expected_keys = set(range(len(indexed_matches)))
277
+ found_keys = set(indexed_matches.keys())
278
+ assert (
279
+ expected_keys == found_keys
280
+ ), f"Missing {cm_type} meshes for {node_key}: {expected_keys - found_keys}"
281
+ ordered_cm_filenames = [
282
+ indexed_matches[i] for i in range(len(indexed_matches))
283
+ ]
284
+
285
+ convex_meshes = []
286
+ for convex_mesh_filename in ordered_cm_filenames:
287
+ convex_mesh = load_mesh(
288
+ mesh_dir,
289
+ convex_mesh_filename,
290
+ force="mesh",
291
+ process=False,
292
+ skip_materials=True,
293
+ )
294
+ convex_mesh.apply_transform(SCALE_MATRIX)
295
+ convex_meshes.append(convex_mesh)
296
+ G.nodes[node_key][f"{cm_type}_mesh"] = convex_meshes
297
+
298
+ # Add the edge in from the parent
299
+ if link_name != "base_link":
300
+ assert (
301
+ parent_link_name
302
+ ), f"Non-base_link {node_key} should have a parent link name."
303
+ parent_key = (obj_cat, obj_model, obj_inst_id, parent_link_name)
304
+ G.add_edge(parent_key, node_key, joint_type=joint_type)
305
+ if "is_loose" not in G.nodes[parent_key]:
306
+ G.nodes[parent_key]["is_loose"] = None
307
+
308
+ # Quick validation.
309
+ for node, data in G.nodes(data=True):
310
+ should_load_data = not data["is_broken"] and int(node[2]) == 0
311
+ needs_upper = False
312
+ if node[-1] != "base_link":
313
+ assert len(G.in_edges(node)) == 1, node
314
+ ((_, _, d),) = G.in_edges(node, data=True)
315
+ joint_type = d["joint_type"]
316
+ needs_upper = load_upper and not data["is_broken"] and joint_type != "F"
317
+ assert (
318
+ not should_load_data
319
+ or not load_meshes
320
+ or not needs_upper
321
+ or "upper_points" in data
322
+ ), f"{node} does not have upper mesh."
323
+ assert (
324
+ not should_load_data or not load_meshes or "lower_mesh" in data
325
+ ), f"{node} does not have lower mesh."
326
+ assert (
327
+ not should_load_data or not load_meshes or "lower_points" in data
328
+ ), f"{node} does not have lower mesh."
329
+ assert (
330
+ not should_load_data or "metadata" in data
331
+ ), f"{node} does not have metadata."
332
+
333
+ if "upper_points" in data:
334
+ lower_vertices = len(data["lower_points"])
335
+ upper_vertices = len(data["upper_points"])
336
+ assert (
337
+ lower_vertices == upper_vertices
338
+ ), f"{node} lower mesh has {lower_vertices} while upper mesh has {upper_vertices}. They should be equal."
339
+
340
+ if node[3] == "base_link":
341
+ assert (
342
+ G.in_degree(node) == 0
343
+ ), f"Base_link node {node} should have in degree 0."
344
+ else:
345
+ assert (
346
+ G.in_degree(node) != 0
347
+ ), f"Non-base_link node {node} should not have in degree 0."
348
+
349
+ # Find roots to look them up in bounding boxes.
350
+ roots = [node for node, in_degree in G.in_degree() if in_degree == 0]
351
+
352
+ # Assert that the roots keys are a subset of the bounding boxes keys.
353
+ roots_to_model_and_instance = sorted([(node[1], node[2]) for node in roots])
354
+ roots_to_model_and_instance_set = set(roots_to_model_and_instance)
355
+ assert len(roots_to_model_and_instance) == len(
356
+ roots_to_model_and_instance_set
357
+ ), f"Duplicate root nodes found in {roots_to_model_and_instance}"
358
+ bbox_keys = set(
359
+ [
360
+ (model_id, instance_id)
361
+ for model_id, instances in object_bounding_boxes.items()
362
+ for instance_id in instances
363
+ ]
364
+ )
365
+ assert roots_to_model_and_instance_set.issubset(
366
+ bbox_keys
367
+ ), f"Root nodes do not match the bounding boxes. Roots: {roots_to_model_and_instance}, BBoxes: {bbox_keys}"
368
+
369
+ for root in roots:
370
+ # First find the object bounding box.
371
+ G.nodes[root]["object_bounding_box"] = object_bounding_boxes[root[1]][root[2]]
372
+
373
+ # Check that the bounding box orientation is the same as the canonical orientation when one is available.
374
+ bbox_orientation = G.nodes[root]["object_bounding_box"]["rotation"]
375
+ bbox_orientation = R.from_quat(bbox_orientation)
376
+ if "canonical_orientation" in G.nodes[root]:
377
+ canonical_orientation = G.nodes[root]["canonical_orientation"]
378
+ canonical_orientation = R.from_quat(canonical_orientation)
379
+ delta_orientation = bbox_orientation.inv() * canonical_orientation
380
+ assert (
381
+ delta_orientation.magnitude() < 1e-5
382
+ ), f"Root node {root} has a bounding box with orientation {bbox_orientation.as_quat()} that does not match the canonical orientation {canonical_orientation.as_quat()}."
383
+
384
+ # Create combined mesh for each root node and add some data.
385
+ if load_meshes:
386
+ nodes = list(nx.dfs_preorder_nodes(G, root))
387
+ meshes = [
388
+ G.nodes[node]["lower_mesh"]
389
+ for node in nodes
390
+ if "lower_mesh" in G.nodes[node]
391
+ ]
392
+ combined_mesh = trimesh.util.concatenate(meshes)
393
+ G.nodes[root]["combined_mesh"] = combined_mesh
394
+
395
+ for cm_type in CONVEX_MESH_TYPES:
396
+ if all(f"{cm_type}_mesh" in G.nodes[node] for node in nodes):
397
+ convex_meshes = [
398
+ cm for node in nodes for cm in G.nodes[node][f"{cm_type}_mesh"]
399
+ ]
400
+ combined_convex_mesh = trimesh.util.concatenate(convex_meshes)
401
+ G.nodes[root][f"combined_{cm_type}_mesh"] = combined_convex_mesh
402
+
403
+ return G
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/model_rename.yml ADDED
@@ -0,0 +1,1216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ alarm/alarm_000: alarm/dkwmmf
2
+ almond/almond_000: almond/acooui
3
+ apple/00_0: apple/agveuv
4
+ apple/00_1: apple/sguztn
5
+ apple/00_2: apple/omzprq
6
+ apple/00_3: apple/qusmpx
7
+ apricot/04_0: apricot/qmwmwm
8
+ apricot/04_1: apricot/inxcvi
9
+ armchair/1e276a016b664e424d678187b8261d95: armchair/rabzuf
10
+ armchair/2f1a67cdabe2a70c492d9da2668ec34c: armchair/vzhxuf
11
+ armchair/31a3884f500d9fa2025d98fb9de28cb: armchair/pmrcex
12
+ armchair/35e8b034d84f60cb4d226702c1bfe9e2: armchair/qplklw
13
+ armchair/3ab3c9d99fcaa66bebd676e3a69dcf6: armchair/nckeqb
14
+ armchair/453a678dec4e9d40f36ea1eb6542fe7e: armchair/axudcx
15
+ armchair/47d13a704da37b588fda227abcbd8611: armchair/xpcheg
16
+ armchair/4a329240c6a9d2547b11ae648ea92233: armchair/xqovyv
17
+ armchair/5107542cfbf142f36209799e55a657c: armchair/tnryza
18
+ armchair/61d313bb88532dcb74039aeb9f7d295: armchair/xkacfd
19
+ armchair/79e5eb7be94f5479696b74614952b2d0: armchair/umbrpd
20
+ armchair/8d9061d863268349db224de2961e777c: armchair/fsrprw
21
+ armchair/990ae87d8fb108ee80bd85224f0b94aa: armchair/tcxiue
22
+ armchair/c405857cd7d8aa04d225e12279334514: armchair/qgcjtr
23
+ armchair/c7f607892513a2f787bf0444104341d5: armchair/jmunen
24
+ armchair/d14d1da1e682a7cfaac8336231c53cd1: armchair/viphen
25
+ armchair/d72f27e4240bd7d0283b00891f680579: armchair/bslhmj
26
+ armchair/e4114b81f793628fe8f8c11a24c52ebb: armchair/vtsoat
27
+ armchair/f3f331e64d12b76d727e9f790cd597: armchair/cyvmhv
28
+ armchair/fc131dfba15fafb2fdeed357dfbe708a: armchair/qjwuus
29
+ artichoke/51_0: artichoke/tfclmg
30
+ atomizer/atomizer_000: atomizer/tehmzy
31
+ backpack/articulated_bag_000: backpack/gvbiwl
32
+ bagel/bagel_000: bagel/zlxkry
33
+ baguette/baguette_000: baguette/xydhpd
34
+ ball/ball_000: ball/nofzds
35
+ banana/09_0: banana/vvyyyv
36
+ baseboard/baseboard_000: baseboard/prytbo
37
+ basil/basil_000: basil/bebpnf
38
+ basket/284c23b810fc7823466f97f37dccbde: basket/pgwdlg
39
+ basket/2ae75c0f4bf43142e76bc197b3a3ffc0: basket/haewxp
40
+ basket/35bc440973661b91259e0fe12d9ec13d: basket/clziqw
41
+ basket/814bba8e48083abfdce1af5c27e3da18: basket/xjftlf
42
+ basket/9e2a1751b9129b1132fd0b3f17b0d6c: basket/xhdtjn
43
+ basket/9e4a936285f32194e1a03d0bf111d109: basket/pqzyxx
44
+ basket/e3bae8da192ab3d4a17ae19fa77775ff: basket/wqxrbf
45
+ basket/eb58305e6c1b4455a9e3e4940ed610e4: basket/wdsnjy
46
+ basket/f870bedc47fdbd287ae6f33544c233fe: basket/pcyjbu
47
+ bath_towel/Provence_Bath_Towel_Royal_Blue: bath_towel/lyqgnf
48
+ bath_towel/Threshold_Performance_Bath_Sheet_Sandoval_Blue: bath_towel/iviyls
49
+ bath_towel/Threshold_Textured_Damask_Bath_Towel_Pink: bath_towel/feojdm
50
+ bathtub/1f5642ecc73ef347323f2769d46520fa: bathtub/wxrafq
51
+ bathtub/66bf814e881c1c1a51c83dffb1e07a0e: bathtub/jfhrwj
52
+ bathtub/85c3bd8f53a7329ed83a3378d32b3048: bathtub/fdjykf
53
+ bathtub/8be7711dfc0c7e3a54d7082b34825ef0: bathtub/azdgtl
54
+ bathtub/a26f1817df243dbf601f1922eb3d98df: bathtub/enpxbn
55
+ bathtub/a92ca67b245f008b54d7082b34825ef0: bathtub/gulceo
56
+ bathtub/e34833b19879020d54d7082b34825ef0: bathtub/oobbwn
57
+ bean/52_0: bean/mfkwzi
58
+ bean/52_1: bean/lvbjws
59
+ bean/53_0: bean/cdinsu
60
+ bean/53_1: bean/dyjvwv
61
+ bed/1edea7d187858e2630b07c64830a47f3: bed/hkmwyc
62
+ bed/3fc3087faa29bce5b1b6b0c5ddacb607: bed/wfxgbb
63
+ bed/644f11d3687ab3ba2ade7345ab5b0cf6: bed/gcgodj
64
+ bed/64c2347dfd79c63a63d977b06bbd429d: bed/nwzbyk
65
+ bed/7c8eb4ab1f2c8bfa2fb46fb8b9b1ac9f: bed/lslyyi
66
+ bed/9725ec5429b19ba05ac28d2931a0cac6: bed/sunfhf
67
+ bed/9e0733f8515335ba9a87002a4eeaf610: bed/rhanfx
68
+ bed/a39d775401e716948cbb8bac2032149c: bed/wbjidf
69
+ bed/ac06e06d1d533932d8ab9ec32b20d37a: bed/sztpse
70
+ bed/af2e51ff34f1084564dabb9b8161e0a7: bed/fnzxxr
71
+ bed/c2b65540d51fada22bfa21768064df9c: bed/pqptex
72
+ bed/d52149ba05e9efbfd54014b91baf8631: bed/xhegju
73
+ bed/d7b9238af2efa963c862eec8232fff1e: bed/zrumze
74
+ bed/dc5a7937cf3d5ce2d6547ce8d3c3ea11: bed/mpgavt
75
+ bed/e7d0920ba8d4b1be71424c004dd7ab2f: bed/guguqb
76
+ bed/e91c2df09de0d4b1ed4d676215f46734: bed/hojitx
77
+ bed/ec8298e0eb6fe81aeb3829c3063c353c: bed/yghbxh
78
+ bed/f10984c7255bc5b25519d54a714fac86: bed/wyxtqf
79
+ bed/fd1f49ec5a690d53c3bd24f986301745: bed/smmmaf
80
+ beef/beef_000: beef/vdfkby
81
+ beer/beer_000: beer/phdimo
82
+ beet/49_0: beet/wantjv
83
+ bell/bell_000: bell/oshurh
84
+ bell_pepper/26_0: bell_pepper/ggurxn
85
+ bell_pepper/26_1: bell_pepper/ukkycp
86
+ bell_pepper/26_2: bell_pepper/ihctxa
87
+ bell_pepper/bell_pepper_000: bell_pepper/uqcenz
88
+ bench/12ae14d584758b4ee42c56c78fb88524: bench/hezgut
89
+ bench/135765739f0cb969f155d75bbf62b80: bench/jaklov
90
+ bench/27c3e5b2656c50f7cb2a965e75be701c: bench/nzsfrw
91
+ bench/65f6f33358b798892056b4bd5d870b47: bench/pcymmc
92
+ bench/704e4229c7f8a0771015feecec1fadc0: bench/wtkahs
93
+ bench/b274f40cccd7e067f155d75bbf62b80: bench/svnyht
94
+ bench/b8f462d89a31e95b777c3ba457301e8c: bench/jvygiq
95
+ bench/c2c788ec4dc9f467d85a7a4d55e9b869: bench/zfpjkj
96
+ bench/de00838284782bfe97fb25ec4f973add: bench/nokayw
97
+ blender/blender_000: blender/cwkvib
98
+ blender/blender_001: blender/eyedvd
99
+ board_game/Balderdash_Game_Blue_Purple_Medium_Size: board_game/rgvkmy
100
+ board_game/Clue_Board_Game_Classic_Edition_Green_Yellow_Thin_Box: board_game/qgvsnb
101
+ board_game/Cootie_Game_Cube_Light_Colored: board_game/phwwnx
102
+ board_game/Firefly_Clue_Board_Game_Dark_Blue_Thin_Box: board_game/gumkqh
103
+ board_game/Hasbro_Cranium_Performance_and_Acting_Game_Colorful_Medium_Size_Box: board_game/qdkyzl
104
+ board_game/Hasbro_Dont_Wake_Daddy_Board_Game_Purple_Yellow_Box: board_game/gcfkqa
105
+ board_game/Hasbro_Life_Board_Game_White_Colorful_Box: board_game/lzslbu
106
+ board_game/Hasbro_Trivial_Pursuit_Family_Edition_Game_Light_Blue_Black_Medium_Box: board_game/nfewft
107
+ board_game/Mad_Gab_Refresh_Card_Game_Orange_Purple_Cube: board_game/iqfvfl
108
+ board_game/Mattel_SKIP_Card_Game_Green_Orange_Small_Box: board_game/vbamua
109
+ board_game/My_Monopoly_Board_Game_Green_Red_Box: board_game/ovttum
110
+ board_game/Nightmare_Before_Christmas_Collectors_Edition_Operation_Red_Purple_Box: board_game/eoywpy
111
+ board_game/Pass_The_Popcorn_Movie_Guessing_Game_Yellow_Red_White_Box: board_game/twkglv
112
+ board_game/Sorry_Sliders_Board_Game_Orage_Purple_Box: board_game/frgdqh
113
+ board_game/Supernatural_Ouija_Board_Game_Dark_Blue_Medium_Box: board_game/ibzhzu
114
+ board_game/Tetris_Link_Game_Dark_Purple_Yellow_White: board_game/fzyuip
115
+ bottom_cabinet/38516: bottom_cabinet/imyaje
116
+ bottom_cabinet/40453: bottom_cabinet/qacthv
117
+ bottom_cabinet/41003: bottom_cabinet/rvunhj
118
+ bottom_cabinet/41085: bottom_cabinet/dajebq
119
+ bottom_cabinet/41086: bottom_cabinet/yohygj
120
+ bottom_cabinet/41452: bottom_cabinet/leizjb
121
+ bottom_cabinet/44962: bottom_cabinet/ttmejh
122
+ bottom_cabinet/45087: bottom_cabinet/zuwvdo
123
+ bottom_cabinet/45091: bottom_cabinet/kxushk
124
+ bottom_cabinet/45177: bottom_cabinet/jrhgeu
125
+ bottom_cabinet/45178: bottom_cabinet/mxrzpj
126
+ bottom_cabinet/45189: bottom_cabinet/xpdbgf
127
+ bottom_cabinet/45247: bottom_cabinet/kenkcw
128
+ bottom_cabinet/45262: bottom_cabinet/ilofmb
129
+ bottom_cabinet/45385: bottom_cabinet/getjzo
130
+ bottom_cabinet/45423: bottom_cabinet/kubcdk
131
+ bottom_cabinet/45443: bottom_cabinet/ujniob
132
+ bottom_cabinet/45503: bottom_cabinet/lwjdmj
133
+ bottom_cabinet/45594: bottom_cabinet/nnvyol
134
+ bottom_cabinet/45642: bottom_cabinet/gvtucm
135
+ bottom_cabinet/45661: bottom_cabinet/wesxdp
136
+ bottom_cabinet/45696: bottom_cabinet/nrlayx
137
+ bottom_cabinet/45717: bottom_cabinet/yxfueo
138
+ bottom_cabinet/45746: bottom_cabinet/mbmbpa
139
+ bottom_cabinet/45779: bottom_cabinet/ybntlp
140
+ bottom_cabinet/45841: bottom_cabinet/pkdnbu
141
+ bottom_cabinet/45908: bottom_cabinet/phoesw
142
+ bottom_cabinet/45922: bottom_cabinet/sxppcj
143
+ bottom_cabinet/46014: bottom_cabinet/nddvba
144
+ bottom_cabinet/46044: bottom_cabinet/ryznya
145
+ bottom_cabinet/46057: bottom_cabinet/ncbfwr
146
+ bottom_cabinet/46108: bottom_cabinet/gcrjan
147
+ bottom_cabinet/46109: bottom_cabinet/rntwkg
148
+ bottom_cabinet/46117: bottom_cabinet/ojceew
149
+ bottom_cabinet/46127: bottom_cabinet/olgoza
150
+ bottom_cabinet/46172: bottom_cabinet/pllcur
151
+ bottom_cabinet/46197: bottom_cabinet/twhums
152
+ bottom_cabinet/46380: bottom_cabinet/bamfsz
153
+ bottom_cabinet/46452: bottom_cabinet/immwzb
154
+ bottom_cabinet/46699: bottom_cabinet/hnxyev
155
+ bottom_cabinet/46732: bottom_cabinet/mwgceh
156
+ bottom_cabinet/46955: bottom_cabinet/smujam
157
+ bottom_cabinet/47235: bottom_cabinet/jhymlr
158
+ bottom_cabinet/47281: bottom_cabinet/bycegi
159
+ bottom_cabinet/47565: bottom_cabinet/dsbcxl
160
+ bottom_cabinet/47577: bottom_cabinet/eupgpt
161
+ bottom_cabinet/47595: bottom_cabinet/nyfebf
162
+ bottom_cabinet/47613: bottom_cabinet/kdbgpm
163
+ bottom_cabinet/47669: bottom_cabinet/tolupn
164
+ bottom_cabinet/47747: bottom_cabinet/qkgfln
165
+ bottom_cabinet/47963: bottom_cabinet/cjcyed
166
+ bottom_cabinet/47976: bottom_cabinet/glefdh
167
+ bottom_cabinet/48018: bottom_cabinet/pzjecb
168
+ bottom_cabinet/48169: bottom_cabinet/lhucjo
169
+ bottom_cabinet/48356: bottom_cabinet/vceupd
170
+ bottom_cabinet/48859: bottom_cabinet/hrdeys
171
+ bottom_cabinet/49140: bottom_cabinet/slgzfc
172
+ bottom_cabinet/49182: bottom_cabinet/xiurwn
173
+ bottom_cabinet/cabinet_0009: bottom_cabinet/rvpunw
174
+ bottom_cabinet/cabinet_0013: bottom_cabinet/plccav
175
+ bottom_cabinet/cabinet_0024: bottom_cabinet/vespxk
176
+ bottom_cabinet_no_top/35059: bottom_cabinet_no_top/vzzafs
177
+ bottom_cabinet_no_top/40147: bottom_cabinet_no_top/pluwfl
178
+ bottom_cabinet_no_top/41083: bottom_cabinet_no_top/ozzcvs
179
+ bottom_cabinet_no_top/44781: bottom_cabinet_no_top/exgntg
180
+ bottom_cabinet_no_top/45001: bottom_cabinet_no_top/fmelap
181
+ bottom_cabinet_no_top/45130: bottom_cabinet_no_top/apjbrw
182
+ bottom_cabinet_no_top/45168: bottom_cabinet_no_top/wamrju
183
+ bottom_cabinet_no_top/45173: bottom_cabinet_no_top/motill
184
+ bottom_cabinet_no_top/45212: bottom_cabinet_no_top/bmsclc
185
+ bottom_cabinet_no_top/45213: bottom_cabinet_no_top/wtnrwl
186
+ bottom_cabinet_no_top/45420: bottom_cabinet_no_top/spojpj
187
+ bottom_cabinet_no_top/45620: bottom_cabinet_no_top/ufhpbn
188
+ bottom_cabinet_no_top/45636: bottom_cabinet_no_top/qudfwe
189
+ bottom_cabinet_no_top/48010: bottom_cabinet_no_top/qohxjq
190
+ bottom_cabinet_no_top/49133: bottom_cabinet_no_top/vdedzt
191
+ bow/bow_000: bow/fhchql
192
+ bowl/260545503087dc5186810055962d0a91: bowl/kthvrl
193
+ bowl/56803af65db53307467ca2ad6571afff: bowl/adciys
194
+ bowl/5aad71b5e6cb3967674684c50f1db165: bowl/fwdfeg
195
+ bowl/6494761a8a0461777cba8364368aa1d: bowl/dalyim
196
+ bowl/68_0: bowl/ajzltc
197
+ bowl/68_1: bowl/mspdar
198
+ bowl/68_2: bowl/rlwpcd
199
+ bowl/68_3: bowl/fiarri
200
+ bowl/7d7bdea515818eb844638317e9e4ff18: bowl/xpnlup
201
+ bowl/80_0: bowl/zwhewa
202
+ bowl/8b90aa9f4418c75452dd9cc5bac31c96: bowl/jfvjep
203
+ bowl/a1393437aac09108d627bfab5d10d45d: bowl/oyidja
204
+ bowl/c25fd49b75c12ef86bbb74f0f607cdd: bowl/eipwho
205
+ bracelet/bracelet_000: bracelet/thqqmo
206
+ breakfast_table/19203: breakfast_table/rjgmmy
207
+ breakfast_table/1b4e6f9dd22a8c628ef9d976af675b86: breakfast_table/lcsizg
208
+ breakfast_table/242b7dde571b99bd3002761e7a3ba3bd: breakfast_table/bmnubh
209
+ breakfast_table/26073: breakfast_table/lwtcfh
210
+ breakfast_table/265851637a59eb2f882f822c83877cbc: breakfast_table/kwmfdg
211
+ breakfast_table/26670: breakfast_table/mwsyqb
212
+ breakfast_table/323ed7752b2a1db03ddaef18f97f546: breakfast_table/wwsikw
213
+ breakfast_table/3344c70694e1bacdc5bd1ef3bc48a26: breakfast_table/hggsao
214
+ breakfast_table/33e4866b6db3f49e6fe3612af521500: breakfast_table/sfxqtk
215
+ breakfast_table/5f3f97d6854426cfb41eedea248a6d25: breakfast_table/zypvuv
216
+ breakfast_table/72c8fb162c90a716dc6d75c6559b82a2: breakfast_table/skczfi
217
+ breakfast_table/79f63a1564928af071a782a4379556c7: breakfast_table/uhrsex
218
+ breakfast_table/98bab29db492767bc3bd24f986301745: breakfast_table/dnsjnv
219
+ breakfast_table/9ad91992184e2b3e283b00891f680579: breakfast_table/cjjayg
220
+ breakfast_table/b595da70965fff189427e63287029752: breakfast_table/metubv
221
+ breakfast_table/c8cf1c77bbb79d214719088c8e42c6ab: breakfast_table/lnwggc
222
+ breakfast_table/cafca523ae3653502454f22008de5a3e: breakfast_table/kpwegp
223
+ breakfast_table/ccb96ea5f047c97f278d386bfa54545: breakfast_table/idnnmz
224
+ breakfast_table/db665d85f1d9b1ea5c6a44a505804654: breakfast_table/skseyx
225
+ breakfast_table/e02925509615eb5a4eaf5bbf36d243d4: breakfast_table/pllvrt
226
+ breakfast_table/fd958ba5f3116085492d9da2668ec34c: breakfast_table/ixvmic
227
+ briefcase/articulated_101668: briefcase/rxvbea
228
+ briefcase/articulated_103755: briefcase/ohelib
229
+ briefcase/articulated_103761: briefcase/fdpjtj
230
+ briefcase/bag_003: briefcase/lwbctq
231
+ broccoli/28_0: broccoli/wsxavx
232
+ broom/broom_000: broom/tpyvbt
233
+ bucket/45_0: bucket/lsmlzi
234
+ bucket/45_1: bucket/wlilma
235
+ bucket/46_0: bucket/bdhvnt
236
+ bulldog_clip/03_0: bulldog_clip/cqxnkn
237
+ bulletin_board/01_0: bulletin_board/rjlpsy
238
+ bulletin_board/01_1: bulletin_board/ayaoal
239
+ burner/cooktop_0: burner/pmntxh
240
+ burner/cooktop_1: burner/lfyqat
241
+ butter/butter_000: butter/ovirmc
242
+ calculator/calculator_000: calculator/kwmmty
243
+ caliper/02_0: caliper/sngjmj
244
+ candle/candle_000: candle/bhaqam
245
+ candy_cane/candy_cane_000: candy_cane/qfomjj
246
+ canned_food/canned_food_000: canned_food/cbmndg
247
+ canned_food/canned_food_001: canned_food/zfmfje
248
+ canned_food/canned_food_002: canned_food/mzoaia
249
+ canned_food/canned_food_003: canned_food/acgdtc
250
+ canned_food/canned_food_004: canned_food/pkopdw
251
+ canned_food/canned_food_005: canned_food/foetdd
252
+ cantaloup/39_0: cantaloup/pqcnoc
253
+ car/articulated_car_000: car/takwdb
254
+ carafe/64_1: carafe/ocjcgp
255
+ carpet/carpet_0: carpet/ctclvd
256
+ carpet_sweeper/carpet_sweeper_000: carpet_sweeper/xboreo
257
+ carrot/47_0: carrot/qhmmmx
258
+ carton/articulated_100162: carton/causya
259
+ carving_knife/14_1: carving_knife/alekva
260
+ carving_knife/15_1: carving_knife/awvoox
261
+ carving_knife/17_0: carving_knife/mzhpkm
262
+ casserole/47_0: casserole/mmbavt
263
+ catsup/catsup_000: catsup/hvxkso
264
+ cauldron/cauldron_000: cauldron/zndohl
265
+ celery/celery_000: celery/rqvtqi
266
+ cereal/cereal_000: cereal/dkhgxn
267
+ cereal/cereal_001: cereal/hcwbzw
268
+ cereal/cereal_002: cereal/iucshm
269
+ cereal/cereal_003: cereal/surzft
270
+ cereal/cereal_004: cereal/tiykku
271
+ chaise_longue/751d61e1d2cbbeaebdcc459b19e43a6: chaise_longue/uicxlz
272
+ chaise_longue/758173c2c4630eab21f01d01c8c9dec6: chaise_longue/xmjcle
273
+ chaise_longue/d324baae6630d7c8fb60456da917147: chaise_longue/ajjxcd
274
+ cheese/cheese_000: cheese/hwxeto
275
+ cherry/02_0: cherry/lkltpa
276
+ chest/chest_0: chest/gbdzls
277
+ chest/chest_1: chest/fwstpx
278
+ chestnut/14_0: chestnut/tfawre
279
+ chestnut/14_1: chestnut/jvnilh
280
+ chestnut/14_3: chestnut/fmomat
281
+ chicken/chicken_000: chicken/nppsmz
282
+ chili/25_0: chili/nidjog
283
+ chili/chili_000: chili/pbbkpz
284
+ chip/chip_000: chip/qstxpj
285
+ chives/19_0: chives/vvacxt
286
+ chives/19_1: chives/gboofh
287
+ chives/19_2: chives/yifjct
288
+ chocolate_box/chocolate_box_000: chocolate_box/bdvkbh
289
+ chopping_board/10_0: chopping_board/akgegh
290
+ chopping_board/13_0: chopping_board/ayegwd
291
+ chopping_board/16_0: chopping_board/ktxcvz
292
+ chopping_board/17_2: chopping_board/mwmzzv
293
+ chopstick/chopstick_000: chopstick/ahmhza
294
+ christmas_tree/christmas_tree_000: christmas_tree/eadukw
295
+ christmas_tree_decorated/christmas_tree_decorated_000: christmas_tree_decorated/wakmhn
296
+ cinnamon/cinnamon_000: cinnamon/bmbjdf
297
+ clout_nail/nail_000: clout_nail/gvfevt
298
+ clove/20_1: clove/thigpl
299
+ coat/coat_000: coat/brebdk
300
+ coat/coat_001: coat/kiiium
301
+ coatrack/53_0: coatrack/qyjssf
302
+ coconut/11_0: coconut/qwriih
303
+ coconut/11_1: coconut/txtabm
304
+ coconut/11_2: coconut/nnankv
305
+ coffee_cup/coffee_cup_000: coffee_cup/skamgp
306
+ coffee_maker/102901: coffee_maker/pyttso
307
+ coffee_pouch/coffee_pouch_000: coffee_pouch/fovxcx
308
+ coffee_pouch/coffee_pouch_001: coffee_pouch/zmadza
309
+ coffee_table/19203: coffee_table/qlmqyy
310
+ coffee_table/19740: coffee_table/fqluyq
311
+ coffee_table/19855: coffee_table/stocuk
312
+ coffee_table/20043: coffee_table/vcgabn
313
+ coffee_table/20411: coffee_table/hmwkkt
314
+ coffee_table/20985: coffee_table/gpkbiw
315
+ coffee_table/21473: coffee_table/gcollb
316
+ coffee_table/22339: coffee_table/ytlgdt
317
+ coffee_table/23511: coffee_table/tzmkgq
318
+ coffee_table/25144: coffee_table/aoojzy
319
+ coffee_table/25959: coffee_table/elhvfw
320
+ coffee_table/26652: coffee_table/zzqwse
321
+ coffee_table/coffee_table_sketchfab: coffee_table/xshzms
322
+ colander/50_0: colander/ambnzk
323
+ cologne/cologne_000: cologne/lyipur
324
+ comb/comb_000: comb/lqnwhb
325
+ conditioner/conditioner_000: conditioner/njqnuo
326
+ console_table/19836: console_table/xqlxni
327
+ console_table/20411: console_table/tvhett
328
+ console_table/22339: console_table/emeeke
329
+ console_table/23807: console_table/fihyuz
330
+ container_cranberry/container_cranberry_000: container_cranberry/fbcpsl
331
+ container_date/container_date_000: container_date/qqddba
332
+ cookie/cookie_000: cookie/ggpang
333
+ cord/Shaxon_100_Molded_Category_6_RJ45RJ45_Shielded_Patch_Cord_White: cord/aqikou
334
+ cord/Ubisoft_RockSmith_Real_Tone_Cable_Xbox_360: cord/ydrhwh
335
+ cord/cord_000: cord/tzurlz
336
+ countertop/counter_0: countertop/tpuwys
337
+ cpu_board/Gigabyte_GAZ97XSLI_10_motherboard_ATX_LGA1150_Socket_Z97: cpu_board/xlqvil
338
+ crab/crab_000: crab/tjkiva
339
+ cracker_box/cracker_box_000: cracker_box/cmdigf
340
+ cream/67_0: cream/ompiss
341
+ cream_pitcher/44_1: cream_pitcher/wmkwhg
342
+ crib/crib_0: crib/oimydv
343
+ cruet/63_0: cruet/njqmqv
344
+ crumb/crumb_000: crumb/irhmll
345
+ cucumber/29_0: cucumber/wcvwye
346
+ cup/cup_000: cup/ykuftq
347
+ cup/cup_001: cup/vckahe
348
+ cup/cup_002: cup/dkxddg
349
+ cup/cup_003: cup/rypdvd
350
+ cup/cup_004: cup/ckkwmj
351
+ cupcake/cupcake_000: cupcake/pfwrlq
352
+ dart/dart_000: dart/hzvuwy
353
+ dartboard/dartboard_000: dartboard/zjenlc
354
+ dental_floss/dental_floss_000: dental_floss/aokqke
355
+ desk/19898: desk/yezrwt
356
+ desk/19d04a424a82894e641aac62064f7645: desk/uffjvo
357
+ desk/1f64fc95a612c646ecb720bdac052a97: desk/cjhriz
358
+ desk/20043: desk/vpwmkm
359
+ desk/20745: desk/uxgyui
360
+ desk/22339: desk/jfhurf
361
+ desk/22367: desk/ampuyz
362
+ desk/23372: desk/kmmlna
363
+ desk/23511: desk/tdhgko
364
+ desk/25913: desk/ntezkg
365
+ desk/28164: desk/tmukzm
366
+ desk/32052: desk/bptvoy
367
+ desk/32746: desk/phavlj
368
+ desk/32932: desk/cnewsu
369
+ desk/33457: desk/egzdgz
370
+ desk/783af15c06117bb29dd45a4e759f1d9c: desk/zjbhgq
371
+ desk/c356393b27c3fbca34ee3fb22432c207: desk/clenrz
372
+ desk/ea45801f26b84935d0ebb3b81115ac90: desk/sfstso
373
+ detergent/detergent_000: detergent/qjkmhq
374
+ detergent/detergent_001: detergent/gkpmii
375
+ digital_scale/75_0: digital_scale/ccphiu
376
+ dinner_napkin/79_0: dinner_napkin/rpccls
377
+ dipper/11_0: dipper/hqqjfo
378
+ dish_rack/03_2: dish_rack/kxuutl
379
+ dishtowel/Tag_Dishtowel_Basket_Weave_Red: dishtowel/dtfspn
380
+ dishtowel/Tag_Dishtowel_Dobby_Stripe_Blue: dishtowel/ltydgg
381
+ dishtowel/Tag_Dishtowel_Green: dishtowel/qvzbjx
382
+ dishtowel/Tag_Dishtowel_Waffle_Gray_Checks: dishtowel/yobhae
383
+ dishwasher/11826: dishwasher/ynrhuk
384
+ dishwasher/12065: dishwasher/znfvmj
385
+ dishwasher/12085: dishwasher/xlmier
386
+ dishwasher/12349: dishwasher/dngvvi
387
+ dishwasher/12428: dishwasher/tnlzww
388
+ dishwasher/12553: dishwasher/cgugie
389
+ dishwasher/12654: dishwasher/dugpby
390
+ document/document_000: document/qkrlsi
391
+ door/8867: door/rhcnln
392
+ door/8903: door/lvgliq
393
+ door/8930: door/ohagsq
394
+ door/8961: door/gmytjz
395
+ door/8983: door/lhxdte
396
+ door/8994: door/ktydvs
397
+ door/9003: door/mgmayh
398
+ door/9016: door/rrsovh
399
+ door/9041: door/chonxi
400
+ door/9164: door/nfrbch
401
+ door/9263: door/ceddpg
402
+ door/door_0024: door/lctyaf
403
+ door/door_0081: door/cbgtjl
404
+ dress/dress_000: dress/gtghon
405
+ drill/drill_000: drill/nzgmza
406
+ drumstick/drumstick_000: drumstick/lkvzmj
407
+ dryer/100283: dryer/xsuyua
408
+ dryer/103361: dryer/zlmnfg
409
+ dryer/103778: dryer/fhtvuq
410
+ dryer/washing_machine_0012: dryer/tpqzai
411
+ dryer/washing_machine_0021: dryer/smcyys
412
+ dryer/washing_machine_0030: dryer/wivnic
413
+ duffel_bag/duffel_bag_000: duffel_bag/ozykxk
414
+ dustpan/dustpan_000: dustpan/espzwv
415
+ egg/egg_000: egg/mimzbz
416
+ eggplant/21_1: eggplant/jniuxf
417
+ envelope/envelope_000: envelope/urcigc
418
+ eraser/06_0: eraser/cungod
419
+ facsimile/facsimile_000: facsimile/mcqqhy
420
+ fillet/fillet_000: fillet/fqhuey
421
+ fish/fish_000: fish/qofuoa
422
+ floor_lamp/14306: floor_lamp/pfuqec
423
+ floor_lamp/3889631e42a84b0f51f77a6d7299806: floor_lamp/jcbvfi
424
+ floor_lamp/83353863ea1349682ebeb1e6a8111f53: floor_lamp/jqsuky
425
+ floor_lamp/c7aadb7ac29ac778aaae3d020f5ddf8: floor_lamp/vdxlda
426
+ floor_lamp/lamp_0005: floor_lamp/lqdmym
427
+ floor_lamp/lamp_0006: floor_lamp/fanocp
428
+ floor_lamp/lamp_0035: floor_lamp/imgsrd
429
+ flour/flour_000: flour/ylezpk
430
+ folder/articulated_folder_000: folder/poqpux
431
+ folder/folder_000: folder/piezyg
432
+ folderal/decoration_000: folderal/ttldpx
433
+ folding_chair/100562: folding_chair/vngcqu
434
+ folding_chair/folding_chair_0010: folding_chair/dqhazh
435
+ folding_chair/folding_chair_0019: folding_chair/dxergu
436
+ foot_rule/07_0: foot_rule/swlgkg
437
+ foot_rule/11_0: foot_rule/ujizkx
438
+ foot_rule/11_1: foot_rule/vmnaih
439
+ foot_rule/14_0: foot_rule/rutqab
440
+ foot_rule/16_0: foot_rule/ckywbx
441
+ fridge/10144: fridge/jtqazu
442
+ fridge/10373: fridge/juwaoh
443
+ fridge/10905: fridge/hzgqdn
444
+ fridge/11211: fridge/dszchb
445
+ fridge/11712: fridge/xyejdx
446
+ fridge/12252: fridge/hivvdf
447
+ frying_pan/36_0: frying_pan/sfbdjn
448
+ gaming_table/72a4fae0f304519dd8e0cfcf62e3e594: gaming_table/ipdvzo
449
+ ginger/ginger_000: ginger/wqcasl
450
+ gingerbread/gingerbread_000: gingerbread/hxkcxs
451
+ glass/23_0: glass/nfoydb
452
+ glass/54_0: glass/slscza
453
+ glove/Clorox_Premium_Choice_Gloves_SM_1_pair: glove/rlzvry
454
+ glove/Rexy_Glove_Heavy_Duty_Gloves_Medium_Blue: glove/hsaxtc
455
+ glove/Rexy_Glove_Heavy_Duty_Large_Orange_Black: glove/crbvcg
456
+ gooseberry/55_0: gooseberry/cltzwx
457
+ grandfather_clock/3edef12fcf087125868fb986bc092533: grandfather_clock/icznug
458
+ grandfather_clock/94d692071e8404ebc0aaedf10d776af7: grandfather_clock/veyqcp
459
+ grandfather_clock/ade988dac6b48a6cf133407de2f7837a: grandfather_clock/oskfvo
460
+ grape/05_0: grape/venbog
461
+ grape/05_1: grape/uprbwp
462
+ grape/05_2: grape/snjrhg
463
+ grater/55_0: grater/jlkowf
464
+ green_onion/green_onion_000: green_onion/wzqhsg
465
+ green_onion_chopped/green_onion_chopped_000: green_onion_chopped/akrkjr
466
+ griddle/56_0: griddle/ryvqep
467
+ grill/grill_000: grill/ddlqye
468
+ guacamole/guacamole_000: guacamole/ajnjvv
469
+ guitar/2d767b3fbb8a3053b8836869016d1afd: guitar/cybisc
470
+ guitar/a5e2f05386e4ba55a894e1aba5d3799a: guitar/wjohag
471
+ guitar/bad8978268948ea3d3eb77b119df6d: guitar/gysapt
472
+ guitar/bb36b42935f0a1bfe5ef386e39420701: guitar/hpqjrq
473
+ gym_shoe/F5_TRX_FG_adidas_soccer_show_yellow: gym_shoe/arigtn
474
+ gym_shoe/FYW_DIVISION_adidas_basketball_shoe_grey: gym_shoe/mjyyda
475
+ gym_shoe/TERREX_FAST_blue_sneaker: gym_shoe/wfmrpw
476
+ gym_shoe/TOP_TEN_HI_red_sneaker_shoe: gym_shoe/qxecbh
477
+ gym_shoe/TZX_Runner_adidas_purple_grey_shoe: gym_shoe/hwrvmy
478
+ gym_shoe/ZX700_adidas_black_orange_sneaker: gym_shoe/uuvwev
479
+ gym_shoe/ZX700_adidas_purple_yellow_show: gym_shoe/picdro
480
+ gym_shoe/ZX700_adidas_white_red_sneaker: gym_shoe/kmcbym
481
+ gym_shoe/ZigKick_Hoops_reebok_blue_white_show: gym_shoe/pblxfp
482
+ gym_shoe/adistar_boost_yellow_grey: gym_shoe/lqzooz
483
+ hairbrush/hairbrush_000: hairbrush/bdylnb
484
+ hamburger/hamburger_000: hamburger/fyswch
485
+ hammer/Cole_Hardware_Hammer_Black: hammer/bbzlel
486
+ hand_towel/Threshold_Hand_Towel_Light_Yellow: hand_towel/jaubic
487
+ hanger/hanger_000: hanger/ffecvd
488
+ hard_drive/Seagate_1TB_Wireless_Plus_mobile_device_storage: hard_drive/ijibkm
489
+ hard_drive/Seagate_Archive_HDD_8_TB_Internal_hard_drive_SATA_6Gbs_35_ST8000AS0002: hard_drive/ubjbsm
490
+ hardback/hardback_000: hardback/nubbfj
491
+ hat/DPC_Handmade_Hat_Brown: hat/zymxgw
492
+ hat/DPC_tropical_Trends_straw_Hat: hat/avvknr
493
+ hat/Retail_Leadership_Summit_Grey_Trilby: hat/ldxyyc
494
+ hat/Retail_Leadership_Summit_Straw_Hat: hat/wkrzep
495
+ head_cabbage/27_0: head_cabbage/tqohvs
496
+ headset/Razer_Kraken_Pro_headset_Full_size_Black: headset/oytuam
497
+ heater/heater_0: heater/dwmloz
498
+ heater/heater_1: heater/wntwxx
499
+ heater/heater_2: heater/arfdpk
500
+ highchair/dbfab57f9238e76799fc3b509229d3d: highchair/pahqnp
501
+ highchair/high_chair: highchair/eteuuf
502
+ highlighter/highlighter_000: highlighter/tcsmqv
503
+ hinge/hinge_000: hinge/qroify
504
+ honing_steel/17_3: honing_steel/ugerym
505
+ hook/hook_000: hook/mdnfjr
506
+ hose/hose_000: hose/gavrvw
507
+ ice_cube/ice_cube_000: ice_cube/iiimgo
508
+ ink_cartridge/Epson_273XL_Ink_Cartridge_Magenta: ink_cartridge/oinelo
509
+ ink_cartridge/Epson_Ink_Cartridge_126_Yellow: ink_cartridge/oepuip
510
+ ink_cartridge/Office_Depot_Canon_CLI_221BK_Ink_Cartridge_Black_2946B001: ink_cartridge/ltblou
511
+ iron/iron_000: iron/fzbvce
512
+ jam/jam_000: jam/vxjbjf
513
+ jar/03_0: jar/zqoboc
514
+ jar/03_1: jar/nzcbda
515
+ jar/03_10: jar/rdngsc
516
+ jar/03_11: jar/xrirkq
517
+ jar/03_12: jar/piemou
518
+ jar/03_13: jar/vuolos
519
+ jar/03_14: jar/pluujx
520
+ jar/03_15: jar/jbhdeu
521
+ jar/03_3: jar/sktwfj
522
+ jar/03_4: jar/uydvnv
523
+ jar/03_5: jar/lnxzuy
524
+ jar/03_6: jar/fyfahz
525
+ jar/03_7: jar/xebmcy
526
+ jar/03_8: jar/irqkdw
527
+ jar/03_9: jar/ykrdzg
528
+ jar/25_0: jar/gtnmis
529
+ jar/26_0: jar/wvgsqk
530
+ jar/28_0: jar/qzwijs
531
+ jar/articulated_jar_000: jar/vzwhbg
532
+ jeans/jeans_000: jeans/pvzxyp
533
+ jeans/jeans_001: jeans/nmvvil
534
+ jewel/jewel_000: jewel/syneus
535
+ juice/juice_000: juice/bbewjo
536
+ kettle/04_0: kettle/tzbnmh
537
+ kettle/04_1: kettle/tsyims
538
+ kettle/05_0: kettle/bzisss
539
+ kettle/06_0: kettle/vjbldp
540
+ keyboard/Razer_BlackWidow_Ultimate_2014_Mechanical_Gaming_Keyboard: keyboard/nddmmy
541
+ kitchen_analog_scale/02_0: kitchen_analog_scale/zpmpoq
542
+ kitchen_analog_scale/71_0: kitchen_analog_scale/lpjpez
543
+ kiwi/10_0: kiwi/khupqq
544
+ kiwi/10_1: kiwi/ukwism
545
+ ladder/ladder_000: ladder/shfvtl
546
+ laptop/9996: laptop/nvulcs
547
+ lasagna/lasagna_000: lasagna/eovigz
548
+ lawn_mower/lawn_mower_000: lawn_mower/bterwo
549
+ lemon/07_1: lemon/vuwehu
550
+ lemon/07_2: lemon/wouoym
551
+ lettuce/31_0: lettuce/yxemcs
552
+ lid/03_16: lid/qkogll
553
+ lid/07_0: lid/muczdt
554
+ lid/09_0: lid/chwwdg
555
+ lid/18_0: lid/aybgkm
556
+ lid/19_0: lid/jvqtqi
557
+ lid/20_0: lid/dkncbi
558
+ lid/32_0: lid/exzfzm
559
+ lid/38_0: lid/exiqxa
560
+ lid/38_1: lid/qferch
561
+ lid/39_0: lid/qfqccp
562
+ lid/40_0: lid/haxrqc
563
+ lid/42_0: lid/uwzqlf
564
+ lid/43_0: lid/itwwle
565
+ lid/44_0: lid/jvzjzp
566
+ lid/48_0: lid/fnqhbz
567
+ lid/51_0: lid/kuibhu
568
+ lid/52_0: lid/vkepll
569
+ lid/57_0: lid/lwyfab
570
+ lid/64_2: lid/qhlsdq
571
+ lid/65_0: lid/niarsj
572
+ lid/67_1: lid/jqvurl
573
+ lid/69_0: lid/utfcdx
574
+ light_bulb/light_bulb_000: light_bulb/kfmkwd
575
+ lime/lime_000: lime/iwjcjp
576
+ lipstick/lipstick_000: lipstick/petufo
577
+ lollipop/lollipop_000: lollipop/bhjyff
578
+ lotion/lotion_000: lotion/ixfuxm
579
+ loudspeaker/563b0c299b32e73327ac18a9705c27f1: loudspeaker/bmpdyv
580
+ loudspeaker/fe613d2a63582e126e5a8ef1ff6470a3: loudspeaker/avtlcj
581
+ magazine/magazine_000: magazine/ehdwsd
582
+ martini/martini_000: martini/xevdnl
583
+ mat/04_0: mat/mayaur
584
+ mayonnaise/mayonnaise_000: mayonnaise/ktmjvg
585
+ medicine/CoQ10_Pills_Grey: medicine/fmfwng
586
+ medicine/Krill_Oil_Pills_Blue: medicine/kasbsy
587
+ medicine/LTyrosine_Pills_Red: medicine/syfpak
588
+ medicine/Lactoferrin_Pills_Dark_Blue: medicine/zfbnjh
589
+ medicine/Lutein_Pills_Orange_Yellow: medicine/kqkwoq
590
+ medicine/PhosphOmega_Pills_Light_Blue_Red: medicine/qqsukh
591
+ medicine/Womens_Multi_Dark_Red: medicine/egondf
592
+ medicine/YumYum_D3_Liquid_Box_Orange: medicine/hvocpc
593
+ microwave/7128: microwave/hjjxmi
594
+ microwave/7263: microwave/bfbeeb
595
+ microwave/7265: microwave/abzvij
596
+ microwave/7296: microwave/rtfebu
597
+ microwave/7310: microwave/vuezel
598
+ microwave/7320: microwave/snsqrt
599
+ milk/milk_000: milk/xbvdpc
600
+ mirror/mirror_0: mirror/pevdqu
601
+ modem/modem_000: modem/axqxsv
602
+ monitor/3386: monitor/huvcgu
603
+ monitor/3393: monitor/rbqanz
604
+ mouse/Razer_Naga_MMO_Gaming_Mouse: mouse/oydobn
605
+ mousetrap/mousetrap_000: mousetrap/mwfwsv
606
+ muffin/muffin_000: muffin/pxrntz
607
+ mug/08_0: mug/ppzttc
608
+ mushroom/41_0: mushroom/xeodai
609
+ mushroom/41_1: mushroom/zlukhz
610
+ necklace/necklace_000: necklace/wzmleo
611
+ newspaper/newspaper_000: newspaper/ukamcl
612
+ notebook/12_0: notebook/svisnb
613
+ notebook/12_1: notebook/ffdjzp
614
+ notebook/12_2: notebook/xhigou
615
+ notebook/12_3: notebook/jxabmj
616
+ notebook/12_4: notebook/ksxknp
617
+ notebook/12_5: notebook/umxsmd
618
+ notebook/notebook_000: notebook/aanuhi
619
+ oatmeal/oatmeal_000: oatmeal/zkggxm
620
+ olive/33_0: olive/rstwkd
621
+ olive/34_0: olive/rzktwr
622
+ olive_oil/22_0: olive_oil/lvsfgc
623
+ olive_oil/34_0: olive_oil/luikop
624
+ olive_oil/35_0: olive_oil/cqycjk
625
+ orange/06_0: orange/ucstpm
626
+ orange/06_1: orange/yloghd
627
+ oven/7120: oven/wuinhm
628
+ oven/7179: oven/hxorzh
629
+ oven/7187: oven/qygclv
630
+ oven/7220: oven/kenajw
631
+ oven/7332: oven/nkxhvf
632
+ oven/oven_0001: oven/tllnvs
633
+ oven/oven_0004: oven/nvqqkv
634
+ oven/oven_0009: oven/qriitd
635
+ oven/oven_0013: oven/fexqbj
636
+ oven/oven_0016: oven/rwuazb
637
+ oven/oven_0017: oven/leqtlc
638
+ oven/oven_0028: oven/kfftgk
639
+ package/articulated_100162: package/msfzpz
640
+ package/package_000: package/sxlklf
641
+ paint/paint_000: paint/mxyrzd
642
+ paint/paint_001: paint/qbqche
643
+ paint/paint_002: paint/gjjugj
644
+ paint/paint_003: paint/ycnaho
645
+ paintbrush/paintbrush_000: paintbrush/gngyrk
646
+ painting/painting_000: painting/ggloob
647
+ painting/painting_001: painting/uzhuyu
648
+ pajamas/pajamas_000: pajamas/rcgdde
649
+ paper_bag/bag_001: paper_bag/bzsxgw
650
+ paper_clip/03_3: paper_clip/xjfirk
651
+ paper_towel/33_0: paper_towel/aclaus
652
+ paper_towel_holder/64_0: paper_towel_holder/rntefx
653
+ parsley/32_0: parsley/kkgkkd
654
+ pasta/pasta_000: pasta/gwqhko
655
+ pea/30_0: pea/iblyep
656
+ peach/56_0: peach/orowgl
657
+ peach/56_1: peach/wrutgk
658
+ pear/01_0: pear/ngtwvy
659
+ pear/01_1: pear/mqvgcg
660
+ pedestal_table/10cc8c941fc8aeaa71a782a4379556c7: pedestal_table/mbojpo
661
+ pedestal_table/22870: pedestal_table/pyybeq
662
+ pedestal_table/2fd962562b9f0370339797c21e8801b1: pedestal_table/ktevfe
663
+ pedestal_table/bc48080ee5498d721fca2012865943e2: pedestal_table/oqclwq
664
+ pedestal_table/f856245a7a9485deeb2d738c3fe5867f: pedestal_table/poukwl
665
+ pegboard/pegboard_000: pegboard/jafivf
666
+ pen/01_4: pen/zmimhb
667
+ pen/01_7: pen/nqxveo
668
+ pencil/08_0: pencil/zzzvln
669
+ pencil/08_1: pencil/dcqvto
670
+ pencil/08_2: pencil/tqrrbk
671
+ pencil/08_3: pencil/lrwosa
672
+ pencil/08_4: pencil/xuanpj
673
+ pencil/08_5: pencil/faudjj
674
+ pencil/08_6: pencil/vakowb
675
+ pencil_box/13_0: pencil_box/otcmih
676
+ pencil_box/13_1: pencil_box/acikzo
677
+ pepper_grinder/69_1: pepper_grinder/tfoogy
678
+ perfume/perfume_000: perfume/ipurzb
679
+ piano/8edcb709ebd1d09e5f3d43a486973313: piano/ygmqqa
680
+ piano/d26149f3d01ffb4d9ff9560d055ab12: piano/bnxcvw
681
+ piano/f90c23de385d10f62f5fb84eadb6c469: piano/ojoiqt
682
+ picture/picture_0: picture/jpfyrq
683
+ picture/picture_1: picture/hhxttu
684
+ picture/picture_10: picture/yrgaal
685
+ picture/picture_11: picture/fhkzlm
686
+ picture/picture_12: picture/cltbty
687
+ picture/picture_13: picture/ytxhyl
688
+ picture/picture_14: picture/qavxsz
689
+ picture/picture_15: picture/rciuob
690
+ picture/picture_16: picture/zsirgc
691
+ picture/picture_17: picture/tlwjpv
692
+ picture/picture_2: picture/lucjyq
693
+ picture/picture_3: picture/qtvjzk
694
+ picture/picture_4: picture/wfdvzv
695
+ picture/picture_5: picture/qjkajj
696
+ picture/picture_6: picture/fanvpf
697
+ picture/picture_7: picture/szpupz
698
+ picture/picture_8: picture/weqggl
699
+ picture/picture_9: picture/gwricv
700
+ picture/picture_frame: picture/etixod
701
+ pillow/3b5e274f653258a737f437b479038901: pillow/uavnng
702
+ pillow/757be11305637a815b68a464a9cbfadf: pillow/rteuzs
703
+ pillow/89fd3acbd34e72106a6cca39468798a8: pillow/pjqqmb
704
+ pillow/b422f9f038fc1f4da3149acda85b1964: pillow/ajpapo
705
+ pillow/c9f732b5bfe7b1cd29c99526bacef0da: pillow/tepkbl
706
+ pillow/ea69362db645cb4c1185ac82ed4da80d: pillow/fxxpwf
707
+ pineapple/37_0: pineapple/wfaybl
708
+ pineapple/37_1: pineapple/jizmyh
709
+ pineapple/37_2: pineapple/zympwt
710
+ pistachio/15_0: pistachio/bhirar
711
+ plate/plate_000: plate/iawoof
712
+ platter/platter_000: platter/ekjpdj
713
+ platter/platter_001: platter/kiiamx
714
+ platter/platter_002: platter/csanbr
715
+ platter/platter_003: platter/hnlivs
716
+ platter/platter_004: platter/iadlti
717
+ plum/03_0: plum/rhaemq
718
+ plum/03_1: plum/dsybez
719
+ plywood/plywood_000: plywood/fkmkqa
720
+ pocketknife/pocketknife_000: pocketknife/ngtgdn
721
+ pomegranate/08_0: pomegranate/vqybii
722
+ pomegranate/08_1: pomegranate/tbwsgm
723
+ pomegranate/08_2: pomegranate/tldskr
724
+ pomelo/12_0: pomelo/ezckjt
725
+ pomelo/12_1: pomelo/qecwzm
726
+ pool/pool_000: pool/xixlzr
727
+ pool_table/pool_table_0: pool_table/atjfhn
728
+ pop/1: pop/vfjhav
729
+ pop/10: pop/ribekf
730
+ pop/11: pop/wmqhul
731
+ pop/12: pop/nepfjl
732
+ pop/13: pop/mhzttm
733
+ pop/14: pop/uwmchl
734
+ pop/15: pop/haoywb
735
+ pop/16: pop/dlqmit
736
+ pop/17: pop/wrgmdt
737
+ pop/18: pop/nyupqh
738
+ pop/19: pop/ghxeqz
739
+ pop/2: pop/sevoto
740
+ pop/20: pop/pyrics
741
+ pop/21: pop/ubazru
742
+ pop/22: pop/msmlud
743
+ pop/23: pop/hjrwqb
744
+ pop/24: pop/exapzb
745
+ pop/25: pop/jnoksl
746
+ pop/26: pop/pvabxf
747
+ pop/27: pop/rhclfg
748
+ pop/28: pop/oeipjl
749
+ pop/29: pop/pfjzkn
750
+ pop/3: pop/zxambx
751
+ pop/4: pop/kviogj
752
+ pop/40: pop/vszbvb
753
+ pop/41: pop/xlyult
754
+ pop/42: pop/chwjfu
755
+ pop/43: pop/iloapr
756
+ pop/44: pop/mrrozu
757
+ pop/45: pop/uzbpnw
758
+ pop/5: pop/xoldze
759
+ pop/6: pop/drqbiy
760
+ pop/7: pop/bqretx
761
+ pop/8: pop/oghrnk
762
+ pop/9: pop/mdznsn
763
+ pop_case/30: pop_case/seiatm
764
+ pop_case/31: pop_case/sqiatv
765
+ pop_case/32: pop_case/oarbks
766
+ pop_case/33: pop_case/zxguap
767
+ pop_case/34: pop_case/dufbnv
768
+ pop_case/35: pop_case/qwtbon
769
+ pop_case/36: pop_case/noiyxv
770
+ pop_case/37: pop_case/pldtgy
771
+ pop_case/38: pop_case/gwgaqb
772
+ pop_case/39: pop_case/zfyatg
773
+ pop_case/46: pop_case/rzhvvk
774
+ pop_case/47: pop_case/qcfxec
775
+ pop_case/48: pop_case/unmexe
776
+ pork/pork_000: pork/ihekpm
777
+ pot_plant/133dc38c1316d9515dc3653f8341633a: pot_plant/kjnypo
778
+ pot_plant/1ab5af367e30508d9ec500769fff320: pot_plant/ftbsdt
779
+ pot_plant/1af2b0b5ca59c8d8a4136492f17b9a59: pot_plant/xlylfy
780
+ pot_plant/1e42e5b37a46fd9c3202f7933a14e59b: pot_plant/azfbnd
781
+ pot_plant/2c262de36d12bc82411e92cfbad3bd2c: pot_plant/vcwwrd
782
+ pot_plant/2ccd2b095bd8ec27e2ec5524ed185c34: pot_plant/udqjui
783
+ pot_plant/2d815a9139dc24e5adfef0837ef69723: pot_plant/jaunqh
784
+ pot_plant/3ac8ac4f319e5c0c785f06f424b9d06: pot_plant/jatssq
785
+ pot_plant/4fcc70a519fac2a3f11c3739edd52fa3: pot_plant/quaxmw
786
+ pot_plant/53b0b1db08024807c995f1efad0eebc3: pot_plant/vyswzs
787
+ pot_plant/6e66370dd674686ec938effd02ae5d4c: pot_plant/yvuagy
788
+ pot_plant/7ae8b260ffda13745d90c2f8862ed5c1: pot_plant/imhfnc
789
+ pot_plant/7b0e40cc37ff733d4437e0a6aa050dc2: pot_plant/nscddw
790
+ pot_plant/7de2c51034e824811f2146f064414afc: pot_plant/qbnaph
791
+ pot_plant/8a88fff550a841c5fc2b7781f0f02585: pot_plant/qcpges
792
+ pot_plant/8c278785a66bd82ababc8956356bfae7: pot_plant/uvbpsf
793
+ pot_plant/92dd4a5efaf2a1702d7a27ffaafaaddb: pot_plant/kxmvco
794
+ pot_plant/a30eea3bbb52b3d4f13ce777d031b4b2: pot_plant/qenqqv
795
+ potato/44_0: potato/lqjear
796
+ potato/44_1: potato/ngjeog
797
+ potato/44_2: potato/ljfitc
798
+ potato/44_3: potato/bpwohr
799
+ powder_bottle/powder_bottle_000: powder_bottle/vfabau
800
+ pretzel/pretzel_000: pretzel/rmutwn
801
+ printer/printer_000: printer/oyqbtq
802
+ prosciutto/prosciutto_000: prosciutto/udjqae
803
+ protein_powder/Twinlab_Whey_Protein_Fuel_Vanilla: protein_powder/rbvrrp
804
+ protein_powder/Whey_Protein_Chocolate: protein_powder/rikjwx
805
+ protein_powder/Whey_Protein_Vanilla: protein_powder/ysgesq
806
+ protein_powder/Whey_Protein_Vanilla_12_Packets: protein_powder/tpcsve
807
+ pumpkin/23_1: pumpkin/mrntpd
808
+ pumpkin/50_0: pumpkin/apitmi
809
+ puree/puree_000: puree/raagvm
810
+ radish/45_0: radish/bpmjki
811
+ radish/46_0: radish/vztgpr
812
+ rag/rag_000: rag/dgzewy
813
+ rag/rag_001: rag/zmmbpz
814
+ rail_fence/fence_1: rail_fence/vwpqly
815
+ rail_fence/fence_2: rail_fence/qmsnld
816
+ rail_fence/fence_3: rail_fence/iduxiv
817
+ rake/rake_000: rake/jjetot
818
+ range_hood/range_hood_0: range_hood/duqgcu
819
+ range_hood/range_hood_1: range_hood/iqbpie
820
+ range_hood/range_hood_2: range_hood/ylsdmp
821
+ range_hood/range_hood_3: range_hood/lejkwg
822
+ raspberry/35_0: raspberry/spkers
823
+ razor/razor_000: razor/jocsgp
824
+ rib/rib_000: rib/nzbnqp
825
+ ribbon/ribbon_000: ribbon/puwdwq
826
+ ring/ring_000: ring/oolbrj
827
+ rocking_chair/4ce5a0d60fc942f2e595afbdc333be49: rocking_chair/wkduul
828
+ rocking_chair/a4da5746b99209f85da16758ae613576: rocking_chair/drpbxj
829
+ rocking_chair/rocking_chair_0002: rocking_chair/tjaphm
830
+ roller/roller_000: roller/jcqwrt
831
+ roller/roller_001: roller/nbwihe
832
+ rosehip/54_0: rosehip/xembcb
833
+ router/Netgear_Ac1750_Router_Wireless_Dual_Band_Gigabit_Router: router/dsgtpk
834
+ salad/salad_000: salad/dhdhul
835
+ salt/salt_000: salt/iomwtn
836
+ sandal/Mens_Santa_Cruz_Thong_in_Chocolate: sandal/chgcrm
837
+ sandal/Mens_Santa_Cruz_Thong_in_Tan: sandal/uhzfis
838
+ sandal/NAPA_VALLEY_NAVAJO_SANDAL: sandal/zafskl
839
+ sandal/REEF_BRAIDED_CUSHION_black_pink_sandal: sandal/shdahi
840
+ sandal/Reef_Star_Cushion_Flipflops_Black: sandal/spcddb
841
+ saucepan/38_2: saucepan/fsinsu
842
+ sausage/sausage_000: sausage/qijvmi
843
+ saw/saw_000: saw/laysom
844
+ scanner/scanner_000: scanner/juzkjp
845
+ scarf/scarf_000: scarf/gqzivs
846
+ scarf/scarf_001: scarf/xdcrfh
847
+ scissors/Diamond_Visions_Scissors_Red: scissors/hqfure
848
+ scissors/scissors_000: scissors/iizidc
849
+ scraper/scraper_000: scraper/icqmje
850
+ screwdriver/Craftsman_Grip_Screwdriver_Phillips_Cushion: screwdriver/irtslw
851
+ screwdriver/screwdriver_000: screwdriver/uajlga
852
+ scrub_brush/scrub_brush_000: scrub_brush/hsejyi
853
+ shampoo/Professional_Oil_of_Morocco_Conditioner_with_Argan_Oil_Light_Blue: shampoo/dvrzmy
854
+ shampoo/Shampoo_In_Haircolor_Jet_Black_60_Box_Grey_Red: shampoo/bclpiq
855
+ shampoo/Shampoo_In_Haircolor_Light_Brown_Grey_Box: shampoo/jccyom
856
+ shampoo/Strictly_Curls_Curl_Envy_Perfect_Curl_Cream_Yellow_Box: shampoo/tzghev
857
+ shampoo/True_Professional_Oil_of_Morocco_Argan_Oil_Treatment_Light_Blue_Box: shampoo/nijidu
858
+ shampoo/True_Professional_Strictly_Curls_Curl_Defining_Lotion_Yellow: shampoo/hlkpwd
859
+ shampoo/shampoo_001: shampoo/kkbhzw
860
+ sheet/sheet_000: sheet/czdhwu
861
+ shelf/1170df5b9512c1d92f6bce2b7e6c12b7: shelf/pkgbcp
862
+ shelf/38be55deba61bcfd808d50b6f71a45b: shelf/uriudf
863
+ shelf/3bff6c7c4ab1e47e2a9a1691b6f98331: shelf/vgzdul
864
+ shelf/50fea70354d4d987d42b9650f19dd425: shelf/vehhll
865
+ shelf/6ae80779dd34c194c664c3d4e2d59341: shelf/cqcoox
866
+ shelf/6d5e521ebaba489bd9a347e62c5432e: shelf/lbbims
867
+ shelf/71b87045c8fbce807c7680c7449f4f61: shelf/tahafx
868
+ shelf/b079feff448e925546c4f23965b7dd40: shelf/eyidvz
869
+ shelf/b7697d284c38fcade76bc197b3a3ffc0: shelf/owvfik
870
+ shelf/de3b28f255111570bc6a557844fbbce9: shelf/njwsoa
871
+ shelf/e9850d3c5243cc60f62af8489541547b: shelf/ptxdid
872
+ shelf/f000edc1cfdeda11bee0494534c13f8c: shelf/wnvxme
873
+ shoulder_bag/bag_002: shoulder_bag/mcualj
874
+ shower/shower_0: shower/aktzdp
875
+ shower/shower_1: shower/invgma
876
+ shower/shower_2: shower/atiuco
877
+ sink/bathroom_sink: sink/ksecxq
878
+ sink/kitchen_sink: sink/czyfhq
879
+ sink/sink_0: sink/wzpabm
880
+ sink/sink_1: sink/yfaufu
881
+ sink/sink_2: sink/zexzrc
882
+ sink/sink_3: sink/vbquye
883
+ sink/sink_4: sink/bnpjjy
884
+ sink/sink_5: sink/xiybkb
885
+ sink/sink_6: sink/ejooms
886
+ soap/soap_000: soap/ozifwa
887
+ sock/sock_000: sock/rhgweu
888
+ sofa/1a9d0480b74d782698f5bccb3529a48d: sofa/rxtscm
889
+ sofa/1d8716f741424998f29666f384be6c43: sofa/ocydlq
890
+ sofa/1dab0c0c72f9cd6f593ebeeedbff73b: sofa/qnnwfx
891
+ sofa/1f75847dbddcd34afac76e6fcbdc3631: sofa/jhfkdc
892
+ sofa/3aa613c06675d2a4dd94d3cfe79da065: sofa/ctjgcl
893
+ sofa/427c7655012b6cc5593ebeeedbff73b: sofa/mnfbbh
894
+ sofa/5f93127875373b8657f15fc9385a8a01: sofa/otxxor
895
+ sofa/7e2d4791502378f2593ebeeedbff73b: sofa/itbkff
896
+ sofa/875c7185cce6b8b0813204830fbed813: sofa/uixwiv
897
+ sofa/sofa_sketchfab: sofa/xhxdqf
898
+ soup/soup_000: soup/wbqjbt
899
+ soup_ladle/01_2: soup_ladle/hgvzdm
900
+ soup_ladle/01_3: soup_ladle/xocqxg
901
+ spaghetti_sauce/spaghetti_sauce_000: spaghetti_sauce/zahyds
902
+ spatula/01_4: spatula/ktkigm
903
+ speaker_system/43730d7a76ea63f920363e2561dd589a: speaker_system/lgkhqt
904
+ speaker_system/6ca4143e8b989ddf8dfd947f5413afaa: speaker_system/suzqfe
905
+ speaker_system/b6210936b5d1be007670e02527d78e8d: speaker_system/snbvop
906
+ spinach/43_0: spinach/nshkpm
907
+ spoon/01_1: spoon/pxwpuw
908
+ spoon/01_5: spoon/kwyoqh
909
+ spoon/01_6: spoon/huudhe
910
+ spoon/2: spoon/nxddfp
911
+ spoon/5: spoon/prbhag
912
+ spoon/6: spoon/qdepdj
913
+ spoon/66_0: spoon/aeubta
914
+ stand/26525: stand/kanola
915
+ stand/26652: stand/ljtrka
916
+ stand/28668: stand/geeldi
917
+ standing_tv/3392: standing_tv/gjlztf
918
+ standing_tv/4094: standing_tv/lkpsai
919
+ standing_tv/4541: standing_tv/udotid
920
+ standing_tv/4564: standing_tv/sbxgwj
921
+ standing_tv/4574: standing_tv/wbkvxr
922
+ standing_tv/4576: standing_tv/ghxsoy
923
+ standing_tv/4628: standing_tv/bkyguk
924
+ standing_tv/5306: standing_tv/blyapt
925
+ steak/steak_000: steak/ppykkp
926
+ sticky_note/03_1: sticky_note/tghqep
927
+ stocking/stocking_000: stocking/imdhfp
928
+ stool/ottoman: stool/ycfbsd
929
+ stool/stool_1: stool/xcmniq
930
+ stool/stool_2: stool/mysfnz
931
+ stool/stool_3: stool/miftfy
932
+ stool/stool_4: stool/sghekm
933
+ stove/101908: stove/qbjiva
934
+ stove/101924: stove/rgpphy
935
+ stove/101930: stove/dwhqap
936
+ stove/101940: stove/kfhkqp
937
+ stove/101943: stove/yhjzwg
938
+ stove/101947: stove/dusebh
939
+ stove/102001: stove/igwqpj
940
+ stove/102019: stove/jhyhag
941
+ straight_chair/1b6c268811e1724ead75d368738e0b47: straight_chair/lfgxjk
942
+ straight_chair/219c603c479be977d5e0096fb2d3266a: straight_chair/lxmgbs
943
+ straight_chair/239c363cbe7a650c8b1ad2cf16678177: straight_chair/hwpixe
944
+ straight_chair/25957008f839ef647abe6643657b8aec: straight_chair/zhojwx
945
+ straight_chair/28a0b2a5afc96922ba63bc389be1ed5a: straight_chair/eospnr
946
+ straight_chair/2a8d87523e23a01d5f40874aec1ee3a6: straight_chair/amgwaw
947
+ straight_chair/2db6c88145049555e6c5cd45aa112726: straight_chair/kywbxv
948
+ straight_chair/2f42261a7f658407d12a1bc232f6622c: straight_chair/htssho
949
+ straight_chair/3cc6485ab499244360b0434449421de1: straight_chair/fgoezn
950
+ straight_chair/4c0983329afcd06f730e89ca0d2d13c3: straight_chair/axmhdk
951
+ straight_chair/588bf81e78829fe7a16baf954c1d99bc: straight_chair/hetymd
952
+ straight_chair/5a643c0c638fc2c3ff3a3ae710d23d1e: straight_chair/laxufh
953
+ straight_chair/640f61579181aef13ad3591a780fa12b: straight_chair/isirjh
954
+ straight_chair/662ecf4b0cd1f3d61f30b807ae39b61d: straight_chair/mgzcic
955
+ straight_chair/7139284dff5142d4593ebeeedbff73b: straight_chair/osvmes
956
+ straight_chair/791c14d53bd565f56ba14bfd91a75020: straight_chair/mdnhjm
957
+ straight_chair/8d4efa9893f7e49b3a85b56ecd01e269: straight_chair/rosdkm
958
+ straight_chair/8d80cc5cdafc4b8929e17f7efc5a2421: straight_chair/psoizi
959
+ straight_chair/8d983a0adc059082b300c4ca2f51c01b: straight_chair/fffhmn
960
+ straight_chair/8ec95f15623085a7b11ae648ea92233: straight_chair/pmpwwi
961
+ straight_chair/97cd4ed02e022ce7174150bd56e389a8: straight_chair/gxzrim
962
+ straight_chair/b2ba1569509cdb439451566a8c6563ed: straight_chair/tfdjag
963
+ straight_chair/cd5007a237ffde592b5bf1f191733d75: straight_chair/enuago
964
+ straight_chair/cef1883847c02458cf44224546cb0306: straight_chair/vkgbbl
965
+ straight_chair/d0cf0982f16e5d583178d91f48c2217: straight_chair/myxhad
966
+ straight_chair/e07c7d5be62d7cd73ff4affcd321d45: straight_chair/xfhcep
967
+ straight_chair/e8089df5cd0f9a573a3e9361d5a49edf: straight_chair/dmdipc
968
+ straight_chair/ed108ed496777cf6490ad276cd2af3a4: straight_chair/dmcixv
969
+ straight_chair/f2af2483f9fb980cb237f85c0ae7ac77: straight_chair/haaiau
970
+ straight_pin/03_4: straight_pin/ohhsqc
971
+ straw/straw_000: straw/ovckrp
972
+ straw/straw_001: straw/qcqvjt
973
+ strawberry/36_0: strawberry/pgguhi
974
+ strawberry/36_1: strawberry/xcnzxh
975
+ sugar_jar/sugar_jar_000: sugar_jar/bholak
976
+ sunglass/sunglass_000: sunglass/wdxiwf
977
+ sunglass/sunglass_001: sunglass/nxfifs
978
+ sunscreen/sunscreen_000: sunscreen/prlrwi
979
+ sushi/sushi_000: sushi/akpnxn
980
+ sweater/sweater_000: sweater/eknmzl
981
+ sweater/sweater_001: sweater/ekcjci
982
+ sweet_corn/24_0: sweet_corn/dacgvr
983
+ swivel_chair/179: swivel_chair/mhsjfu
984
+ swivel_chair/21ba49d0622c590c8a93d439b5823fb6: swivel_chair/dxusxd
985
+ swivel_chair/2230: swivel_chair/lizuow
986
+ swivel_chair/2320: swivel_chair/lafeot
987
+ swivel_chair/2364: swivel_chair/iageoq
988
+ swivel_chair/2440: swivel_chair/mqxrim
989
+ swivel_chair/2471: swivel_chair/vhlzdb
990
+ swivel_chair/2490: swivel_chair/elwzdc
991
+ swivel_chair/2554: swivel_chair/kjrrxi
992
+ swivel_chair/2627: swivel_chair/dmedmy
993
+ swivel_chair/2780: swivel_chair/barmrv
994
+ swivel_chair/3143: swivel_chair/xppcsn
995
+ swivel_chair/3171: swivel_chair/yiphfr
996
+ swivel_chair/35063: swivel_chair/zswgck
997
+ swivel_chair/36250: swivel_chair/qtqitn
998
+ swivel_chair/36280: swivel_chair/imhixv
999
+ swivel_chair/36409: swivel_chair/danzuv
1000
+ swivel_chair/36761: swivel_chair/aepbmj
1001
+ swivel_chair/36912: swivel_chair/njxooh
1002
+ swivel_chair/36983: swivel_chair/fqbnuk
1003
+ swivel_chair/37099: swivel_chair/alvjtk
1004
+ swivel_chair/37247: swivel_chair/moimne
1005
+ swivel_chair/38325: swivel_chair/dqllma
1006
+ swivel_chair/38486: swivel_chair/bvqqps
1007
+ swivel_chair/38519: swivel_chair/sddcnh
1008
+ swivel_chair/38803: swivel_chair/lxupys
1009
+ swivel_chair/39138: swivel_chair/lmmjpk
1010
+ swivel_chair/39313: swivel_chair/dqkces
1011
+ swivel_chair/39392: swivel_chair/ywqhzu
1012
+ swivel_chair/39432: swivel_chair/fvfaeu
1013
+ swivel_chair/39485: swivel_chair/aqobyj
1014
+ swivel_chair/40225: swivel_chair/opkoam
1015
+ swivel_chair/41434: swivel_chair/mrjlps
1016
+ swivel_chair/41653: swivel_chair/spwzyt
1017
+ swivel_chair/41838: swivel_chair/nqojos
1018
+ swivel_chair/42556: swivel_chair/irlmpz
1019
+ swivel_chair/44445: swivel_chair/gbknnw
1020
+ swivel_chair/44729: swivel_chair/odoklx
1021
+ swivel_chair/44876: swivel_chair/zcegqh
1022
+ swivel_chair/5a60c649a221293d72ed554eb3baedcc: swivel_chair/llckbs
1023
+ swivel_chair/723: swivel_chair/bukrxm
1024
+ swivel_chair/762: swivel_chair/ffvxwn
1025
+ t-shirt/t-shirt_000: t_shirt/kvidcx
1026
+ table_knife/1: table_knife/nmkend
1027
+ table_knife/4: table_knife/lrdmpf
1028
+ table_lamp/13310: table_lamp/tggobp
1029
+ table_lamp/13928: table_lamp/kwkqot
1030
+ table_lamp/14127: table_lamp/xbfgjc
1031
+ table_lamp/14402: table_lamp/wdqvjl
1032
+ table_lamp/14422: table_lamp/awfehr
1033
+ table_lamp/14563: table_lamp/lyjkje
1034
+ table_lamp/14605: table_lamp/dkfwyb
1035
+ table_lamp/14986: table_lamp/ncgcgo
1036
+ table_lamp/15030: table_lamp/wslomg
1037
+ table_lamp/15423: table_lamp/tnbwvj
1038
+ table_lamp/16032: table_lamp/zpqejt
1039
+ table_lamp/16378: table_lamp/utsqrs
1040
+ table_lamp/16832: table_lamp/wvysoe
1041
+ table_lamp/lamp_0007: table_lamp/jiuwwn
1042
+ table_lamp/lamp_0008: table_lamp/eosezn
1043
+ table_lamp/lamp_0023: table_lamp/bhdxug
1044
+ table_lamp/lamp_0025: table_lamp/htinka
1045
+ table_lamp/lamp_0053: table_lamp/pxdhzm
1046
+ table_lamp/lamp_0055: table_lamp/midfvh
1047
+ table_lamp/lamp_0059: table_lamp/pmekkr
1048
+ tablefork/0: tablefork/flexrc
1049
+ tablefork/3: tablefork/pqrtkc
1050
+ tape/15_0: tape/budhaz
1051
+ tape/15_1: tape/fetnry
1052
+ tape/15_2: tape/yyekns
1053
+ tape/3M_Antislip_Surfacing_Light_Duty_White: tape/sklkyc
1054
+ tape/3M_Vinyl_Tape_Green_1_x_36_yd: tape/vpgzne
1055
+ tape/Shurtape_Gaffers_Tape_Silver_2_x_60_yd: tape/gchdhk
1056
+ tart/tart_000: tart/borxmv
1057
+ tea_bag/tea_bag_000: tea_bag/kmvcrb
1058
+ teapot/41_0: teapot/foaehs
1059
+ thumbtack/03_2: thumbtack/qfrphh
1060
+ tile/tile_000: tile/vowkci
1061
+ tile/tile_001: tile/kuombe
1062
+ tinsel/tinsel_000: tinsel/ndmqqw
1063
+ toaster/toaster_000: toaster/kjwqav
1064
+ toasting_fork/01_0: toasting_fork/vokznh
1065
+ toasting_fork/17_1: toasting_fork/osrfkc
1066
+ toilet/101323: toilet/nqwekw
1067
+ toilet/102621: toilet/vcgvfe
1068
+ toilet/102625: toilet/wusctd
1069
+ toilet/102629: toilet/kfmkbm
1070
+ toilet/102630: toilet/jkwccu
1071
+ toilet/102639: toilet/vtqdev
1072
+ toilet/102648: toilet/wkltpj
1073
+ toilet/102664: toilet/sjjweo
1074
+ toilet/102670: toilet/mzocsn
1075
+ toilet/102676: toilet/aapttl
1076
+ toilet/102677: toilet/chuack
1077
+ toilet/102689: toilet/rqxqtd
1078
+ toilet/102703: toilet/vdbmon
1079
+ toilet/102707: toilet/yxbgey
1080
+ tomato/16_0: tomato/altlfz
1081
+ tomato/16_1: tomato/wjreyv
1082
+ tongs/62_0: tongs/rcpjld
1083
+ toothbrush/toothbrush_000: toothbrush/qbkrzg
1084
+ toothbrush/toothbrush_001: toothbrush/vkrjps
1085
+ toothpaste/toothpaste_000: toothpaste/vsclsj
1086
+ toothpick/toothpick_000: toothpick/deysav
1087
+ top_cabinet/45415: top_cabinet/tactqn
1088
+ top_cabinet/45523: top_cabinet/zjtaus
1089
+ top_cabinet/45526: top_cabinet/jvdbxh
1090
+ top_cabinet/45621: top_cabinet/fqhdne
1091
+ top_cabinet/45747: top_cabinet/dmwxyl
1092
+ top_cabinet/45855: top_cabinet/twjqua
1093
+ top_cabinet/46408: top_cabinet/oztrra
1094
+ top_cabinet/46437: top_cabinet/nkrgez
1095
+ top_cabinet/46439: top_cabinet/yegcau
1096
+ top_cabinet/46787: top_cabinet/lsyzkh
1097
+ top_cabinet/46889: top_cabinet/eobsmt
1098
+ top_cabinet/46906: top_cabinet/dhguym
1099
+ top_cabinet/47729: top_cabinet/fqitbw
1100
+ top_cabinet/cabinet_0006: top_cabinet/qiausz
1101
+ towel_rack/towel_rack_0: towel_rack/kqrmrh
1102
+ towel_rack/towel_rack_1: towel_rack/crivoa
1103
+ towel_rack/towel_rack_2: towel_rack/pqhsry
1104
+ toy/Air_Hogs_Wind_Flyers_Set_Airplane_Red: toy/tjchdg
1105
+ toy/Android_Figure_Orange: toy/gqspnb
1106
+ toy/Android_Figure_Panda_Black_White: toy/gdekzd
1107
+ toy/Android_Lego_Green: toy/krmxjk
1108
+ toy/Guardians_of_the_Galaxy_Galactic_Battlers_Rocket_Raccoon_Figure: toy/cobfpg
1109
+ toy/Nintendo_Mario_Action_Figure: toy/txgpxx
1110
+ toy/Nintendo_Yoshi_Action_Figure: toy/wvpqbf
1111
+ toy/Playmates_Industrial_CoSplinter_Teenage_Mutant_Ninja_Turtle_Action_Figure: toy/aihmqy
1112
+ toy/Racoon_Plush_Toy: toy/nncqfn
1113
+ toy/Schleich_Allosaurus_Plastic_Toy: toy/zuntus
1114
+ toy/Schleich_Bayala_Unicorn_Plastic_Toy: toy/vcmcoi
1115
+ toy/Schleich_Hereford_Bull_Plastic_Toy: toy/gnofgv
1116
+ toy/Schleich_Lion_Action_Figure: toy/fnueyn
1117
+ toy/Schleich_Spinosaurus_Action_Figure: toy/orunry
1118
+ toy/Squirrel_Plush_Toy: toy/issvzv
1119
+ toy/Teenage_Mutant_Ninja_Turtles_Rahzar_Action_Figure: toy/acymin
1120
+ toy/Transformers_Age_of_Extinction_Bumblebee_Action_Figure_Orange: toy/jwjrza
1121
+ toy/Transformers_Age_of_Extinction_Stomp_and_Chomp_Grimlock_Figure: toy/cqeowc
1122
+ toy/Vtech_Roll_Learn_Turtle_Plastic_Toy: toy/gyrsew
1123
+ toy/Vtech_Stack_Sing_Rings_636_Months_Colorful_Plastic_Toy: toy/jddrck
1124
+ toy/Weisshai_Great_White_Shark_Plastic_Toy: toy/lfxygp
1125
+ toy/toy_000: toy/ecvxmu
1126
+ trash_can/102200: trash_can/pdmzhv
1127
+ trash_can/102210: trash_can/nuoypc
1128
+ trash_can/102254: trash_can/mdojox
1129
+ trash_can/102257: trash_can/eahqyq
1130
+ trash_can/11259: trash_can/wklill
1131
+ trash_can/12445: trash_can/ifzxzj
1132
+ trash_can/39733528663b8ffbad5067eac75a07f7: trash_can/glzckq
1133
+ trash_can/555a9bff25db49ddcb2a965e75be701c: trash_can/xkqkbf
1134
+ trash_can/64393896dc4403c0e88c1d6fc3580355: trash_can/gsgutn
1135
+ trash_can/97e3b7b4688c2a93f155d75bbf62b80: trash_can/aefcem
1136
+ trash_can/ae33867e3c5e1703f155d75bbf62b80: trash_can/leazin
1137
+ trash_can/b4b4f2d95de89e88b693b28f9c9c2143: trash_can/zotrbg
1138
+ trash_can/ccd313055ecb8799f155d75bbf62b80: trash_can/rteihy
1139
+ trash_can/e3484284e1f301077d9a3c398c7b4709: trash_can/hqdnjz
1140
+ tray/tray_000: tray/xzcnjq
1141
+ treadmill/treadmill_0: treadmill/ahwnhu
1142
+ treadmill/treadmill_1: treadmill/ackppx
1143
+ trowel/trowel_000: trowel/ematag
1144
+ turnip/48_0: turnip/nnvlrd
1145
+ umbrella/umbrella_000: umbrella/zxnjwz
1146
+ umbrella/umbrella_001: umbrella/cqfbku
1147
+ underwear/underwear_000: underwear/uwzqxm
1148
+ vacuum/vacuum_000: vacuum/wikhik
1149
+ vacuum/vacuum_001: vacuum/amnmmq
1150
+ vacuum/vacuum_002: vacuum/bdmsbr
1151
+ vidalia_onion/17_0: vidalia_onion/yxwjgn
1152
+ vidalia_onion/17_1: vidalia_onion/ldeuli
1153
+ vidalia_onion/18_0: vidalia_onion/tnmqrt
1154
+ vidalia_onion/18_1: vidalia_onion/buyxll
1155
+ video_game/Animal_Crossing_New_Leaf_Nintendo_3DS_Game: video_game/pujfzk
1156
+ video_game/Luigis_Mansion_Dark_Moon_Nintendo_3DS_Game: video_game/quzjuo
1157
+ video_game/Mario_Luigi_Dream_Team_Nintendo_3DS_Game: video_game/coiafo
1158
+ video_game/Mario_Party_9_Wii_Game: video_game/yyvkel
1159
+ video_game/New_Super_Mario_BrosWii_Wii_Game: video_game/ceaxsd
1160
+ video_game/Nintendo_2DS_Crimson_Red: video_game/muwcnf
1161
+ video_game/Nintendo_Wii_Party_U_with_Controller_Wii_U_Game: video_game/veodkq
1162
+ video_game/Paper_Mario_Sticker_Star_Nintendo_3DS_Game: video_game/lfdpse
1163
+ video_game/Persona_Q_Shadow_of_the_Labyrinth_Nintendo_3DS: video_game/qsyyql
1164
+ video_game/Pokmon_X_Nintendo_3DS_Game: video_game/ppnzqm
1165
+ video_game/Pokmon_Y_Nintendo_3DS_Game: video_game/ckugyi
1166
+ "video_game/Pok\xE9mon_Omega_Ruby_Alpha_Sapphire_Dual_Pack_Nintendo_3DS": video_game/rzaxlj
1167
+ video_game/Super_Mario_3D_World_Wii_U_Game: video_game/apjpos
1168
+ vinegar/vinegar_000: vinegar/snzyfk
1169
+ walker/Mens_Gold_Cup_ASV_Dress_Casual_Venetian_in_Dark_Brown_Leather: walker/cmfdmv
1170
+ walker/Timberland_Mens_Earthkeepers_Heritage_Boat_Shoe_Black: walker/scbatq
1171
+ walker/Tory_Burch_Kaitlin_Ballet_Mestico_in_Black_Gold: walker/ykjauh
1172
+ walker/Womens_Angelfish_Boat_Shoe_in_Linen_Brown: walker/glrsok
1173
+ walker/Womens_Authentic_Original_Boat_Shoe_in_Classic_Brown_Leather: walker/ndexvs
1174
+ walker/Womens_Authentic_Original_Boat_Shoe_in_Classic_Brown_Leather_48Nh7VuMwW6: walker/txpihh
1175
+ walker/walker_000: walker/dgewyj
1176
+ walker/walker_001: walker/xnpimz
1177
+ wall_clock/5696: wall_clock/xevvel
1178
+ wall_clock/7078: wall_clock/przkmo
1179
+ wall_mounted_tv/3392_w: wall_mounted_tv/gffrzl
1180
+ wall_mounted_tv/4094_w: wall_mounted_tv/ylvjhb
1181
+ wall_mounted_tv/4628_w: wall_mounted_tv/ggfznh
1182
+ wall_socket/wall_socket_000: wall_socket/eaxxbm
1183
+ walnut/13_0: walnut/nzqier
1184
+ walnut/13_1: walnut/rmwtdh
1185
+ washer/100283: washer/mrgspe
1186
+ washer/103369: washer/omeuop
1187
+ washer/103425: washer/xusefg
1188
+ washer/103490: washer/zgzvcv
1189
+ washer/103776: washer/dobgmu
1190
+ washer/103781: washer/jgyzhv
1191
+ watch/watch_000: watch/ghobzn
1192
+ water/water_000: water/emquat
1193
+ watermelon/38_0: watermelon/slucoe
1194
+ watermelon/38_1: watermelon/zgmaqe
1195
+ whiteboard/01_3: whiteboard/bqqmtc
1196
+ window/102803: window/subxdn
1197
+ window/102896: window/ulnafj
1198
+ window/102905: window/fufios
1199
+ window/102906: window/jzxtbv
1200
+ window/103032: window/tflzbx
1201
+ window/103052: window/iwcqsz
1202
+ window/103070: window/bxydsr
1203
+ window/103236: window/tuztdv
1204
+ window/103238: window/ithrgo
1205
+ window/103311: window/mjssrd
1206
+ window/window_0004: window/bhwwja
1207
+ window/window_0011: window/qdkcdn
1208
+ wine_bottle/23_1: wine_bottle/fzuiwy
1209
+ wine_bottle/58_0: wine_bottle/vecadn
1210
+ wine_bottle/59_0: wine_bottle/hnkiog
1211
+ wrapped_gift/wrapped_gift_000: wrapped_gift/wpmksn
1212
+ wreath/wreath_000: wreath/rkrxno
1213
+ yogurt/yogurt_000: yogurt/kihdsj
1214
+ zucchini/22_2: zucchini/udvfaz
1215
+ zucchini/22_3: zucchini/ifvmal
1216
+ zucchini/23_0: zucchini/dybtwb
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/object_inventory.py ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ from collections import Counter, defaultdict
3
+ import glob
4
+ import json
5
+ import os
6
+
7
+ import yaml
8
+ import b1k_pipeline.utils
9
+
10
+ ALLOWED_PART_TAGS = {
11
+ "subpart",
12
+ "extrapart",
13
+ "connectedpart",
14
+ }
15
+
16
+
17
+ def main():
18
+ needed = set()
19
+ providers = defaultdict(list)
20
+ bounding_box_sizes = {}
21
+ meta_links = defaultdict(set)
22
+ attachment_pairs = defaultdict(
23
+ lambda: defaultdict(set)
24
+ ) # attachment_pairs[model_id][F/M] = {attachment_type1, attachment_type2}
25
+ needed_by = defaultdict(list)
26
+ seen_as = defaultdict(set)
27
+ skipped_files = []
28
+
29
+ with b1k_pipeline.utils.PipelineFS() as pipeline_fs:
30
+ # Get the providers.
31
+ with pipeline_fs.open("params.yaml", "r") as f:
32
+ params = yaml.load(f, Loader=yaml.SafeLoader)
33
+ targets = params["combined"]
34
+
35
+ # Merge the object lists.
36
+ for target in targets:
37
+ with pipeline_fs.target_output(target) as target_output_fs:
38
+ with target_output_fs.open("object_list.json", "r") as f:
39
+ object_list = json.load(f)
40
+
41
+ if not object_list["success"]:
42
+ skipped_files.append(target)
43
+ continue
44
+
45
+ needed |= set(object_list["needed_objects"])
46
+ for obj in object_list["needed_objects"]:
47
+ needed_by[obj].append(target)
48
+ for provided in object_list["provided_objects"]:
49
+ providers[provided].append(target)
50
+
51
+ model_id = provided.split("-")[1]
52
+ bounding_box_size = object_list["bounding_boxes"][model_id]["0"][
53
+ "extent"
54
+ ]
55
+ bounding_box_sizes[model_id] = [
56
+ x / 1000.0 for x in bounding_box_size
57
+ ]
58
+ for obj, links in object_list["meta_links"].items():
59
+ meta_links[obj].update(links)
60
+ for obj, attachment_dict in object_list["attachment_pairs"].items():
61
+ for attachment_gender, attachment_types in attachment_dict.items():
62
+ attachment_pairs[obj][attachment_gender].update(
63
+ attachment_types
64
+ )
65
+
66
+ # Manually generate pseudo-metalinks for parts
67
+ for name, _, parent in object_list["max_tree"]:
68
+ if not parent:
69
+ continue
70
+
71
+ # Check parseable name
72
+ parsed_name = b1k_pipeline.utils.parse_name(name)
73
+ if parsed_name is None:
74
+ continue
75
+
76
+ # Record the seen-as categories
77
+ seen_as[parsed_name.group("model_id")].add(
78
+ parsed_name.group("category")
79
+ )
80
+
81
+ # Get the tags that are on the parent
82
+ tags_str = parsed_name.group("tag")
83
+ tags = set()
84
+ if tags_str:
85
+ tags = {x[1:] for x in tags_str.split("-") if x}
86
+
87
+ part_tags = tags & ALLOWED_PART_TAGS
88
+ if not part_tags:
89
+ continue
90
+
91
+ # If we have part tags, we need to add them to the parent's meta links.
92
+ # For that, get the parent's name.
93
+ parsed_parent_name = b1k_pipeline.utils.parse_name(parent)
94
+ assert (
95
+ parsed_parent_name
96
+ ), f"Parent {parent} of {name} is not parseable"
97
+ parent_category = parsed_parent_name.group("category")
98
+ parent_model = parsed_parent_name.group("model_id")
99
+ parent_name = f"{parent_category}-{parent_model}"
100
+
101
+ # Check that the parent shows up in the inventory
102
+ assert (
103
+ parent_name in needed_by
104
+ ), f"Parent {parent_name} of {name} is not in the inventory"
105
+
106
+ # Add the part tags as meta links to the parent
107
+ meta_links[parent_name].update(part_tags)
108
+
109
+ # Check the multiple-provided copies.
110
+ multiple_provided = {k: v for k, v in providers.items() if len(v) > 1}
111
+ single_provider = {k: v[0] for k, v in providers.items()}
112
+
113
+ provided_objects = set(single_provider.keys())
114
+ missing_objects = {x.split("-")[1] for x in needed} - {
115
+ x.split("-")[1] for x in provided_objects
116
+ }
117
+ missing_objects &= {
118
+ obj.split("-")[1]
119
+ for obj, needers in needed_by.items()
120
+ if any(t in params["final_scenes"] for t in needers)
121
+ } # Limit this to stuff that shows up in final scenes
122
+
123
+ seen_as_multiple_categories = {
124
+ obj_id: sorted(categories)
125
+ for obj_id, categories in seen_as.items()
126
+ if len(categories) > 1
127
+ }
128
+
129
+ id_occurrences = defaultdict(list)
130
+ for obj_name, provider in single_provider.items():
131
+ id_occurrences[obj_name.split("-")[1]].append(provider)
132
+ id_collisions = {
133
+ obj_id: obj_names
134
+ for obj_id, obj_names in id_occurrences.items()
135
+ if len(obj_names) > 1
136
+ }
137
+
138
+ success = (
139
+ len(skipped_files) == 0
140
+ and len(multiple_provided) == 0
141
+ and len(missing_objects) == 0
142
+ and len(id_collisions) == 0
143
+ and len(seen_as_multiple_categories) == 0
144
+ )
145
+ results = {
146
+ "success": success,
147
+ "providers": single_provider,
148
+ "needed_by": needed_by,
149
+ "meta_links": {x: sorted(y) for x, y in meta_links.items()},
150
+ "attachment_pairs": {
151
+ k: {kk: sorted(vv) for kk, vv in sorted(v.items())}
152
+ for k, v in sorted(attachment_pairs.items())
153
+ },
154
+ "bounding_box_sizes": bounding_box_sizes,
155
+ "error_skipped_files": sorted(skipped_files),
156
+ "error_multiple_provided": multiple_provided,
157
+ "error_missing_objects": sorted(missing_objects),
158
+ "error_id_collisions": id_collisions,
159
+ "error_seen_as_multiple_categories": seen_as_multiple_categories,
160
+ }
161
+ with pipeline_fs.pipeline_output() as pipeline_output_fs:
162
+ with pipeline_output_fs.open("object_inventory.json", "w") as f:
163
+ json.dump(results, f, indent=4)
164
+
165
+
166
+ if __name__ == "__main__":
167
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/object_positioning_data_for_r1_plot.py ADDED
@@ -0,0 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from collections import deque
2
+ from concurrent.futures import ProcessPoolExecutor, as_completed
3
+ import json
4
+ import os
5
+ import pathlib
6
+ import tempfile
7
+ import traceback
8
+ from cryptography.fernet import Fernet
9
+ from pxr import Usd, UsdGeom, Gf, Sdf
10
+ import numpy as np
11
+ from scipy.spatial.transform import Rotation as R
12
+ from tqdm import tqdm
13
+ import fs.path
14
+ from fs.zipfs import ZipFS
15
+ import torch as th
16
+ import cv2
17
+
18
+ DATASET_DIR = pathlib.Path(r"/scr/BEHAVIOR-1K/OmniGibson/omnigibson/data/og_dataset")
19
+ KEY_PATH = pathlib.Path(r"/scr/BEHAVIOR-1K/OmniGibson/omnigibson/data/omnigibson.key")
20
+ MODE = "USD" # use one of "ATTRIBUTE", "USD" or "JSON"
21
+
22
+
23
+ class BaseMap:
24
+ """
25
+ Base map class.
26
+ Contains basic interface for converting from map to world frame, and vise-versa
27
+ """
28
+
29
+ def __init__(
30
+ self,
31
+ map_resolution=0.1,
32
+ ):
33
+ """
34
+ Args:
35
+ map_resolution (float): map resolution
36
+ """
37
+ # Set internal values
38
+ self.map_resolution = map_resolution
39
+ self.map_size = None
40
+
41
+ def load_map(self, *args, **kwargs):
42
+ """
43
+ Load's this map internally
44
+ """
45
+ # Run internal method and store map size
46
+ self.map_size = self._load_map(*args, **kwargs)
47
+
48
+ def _load_map(self, *args, **kwargs):
49
+ """
50
+ Arbitrary function to load this map. Should be implemented by subclass
51
+
52
+ Returns:
53
+ int: Size of the loaded map
54
+ """
55
+ raise NotImplementedError()
56
+
57
+ def map_to_world(self, xy):
58
+ """
59
+ Transforms a 2D point in map reference frame into world (simulator) reference frame
60
+
61
+ Args:
62
+ xy (2-array or (N, 2)-array): 2D location(s) in map reference frame (in image pixel space)
63
+
64
+ Returns:
65
+ 2-array or (N, 2)-array: 2D location(s) in world reference frame (in metric space)
66
+ """
67
+ dims = 0 if xy.dim() == 1 else 1
68
+ return th.flip((xy - self.map_size / 2.0) * self.map_resolution, dims=(dims,))
69
+
70
+ def world_to_map(self, xy):
71
+ """
72
+ Transforms a 2D point in world (simulator) reference frame into map reference frame
73
+
74
+ xy: 2D location in world reference frame (metric)
75
+ :return: 2D location in map reference frame (image)
76
+ """
77
+
78
+ xy = th.as_tensor(xy)
79
+ point_wrt_map = xy / self.map_resolution + self.map_size / 2.0
80
+ return th.flip(point_wrt_map, dims=tuple(range(point_wrt_map.dim()))).int()
81
+
82
+
83
+ class TraversableMap(BaseMap):
84
+ """
85
+ Traversable scene class.
86
+ Contains the functionalities for navigation such as shortest path computation
87
+ """
88
+
89
+ def __init__(
90
+ self,
91
+ map_resolution=0.1,
92
+ default_erosion_radius=0.0,
93
+ trav_map_with_objects=True,
94
+ num_waypoints=10,
95
+ waypoint_resolution=0.2,
96
+ ):
97
+ """
98
+ Args:
99
+ map_resolution (float): map resolution in meters, each pixel represents this many meters;
100
+ normally, this should be between 0.01 and 0.1
101
+ default_erosion_radius (float): default map erosion radius in meters
102
+ trav_map_with_objects (bool): whether to use objects or not when constructing graph
103
+ num_waypoints (int): number of way points returned
104
+ waypoint_resolution (float): resolution of adjacent way points
105
+ """
106
+ # Set internal values
107
+ self.map_default_resolution = (
108
+ 0.01 # each pixel == 0.01m in the dataset representation
109
+ )
110
+ self.default_erosion_radius = default_erosion_radius
111
+ self.trav_map_with_objects = trav_map_with_objects
112
+ self.num_waypoints = num_waypoints
113
+ self.waypoint_interval = int(waypoint_resolution / map_resolution)
114
+
115
+ # Values loaded at runtime
116
+ self.trav_map_original_size = None
117
+ self.trav_map_size = None
118
+ self.mesh_body_id = None
119
+ self.floor_heights = None
120
+ self.floor_map = None
121
+
122
+ # Run super method
123
+ super().__init__(map_resolution=map_resolution)
124
+
125
+ def _load_map(self, maps_path, floor_heights=(0.0,)):
126
+ """
127
+ Loads the traversability maps for all floors
128
+
129
+ Args:
130
+ maps_path (str): Path to the folder containing the traversability maps
131
+ floor_heights (n-array): Height(s) of the floors for this map
132
+
133
+ Returns:
134
+ int: Size of the loaded map
135
+ """
136
+ if not os.path.exists(maps_path):
137
+ print("trav map does not exist: {}".format(maps_path))
138
+ return
139
+
140
+ self.floor_heights = floor_heights
141
+ self.floor_map = []
142
+ map_size = None
143
+ for floor in range(len(self.floor_heights)):
144
+ if self.trav_map_with_objects:
145
+ # TODO: Shouldn't this be generated dynamically?
146
+ trav_map = th.tensor(
147
+ cv2.imread(
148
+ os.path.join(maps_path, "floor_trav_{}.png".format(floor)),
149
+ cv2.IMREAD_GRAYSCALE,
150
+ )
151
+ )
152
+ else:
153
+ trav_map = th.tensor(
154
+ cv2.imread(
155
+ os.path.join(
156
+ maps_path, "floor_trav_no_obj_{}.png".format(floor)
157
+ ),
158
+ cv2.IMREAD_GRAYSCALE,
159
+ )
160
+ )
161
+
162
+ # If we do not initialize the original size of the traversability map, we obtain it from the image
163
+ # Then, we compute the final map size as the factor of scaling (default_resolution/resolution) times the
164
+ # original map size
165
+ if self.trav_map_original_size is None:
166
+ height, width = trav_map.shape
167
+ assert height == width, "trav map is not a square"
168
+ self.trav_map_original_size = height
169
+ map_size = int(
170
+ self.trav_map_original_size
171
+ * self.map_default_resolution
172
+ / self.map_resolution
173
+ )
174
+
175
+ # We resize the traversability map to the new size computed before
176
+ trav_map = th.tensor(
177
+ cv2.resize(trav_map.cpu().numpy(), (map_size, map_size))
178
+ )
179
+
180
+ # We make the pixels of the image to be either 0 or 255
181
+ trav_map[trav_map < 255] = 0
182
+
183
+ self.floor_map.append(trav_map)
184
+
185
+ return map_size
186
+
187
+
188
+ def _set_xform_properties(prim, pos, quat):
189
+ properties_to_remove = [
190
+ "xformOp:rotateX",
191
+ "xformOp:rotateXZY",
192
+ "xformOp:rotateY",
193
+ "xformOp:rotateYXZ",
194
+ "xformOp:rotateYZX",
195
+ "xformOp:rotateZ",
196
+ "xformOp:rotateZYX",
197
+ "xformOp:rotateZXY",
198
+ "xformOp:rotateXYZ",
199
+ "xformOp:transform",
200
+ ]
201
+ prop_names = prim.GetPropertyNames()
202
+ xformable = UsdGeom.Xformable(prim)
203
+ xformable.ClearXformOpOrder()
204
+ # TODO: wont be able to delete props for non root links on articulated objects
205
+ for prop_name in prop_names:
206
+ if prop_name in properties_to_remove:
207
+ prim.RemoveProperty(prop_name)
208
+ if "xformOp:scale" not in prop_names:
209
+ xform_op_scale = xformable.AddXformOp(
210
+ UsdGeom.XformOp.TypeScale, UsdGeom.XformOp.PrecisionDouble, ""
211
+ )
212
+ xform_op_scale.Set(Gf.Vec3d([1.0, 1.0, 1.0]))
213
+ else:
214
+ xform_op_scale = UsdGeom.XformOp(prim.GetAttribute("xformOp:scale"))
215
+
216
+ if "xformOp:translate" not in prop_names:
217
+ xform_op_translate = xformable.AddXformOp(
218
+ UsdGeom.XformOp.TypeTranslate, UsdGeom.XformOp.PrecisionDouble, ""
219
+ )
220
+ else:
221
+ xform_op_translate = UsdGeom.XformOp(prim.GetAttribute("xformOp:translate"))
222
+
223
+ if "xformOp:orient" not in prop_names:
224
+ xform_op_rot = xformable.AddXformOp(
225
+ UsdGeom.XformOp.TypeOrient, UsdGeom.XformOp.PrecisionDouble, ""
226
+ )
227
+ else:
228
+ xform_op_rot = UsdGeom.XformOp(prim.GetAttribute("xformOp:orient"))
229
+ xformable.SetXformOpOrder([xform_op_translate, xform_op_rot, xform_op_scale])
230
+
231
+ position = Gf.Vec3d(*pos.tolist())
232
+ xform_op_translate.Set(position)
233
+
234
+ orientation = quat[[3, 0, 1, 2]].tolist()
235
+ if xform_op_rot.GetTypeName() == "quatf":
236
+ rotq = Gf.Quatf(*orientation)
237
+ else:
238
+ rotq = Gf.Quatd(*orientation)
239
+ xform_op_rot.Set(rotq)
240
+
241
+
242
+ def decrypt_file(encrypted_filename, decrypted_filename):
243
+ with open(KEY_PATH, "rb") as filekey:
244
+ key = filekey.read()
245
+ fernet = Fernet(key)
246
+
247
+ with open(encrypted_filename, "rb") as enc_f:
248
+ encrypted = enc_f.read()
249
+
250
+ decrypted = fernet.decrypt(encrypted)
251
+
252
+ with open(decrypted_filename, "wb") as decrypted_file:
253
+ decrypted_file.write(decrypted)
254
+
255
+
256
+ def compute_bbox(prim: Usd.Prim) -> Gf.Range3d:
257
+ """
258
+ Compute Bounding Box using ComputeWorldBound at UsdGeom.Imageable
259
+ See https://openusd.org/release/api/class_usd_geom_imageable.html
260
+
261
+ Args:
262
+ prim: A prim to compute the bounding box.
263
+ Returns:
264
+ A range (i.e. bounding box), see more at: https://openusd.org/release/api/class_gf_range3d.html
265
+ """
266
+ imageable = UsdGeom.Imageable(prim)
267
+ time = Usd.TimeCode.Default() # The time at which we compute the bounding box
268
+ bound = imageable.ComputeWorldBound(time, UsdGeom.Tokens.default_)
269
+ bound_range = bound.ComputeAlignedBox()
270
+ return np.array(bound_range.GetMin()), np.array(bound_range.GetMax())
271
+
272
+
273
+ def keep_paths_to_all_visuals(stage):
274
+ """
275
+ Keeps only the paths to all prims named 'visuals' and their ancestors.
276
+
277
+ Args:
278
+ stage (Usd.Stage): The USD stage to modify.
279
+ """
280
+
281
+ # Find all prims named 'visuals'
282
+ def find_visuals_prims(prim, visuals_paths):
283
+ for child in prim.GetChildren():
284
+ if child.GetName() == "visuals":
285
+ visuals_paths.add(child.GetPath())
286
+ find_visuals_prims(child, visuals_paths)
287
+
288
+ visuals_paths = set()
289
+ root_prim = stage.GetPseudoRoot()
290
+ find_visuals_prims(root_prim, visuals_paths)
291
+
292
+ if not visuals_paths:
293
+ print("No prims named 'visuals' found.")
294
+ return
295
+
296
+ # Collect paths to keep (visuals and their ancestors)
297
+ paths_to_keep = set()
298
+ for path in visuals_paths:
299
+ current_path = path
300
+ while current_path != Sdf.Path.emptyPath:
301
+ paths_to_keep.add(current_path)
302
+ current_path = current_path.GetParentPath()
303
+
304
+ # Traverse and prune
305
+ def traverse_and_prune(prim):
306
+ for child in prim.GetChildren():
307
+ traverse_and_prune(child)
308
+
309
+ # Remove the prim if its path is not in paths_to_keep
310
+ if prim.GetPath() not in paths_to_keep:
311
+ stage.RemovePrim(prim.GetPath())
312
+
313
+ traverse_and_prune(root_prim)
314
+
315
+
316
+ def get_bounding_box_from_usd(input_usd, pos, quat, tempdir):
317
+ encrypted_filename = input_usd
318
+ fd, decrypted_filename = tempfile.mkstemp(suffix=".usd", dir=tempdir)
319
+ os.close(fd)
320
+ decrypt_file(encrypted_filename, decrypted_filename)
321
+ stage = Usd.Stage.Open(str(decrypted_filename))
322
+ prim = stage.GetDefaultPrim()
323
+ keep_paths_to_all_visuals(stage)
324
+ stage.Save()
325
+
326
+ # Rotate the object by the rotmat and get the bounding box
327
+ _set_xform_properties(prim, np.array(pos), np.array(quat))
328
+ bb_min, bb_max = compute_bbox(prim)
329
+ return bb_min, bb_max
330
+
331
+
332
+ def find_nearest_unoccupied_cell(grid, start_coord):
333
+ """
334
+ Find the nearest unoccupied cell's coordinate from a given start coordinate.
335
+
336
+ Parameters:
337
+ - grid: 2D numpy array where 1 represents occupied cells, 0 represents unoccupied cells
338
+ - start_coord: tuple (row, col) of the starting coordinate
339
+
340
+ Returns:
341
+ - tuple of (row, col) of the nearest unoccupied cell, or None if no unoccupied cell exists
342
+ """
343
+ rows, cols = grid.shape
344
+ start_row, start_col = start_coord
345
+
346
+ # If the start cell is already unoccupied, return its coordinate
347
+ if grid[start_row, start_col] == 255:
348
+ return start_coord
349
+
350
+ # Possible movement directions: 4-directional (up, right, down, left)
351
+ directions = [(-1, 0), (0, 1), (1, 0), (0, -1)]
352
+
353
+ # Queue for BFS, initialized with the start coordinate
354
+ queue = deque([(start_row, start_col, 0)])
355
+
356
+ # Keep track of visited cells to avoid revisiting
357
+ visited = set([(start_row, start_col)])
358
+
359
+ while queue:
360
+ current_row, current_col, distance = queue.popleft()
361
+
362
+ # Check all 4 directions
363
+ for dx, dy in directions:
364
+ next_row = current_row + dx
365
+ next_col = current_col + dy
366
+
367
+ # Check if the next cell is within grid boundaries and not visited
368
+ if (
369
+ 0 <= next_row < rows
370
+ and 0 <= next_col < cols
371
+ and (next_row, next_col) not in visited
372
+ ):
373
+ # Mark as visited
374
+ visited.add((next_row, next_col))
375
+
376
+ # If unoccupied cell is found, return its coordinate
377
+ if grid[next_row, next_col] == 255:
378
+ return (next_row, next_col)
379
+
380
+ # Add to queue for further exploration
381
+ queue.append((next_row, next_col, distance + 1))
382
+
383
+ # No unoccupied cell found
384
+ return None
385
+
386
+
387
+ def get_distance_from_traversability(trav_map, bbox_min, bbox_max):
388
+ bbox_corners_2d = [
389
+ [bbox_min[0], bbox_min[1]],
390
+ [bbox_min[0], bbox_max[1]],
391
+ [bbox_max[0], bbox_min[1]],
392
+ [bbox_max[0], bbox_max[1]],
393
+ ]
394
+ min_dist = None
395
+ for corner_2d in bbox_corners_2d:
396
+ corner_on_map = trav_map.world_to_map(corner_2d)
397
+
398
+ # Clip the corner to the map coordinate range
399
+ corner_on_map = np.clip(
400
+ corner_on_map, 0, np.array(trav_map.floor_map[0].shape) - 1
401
+ )
402
+
403
+ # Find the point on the map that is closest to the corner that is marked as traversable
404
+ closest_traversable_point_on_map = find_nearest_unoccupied_cell(
405
+ trav_map.floor_map[0], tuple(corner_on_map.int().tolist())
406
+ )
407
+
408
+ # Convert back to world coordinates
409
+ closest_traversable_point = trav_map.map_to_world(
410
+ th.tensor(closest_traversable_point_on_map, dtype=float)
411
+ )
412
+
413
+ # Compute the distance between the corner and the closest traversable point
414
+ distance = (th.tensor(corner_2d) - closest_traversable_point).tolist()
415
+ if distance is None:
416
+ continue
417
+
418
+ # Update the minimum distance
419
+ if min_dist is None or np.linalg.norm(distance) < np.linalg.norm(min_dist):
420
+ min_dist = distance
421
+
422
+ return min_dist
423
+
424
+
425
+ def get_tro_positions(task_file, tempdir, include_fixed=False):
426
+ # Load the traversability map
427
+ traversability_map = TraversableMap()
428
+ traversability_map.load_map(maps_path=str(task_file.parent.parent / "layout"))
429
+
430
+ example_task = json.loads(task_file.read_text())
431
+ tro_names = [
432
+ x
433
+ for syn, x in example_task["metadata"]["task"]["inst_to_name"].items()
434
+ if syn != "agent.n.01_1"
435
+ ]
436
+ objects = example_task["state"]["object_registry"]
437
+ object_init_infos = example_task["objects_info"]["init_info"]
438
+ tros = [
439
+ (tro_name, objects[tro_name], object_init_infos[tro_name])
440
+ for tro_name in tro_names
441
+ if tro_name in objects
442
+ ]
443
+ tro_ranges = {}
444
+ for tro_name, tro_state, tro_init in tros:
445
+ if not include_fixed and tro_init["args"].get("fixed_base", False):
446
+ continue
447
+
448
+ # Get the position and rotation
449
+ tro_pos = tro_state["root_link"]["pos"]
450
+ tro_rot = tro_state["root_link"]["ori"]
451
+
452
+ # Get the bounding box
453
+ category = tro_init["args"]["category"]
454
+ model_id = tro_init["args"]["model"]
455
+ usd_path = (
456
+ DATASET_DIR
457
+ / "objects"
458
+ / category
459
+ / model_id
460
+ / "usd"
461
+ / f"{model_id}.encrypted.usd"
462
+ )
463
+
464
+ # Get the oriented bounding box
465
+ bbox_min, bbox_max = get_bounding_box_from_usd(
466
+ usd_path, tro_pos, tro_rot, tempdir
467
+ )
468
+
469
+ # Get the distance from the traversability map
470
+ dist_from_trav = get_distance_from_traversability(
471
+ traversability_map, bbox_min, bbox_max
472
+ )
473
+
474
+ tro_ranges[tro_name] = {
475
+ "pos": tro_pos,
476
+ "bbmin": bbox_min.tolist(),
477
+ "bbmax": bbox_max.tolist(),
478
+ "dist_from_trav": dist_from_trav,
479
+ }
480
+
481
+ return tro_ranges
482
+
483
+
484
+ def main():
485
+ print("Globbing tasks")
486
+ task_files = list(DATASET_DIR.glob("scenes/*/json/*_0_0_template.json"))
487
+ print(f"Found {len(task_files)} tasks")
488
+
489
+ # Scale up
490
+ futures = {}
491
+ with tempfile.TemporaryDirectory() as tempdir:
492
+ with ProcessPoolExecutor() as executor:
493
+ for p in tqdm(task_files, desc="Queueing up jobs"):
494
+ task_name = p.stem.replace("_0_0_template", "")
495
+ future = executor.submit(get_tro_positions, p, tempdir)
496
+ futures[future] = task_name
497
+
498
+ # Gather the results (with a tqdm progress bar)
499
+ results = {}
500
+ for future in tqdm(
501
+ as_completed(futures), total=len(futures), desc="Processing results"
502
+ ):
503
+ task_name = futures[future]
504
+ try:
505
+ results[task_name] = future.result()
506
+ except Exception as e:
507
+ print(f"Error processing {task_name}: {e}")
508
+ traceback.print_exc()
509
+
510
+ with open(DATASET_DIR / "task_object_infos.json", "w") as f:
511
+ json.dump(results, f)
512
+
513
+
514
+ if __name__ == "__main__":
515
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/object_to_stl_urdfpy.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ast import Dict
2
+ import sys
3
+
4
+ import numpy as np
5
+ import trimesh
6
+ from b1k_pipeline.urdfpy import URDF
7
+ import os
8
+
9
+
10
+ def main(model_dir):
11
+ # Load the URDF file into urdfpy
12
+ model_id = os.path.basename(model_dir)
13
+ urdf_filename = f"{model_id}.urdf"
14
+ urdf_path = os.path.join(model_dir, "urdf", urdf_filename)
15
+ robot = URDF.load(urdf_path)
16
+
17
+ # Do FK with everything at the lower position
18
+ joint_cfg = {
19
+ joint.name: joint.limit.lower
20
+ for joint in robot.joints
21
+ if joint.joint_type in ("prismatic", "revolute")
22
+ }
23
+ cfk: Dict[trimesh.Trimesh, np.ndarray] = robot.collision_trimesh_fk(cfg=joint_cfg)
24
+
25
+ meshes = []
26
+ for mesh, transform in cfk.items():
27
+ mesh_copy = mesh.copy()
28
+ mesh_copy.apply_transform(transform)
29
+ meshes.append(mesh_copy)
30
+ final_mesh = trimesh.boolean.union(meshes, engine="manifold")
31
+ final_mesh.show()
32
+ final_mesh.export(os.path.join(model_dir, f"{model_id}.stl"))
33
+
34
+
35
+ if __name__ == "__main__":
36
+ main(sys.argv[1])
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/pack_dataset.py ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import glob
2
+ import json
3
+ import logging
4
+ import os
5
+ import pathlib
6
+ import shutil
7
+ import traceback
8
+ import fs
9
+ import fs.copy
10
+ import fs.zipfs
11
+ import fs.multifs
12
+ import fs.osfs
13
+ import tqdm
14
+
15
+ import b1k_pipeline.utils
16
+
17
+ logger = logging.getLogger(__name__)
18
+ logger.setLevel(logging.DEBUG)
19
+
20
+ OUTPUT_FILENAME = os.path.join(
21
+ os.path.dirname(os.path.dirname(__file__)),
22
+ "artifacts",
23
+ "pipeline",
24
+ "pack_dataset.json",
25
+ )
26
+ SUCCESS_FILENAME = os.path.join(
27
+ os.path.dirname(os.path.dirname(__file__)),
28
+ "artifacts",
29
+ "pipeline",
30
+ "pack_dataset.success",
31
+ )
32
+ IN_FILENAME_AGGREGATE = os.path.join(
33
+ os.path.dirname(os.path.dirname(__file__)), "artifacts", "aggregate"
34
+ )
35
+ PARALLELS_DIR = os.path.join(
36
+ os.path.dirname(os.path.dirname(__file__)), "artifacts", "parallels"
37
+ )
38
+ OUT_FILENAME = os.path.join(
39
+ os.path.dirname(os.path.dirname(__file__)), "artifacts", "og_dataset.zip"
40
+ )
41
+ DEMO_OUT_FILENAME = os.path.join(
42
+ os.path.dirname(os.path.dirname(__file__)), "artifacts", "og_dataset_demo.zip"
43
+ )
44
+ VERSION_FILENAME = os.path.join(os.path.dirname(os.path.dirname(__file__)), "VERSION")
45
+ PARALLELS = [
46
+ "objects.zip",
47
+ "objects_usd.zip",
48
+ "metadata.zip",
49
+ "scenes_json.zip",
50
+ "systems.zip",
51
+ ]
52
+
53
+
54
+ def main():
55
+ success = True
56
+ error_msg = ""
57
+ try:
58
+ # Get a multi-FS view over all of the parallel filesystems.
59
+ multi_fs = fs.multifs.MultiFS()
60
+ # multi_fs.add_fs('aggregate', fs.osfs.OSFS(IN_FILENAME_AGGREGATE), priority=0)
61
+ for parallel_zip_name in PARALLELS:
62
+ parallel_zip = os.path.join(PARALLELS_DIR, parallel_zip_name)
63
+ print("Adding", parallel_zip)
64
+ multi_fs.add_fs(
65
+ os.path.basename(parallel_zip), fs.zipfs.ZipFS(parallel_zip), priority=1
66
+ )
67
+
68
+ # Copy all the files to the output zip filesystem.
69
+ print("Copying files")
70
+ total_files = sum(1 for f in multi_fs.walk.files())
71
+ with b1k_pipeline.utils.WriteOnly7ZipFS(OUT_FILENAME) as out_fs:
72
+ with tqdm.tqdm(total=total_files) as pbar:
73
+ fs.copy.copy_fs(multi_fs, out_fs, on_copy=lambda *args: pbar.update(1))
74
+
75
+ # Rename any WIP scenes
76
+ print("Renaming WIP scenes")
77
+ if out_fs.exists("scenes"):
78
+ scenes_dir = out_fs.opendir("scenes")
79
+ for scene_dir in list(scenes_dir.listdir("/")):
80
+ if "scenes/" + scene_dir in b1k_pipeline.utils.get_targets(
81
+ "verified_scenes"
82
+ ):
83
+ continue
84
+
85
+ # First rename the main dir
86
+ renamed_dir = "WIP_" + scene_dir
87
+ print("Renaming", scene_dir, "to", renamed_dir)
88
+ scenes_dir.movedir(scene_dir, renamed_dir, create=True)
89
+
90
+ # Then rename the JSONs
91
+ json_dir = scenes_dir.opendir(renamed_dir).opendir("json")
92
+ for json_file in list(json_dir.listdir("/")):
93
+ json_dir.move(json_file, "WIP_" + json_file)
94
+
95
+ # Nuke any systems' directories in the objects directory
96
+ print("Removing object dirs of systems")
97
+ objects_dir = out_fs.opendir("objects")
98
+ systems_dir = out_fs.opendir("systems")
99
+ for system_dir in list(systems_dir.listdir("/")):
100
+ if objects_dir.exists(system_dir):
101
+ print("Removing", system_dir)
102
+ objects_dir.removetree(system_dir)
103
+
104
+ # Delete the URDF and shape directories since they contain unencrypted objects
105
+ print("Removing URDF directories")
106
+ urdf_dirs = {x.path for x in out_fs.glob("*/*/*/urdf/")} | {
107
+ x.path for x in out_fs.glob("*/*/*/shape/")
108
+ }
109
+ for urdf_dir in urdf_dirs:
110
+ out_fs.removetree(urdf_dir)
111
+
112
+ # Add the VERSION file
113
+ out_fs.writetext("VERSION", pathlib.Path(VERSION_FILENAME).read_text())
114
+
115
+ # Now create the demo zip
116
+ # with fs.zipfs.ZipFS(DEMO_OUT_FILENAME, write=True) as demo_out_fs:
117
+ # # Copy over the metadata directory
118
+ # fs.copy.copy_fs(out_fs.opendir("metadata"), demo_out_fs.makedirs("metadata"))
119
+
120
+ # # Copy over the Rs_int scene directory
121
+ # fs.copy.copy_fs(out_fs.opendir("scenes/Rs_int"), demo_out_fs.makedirs("scenes/Rs_int"))
122
+
123
+ # # Copy over the water system directory
124
+ # fs.copy.copy_fs(out_fs.opendir("systems/water"), demo_out_fs.makedirs("systems/water"))
125
+
126
+ # # Copy over the object directories of ALL objects that are needed for Rs_int
127
+ # rs_int_object_list = json.loads(b1k_pipeline.utils.PipelineFS().target_output("scenes/Rs_int").readtext("object_list.json"))
128
+ # rs_int_needed_objects = {obj.split("-")[1] for obj in rs_int_object_list["needed_objects"]}
129
+ # objects_dir = out_fs.opendir("objects")
130
+ # for cat in objects_dir.listdir("/"):
131
+ # cat_dir = objects_dir.opendir(cat)
132
+ # for mdl in cat_dir.listdir("/"):
133
+ # mdl_dir = cat_dir.opendir(mdl)
134
+
135
+ # if mdl in rs_int_needed_objects:
136
+ # fs.copy.copy_fs(mdl_dir, demo_out_fs.makedirs(f"objects/{cat}/{mdl}", recreate=True))
137
+
138
+ except Exception as e:
139
+ success = False
140
+ error_msg = traceback.format_exc()
141
+
142
+ with open(OUTPUT_FILENAME, "w") as f:
143
+ json.dump({"success": success, "error_msg": error_msg}, f, indent=4)
144
+
145
+ if success:
146
+ with open(SUCCESS_FILENAME, "w") as f:
147
+ pass
148
+
149
+
150
+ if __name__ == "__main__":
151
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/patch_sampled.sh ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -eo pipefail
3
+
4
+ # Check that the first argument is either og_dataset or og_dataset_demo
5
+ if [ "$1" != "og_dataset" ] && [ "$1" != "og_dataset_demo" ]; then
6
+ echo "ERROR: First argument must be either og_dataset or og_dataset_demo"
7
+ exit 1
8
+ fi
9
+
10
+ # Get the pipeline path
11
+ SCRIPTDIR="$(dirname "$0")"
12
+ SCRIPTDIR="$(cd "$SCRIPTDIR" && pwd)"
13
+ PIPELINEDIR="${SCRIPTDIR}/.."
14
+ PIPELINEDIR="$(cd "$PIPELINEDIR" && pwd)"
15
+
16
+ # Create a temp dir
17
+ TMP_DIR=$(mktemp -d)
18
+ echo "TMP_DIR: $TMP_DIR"
19
+
20
+ # Change to the temp dir
21
+ cd $TMP_DIR
22
+
23
+ # Unpack the full dataset into the og_dataset directory
24
+ mkdir og_dataset
25
+ cd og_dataset
26
+ unzip -q $PIPELINEDIR/artifacts/${1}.zip
27
+ echo "Unpacked og_dataset"
28
+
29
+ # Unpack the sampled tasks over the og_dataset
30
+ # If $1 is og_dataset_demo, then we need to unzip only a subset.
31
+ if [ "$1" == "og_dataset_demo" ]; then
32
+ unzip -l $PIPELINEDIR/sampled_tasks.zip | grep 'Rs_int' | awk '{print $4}' | xargs -I{} unzip $PIPELINEDIR/sampled_tasks.zip '{}'
33
+ else
34
+ unzip -q $PIPELINEDIR/sampled_tasks.zip
35
+ fi
36
+
37
+ # Check that both _best.json and _template.json files exist
38
+ NUM_BEST=$(find . -type f | grep "_best\.json" | wc -l)
39
+ NUM_TEMPLATE=$(find . -type f | grep "_template\.json" | wc -l)
40
+ if [ $NUM_BEST -eq 0 ] || [ $NUM_TEMPLATE -eq 0 ]; then
41
+ echo "ERROR: _best.json and _template.json files not found in ${TMP_DIR}"
42
+ exit 1
43
+ fi
44
+
45
+ # Tar the og dataset using 7za
46
+ cd $TMP_DIR
47
+ 7za a ${1}_sampled.tar og_dataset > /dev/null 2>&1
48
+ echo "Tared og_dataset"
49
+ gzip -9 ${1}_sampled.tar
50
+ echo "Gzipped og_dataset"
51
+
52
+ # Check that the tar.gz file exists
53
+ if [ ! -f ${1}_sampled.tar.gz ]; then
54
+ echo "ERROR: ${1}_sampled.tar.gz not found in ${TMP_DIR}"
55
+ exit 1
56
+ fi
57
+
58
+ # Move the tar.gz file to the artifacts directory
59
+ mv ${1}_sampled.tar.gz $PIPELINEDIR/artifacts/
60
+ echo "Moved ${1}_sampled.tar.gz to $PIPELINEDIR/artifacts/"
61
+
62
+ # Clean up
63
+ rm -rf $TMP_DIR
64
+ echo "Cleaned up"
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/physics_test.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ This script is used to load a newly-exported scene and check it for physics stability.
3
+
4
+ To run this script, you need to have a valid version of iGibson 2.0 installed in your environment.
5
+ """
6
+
7
+ import sys
8
+ import pybullet as p
9
+ from b1k_pipeline.utils import PIPELINE_ROOT
10
+
11
+ import igibson
12
+ igibson.ig_dataset_path = str(PIPELINE_ROOT / "artifacts/aggregate")
13
+
14
+ from igibson.simulator import Simulator
15
+ from igibson.scenes.igibson_indoor_scene import InteractiveIndoorScene
16
+
17
+
18
+ OUTPUT_FILENAME = "physics_test.json"
19
+ SUCCESS_FILENAME = "physics_test.success"
20
+
21
+
22
+
23
+ def main():
24
+ target = sys.argv[1]
25
+ scene_name = target.split("/")[1]
26
+ output_dir = PIPELINE_ROOT / "cad" / target / "artifacts"
27
+
28
+ s = Simulator(mode="headless", use_pb_gui=True)
29
+
30
+ try:
31
+ scene = InteractiveIndoorScene(
32
+ scene_name,
33
+ build_graph=True,
34
+ )
35
+ s.import_scene(scene)
36
+
37
+ # Save the pose of everything
38
+ initial_poses = {}
39
+ for b in range(p.getNumBodies()):
40
+ initial_poses{b} = p.getPositionAndOrientation(b)
41
+
42
+ for _ in range(1000):
43
+ p.stepSimulation()
44
+
45
+ # Recheck the pose of everything
46
+ errors = []
47
+ for b in range(p.getNumBodies()):
48
+ if b not in scene.objects_by_id:
49
+ continue
50
+
51
+ obj_name = scene.objects_by_id[b].name
52
+ orig_pos, orig_orn = initial_poses[b]
53
+ pos, orn = p.getPositionAndOrientation(b)
54
+ diff_pos = np.linalg.norm(np.array(pos) - np.array(orig_pos))
55
+ diff_orn = (R.from_quat(orn) * R.from_quat(old-1).inv()).magnitude()
56
+
57
+ if diff_pos > POS_THRESHOLD:
58
+ errors.append(f"{obj_name} moved by {diff_pos} meters.")
59
+ if diff_rot > ORN_THRESHOLD:
60
+ errors.append(f"{obj_name} rotated by {np.rad2deg(diff_orn)} degrees.")
61
+
62
+
63
+ success = not errors
64
+ filename = output_dir / OUTPUT_FILENAME
65
+ with open(filename, "w") as f:
66
+ json.dump({"success": success}, f, indent=4)
67
+
68
+ if success:
69
+ with open(output_dir / SUCCESS_FILENAME, "w") as f:
70
+ pass
71
+
72
+ finally:
73
+ s.disconnect()
74
+
75
+
76
+ if __name__ == "__main__":
77
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/qa_viewer.py ADDED
@@ -0,0 +1,314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ import os
3
+ import json
4
+ import sys
5
+ import nltk
6
+ import numpy as np
7
+ import csv
8
+ import pybullet as p
9
+ import shutil
10
+
11
+ nltk.download("wordnet")
12
+ nltk.download("omw-1.4")
13
+ from nltk.corpus import wordnet as wn
14
+
15
+ import igibson
16
+
17
+ import igibson.external.pybullet_tools.utils as pb_utils
18
+ from igibson.object_states.link_based_state_mixin import LinkBasedStateMixin
19
+ from igibson.objects.articulated_object import URDFObject
20
+ from igibson.render.mesh_renderer.mesh_renderer_settings import MeshRendererSettings
21
+ from igibson.scenes.empty_scene import EmptyScene
22
+ from igibson.simulator import Simulator
23
+ from igibson.utils.assets_utils import (
24
+ get_all_object_categories,
25
+ get_ig_avg_category_specs,
26
+ get_ig_model_path,
27
+ get_object_models_of_category,
28
+ )
29
+
30
+ from bddl.knowledge_base import KnowledgeBase
31
+ from b1k_pipeline.utils import PIPELINE_ROOT
32
+
33
+
34
+ INVENTORY_PATH = r"D:\object_inventory.json"
35
+ with open(INVENTORY_PATH, "r") as f:
36
+ INVENTORY_DICT = json.load(f)["providers"]
37
+
38
+ CATEGORY_TO_SYNSET = {}
39
+ with open(PIPELINE_ROOT / "metadata/category_mapping.csv", "r") as f:
40
+ r = csv.DictReader(f)
41
+ for row in r:
42
+ CATEGORY_TO_SYNSET[row["category"].strip()] = row["synset"].strip()
43
+
44
+
45
+ def main(dataset_path, record_path):
46
+ """
47
+ Minimal example to visualize all the models available in the iG dataset
48
+ It queries the user to select an object category and a model of that category, loads it and visualizes it
49
+ No physical simulation
50
+ """
51
+ igibson.ignore_visual_shape = False
52
+ igibson.ig_dataset_path = dataset_path
53
+
54
+ print("*" * 80 + "\nDescription:" + main.__doc__ + "*" * 80)
55
+
56
+ processed_objs = set()
57
+ if os.path.exists(record_path):
58
+ # Load the processed objects from the pass record file
59
+ with open(record_path) as f:
60
+ processed_objs = {tuple(obj) for obj in json.load(f)}
61
+
62
+ # Get all the objects in the dataset
63
+ all_objs = {
64
+ (cat, model)
65
+ for cat in get_all_object_categories()
66
+ for model in get_object_models_of_category(cat)
67
+ }
68
+
69
+ # Compute the remaining objects to be processed
70
+ remaining_objs = all_objs - processed_objs
71
+
72
+ print(f"{len(remaining_objs)} objects remaining out of {len(all_objs)}.")
73
+
74
+ for i, (obj_category, obj_model) in enumerate(sorted(remaining_objs)):
75
+ sim = Simulator(mode="headless", use_pb_gui=True)
76
+ sim.import_scene(EmptyScene(floor_plane_rgba=[0.6, 0.6, 0.6, 1]))
77
+
78
+ obj_name = "{}_{}".format(obj_category, obj_model)
79
+ model_path = get_ig_model_path(obj_category, obj_model)
80
+ filename = os.path.join(model_path, "urdf", f"{obj_model}.urdf")
81
+
82
+ print(
83
+ "\n\n-----------------------------------------------------------------------------"
84
+ )
85
+ print(f"Object {i + 1}/{len(remaining_objs)}: ")
86
+ print(f"{obj_category}-{obj_model}")
87
+
88
+ try:
89
+ simulator_obj = URDFObject(
90
+ filename,
91
+ name=obj_name,
92
+ category=obj_category,
93
+ model_path=model_path,
94
+ fixed_base=True,
95
+ )
96
+
97
+ sim.import_object(simulator_obj)
98
+ z_pos = (
99
+ simulator_obj.bounding_box[2] / 2 + simulator_obj.scaled_bbxc_in_blf[2]
100
+ )
101
+ simulator_obj.set_position([0.0, 0.0, z_pos])
102
+
103
+ dist = 3 * np.max(simulator_obj.bounding_box)
104
+ p.resetDebugVisualizerCamera(
105
+ cameraDistance=dist,
106
+ cameraYaw=30,
107
+ cameraPitch=-30,
108
+ cameraTargetPosition=[0, 0, 0],
109
+ )
110
+
111
+ user_complained_synset(simulator_obj)
112
+ user_complained_appearance(simulator_obj)
113
+ user_complained_bbox(simulator_obj)
114
+ user_complained_softbody(simulator_obj)
115
+ # user_complained_properties(simulator_obj)
116
+ user_complained_metas(simulator_obj)
117
+ user_complained_articulation(simulator_obj)
118
+
119
+ with open(record_path, "w") as f:
120
+ processed_objs.add((obj_category, obj_model))
121
+ json.dump(sorted(processed_objs), f, indent=4)
122
+ finally:
123
+ sim.disconnect()
124
+ shutil.rmtree(
125
+ PIPELINE_ROOT / "artifacts/aggregate/scene_instances",
126
+ ignore_errors=True,
127
+ )
128
+
129
+
130
+ def process_complaint(message, simulator_obj):
131
+ print("-----------------------")
132
+ print(message)
133
+ response = input(
134
+ "Do you think anything is wrong? Enter a complaint (hit enter if all's good): "
135
+ )
136
+ if response:
137
+ model = os.path.basename(simulator_obj.model_path)
138
+ object_key = simulator_obj.category + "-" + model
139
+ complaint = {
140
+ "object": object_key,
141
+ "message": message,
142
+ "complaint": response,
143
+ "processed": False,
144
+ }
145
+ target_name = INVENTORY_DICT[object_key]
146
+
147
+ complaints_file = PIPELINE_ROOT / "cad" / target_name / "complaints.json"
148
+ complaints = []
149
+ if os.path.exists(complaints_file):
150
+ with open(complaints_file, "r") as f:
151
+ complaints = json.load(f)
152
+ complaints.append(complaint)
153
+ with open(complaints_file, "w") as f:
154
+ json.dump(complaints, f, indent=4)
155
+
156
+
157
+ def get_synset(category):
158
+ if category not in CATEGORY_TO_SYNSET:
159
+ return "", ""
160
+
161
+ synset_name = CATEGORY_TO_SYNSET[category]
162
+
163
+ # Read the custom synsets from the CSV file
164
+ custom_synsets = []
165
+ with open(PIPELINE_ROOT / "metadata/synsets.csv", "r") as csvfile:
166
+ reader = csv.reader(csvfile)
167
+ for row in reader:
168
+ if synset_name == row[1]:
169
+ return row[1] + " (custom synset)", row[2] + "(hypernyms): " + (
170
+ wn.synset(row[2])
171
+ ).definition()
172
+ try:
173
+ synset = wn.synset(synset_name)
174
+ except:
175
+ return "", ""
176
+ return synset.name(), synset.definition()
177
+
178
+
179
+ def user_complained_synset(simulator_obj):
180
+ # Get the synset assigned to the object
181
+ synset, definition = get_synset(simulator_obj.category)
182
+
183
+ # Print the synset name and definition
184
+ message = (
185
+ "Confirm object synset assignment.\n"
186
+ f"Object assigned to synset: {synset}\n"
187
+ f"Definition: {definition}\n"
188
+ "Reminder: synset should match the object and not its contents.\n"
189
+ "(e.g. orange juice bottle needs to match bottled__orange_juice.n.01\n"
190
+ "and not orange_juice.n.01)"
191
+ )
192
+ process_complaint(message, simulator_obj)
193
+
194
+
195
+ def user_complained_appearance(simulator_obj):
196
+ message = (
197
+ "Confirm object visual appearance.\n"
198
+ "Requirements:\n"
199
+ "- make sure there is only one rigid body.\n"
200
+ "- make sure the object has a valid texture or appearance.\n"
201
+ "- make sure the object has all parts necessary."
202
+ )
203
+ process_complaint(message, simulator_obj)
204
+
205
+
206
+ def user_complained_softbody(simulator_obj):
207
+ message = (
208
+ "Check if the object looks like it absolutely MUST be a soft body.\n"
209
+ "Requirements:\n"
210
+ "- type 'cloth' if you think the object can reasonably be simulated by 2D cloth.\n"
211
+ "- type 'soft' if it needs to be soft but still needs to have a volume.\n"
212
+ "- just hit enter without typing anything if the object does NOT have to be a soft body."
213
+ )
214
+ process_complaint(message, simulator_obj)
215
+
216
+
217
+ def user_complained_properties(simulator_obj):
218
+ BAD_PROPERTIES = {"breakable", "timeSetable", "perishable", "screwable"}
219
+
220
+ kb = KnowledgeBase(populate=True)
221
+ cat_obj = kb.get_category(simulator_obj.category)
222
+ synset = cat_obj.synset.name if cat_obj else None
223
+ try:
224
+ abilities = kb.get_synset(synset).abilities if synset else {}
225
+ except:
226
+ abilities = []
227
+ print("synset not in taxonomy")
228
+
229
+ all_abilities = sorted(
230
+ {a for s in kb.all_synsets() for a in s.abilities.keys()}
231
+ - BAD_PROPERTIES
232
+ )
233
+ message = "Confirm object properties:\n"
234
+ for ability in abilities:
235
+ if ability not in BAD_PROPERTIES:
236
+ message += f"- {ability}\n"
237
+ message += f"Full list of iGibson abilities: {', '.join(all_abilities)}\n"
238
+ message += "Check incorrect or missing properties, especially liquid property\n"
239
+ process_complaint(message, simulator_obj)
240
+
241
+
242
+ def user_complained_metas(simulator_obj):
243
+ meta_links = sorted(
244
+ {
245
+ meta_name
246
+ for link_metas in simulator_obj.metadata["meta_links"].values()
247
+ for meta_name in link_metas
248
+ }
249
+ )
250
+ message = f"Confirm object meta links listed below:\n"
251
+ if meta_links:
252
+ for meta_link in meta_links:
253
+ message += f"- {meta_link}\n"
254
+ else:
255
+ message += f"- N/A\n"
256
+ message += "\nMake sure these match mechanisms you expect from this object."
257
+ process_complaint(message, simulator_obj)
258
+
259
+
260
+ def user_complained_bbox(simulator_obj):
261
+ bounding_box = simulator_obj.bounding_box
262
+ message = "Confirm reasonable bounding box size:\n"
263
+ bb_items = []
264
+ for k in range(3):
265
+ size = bounding_box[k]
266
+ size_m = size
267
+ size_cm = size * 100
268
+ size_mm = size * 1000
269
+ if size_m > 1:
270
+ bb_items.append("%.2fm" % size_m)
271
+ elif size_cm > 1:
272
+ bb_items.append("%.2fcm" % size_cm)
273
+ else:
274
+ bb_items.append("%.2fmm" % size_mm)
275
+ message += ", ".join(bb_items) + "\n"
276
+ message += "Make sure these sizes are within the same order of magnitude you expect from this object IRL.\n"
277
+ message += "If the scale is off, please let us know by a factor of how much (for example, 1000 if something\n"
278
+ message += "that's supposed to be 1mm is 1m instead) in your complaint note."
279
+ # TODO: Print avg category specs too
280
+ process_complaint(message, simulator_obj)
281
+
282
+
283
+ def user_complained_articulation(simulator_obj):
284
+ message = f"Confirm articulation:\n"
285
+ message += "This object has the below movable links annotated:\n"
286
+ joint_ids = [
287
+ (bid, joint)
288
+ for bid in simulator_obj.get_body_ids()
289
+ for joint in pb_utils.get_movable_joints(bid)
290
+ ]
291
+ if joint_ids:
292
+ for bid, joint in joint_ids:
293
+ name = pb_utils.get_link_name(bid, joint)
294
+ _, upper = pb_utils.get_joint_limits(bid, joint)
295
+ pb_utils.set_joint_position(bid, joint, upper)
296
+ message += f"- {name}\n"
297
+ else:
298
+ message += f"- N/A\n"
299
+ message += "\nThey have now all been set to their upper (maximum) limits.\n"
300
+ message += (
301
+ "Verify that these are all the moving parts you expect from this object\n"
302
+ )
303
+ message += "and that the joint limits look reasonable."
304
+ process_complaint(message, simulator_obj)
305
+
306
+
307
+ if __name__ == "__main__":
308
+ logging.basicConfig(level=logging.INFO)
309
+ if len(sys.argv) != 3:
310
+ print(
311
+ "Usage: python -m b1k_pipeline.qa_viewer dataset_path record_file_path.json"
312
+ )
313
+ sys.exit(1)
314
+ main(sys.argv[1], sys.argv[2])
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/qa_viewer_og.py ADDED
@@ -0,0 +1,547 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ import multiprocessing
3
+ import os
4
+ import json
5
+ import sys
6
+ import nltk
7
+ import numpy as np
8
+ import csv
9
+ import networkx as nx
10
+ import sys
11
+
12
+ nltk.download("wordnet")
13
+ nltk.download("omw-1.4")
14
+ from nltk.corpus import wordnet as wn
15
+
16
+ from b1k_pipeline.utils import PIPELINE_ROOT
17
+
18
+
19
+ # Mapping from object model name (e.g. apple-xyzabc) to the source 3dsmax file.
20
+ INVENTORY_PATH = PIPELINE_ROOT / "artifacts/pipeline/object_inventory.json"
21
+ with open(INVENTORY_PATH, "r") as f:
22
+ INVENTORY_DICT = json.load(f)["providers"]
23
+
24
+ # Mapping from object category to synset (WordNet + custom)
25
+ CATEGORY_TO_SYNSET = {}
26
+ with open(PIPELINE_ROOT / "metadata/category_mapping.csv", "r") as f:
27
+ r = csv.DictReader(f)
28
+ for row in r:
29
+ CATEGORY_TO_SYNSET[row["category"].strip()] = row["synset"].strip()
30
+
31
+ SYNSET_TO_PROPERTY = {}
32
+ with open(PIPELINE_ROOT / "metadata/synset_property.csv", "r") as f:
33
+ r = csv.DictReader(f)
34
+ for row in r:
35
+ SYNSET_TO_PROPERTY[row["synset"].strip()] = row
36
+
37
+
38
+ def sanity_check_category_synset():
39
+ modifiers = [f"{state}__" for state in ["cooked", "half", "diced"]]
40
+ known_exceptions = {"coconut.n.01"}
41
+
42
+ for category, synset in CATEGORY_TO_SYNSET.items():
43
+ assert category != ""
44
+ assert synset != ""
45
+ assert (
46
+ synset in SYNSET_TO_PROPERTY
47
+ ), f"synset {synset} not in synset_property.csv"
48
+
49
+ for synset, properties in SYNSET_TO_PROPERTY.items():
50
+ assert synset != ""
51
+ try:
52
+ wn.synset(synset)
53
+ in_wn = True
54
+ except:
55
+ in_wn = False
56
+
57
+ synset_splits = synset.split(".")
58
+ assert (
59
+ synset_splits[1] == "n" and len(synset_splits[2]) == 2
60
+ ), f"Invalid synset {synset}."
61
+ is_custom_bool = bool(int(properties["is_custom"]))
62
+ if in_wn:
63
+ assert (
64
+ not is_custom_bool
65
+ ), f"synset {synset} is in WordNet but marked as custom."
66
+ else:
67
+ assert (
68
+ is_custom_bool
69
+ ), f"synset {synset} is not in WordNet but not marked as custom."
70
+
71
+ if in_wn:
72
+ wn_synset = wn.synset(synset)
73
+ expected_hypernyms = ",".join([h.name() for h in wn_synset.hypernyms()])
74
+ assert (
75
+ expected_hypernyms == properties["hypernyms"]
76
+ ), f"synset {synset} has hypernyms {properties['hypernyms']} but expected {expected_hypernyms}."
77
+
78
+ for hypernym in properties["hypernyms"].split(","):
79
+ try:
80
+ wn.synset(hypernym)
81
+ except:
82
+ assert (
83
+ False
84
+ ), f"hypernym {hypernym} of synset {synset} is not in WordNet."
85
+
86
+ for modifier in modifiers:
87
+ if modifier in synset:
88
+ synset_parents = set(properties["hypernyms"].split(","))
89
+
90
+ # cooked__batter.n.01 -> batter.n.01
91
+ base_synset = synset
92
+ for modifier in modifiers:
93
+ base_synset = base_synset.replace(modifier, "")
94
+
95
+ # cooked__batter.n.01's base synset should be the smallest index of all synsets that start with batter.n. (batter.n.04, batter.n.08)
96
+ index = int(base_synset[-2:]) - 1
97
+
98
+ synset_candidates = sorted(
99
+ [
100
+ key
101
+ for key in SYNSET_TO_PROPERTY
102
+ if key.startswith(base_synset[:-2])
103
+ ]
104
+ )
105
+ if not index < len(synset_candidates):
106
+ print(
107
+ f"base synset of synset {synset} not found in synset_property.csv"
108
+ )
109
+ break
110
+
111
+ base_synset = synset_candidates[index]
112
+ base_synset_parents = set(
113
+ SYNSET_TO_PROPERTY[base_synset]["hypernyms"].split(",")
114
+ )
115
+
116
+ # The cooked/diced/half version should share the same parent as the base version.
117
+ assert (
118
+ base_synset_parents == synset_parents
119
+ or base_synset in known_exceptions
120
+ ), f"base synset {base_synset} of synset {synset} has parent {base_synset_parents} but synset parent is {synset_parents}"
121
+
122
+ break
123
+
124
+ taxonomy = nx.DiGraph()
125
+ for synset, properties in SYNSET_TO_PROPERTY.items():
126
+ first_layer = True
127
+ current_synsets = [synset]
128
+ while len(current_synsets) > 0:
129
+ next_synsets = []
130
+ for current_synset in current_synsets:
131
+ if first_layer:
132
+ parents = [
133
+ wn.synset(hypernym)
134
+ for hypernym in properties["hypernyms"].split(",")
135
+ ]
136
+ else:
137
+ parents = current_synset.hypernyms()
138
+ for parent in parents:
139
+ taxonomy.add_edge(
140
+ parent.name(),
141
+ current_synset if first_layer else current_synset.name(),
142
+ )
143
+ next_synsets.extend(parents)
144
+
145
+ current_synsets = next_synsets
146
+ first_layer = False
147
+
148
+ for synset in SYNSET_TO_PROPERTY:
149
+ assert (
150
+ taxonomy.out_degree(synset) == 0
151
+ ), f"synset {synset} has out degree {taxonomy.out_degree(synset)} (non-leaf)"
152
+
153
+ for synset, properties in SYNSET_TO_PROPERTY.items():
154
+ if properties["is_custom"] == "1" and "__" in synset:
155
+ if ("__of__" in synset and "heap__of__" not in synset) or (
156
+ "ed__" in synset
157
+ and "cooked__" not in synset
158
+ and "diced__" not in synset
159
+ and "melted" not in synset
160
+ and "_seed__" not in synset
161
+ and "_feed__" not in synset
162
+ and "chopped__" not in synset
163
+ and "sliced__" not in synset
164
+ ):
165
+ assert (
166
+ properties["hypernyms"]
167
+ in [
168
+ "grocery.n.02",
169
+ "durables.n.01",
170
+ "waste.n.01",
171
+ ]
172
+ ), f"Custom synset {synset} with __of__xyz or ed__xyz should have hypernym grocery.n.02"
173
+ assert (
174
+ properties["fillable"] == "0"
175
+ ), f"Custom synset {synset} with __of__xyz or ed__xyz should not be fillable"
176
+ else:
177
+ tokens = synset.split("__")
178
+ container = tokens[-1]
179
+ fillable = None
180
+ if container in ["bottle.n.01", "jar.n.01", "bowl.n.01"]:
181
+ fillable = True
182
+ assert (
183
+ properties["hypernyms"] == "vessel.n.03"
184
+ ), f"Custom synset {synset} with __bottle/jar/bowl.n.01 should have hypernym vessel.n.03"
185
+ elif container in ["carton.n.01"]:
186
+ fillable = True
187
+ assert (
188
+ properties["hypernyms"] == "box.n.01"
189
+ ), f"Custom synset {synset} with __carton.n.01 should have hypernym box.n.01"
190
+ elif container in ["sack.n.01"]:
191
+ fillable = True
192
+ assert (
193
+ properties["hypernyms"] == "bag.n.01"
194
+ ), f"Custom synset {synset} with __sack.n.01 should have hypernym bag.n.01"
195
+ elif container in [
196
+ "bag.n.01",
197
+ "box.n.01",
198
+ "tin.n.01",
199
+ "cup.n.01",
200
+ "package.n.01",
201
+ ]:
202
+ fillable = True
203
+ assert (
204
+ properties["hypernyms"] == "container.n.01"
205
+ ), f"Custom synset {synset} with __bag/box/tin/cup/package.n.01 should have hypernym container.n.01"
206
+ elif container in ["can.n.01"]:
207
+ assert (
208
+ properties["hypernyms"]
209
+ in [
210
+ "container.n.01",
211
+ "dispenser.n.01",
212
+ ]
213
+ ), f"Custom synset {synset} with __can.n.01 should have hypernym container.n.01 or dispenser.n.01"
214
+ fillable = (
215
+ properties["hypernyms"] == "container.n.01"
216
+ ) # tin can versus spray can
217
+ elif container in ["atomizer.n.01"]:
218
+ fillable = False
219
+ assert (
220
+ properties["hypernyms"] == "dispenser.n.01"
221
+ ), f"Custom synset {synset} with __atomizer.n.01 should have hypernym dispenser.n.01"
222
+ elif container in ["dispenser.n.01", "shaker.n.01"]:
223
+ fillable = False
224
+ assert (
225
+ properties["hypernyms"] == "container.n.01"
226
+ ), f"Custom synset {synset} with __dispenser/shaker.n.01 should have hypernym container.n.01"
227
+ elif tokens[0] in [
228
+ "cooked",
229
+ "diced",
230
+ "sliced",
231
+ "half",
232
+ "heap",
233
+ "melted",
234
+ "chopped",
235
+ "pottable",
236
+ "bagged",
237
+ "broken",
238
+ ]:
239
+ pass
240
+ else:
241
+ assert False, f"Unexpected custom synset {synset}."
242
+
243
+ if fillable is not None:
244
+ if fillable:
245
+ assert (
246
+ properties["fillable"] == "1"
247
+ ), f"Custom synset {synset} with __xyz should be fillable"
248
+ assert (
249
+ properties["particleApplier"] == "0"
250
+ ), f"Custom synset {synset} with __xyz should not be particleApplier"
251
+ else:
252
+ assert (
253
+ properties["fillable"] == "0"
254
+ ), f"Custom synset {synset} with __xyz should not be fillable"
255
+ assert (
256
+ properties["particleApplier"] == "1"
257
+ ), f"Custom synset {synset} with __xyz should be particleApplier"
258
+
259
+ assert (
260
+ properties["particleSource"] == "0"
261
+ ), f"Custom synset {synset} with __xyz should not be particleSource"
262
+
263
+
264
+ def main(dataset_path, record_path):
265
+ import omnigibson as og
266
+ from omnigibson.macros import gm
267
+ from omnigibson.utils.asset_utils import (
268
+ get_all_object_categories,
269
+ get_all_object_category_models,
270
+ )
271
+ from omnigibson.objects.dataset_object import DatasetObject
272
+ import omnigibson.utils.transform_utils as T
273
+
274
+ gm.DATASET_PATH = dataset_path
275
+
276
+ sanity_check_category_synset()
277
+
278
+ processed_objs = set()
279
+ if os.path.exists(record_path):
280
+ # Load the processed objects from the pass record file
281
+ with open(record_path) as f:
282
+ processed_objs = {tuple(obj) for obj in json.load(f)}
283
+
284
+ # Get all the objects in the dataset
285
+ all_objs = {
286
+ (cat, model)
287
+ for cat in get_all_object_categories()
288
+ for model in get_all_object_category_models(cat)
289
+ }
290
+
291
+ # Compute the remaining objects to be processed
292
+ remaining_objs = all_objs - processed_objs
293
+ print(f"{len(remaining_objs)} objects remaining out of {len(all_objs)}.")
294
+
295
+ # Create the scene config to load -- empty scene
296
+ cfg = {"scene": {"type": "Scene"}}
297
+
298
+ # Create the environment
299
+ env = og.Environment(configs=cfg)
300
+
301
+ # Make it brighter
302
+ dome_light = og.sim.scene.skybox
303
+ dome_light.intensity = 0.5e4
304
+
305
+ for i, (obj_category, obj_model) in enumerate(sorted(remaining_objs)):
306
+ print(f"Object {i + 1}/{len(remaining_objs)}: {obj_category}-{obj_model}.")
307
+
308
+ og.sim.stop()
309
+
310
+ obj = DatasetObject(
311
+ name=obj_model,
312
+ category=obj_category,
313
+ model=obj_model,
314
+ position=[0, 0, 10.0],
315
+ fixed_base=True,
316
+ )
317
+
318
+ og.sim.import_object(obj)
319
+ # Make sure the object fits in a box of unit size 1
320
+ obj.scale = (np.ones(3) / obj.aabb_extent).min()
321
+ og.sim.play()
322
+
323
+ og.sim.viewer_camera.set_position_orientation(
324
+ position=np.array([-0.00913503, -1.95750906, 1.36407314]),
325
+ orientation=np.array([0.6350064, 0.0, 0.0, 0.77250687]),
326
+ )
327
+ og.sim.enable_viewer_camera_teleoperation()
328
+
329
+ # Get all the questions
330
+ messages = get_questions(obj)
331
+
332
+ # Launch the complaint thread
333
+ complaint_process = multiprocessing.Process(
334
+ target=process_object_complaints,
335
+ args=[obj.category, obj.name, messages, record_path, sys.stdin.fileno()],
336
+ daemon=True,
337
+ )
338
+ complaint_process.start()
339
+
340
+ # Keep simulating until the thread is done
341
+ while complaint_process.is_alive():
342
+ target_pos = np.array([0.0, 0.0, 1.0])
343
+
344
+ obj.set_orientation([0, 0, 0, 1])
345
+ center_offset = obj.get_position() - obj.aabb_center
346
+
347
+ steps = 600
348
+ steps_per_joint = steps // 6
349
+ for i in range(steps):
350
+ quat = T.euler2quat([0, 0, 2 * np.pi * i / steps])
351
+ pos = T.quat2mat(quat) @ center_offset + target_pos
352
+ obj.set_position_orientation(pos, quat)
353
+ if obj.n_dof > 0:
354
+ frac = (i % steps_per_joint) / steps_per_joint
355
+ j_frac = (
356
+ -1.0 + 2.0 * frac
357
+ if (i // steps_per_joint) % 2 == 0
358
+ else 1.0 - 2.0 * frac
359
+ )
360
+ obj.set_joint_positions(
361
+ positions=j_frac * np.ones(obj.n_dof),
362
+ normalized=True,
363
+ drive=False,
364
+ )
365
+ og.sim.step()
366
+ og.sim.render()
367
+
368
+ # Join the finished thread
369
+ complaint_process.join()
370
+ assert complaint_process.exitcode == 0, "Complaint process exited."
371
+
372
+ # Remove the object and move on
373
+ og.sim.remove_object(obj)
374
+
375
+ og.shutdown()
376
+
377
+
378
+ def get_questions(obj):
379
+ messages = [
380
+ user_complained_synset(obj),
381
+ user_complained_bbox(obj),
382
+ user_complained_appearance(obj),
383
+ user_complained_collision(obj),
384
+ user_complained_articulation(obj),
385
+ ]
386
+
387
+ _, properties = get_synset_and_properties(obj.category)
388
+ if properties["objectType"] in ["rope", "cloth"]:
389
+ messages.append(user_complained_cloth(obj))
390
+
391
+ # messages.append(user_complained_metas(_obj))
392
+ return messages
393
+
394
+
395
+ def process_object_complaints(category, model, messages, record_path, stdin_fileno):
396
+ # Open stdin so that we can read from it
397
+ sys.stdin = os.fdopen(stdin_fileno)
398
+
399
+ for m in messages:
400
+ process_complaint(m, category, model)
401
+
402
+ processed_objs = set()
403
+ if os.path.exists(record_path):
404
+ with open(record_path, "r") as f:
405
+ processed_objs = set(json.load(f))
406
+ processed_objs.add((category, model))
407
+ with open(record_path, "w") as f:
408
+ json.dump(sorted(processed_objs), f)
409
+
410
+
411
+ def process_complaint(message, category, model):
412
+ print(message)
413
+ while True:
414
+ response = input(
415
+ "Do you think anything is wrong? Enter a complaint (hit enter if all's good): "
416
+ )
417
+ if response:
418
+ obj_key = f"{category}-{model}"
419
+ complaint = {
420
+ "object": obj_key,
421
+ "message": message,
422
+ "complaint": response,
423
+ "processed": False,
424
+ }
425
+ target_name = INVENTORY_DICT[obj_key]
426
+
427
+ complaints_file = PIPELINE_ROOT / "cad" / target_name / "complaints.json"
428
+ complaints = []
429
+ if os.path.exists(complaints_file):
430
+ with open(complaints_file, "r") as f:
431
+ complaints = json.load(f)
432
+ complaints.append(complaint)
433
+ with open(complaints_file, "w") as f:
434
+ json.dump(complaints, f, indent=4)
435
+ break
436
+
437
+
438
+ def get_synset_and_properties(category):
439
+ assert category in CATEGORY_TO_SYNSET
440
+ synset = CATEGORY_TO_SYNSET[category]
441
+ assert synset in SYNSET_TO_PROPERTY
442
+ return synset, SYNSET_TO_PROPERTY[synset]
443
+
444
+
445
+ def get_synset_and_definition(category):
446
+ synset, properties = get_synset_and_properties(category)
447
+ if bool(int(properties["is_custom"])):
448
+ s = wn.synset(properties["hypernyms"])
449
+ return f"{synset} (custom synset)", f"(hypernyms: {s.name()}): {s.definition()}"
450
+ else:
451
+ s = wn.synset(synset)
452
+ return s.name(), s.definition()
453
+
454
+
455
+ def user_complained_synset(obj):
456
+ # Get the synset assigned to the object
457
+ synset, definition = get_synset_and_definition(obj.category)
458
+
459
+ # Print the synset name and definition
460
+ message = (
461
+ "Confirm object synset assignment.\n"
462
+ f"Object assigned to category: {obj.category}\n"
463
+ f"Object assigned to synset: {synset}\n"
464
+ f"Definition: {definition}\n"
465
+ "Reminder: synset should match the object and not its contents.\n"
466
+ "(e.g. orange juice bottle needs to match orange_juice__bottle.n.01\n"
467
+ "and not orange_juice.n.01)\n"
468
+ "If the object category is wrong, please add this object to the Object Rename tab.\n"
469
+ "If the object synset is empty or wrong, please modify the Object Category Mapping tab."
470
+ )
471
+ return message
472
+
473
+
474
+ def user_complained_bbox(obj):
475
+ original_bounding_box = obj.aabb_extent / obj.scale
476
+ message = (
477
+ "Confirm reasonable bounding box size (in meters):\n"
478
+ f"{', '.join([str(item) for item in original_bounding_box])}\n"
479
+ "Make sure these sizes are within the same order of magnitude you expect from this object in real life.\n"
480
+ "Press Enter if the size is good. Otherwise, enter the scaling factor you want to apply to the object.\n"
481
+ "2 means the object should be scaled 2x larger and 0.5 means the object should be shrinked to half."
482
+ )
483
+ return message
484
+
485
+
486
+ def user_complained_appearance(obj):
487
+ message = (
488
+ "Confirm object visual appearance.\n"
489
+ "Requirements:\n"
490
+ "- make sure there is only one rigid body (e.g. one shoe instead of a pair of shoes).\n"
491
+ "- make sure the object has a valid texture or appearance (e.g. texture not black, transparency rendered correctly, etc).\n"
492
+ "- make sure the object has all parts necessary."
493
+ )
494
+ return message
495
+
496
+
497
+ def user_complained_collision(obj):
498
+ message = (
499
+ "Confirm object collision meshes.\n"
500
+ "Requirements:\n"
501
+ "- make sure the collision meshes well approximate the original visual meshes\n"
502
+ "- make sure the collision meshes don't lose any affordance (e.g. holes and handles are preserved)."
503
+ )
504
+ return message
505
+
506
+
507
+ def user_complained_articulation(obj):
508
+ message = f"Confirm articulation:\n"
509
+ message += "This object has the below movable links annotated:\n"
510
+ for j_name, j in obj.joints.items():
511
+ message += f"- {j_name}, {j.joint_type}\n"
512
+ message += (
513
+ "Verify that these are all the moving parts you expect from this object\n"
514
+ )
515
+ message += "and that the joint limits look reasonable."
516
+ return message
517
+
518
+
519
+ def user_complained_cloth(obj):
520
+ message = "Confirm the default state of the rope/cloth object is unfolded."
521
+ return message
522
+
523
+
524
+ # TODO: after metalinks are added to the USD with the final format, add a check for them here.
525
+ def user_complained_metas(obj):
526
+ meta_links = sorted(
527
+ {
528
+ meta_name
529
+ for link_metas in obj.metadata["meta_links"].values()
530
+ for meta_name in link_metas
531
+ }
532
+ )
533
+ message = f"Confirm object meta links listed below:\n"
534
+ for meta_link in meta_links:
535
+ message += f"- {meta_link}\n"
536
+ message += "\nMake sure these match mechanisms you expect from this object."
537
+ return message
538
+
539
+
540
+ if __name__ == "__main__":
541
+ logging.basicConfig(level=logging.INFO)
542
+ if len(sys.argv) != 3:
543
+ print(
544
+ "Usage: python -m b1k_pipeline.qa_viewer dataset_path record_file_path.json"
545
+ )
546
+ sys.exit(1)
547
+ main(sys.argv[1], sys.argv[2])
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/reflection_analysis.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from PIL import Image
2
+ import pathlib
3
+ import numpy as np
4
+ from tqdm import tqdm
5
+ from concurrent.futures import ProcessPoolExecutor, as_completed
6
+
7
+
8
+ def distance_from_grayscale_stats(filename):
9
+ img = Image.open(filename)
10
+ arr = np.array(img)
11
+
12
+ # Get the distance from grayscale for each pixel
13
+ distances = np.sqrt(
14
+ (
15
+ (arr[:, :, 0] - arr[:, :, 1]) ** 2
16
+ + (arr[:, :, 0] - arr[:, :, 2]) ** 2
17
+ + (arr[:, :, 1] - arr[:, :, 2]) ** 2
18
+ )
19
+ / 3
20
+ )
21
+
22
+ # Get the min, max, mean, median, and 25th / 75th percentiles
23
+ min_dist = np.min(distances)
24
+ max_dist = np.max(distances)
25
+ mean_dist = np.mean(distances)
26
+ dist_std = np.std(distances)
27
+ median_dist = np.median(distances)
28
+ q25_dist = np.percentile(distances, 25)
29
+ q75_dist = np.percentile(distances, 75)
30
+
31
+ return {
32
+ "min": min_dist,
33
+ "max": max_dist,
34
+ "mean": mean_dist,
35
+ "std": dist_std,
36
+ "median": median_dist,
37
+ "q25": q25_dist,
38
+ "q75": q75_dist,
39
+ }
40
+
41
+
42
+ def main():
43
+ files = list(
44
+ pathlib.Path(r"/scr/BEHAVIOR-1K/asset_pipeline").glob(
45
+ "cad/*/*/bakery/*Reflection*.png"
46
+ )
47
+ )
48
+ print("Total files:", len(files))
49
+
50
+ # Go through all the files and get all the unique colors in each of them
51
+ stats_by_file = {}
52
+ with ProcessPoolExecutor() as executor:
53
+ futures = {}
54
+
55
+ for fn in tqdm(files, desc="Queueing files"):
56
+ futures[executor.submit(distance_from_grayscale_stats, fn)] = fn
57
+
58
+ for future in tqdm(
59
+ as_completed(futures), total=len(futures), desc="Processing files"
60
+ ):
61
+ fn = futures[future]
62
+ stats = future.result()
63
+ stats_by_file[fn] = stats
64
+
65
+ # Save the stats to a CSV file
66
+ with open("reflection_analysis.csv", "w") as f:
67
+ f.write("filename,min,max,mean,std,median,q25,q75\n")
68
+ for fn, stats in stats_by_file.items():
69
+ f.write(
70
+ f"{fn},{stats['min']},{stats['max']},{stats['mean']},{stats['std']},{stats['median']},{stats['q25']},{stats['q75']}\n"
71
+ )
72
+
73
+
74
+ if __name__ == "__main__":
75
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/repeated-repro.ps1 ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ while ($true) {
2
+ dvc repro --glob export_meshes@objects* ;
3
+ taskkill /IM 3dsmax.exe /F ;
4
+ }
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/run_stages.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from concurrent.futures import ThreadPoolExecutor
2
+ import os
3
+ import subprocess
4
+ import traceback
5
+ import yaml
6
+
7
+ import click
8
+
9
+ PARAMS_PATH = "../params.yaml"
10
+
11
+
12
+ def process_target(args):
13
+ try:
14
+ stage, target, timeout = args
15
+ cmd = ["dvc", "repro", f"{stage}@{target}"]
16
+ print("Running", " ".join(cmd))
17
+ return (
18
+ subprocess.run(cmd, timeout=timeout, stdin=subprocess.PIPE).returncode == 0
19
+ )
20
+ except:
21
+ traceback.print_exc()
22
+ return False
23
+
24
+
25
+ @click.command()
26
+ @click.argument("stage")
27
+ @click.option(
28
+ "--subset", default="combined", help="Which subset of targets to run.", type=str
29
+ )
30
+ @click.option(
31
+ "--processes", default=3, help="Number of concurrent processes to run.", type=int
32
+ )
33
+ @click.option(
34
+ "--timeout",
35
+ default=15 * 60,
36
+ help="Seconds to wait until the process is terminated.",
37
+ type=int,
38
+ )
39
+ def run_stages(stage, subset, processes, timeout):
40
+ params_path = os.path.join(os.path.dirname(__file__), PARAMS_PATH)
41
+ with open(params_path, "r") as f:
42
+ files = yaml.load(f, yaml.SafeLoader)
43
+
44
+ assert subset in files.keys(), f"Could not find key {subset}"
45
+
46
+ # Get the appropriate targets.
47
+ targets = files[subset]
48
+
49
+ # Run parallel processing.
50
+ with ThreadPoolExecutor(max_workers=processes) as executor:
51
+ arg_pairs = [(stage, target, timeout) for target in targets]
52
+ results = list(executor.map(process_target, arg_pairs))
53
+
54
+ # Split the targets into successes and failures.
55
+ successes = []
56
+ failures = []
57
+ for target, success in zip(targets, results):
58
+ if success:
59
+ successes.append(target)
60
+ else:
61
+ failures.append(target)
62
+
63
+ # Print the results.
64
+ print(f"Successes ({len(successes)} / {len(targets)}):")
65
+ for x in sorted(successes):
66
+ print(" " + x)
67
+
68
+ print(f"\nFailures ({len(failures)} / {len(targets)}):")
69
+ for x in sorted(failures):
70
+ print(" " + x)
71
+
72
+ print(f"\nSuccessfully ran ({len(successes)} / {len(targets)}) targets.")
73
+
74
+
75
+ if __name__ == "__main__":
76
+ run_stages()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/sync_sheets.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import pathlib
3
+ import gspread
4
+ import csv
5
+ import pandas as pd
6
+
7
+ OUTPUT_ROOT = pathlib.Path(__file__).parents[1] / "metadata"
8
+
9
+ ASSETS_SHEET_KEY = "10L8wjNDvr1XYMMHas4IYYP9ZK7TfQHu--Kzoi0qhAe4"
10
+ SYNSETS_SHEET_KEY = "1eIQn1HzUJV15nCP4MqsHvrdWAV9VrKoxOqSnQxF0_1A"
11
+ COMPLAINTS_SHEET_KEY = "1p5SA2Pt44UHcMZsT3IeOHEVPb8TSPkFro_i8bvWodQA"
12
+
13
+ ALL_SHEETS = [
14
+ (ASSETS_SHEET_KEY, "Object Category Mapping", "category_mapping.csv"),
15
+ (ASSETS_SHEET_KEY, "Allowed Room Types", "allowed_room_types.csv"),
16
+ (ASSETS_SHEET_KEY, "Object Renames", "object_renames.csv"),
17
+ (ASSETS_SHEET_KEY, "Deletion Queue", "deletion_queue.csv"),
18
+ (ASSETS_SHEET_KEY, "Non-Sampleable Categories", "non_sampleable_categories.csv"),
19
+ (ASSETS_SHEET_KEY, "Substance Hyperparams", "substance_hyperparams.csv"),
20
+ (SYNSETS_SHEET_KEY, "Synsets", "synset_property.csv"),
21
+ ]
22
+
23
+
24
+ def main():
25
+ # Download the sheets
26
+ OUTPUT_ROOT.mkdir(exist_ok=True)
27
+ client = gspread.service_account(
28
+ filename=os.environ["GOOGLE_APPLICATION_CREDENTIALS"]
29
+ )
30
+ for key, sheet_name, filename in ALL_SHEETS:
31
+ worksheet = client.open_by_key(key).worksheet(sheet_name)
32
+ with open(OUTPUT_ROOT / filename, "w") as f:
33
+ writer = csv.writer(f)
34
+ writer.writerows(worksheet.get_all_values())
35
+
36
+ # Aggregate the complaints
37
+ import pathlib, json
38
+
39
+ cad_dir = pathlib.Path("cad")
40
+ files = cad_dir.glob("*/*/complaints.json")
41
+ complaints_by_file = {}
42
+ for fn in files:
43
+ with open(fn) as f:
44
+ target = fn.parent.relative_to(cad_dir).as_posix()
45
+ complaints_by_file[target] = json.load(f)
46
+ next_id = (
47
+ max(c["id"] for complaints in complaints_by_file.values() for c in complaints)
48
+ + 1
49
+ )
50
+
51
+ # Upload the complaints
52
+ complaint_sheet = client.open_by_key(COMPLAINTS_SHEET_KEY).worksheet("Complaints")
53
+ df = pd.DataFrame(complaint_sheet.get_all_records())
54
+ df.index += 1
55
+ df.id = pd.to_numeric(df.id, errors="coerce")
56
+
57
+ # If there are any new complaints (these would have no ID), assign them IDs, add them to the complaint dicts, and update the sheet
58
+ new_complaints = df[df["id"].isna()]
59
+ indices_to_ids = {}
60
+ for index, c in new_complaints.iterrows():
61
+ # Assign a new ID to the complaint
62
+ this_id = next_id
63
+ next_id += 1
64
+ complaints_by_file[c["file"]].append(
65
+ {
66
+ "id": this_id,
67
+ "object": c["object"],
68
+ "type": c["type"],
69
+ "processed": c["processed"],
70
+ "complaint": c["complaint"],
71
+ "additional_info": c["additional_info"],
72
+ }
73
+ )
74
+ indices_to_ids[index] = this_id
75
+
76
+ # Update the complaints sheet with the new IDs
77
+ for i, this_id in indices_to_ids.items():
78
+ df.at[i, "id"] = this_id
79
+
80
+ # Check that there are no more NaN IDs
81
+ assert (
82
+ df.id.notna().all()
83
+ ), "There are still NaN IDs in the complaints sheet. Please check."
84
+
85
+ # Update the dataframe from the complaint files
86
+ for target, complaints in complaints_by_file.items():
87
+ for c in complaints:
88
+ # Check if a complaint with this ID already exists in the dataframe
89
+ if c["id"] in df.id.values:
90
+ # Update the complaint in the dataframe
91
+ df.at[df[df["id"] == c["id"]].index[0], "processed"] = c["processed"]
92
+ df.at[df[df["id"] == c["id"]].index[0], "complaint"] = c["complaint"]
93
+ df.at[df[df["id"] == c["id"]].index[0], "additional_info"] = c[
94
+ "additional_info"
95
+ ]
96
+ df.at[df[df["id"] == c["id"]].index[0], "type"] = c["type"]
97
+ else:
98
+ # Add a new complaint to the dataframe. Best to do this in-place rather than creating a new dataframe.
99
+ if c["id"] not in df.id.values:
100
+ complaint_with_file = {
101
+ "file": target,
102
+ "assignee": "",
103
+ "work done": "",
104
+ }
105
+ complaint_with_file.update(c)
106
+ df = pd.concat(
107
+ [df, pd.DataFrame([complaint_with_file])], ignore_index=True
108
+ )
109
+ else:
110
+ # Update the existing complaint in the dataframe
111
+ df.at[c["id"], "object"] = c["object"]
112
+ df.at[c["id"], "processed"] = c["processed"]
113
+ df.at[c["id"], "complaint"] = c["complaint"]
114
+ df.at[c["id"], "additional_info"] = c["additional_info"]
115
+ df.at[c["id"], "type"] = c["type"]
116
+
117
+ # Save the JSONs again
118
+ for target, complaints in complaints_by_file.items():
119
+ with open(cad_dir / target / "complaints.json", "w", newline="\n") as f:
120
+ json.dump(complaints, f, indent=4)
121
+
122
+ # Update the spreadsheet
123
+ complaint_sheet.update([df.columns.values.tolist()] + df.values.tolist())
124
+
125
+
126
+ if __name__ == "__main__":
127
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/HumanFemale.keepAlive.usd ADDED
The diff for this file is too large to render. See raw diff
 
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/HumanFemale.usd ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #usda 1.0
2
+ (
3
+ defaultPrim = "HumanFemale_Group"
4
+ upAxis = "Z"
5
+ )
6
+
7
+ def SkelRoot "HumanFemale_Group" (
8
+ prepend apiSchemas = ["SkelBindingAPI"]
9
+ variants = {
10
+ string geometricLOD = "full"
11
+ string rigComplexity = "high"
12
+ }
13
+ prepend variantSets = ["geometricLOD", "rigComplexity"]
14
+ )
15
+ {
16
+ float3[] extent = [(-73.708176, -28.084373, -13.51461), (73.708176, 17.031977, 134.28993)]
17
+ rel skel:skeleton = </HumanFemale_Group/Rig/Skel>
18
+ matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
19
+ uniform token[] xformOpOrder = ["xformOp:transform"]
20
+
21
+ def Scope "Rig" (
22
+ kind = "component"
23
+ prepend references = @./assets/HumanFemale.rig.usd@
24
+ )
25
+ {
26
+ }
27
+ variantSet "geometricLOD" = {
28
+ "full" (
29
+ prepend references = @./assets/HumanFemale.full.usd@
30
+ ) {
31
+
32
+ }
33
+ "low" (
34
+ prepend references = @./assets/HumanFemale.low.usd@
35
+ ) {
36
+
37
+ }
38
+ "medium" (
39
+ prepend references = @./assets/HumanFemale.medium.usd@
40
+ ) {
41
+
42
+ }
43
+ }
44
+ variantSet "rigComplexity" = {
45
+ "faceBones" {
46
+ over "HumanFemale" (
47
+ variants = {
48
+ string rigComplexity = "faceBones"
49
+ }
50
+ )
51
+ {
52
+ }
53
+
54
+ over "HumanFemaleHair" (
55
+ variants = {
56
+ string rigComplexity = "faceBones"
57
+ }
58
+ )
59
+ {
60
+ }
61
+
62
+ over "KidThinButtonDown" (
63
+ variants = {
64
+ string rigComplexity = "faceBones"
65
+ }
66
+ )
67
+ {
68
+ }
69
+
70
+ over "KidThinLeggings" (
71
+ variants = {
72
+ string rigComplexity = "faceBones"
73
+ }
74
+ )
75
+ {
76
+ }
77
+
78
+ over "KidThinSkirt" (
79
+ variants = {
80
+ string rigComplexity = "faceBones"
81
+ }
82
+ )
83
+ {
84
+ }
85
+
86
+ over "ShoesHumanFlats" (
87
+ variants = {
88
+ string rigComplexity = "faceBones"
89
+ }
90
+ )
91
+ {
92
+ }
93
+
94
+ over "SocksHuman" (
95
+ variants = {
96
+ string rigComplexity = "faceBones"
97
+ }
98
+ )
99
+ {
100
+ }
101
+
102
+ over "Rig" (
103
+ variants = {
104
+ string rigComplexity = "faceBones"
105
+ }
106
+ )
107
+ {
108
+ }
109
+
110
+ }
111
+ "high" {
112
+ over "HumanFemale" (
113
+ variants = {
114
+ string rigComplexity = "high"
115
+ }
116
+ )
117
+ {
118
+ }
119
+
120
+ over "HumanFemaleHair" (
121
+ variants = {
122
+ string rigComplexity = "high"
123
+ }
124
+ )
125
+ {
126
+ }
127
+
128
+ over "KidThinButtonDown" (
129
+ variants = {
130
+ string rigComplexity = "high"
131
+ }
132
+ )
133
+ {
134
+ }
135
+
136
+ over "KidThinLeggings" (
137
+ variants = {
138
+ string rigComplexity = "high"
139
+ }
140
+ )
141
+ {
142
+ }
143
+
144
+ over "KidThinSkirt" (
145
+ variants = {
146
+ string rigComplexity = "high"
147
+ }
148
+ )
149
+ {
150
+ }
151
+
152
+ over "ShoesHumanFlats" (
153
+ variants = {
154
+ string rigComplexity = "high"
155
+ }
156
+ )
157
+ {
158
+ }
159
+
160
+ over "SocksHuman" (
161
+ variants = {
162
+ string rigComplexity = "high"
163
+ }
164
+ )
165
+ {
166
+ }
167
+
168
+ over "Rig" (
169
+ variants = {
170
+ string rigComplexity = "high"
171
+ }
172
+ )
173
+ {
174
+ }
175
+
176
+ }
177
+ "reduced" {
178
+ over "HumanFemale" (
179
+ variants = {
180
+ string rigComplexity = "reduced"
181
+ }
182
+ )
183
+ {
184
+ }
185
+
186
+ over "HumanFemaleHair" (
187
+ variants = {
188
+ string rigComplexity = "reduced"
189
+ }
190
+ )
191
+ {
192
+ }
193
+
194
+ over "KidThinButtonDown" (
195
+ variants = {
196
+ string rigComplexity = "reduced"
197
+ }
198
+ )
199
+ {
200
+ }
201
+
202
+ over "KidThinLeggings" (
203
+ variants = {
204
+ string rigComplexity = "reduced"
205
+ }
206
+ )
207
+ {
208
+ }
209
+
210
+ over "KidThinSkirt" (
211
+ variants = {
212
+ string rigComplexity = "reduced"
213
+ }
214
+ )
215
+ {
216
+ }
217
+
218
+ over "ShoesHumanFlats" (
219
+ variants = {
220
+ string rigComplexity = "reduced"
221
+ }
222
+ )
223
+ {
224
+ }
225
+
226
+ over "SocksHuman" (
227
+ variants = {
228
+ string rigComplexity = "reduced"
229
+ }
230
+ )
231
+ {
232
+ }
233
+
234
+ over "Rig" (
235
+ variants = {
236
+ string rigComplexity = "reduced"
237
+ }
238
+ )
239
+ {
240
+ }
241
+
242
+ }
243
+ }
244
+ }
245
+
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/HumanFemale.walk.usd ADDED
The diff for this file is too large to render. See raw diff
 
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/LICENSE.txt ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ USD ASSET END USER LICENSE AGREEMENT
2
+ PLEASE READ THE FOLLOWING USD ASSET END USER LICENSE AGREEMENT (THE “AGREEMENT”) CAREFULLY. THIS AGREEMENT BETWEEN YOU (“YOU” OR “YOUR”) AND PIXAR (“PIXAR,” “WE,” “OUR” OR “US”) SPECIFIES THE TERMS AND CONDITIONS REGARDING USE OF THE USD ASSET THAT IT ACCOMPANIES, INCLUDING ALL SOURCE CODE, COMPILED CODE, IMAGES, MODELS, DOCUMENTATION, DATA, AND OTHER MATERIALS (THE “USD ASSET”).
3
+ BY USING THE USD ASSET OR CLICKING ON THE “OK” BUTTON BELOW, YOU ARE ACCEPTING THIS AGREEMENT AND YOU ARE (1) REPRESENTING THAT YOU ARE OVER THE AGE OF 18, (2) REPRESENTING THAT YOU HAVE THE RIGHT AND AUTHORITY TO LEGALLY BIND YOURSELF OR YOUR COMPANY, AS APPLICABLE, AND (3) CONSENTING TO BE LEGALLY BOUND BY ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THESE TERMS AND CONDITIONS OR CANNOT MAKE SUCH REPRESENTATIONS, YOU MAY NOT USE THE USD ASSET.
4
+ 1. Grant of License. Subject to the restrictions set forth below, Pixar grants You a temporary, revocable, non-exclusive, nontransferable, nonsublicensable, nonassignable license to use the USD ASSET only for your personal, non-commercial testing of Pixar’s Universal Scene Description technology. All other uses of the USD ASSET by You are not permitted under this Agreement.
5
+
6
+ 2. Ownership. Pixar exclusively owns and shall retain all intellectual property rights in and to the USD ASSET and any derivative works based on the USD ASSET (“Derivative Works”).
7
+
8
+ 3. Restrictions.
9
+
10
+ a. YOU MAY NOT (AND YOU AGREE NOT TO ALLOW A THIRD PARTY TO) RENT, LEASE, SUBLICENSE, SELL, ASSIGN, LOAN, USE FOR TIMESHARING OR SERVICE BUREAU PURPOSES, OR OTHERWISE TRANSFER THE USD ASSET, ANY DERIVATIVE WORKS, OR ANY OF YOUR RIGHTS AND OBLIGATIONS UNDER THIS AGREEMENT.
11
+
12
+ b. You MAY NOT (and you agree not to allow a third party to) reverse engineer, decompile, disassemble, or attempt to reconstruct, identify, or discover any source code, underlying ideas, underlying user interface techniques, or algorithms from compiled portions of the USD ASSET by any means whatsoever, except to the extent the foregoing restrictions are expressly prohibited by applicable law.
13
+
14
+ c. You MAY NOT (and you agree not to allow a third party to) use the USD ASSET or any Derivative Works for any production or commercial purpose, including but not limited to: (i) usage in the production of or usage in connection with feature films, television programming, online content, video games, advertising, videos, images, or other types of viewable content; and (ii) usage in the production of or usage in connection with physical or virtual products, including but not limited to vehicles, furniture, toys, graphic art, posters, clipart, physical models, stickers, clothing, 3D models, emoticons, and virtual goods.
15
+
16
+ d. You MAY NOT (and you agree not to allow a third party to) remove or obscure any identification, copyright or other proprietary notices or markings from the USD ASSET.
17
+
18
+ e. You MAY NOT (and you agree not to allow a third party to) distribute the USD ASSET or any Derivative Works without Pixar’s written authorization.
19
+
20
+ f. You MAY NOT (and you agree not to allow a third party to) use the USD ASSET or any Derivative Works in an unlawful or unauthorized manner.
21
+
22
+ Pixar reserves all rights in the USD ASSET and any Derivative Works not expressly granted hereunder.
23
+
24
+ 4. Feedback. You may provide feedback to Pixar concerning the USD ASSET from time to time, including, without limitation, identifying errors and submitting potential improvements (the “Feedback”). You hereby grant to Pixar a worldwide, royalty-free, transferable, irrevocable and perpetual license, with the right to sublicense, use, modify, display, distribute, and otherwise exploit such Feedback without restriction, including, without limitation, utilizing and displaying such Feedback in connection with the USD ASSET and/or Pixar’s Universal Scene Description Project.
25
+
26
+ 5. No Publicity. Nothing in this Agreement grants you permission to use the trade names, trademarks, service marks, brands, designs, or product names of Pixar or its affiliates.
27
+
28
+ 6. No Warranty. THE USD ASSET IS PROVIDED ON AN “AS IS” BASIS. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, PIXAR AND/OR ITS LICENSORS DISCLAIM ALL WARRANTIES, EITHER ORAL OR WRITTEN, EITHER EXPRESS, IMPLIED, OR ARISING BY STATUTE, CUSTOM, COURSE OF DEALING, OR TRADE USAGE, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, QUALITY, ACCURACY, AND FITNESS FOR A PARTICULAR PURPOSE.
29
+
30
+ 7. Indemnification. You hereby agree to indemnify, defend, and hold Pixar and its affiliates and their officers, directors, owners, shareholders, employees, agents, information providers, licensors, and licensees (collectively, the "Indemnified Parties") harmless from and against any and all liabilities and costs (including reasonable attorneys' fees) incurred by the Indemnified Parties in connection with any claim arising out of any breach by you of this Agreement or your use of the USD ASSET or any Derivative Works. You shall use your best efforts to cooperate with us in the defense of any claim. We reserve the right, at our own expense, to assume the exclusive defense and control of any matter otherwise subject to indemnification by you.
31
+
32
+ 8. Limitation on Liability. UNDER NO CIRCUMSTANCES, INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE, SHALL PIXAR AND/OR ITS LICENSORS BE LIABLE FOR ANY PERSONAL INJURY OR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, LOSS OF PROPERTY, LOSS OF DATA, OR BUSINESS INTERRUPTION UNDER ANY LEGAL THEORY (TORT, CONTRACT OR OTHERWISE), THAT RESULT FROM THE ACCESS OF, USE OF, OR THE INABILITY TO ACCESS OR USE THE USD ASSET OR ANY DERIVATIVE WORKS, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. APPLICABLE LAW MAY NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU. IN NO EVENT SHALL PIXAR’S AND/OR ITS LICENSOR’S TOTAL LIABILITY FOR ALL DAMAGES, LOSSES, AND CAUSES OF ACTION (WHETHER IN CONTRACT, TORT [INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE], OR OTHERWISE) ARISING UNDER THIS AGREEMENT OR OUT OF THE USE OR INABILITY TO USE THE USD ASSET OR ANY DERIVATIVE WORKS EXCEED THE GREATER OF THE AMOUNT PAID BY YOU TO PIXAR, IF ANY, FOR ACCESSING AND/OR USING THE USD ASSET OR $50. THE PARTIES ACKNOWLEDGE THAT THIS IS A REASONABLE ALLOCATION OF RISK.
33
+
34
+ 9. Termination. This Agreement is effective until terminated by either party. Pixar reserves the right, in our sole discretion, to terminate your rights under this license at any time. Upon termination, you must cease use of the USD ASSET and any Derivative Works and remove the USD ASSET and any Derivative Works from all computer memories and storage devices within your possession or control.
35
+
36
+ 10. Survival. Sections 2-8 and 10-16 shall survive termination or expiration of this Agreement.
37
+
38
+ 11. Export Restrictions. You may not export or re-export the USD ASSET or any Derivative Works without (i) the prior written consent of Pixar; and (ii) complying with applicable export control laws and obtaining any necessary permits and licenses.
39
+
40
+ 12. Injunctive Relief. You acknowledge and agree that your breach of this Agreement, including any unauthorized use, transfer, distribution, sublicensing, or disclosure of the USD ASSET or any Derivative Works will cause irreparable injury to Pixar and/or its licensors, and under such circumstances, Pixar and/or its licensors shall be entitled to equitable relief, including without limitation preliminary and permanent injunctive relief, without being required to present evidence of such irreparable harm. You further acknowledge and agree that Pixar and/or its licensors shall be entitled to such equitable relief without being required to post a bond or other security.
41
+
42
+ 13. Relationship of Parties. The parties hereunder are independent contractors and this Agreement will not establish any relationship of partnership, joint venture, employment, franchise, or agency between You and Pixar. Neither party will have the power to bind the other or incur obligations on the other’s behalf without the other’s prior written consent, except as otherwise expressly provided herein.
43
+
44
+ 14. Assignment. You may not assign Your rights or delegate Your duties under this Agreement either in whole or in part, whether by merger, reorganization, sale of stock or assets, operation of law, or otherwise, without the prior written consent of Pixar. Any attempted assignment or delegation without such consent will be void. Pixar may assign its rights and obligations hereunder without restriction.
45
+
46
+ 15. Waiver. No waiver of any provision of this Agreement by us shall be deemed a further or continuing waiver of such provision or any other provision, and our failure to assert any right or provision under this Agreement shall not constitute a waiver of such right or provision.
47
+
48
+ 16. Entire Agreement. The terms of this Agreement shall be governed by and construed in accordance with the laws of the State of California, without giving effect to any principles of conflicts of law. You agree that any action at law or in equity arising out of or relating to this Agreement shall be filed only in the state or federal courts located in the city and county of San Francisco, California, and you hereby consent and submit to the personal jurisdiction of such courts for the purposes of litigating any such action. If any provision of these terms shall be unlawful, void, or for any reason unenforceable, then that provision shall be deemed severable from these terms and shall not affect the validity and enforceability of any remaining provisions. This Agreement supersedes in full all prior discussions and agreements between the parties relating to the subject matter hereof, and constitutes the entire agreement between the parties relating to the subject matter hereof. Pixar reserves the right to update, in its sole discretion, this Agreement at any time. Any such updates to the Agreement will be posted to the applicable Pixar website. Your continued use of the USD ASSET and/or any Derivative Works following posting by Pixar of the updated Agreement indicates your acceptance of the updated Agreement. Except for Pixar’s right to update this Agreement as specified in this section, any modifications to this Agreement must be made in writing and signed by both parties.
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/README.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This asset demonstrates use of UsdSkel schemas for describing a
2
+ skeletally-deformed character in USD.
3
+
4
+ The assets are broken down into the following components:
5
+
6
+ # HumanFemale.usd
7
+
8
+ This file is the core 'asset', defining both the geometry that makes up the
9
+ HumanFemale character,its materials as well as all of the UsdSkelBindingAPI
10
+ properties that control the way that a Skeleton affects geometry.
11
+
12
+ The example also defines several variant sets on scope </HumanFemale_Group>,
13
+ demonstrating possible applications of variant sets:
14
+
15
+ ## geometricLOD:
16
+
17
+ A variant set for swtiching between three different levels of geometric
18
+ complexity. The skel bindings have been authored for each level of geometric
19
+ complexity, so that linear blend skinning still applies to the character when
20
+ selecting a different LOD level.
21
+
22
+ ## rigComplexity:
23
+
24
+ A variant set used to switch between three differents levels of 'rig' complexity.
25
+ The 'reduced' complexity rig excludes minor details like fingers, blendshapes, or
26
+ face joints, while the default 'high' complexity includes a complete set of joints
27
+ with facial blendshapes. The 'faceBones' variant uses joints instead of blendshapes
28
+ for facial deformation.
29
+
30
+ # Animation Clips: HumanFemale.keepAlive.usd, HumanFemale.walk.usd
31
+
32
+ Both of these layer provide simple animation clips.
33
+ These animation clips contain only joint transforms, and root character
34
+ transform animation.
35
+
36
+ For the sake of visualizing the animation, animation clips reference in the
37
+ common 'HumanFemale.usd' asset, so that there is skinnable geometry available
38
+ for preview. This is not strictly necessary when defining animation, however:
39
+ It is valid to author animation clips that contain only joint animations.
40
+
41
+ # Payloads:
42
+
43
+ In addition to providing a complete example of use of UsdSkel schemas, this
44
+ asset has been setup to make use of payloads. The HumanFemale assembly has been
45
+ broken into a set of sub-models ('components'), each of which is referenced
46
+ in through a payload.
47
+
48
+ There are many different ways of organizing assets, but for the purposes of this
49
+ example, each payload has been placed in a layer corresponding to each
50
+ different geometryLOD variant.
51
+
52
+ For each geometricLOD ('low', 'medium', 'full'),
53
+ `assets/HumanFemale.{LOD}_payload.usd` includes the payload contents.
54
+ I.e, the geometry, shaders, skel binding properties, etc.
55
+ Paired with these payload files, each `assets/HumanFemale.{LOD}.usd` file
56
+ applies the payload arcs for the corresponding LOD variant. In Pixar's pipeline,
57
+ each payload arc would normally target a unique file for each of the character,
58
+ hair, and garment assets, but for pedantic simplicity we have bundled all data
59
+ into a single file, and made each payload arc target a sub-root prim of that
60
+ file, which means that all data on the root </HumanFemale_Group> prim in the
61
+ `HumanFemale.{LOD}_payload.usd` files is ignored.
62
+
63
+ # assets/HumanFemale.rig.usd
64
+
65
+ The rig.usd file defines HumanFemale's Skeleton, along with its bind pose
66
+ and rest pose. Multiple configurations of the Skeleton have been defined
67
+ at this point within the 'rigComplexity' variant set.
68
+
69
+ In production pipelines, some form of the rig.usd file might contain a common
70
+ definition of a Skeleton -- and possibly other site-specific rig components --
71
+ which could then be reused across multiple character types using referencing
72
+ and other composition features.
73
+
74
+ # Blendshapes:
75
+
76
+ For each geometricLOD ('low', 'medium', 'full'),
77
+ `assets/HumanFemale.{LOD}.blendshapes.usd` contains the blendshape data used
78
+ by the default rig variant (high). The full blendshapes usd contains a very
79
+ large set of shapes designed for high detail. The medium blendshapes usd
80
+ sublayers the full blendshapes and updates the attributes to apply to the medium
81
+ LOD topology. The low blendshapes usd does the same, but for the low LOD topology.
82
+ In addition, as a demonstration of how to non-destructively reduce the number of
83
+ blendshapes for rig LOD, the assets/HumanFemale.low_payload.usd deactivates the
84
+ majority of blendshapes and updates the top level blendshape attributes accordingly.
85
+ Blendshape weight animation is contained in the animation clips.
86
+
87
+
88
+
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full.blendshapes.usd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63748326544784f54e257d662bc236802eaa7b59c8bfecc0e305610abe4eee42
3
+ size 10233667
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full.usd ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #usda 1.0
2
+ (
3
+ defaultPrim = "HumanFemale_Group"
4
+ upAxis = "Z"
5
+ )
6
+
7
+ def Xform "HumanFemale_Group" (
8
+ kind = "assembly"
9
+ )
10
+ {
11
+ def Xform "HumanFemale" (
12
+ kind = "component"
13
+ payload = @./HumanFemale.full_payload.usd@</HumanFemale_Group/HumanFemale>
14
+ )
15
+ {
16
+ }
17
+ def Xform "HumanFemaleHair" (
18
+ kind = "component"
19
+ payload = @./HumanFemale.full_payload.usd@</HumanFemale_Group/HumanFemaleHair>
20
+ )
21
+ {
22
+ }
23
+ def Xform "KidThinButtonDown" (
24
+ kind = "component"
25
+ payload = @./HumanFemale.full_payload.usd@</HumanFemale_Group/KidThinButtonDown>
26
+ )
27
+ {
28
+ }
29
+ def Xform "KidThinLeggings" (
30
+ kind = "component"
31
+ payload = @./HumanFemale.full_payload.usd@</HumanFemale_Group/KidThinLeggings>
32
+ )
33
+ {
34
+ }
35
+
36
+ def Xform "KidThinSkirt" (
37
+ kind = "component"
38
+ payload = @./HumanFemale.full_payload.usd@</HumanFemale_Group/KidThinSkirt>
39
+ )
40
+ {
41
+ }
42
+ def Xform "ShoesHumanFlats" (
43
+ kind = "component"
44
+ payload = @./HumanFemale.full_payload.usd@</HumanFemale_Group/ShoesHumanFlats>
45
+ )
46
+ {
47
+ }
48
+ def Xform "SocksHuman" (
49
+ kind = "component"
50
+ payload = @./HumanFemale.full_payload.usd@</HumanFemale_Group/SocksHuman>
51
+ )
52
+ {
53
+ }
54
+ }
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.full_payload.usd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20a345d63befb96a30eb736af7aab1e619e579f7b65b29ea9b421aeb78450865
3
+ size 6189143
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low.blendshapes.usd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a7bdf04f8931e81a86292949e5ed7eaa822d66d952c36a84cd6ad229e902716
3
+ size 339539
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low.usd ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #usda 1.0
2
+ (
3
+ defaultPrim = "HumanFemale_Group"
4
+ upAxis = "Z"
5
+ )
6
+
7
+ def Xform "HumanFemale_Group" (
8
+ kind = "assembly"
9
+ )
10
+ {
11
+ def Xform "HumanFemale" (
12
+ kind = "component"
13
+ payload = @./HumanFemale.low_payload.usd@</HumanFemale_Group/HumanFemale>
14
+ )
15
+ {
16
+ }
17
+ def Xform "HumanFemaleHair" (
18
+ kind = "component"
19
+ payload = @./HumanFemale.low_payload.usd@</HumanFemale_Group/HumanFemaleHair>
20
+ )
21
+ {
22
+ }
23
+ def Xform "KidThinButtonDown" (
24
+ kind = "component"
25
+ payload = @./HumanFemale.low_payload.usd@</HumanFemale_Group/KidThinButtonDown>
26
+ )
27
+ {
28
+ }
29
+ def Xform "KidThinLeggings" (
30
+ kind = "component"
31
+ payload = @./HumanFemale.low_payload.usd@</HumanFemale_Group/KidThinLeggings>
32
+ )
33
+ {
34
+ }
35
+
36
+ def Xform "KidThinSkirt" (
37
+ kind = "component"
38
+ payload = @./HumanFemale.low_payload.usd@</HumanFemale_Group/KidThinSkirt>
39
+ )
40
+ {
41
+ }
42
+ def Xform "ShoesHumanFlats" (
43
+ kind = "component"
44
+ payload = @./HumanFemale.low_payload.usd@</HumanFemale_Group/ShoesHumanFlats>
45
+ )
46
+ {
47
+ }
48
+ }
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.low_payload.usd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f2cc3edeebf1e6f479126aebe32027b555baf41ac77ef4af1a0ec9007f5ee06
3
+ size 432498
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium.blendshapes.usd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7e26cd2ce128983efaf2ad217513abed403e3930dd82b5554b08ba42ed2ec68
3
+ size 1268001
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium.usd ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #usda 1.0
2
+ (
3
+ defaultPrim = "HumanFemale_Group"
4
+ upAxis = "Z"
5
+ )
6
+
7
+ def Xform "HumanFemale_Group" (
8
+ kind = "assembly"
9
+ )
10
+ {
11
+ def Xform "HumanFemale" (
12
+ kind = "component"
13
+ payload = @./HumanFemale.medium_payload.usd@</HumanFemale_Group/HumanFemale>
14
+ )
15
+ {
16
+ }
17
+ def Xform "HumanFemaleHair" (
18
+ kind = "component"
19
+ payload = @./HumanFemale.medium_payload.usd@</HumanFemale_Group/HumanFemaleHair>
20
+ )
21
+ {
22
+ }
23
+ def Xform "KidThinButtonDown" (
24
+ kind = "component"
25
+ payload = @./HumanFemale.medium_payload.usd@</HumanFemale_Group/KidThinButtonDown>
26
+ )
27
+ {
28
+ }
29
+ def Xform "KidThinLeggings" (
30
+ kind = "component"
31
+ payload = @./HumanFemale.medium_payload.usd@</HumanFemale_Group/KidThinLeggings>
32
+ )
33
+ {
34
+ }
35
+
36
+ def Xform "KidThinSkirt" (
37
+ kind = "component"
38
+ payload = @./HumanFemale.medium_payload.usd@</HumanFemale_Group/KidThinSkirt>
39
+ )
40
+ {
41
+ }
42
+ def Xform "ShoesHumanFlats" (
43
+ kind = "component"
44
+ payload = @./HumanFemale.medium_payload.usd@</HumanFemale_Group/ShoesHumanFlats>
45
+ )
46
+ {
47
+ }
48
+ def Xform "SocksHuman" (
49
+ kind = "component"
50
+ payload = @./HumanFemale.medium_payload.usd@</HumanFemale_Group/SocksHuman>
51
+ )
52
+ {
53
+ }
54
+ }
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.medium_payload.usd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0ebb28430c5d6fe7a776977d8766b6708e7c9e8982bd6c9bef8e1e9b8bdd06b
3
+ size 1872353
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/HumanFemale/assets/HumanFemale.rig.usd ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #usda 1.0
2
+ (
3
+ defaultPrim = "Rig"
4
+ upAxis = "Z"
5
+ )
6
+
7
+ def Scope "Rig" (
8
+ variants = {
9
+ string rigComplexity = "high"
10
+ }
11
+ prepend variantSets = "rigComplexity"
12
+ )
13
+ {
14
+ over "Skel"
15
+ {
16
+ float3[] extent = [(-61.667, -16.043198, -1.4734344), (61.667, 4.990801, 122.24876)]
17
+ uniform token purpose = "guide"
18
+ }
19
+ variantSet "rigComplexity" = {
20
+ "faceBones" {
21
+ def Skeleton "Skel"
22
+ {
23
+ uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491195, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491194, 1) ), ( (1, 0, 0, 0), (0, 1.000000000000003, 0, 0), (0, 0, 1.000000000230045, 0), (0, -0.0013072490692138678, 83.4566497790318, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000036, 0, 0), (0, 0, 1.000000000260911, 0), (0, -0.0013072490692138676, 90.16297149551578, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999993417, 0, 0), (0, 0, 1.0000000003581702, 0), (0, 0.7708339691162103, 100.50954818656874, 1) ), ( (1, 0, 0, 0), (0, 0.999999999999342, 0, 0), (0, 0, 1.0000000003558396, 0), (0, 0.77083396911621, 111.15584182531659, 1) ), ( (3.294367333847379, 0.580885845318013, 0, 0), (-0.5808858453205927, 3.2943673337593746, 0, 0), (0, 0, 3.3451882612197332, 0), (3.3285450935363787, -4.5856332778930655, 119.30845642089824, 1) ), ( (-0.3139689701404085, 0.33297616224292864, 0.8891289901735948, 0), (-0.9491096445815721, -0.08561226979140199, -0.30308649231436624, 0), (-0.024800226052423505, -0.939040653706756, 0.34291048317857403, 0), (3.3800594973152327, -8.151038014626472, 120.28007964610224, 1) ), ( (-0.7299084179793295, -0.6425748414786, 0.23309070007547836, 0), (-0.06310506920123528, -0.27620000344179585, -0.9590262292242386, 0), (0.6806257793806073, -0.7147105225320947, 0.16105097771962443, 0), (5.8376254144043855, -7.03258621475457, 120.29186687991887, 1) ), ( (-0.9088988801386423, -0.40263062488814433, -0.10858823870432183, 0), (-0.2802086261715577, 0.7825034111802578, -0.5560319570945335, 0), (0.30884616154290373, -0.4749494619387396, -0.8240370483809973, 0), (4.605607916693468, -7.968383464139847, 119.11292192119623, 1) ), ( (-0.9292994790720599, 0.3619498488391623, -0.07344920096030305, 0), (0.3692997510308916, 0.9082511195732231, -0.1967170498012745, 0), (-0.004491387435702873, -0.20993382353295156, -0.9777052813480905, 0), (2.847422928271013, -8.056295758656297, 118.95671269473425, 1) ), ( (-0.7252617924239311, -0.6838795377717951, -0.07939842735888485, 0), (-0.535623335774552, 0.6329362683863045, -0.5590163882526441, 0), (0.43255401353330236, -0.36290557722120537, -0.8253463317893437, 0), (5.639872500024073, -7.157433063162772, 119.21287463858378, 1) ), ( (0.21351491275939466, -0.052883429253456724, 0.9755074192131766, 0), (-0.9647331623325851, 0.1459416921390846, 0.21906836373917907, 0), (-0.1539522897696568, -0.9878787199884321, -0.019857670273645947, 0), (2.9285657330211965, -8.168791936345169, 118.23598005718345, 1) ), ( (0.3705140301465095, 0.08461370943132804, -0.9249647958928224, 0), (0.6423537211402113, 0.6959583736329348, 0.32097295697230777, 0), (0.6708957075337832, -0.713079562421224, 0.20351041071628131, 0), (6.140745897338191, -6.9473410289465685, 118.563624825098, 1) ), ( (-0.42261357561429486, 0.8012360478134617, 0.4235782824824764, 0), (-0.8992704270822215, -0.42885358383956795, -0.08600757294168755, 0), (0.11274069665338064, -0.41725939092151826, 0.9017672293924266, 0), (4.6140593978110145, -7.929731271543917, 118.76181351249427, 1) ), ( (-0.10646319848942101, -0.868727588553227, -0.48371268771239495, 0), (0.9918834017222834, -0.12680132298036087, 0.009420290773731582, 0), (-0.06951907523164423, -0.4787836718578744, 0.8751761501214468, 0), (2.8952091080067577, -8.062789463580902, 118.73928572339413, 1) ), ( (-0.7628269228948914, 0.5974270122766586, 0.24733792816491018, 0), (-0.6435746108535019, -0.7384879248809824, -0.2011151537546416, 0), (0.06250444788366277, -0.3125964647541952, 0.9478273282714187, 0), (5.76621513604476, -7.0736245523271135, 118.94241499508733, 1) ), ( (0.6761039865739371, 0.7367769791871891, -0.006563709212794435, 0), (0.10508432639162332, -0.08760580592192826, 0.9905970457839073, 0), (0.7292740799489162, -0.6704363547040477, -0.13665434718959418, 0), (1.9141796583992525, -7.836279641819183, 118.89512152529116, 1) ), ( (-0.07152106325935147, 0.033612342939182416, 0.9968725835896031, 0), (-0.9648527349194759, -0.25570806170269944, -0.060601873722329516, 0), (0.25287138515191965, -0.9661695490866956, 0.05071947346889198, 0), (6.423422958372391, -6.2765464395025985, 119.2810522763062, 1) ), ( (-3.294367333847379, 0.580885845318013, 0, 0), (0.5808858453205927, 3.2943673337593746, 0, 0), (0, 0, 3.3451882612197332, 0), (-3.3285450935363787, -4.5856332778930655, 119.30845642089824, 1) ), ( (0.9496822547804394, -0.07666815161585439, -0.30368669625614053, 0), (0.31204723236833076, 0.3152404370383419, 0.8962421501063857, 0), (0.027021097801637268, -0.9459098590160078, 0.3233023335671022, 0), (-3.3745289080529863, -8.119671010552558, 120.28007960611991, 1) ), ( (0.06326810282124576, -0.27611107313753214, -0.9590410952907301, 0), (0.7303024355534905, -0.6421408169736156, 0.23305262024081516, 0), (-0.6801878415133906, -0.7151348448267852, 0.16101755796164, 0), (-5.837619812988426, -7.032554366623163, 120.29186519983021, 1) ), ( (0.28018502818227986, 0.736161744912941, -0.6160862239243082, 0), (0.8919509338580828, -0.436892140964481, -0.11639926440132252, 0), (-0.354851914977235, -0.5169053515896487, -0.7790307926745289, 0), (-4.599987901157871, -7.961979193740791, 119.11788327216917, 1) ), ( (-0.40707718309116786, 0.8870989694867334, -0.21758581144492387, 0), (0.913277020614965, 0.3991163063460653, -0.08143253419443641, 0), (0.014603328210630116, -0.23186544823633046, -0.9726382455566647, 0), (-2.8434608110269197, -8.033825317835543, 118.95671164409079, 1) ), ( (0.5526477076976287, 0.7028593304147432, -0.44784960960744363, 0), (0.7512689709515014, -0.6527702680252921, -0.09739563885340595, 0), (-0.3607983432082545, -0.28263003879870374, -0.8887883981617876, 0), (-5.613008637821342, -7.12150822249089, 119.18769487674209, 1) ), ( (-0.9663418707344236, -0.12072172321150339, -0.22717758342396166, 0), (0.23816357058594814, -0.08591199595908947, -0.9674178221411284, 0), (0.0972710669252766, -0.988961772454967, 0.11177187554099384, 0), (-2.7832579004676408, -8.12343734445702, 118.26511515939218, 1) ), ( (-0.5711583388668012, 0.7245182759138361, 0.3858126745064133, 0), (-0.450440360001614, 0.11628305484145804, -0.8852015212585931, 0), (-0.686208156406664, -0.6793758304422031, 0.2599362365888014, 0), (-6.298886752031013, -6.754249612112853, 118.67749376730083, 1) ), ( (0.881240796114956, -0.4648225864563086, -0.08575909504389637, 0), (0.4478887452665885, 0.7632095225757606, 0.4657326448867938, 0), (-0.15103089460841884, -0.4488331402311216, 0.880760172296762, 0), (-4.6100565185226525, -7.9070440426746496, 118.7617511284889, 1) ), ( (-0.9909879670736875, -0.13385827914167062, 0.004980985885401168, 0), (0.10957462381514917, -0.8314765083947439, -0.5446468744090244, 0), (0.07704706610062999, -0.5391927091889561, 0.8386506853052192, 0), (-2.8908812554748424, -8.038246927105135, 118.73928267004929, 1) ), ( (0.7620932116121756, 0.5981882054431996, 0.24775957637051643, 0), (-0.6444950056562452, 0.737481729202912, 0.2018585811305732, 0), (-0.061968738408494456, -0.3135148639595458, 0.9475591303642665, 0), (-5.766190973918513, -7.073487875411675, 118.942414996667, 1) ), ( (-0.6761047775044041, 0.7367760743582349, -0.006583774676358081, 0), (0.10510830306697945, 0.0876010695147079, -0.9905949208664839, 0), (-0.7292698913720412, -0.6704379679533604, -0.13666878452954923, 0), (-1.9141796916479166, -7.836279663251395, 118.8951198273395, 1) ), ( (0.9648510732296488, -0.25571235044111407, -0.06061023279510291, 0), (0.07152911203446644, 0.033609208697259106, 0.9968721117688688, 0), (-0.25287544882638635, -0.9661685230448291, 0.050718758445254454, 0), (-6.423423024521913, -6.276546788643873, 119.28105544141073, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999810244, 0, 0), (0, 0, 1.0000000001986282, 0), (0, -11.712834358193557, 115.72798919687062, 1) ), ( (0.9999999998912805, -0.000005217275513842339, -0.000013791994991364425, 0), (0.00000889845244842374, -0.5323061230375036, 0.846551942468835, 0), (-0.000011758258103442888, -0.8465519424994324, -0.5323061229332643, 0), (2.6856988855072927e-14, -8.131153953981457, 108.17131616286895, 1) ), ( (-0.12171535735507574, 0.5730761434449859, -0.8104129228968976, 0), (0.7969969808754539, 0.54307153322659, 0.2643276797354894, 0), (0.5915920758927709, -0.6137239148133687, -0.5228401018735034, 0), (2.3141851283116175, -7.191728473985052, 108.61019913178359, 1) ), ( (-0.7970838502266654, 0.5429499502601859, 0.26431550696149453, 0), (0.12154756197471492, 0.5729984462797449, -0.8104930417586235, 0), (-0.5915095315255857, -0.613904008843537, -0.5227220504630323, 0), (-2.3132236553304697, -7.1925545162095, 108.61008212613707, 1) ), ( (0.7988820129059706, 0.5602782885891936, 0.2188053216694687, 0), (0.06278198672517436, -0.4394590969220349, 0.896065915139889, 0), (0.5982022664602207, -0.7021139091828578, -0.386251352015568, 0), (5.2352675368358685, -7.66855326609351, 112.85124735920554, 1) ), ( (-0.0627796715191902, -0.43946317504524524, 0.8960640772976407, 0), (-0.7988803767098623, 0.5602785496223711, 0.21881062712073926, 0), (-0.5982046945250856, -0.7021111483320889, -0.38625261013484097, 0), (-5.235266763461781, -7.668553282147502, 112.85124498246431, 1) ), ( (0.9999999999991189, 0, 0, 0), (0, 0.9999999999991186, 0, 0), (0, 0, 1.0000000001945182, 0), (9.10751318412261, 1.3637421542940094, 116.4868258306122, 1) ), ( (-0.9999999999991189, 0, 0, 0), (0, 0.9999999999991186, 0, 0), (0, 0, 1.0000000001945182, 0), (-9.10751318412261, 1.3637421542940094, 116.4868258306122, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999991186, 0, 0), (0, 0, 1.0000000001990976, 0), (0, 0.291871661086695, 111.25013417378983, 1) ), ( (0.000007307800311821259, 0.1827182522748383, -0.9831653168376303, 0), (0.9999999999644404, 0.0000028028514284897526, 0.00000795383267983529, 0), (0.000004208976718885465, -0.983165316860686, -0.1827182522478783, 0), (-1.6497952507500377e-9, -10.610579173123828, 112.23374155054012, 1) ), ( (0.8880742243448193, 0.44870109902967514, -0.09995746987549975, 0), (0.1955373965222982, -0.17192291478838134, 0.9655090045836723, 0), (0.4160399719038307, -0.8769890837659042, -0.24041815391877694, 0), (1.0746527675849524, -10.31260589301317, 112.14622176199212, 1) ), ( (-0.19553814756768118, -0.17192438983998548, 0.9655085898241164, 0), (-0.8880744310530598, 0.4487006521074454, -0.09995763956866845, 0), (-0.4160391776766895, -0.876989023261299, -0.24041974901681815, 0), (-1.0746526763148654, -10.31260609439694, 112.14622315150315, 1) ), ( (0.9798734345018166, 0.1805391619186067, -0.08516844117009073, 0), (0.14107654486423887, -0.3244579682993025, 0.9353204987042946, 0), (0.14122839957608468, -0.9285109788369761, -0.34339758492511924, 0), (2.626581109249555, -8.436833805224747, 111.19235176905536, 1) ), ( (-0.13490990106765235, -0.332579181407983, 0.9333758121400536, 0), (-0.9812251038396792, 0.17587233769233976, -0.07915943676810763, 0), (-0.13782820534548795, -0.9265311699714232, -0.35006196149061247, 0), (-2.626260059401881, -8.43722274173243, 111.19326515530139, 1) ), ( (-0.9999999999218181, 0.000004163021974505354, 0.000011791231807576609, 0), (-0.0000069654557832628825, 0.5976668439048566, -0.8017445625936183, 0), (-0.000010384908532201138, -0.8017445626129794, -0.5976668438291983, 0), (-2.4286129490855912e-17, -9.542433885996765, 110.08228782978638, 1) ), ( (-0.9507591822032494, -0.2567401557793293, -0.17361298876126902, 0), (-0.0066635257455310475, 0.5769710733796518, -0.8167373983771761, 0), (0.309858959368365, -0.7753637063354387, -0.550271340519377, 0), (0.9229703850172619, -9.423012480338326, 110.16571665342546, 1) ), ( (0.006688000824810549, 0.5771069610109623, -0.8166411857099825, 0), (0.9507548669874752, -0.2567350828384922, -0.17364411921959053, 0), (-0.30987167240278585, -0.7752642498835393, -0.5504042963993659, 0), (-0.9230282571018357, -9.422934818461542, 110.1656401958396, 1) ), ( (0.999999999980914, 0, 0, 0), (0, 0.9999999999761426, 0, 0), (0, 0, 1.0000000002603602, 0), (1.7621619701925706, -8.9240894317504, 122.24875640871986, 1) ), ( (-0.999999999980914, 0, 0, 0), (0, 0.9999999999761426, 0, 0), (0, 0, 1.0000000002603602, 0), (-1.7621619701925706, -8.9240894317504, 122.24875640871986, 1) ), ( (0, 0, -1.0000000002987688, 0), (0, 1.0000000000189924, 0, 0), (0.9999999999810244, 0, 0, 0), (1.060518026351934, 2.1162056028842935, 97.96696090698222, 1) ), ( (0, 0, -1.0000000003319653, 0), (0, 1.000000000021103, 0, 0), (0.9999999999695919, 0, 0, 0), (9.672762393955217, 2.116205602884292, 97.96696090698224, 1) ), ( (0, 0, -1.0000000003983585, 0), (0, 1.0000000000253235, 0, 0), (0.9999999999579389, 0, 0, 0), (29.752457618900586, 2.11620560288429, 97.96696090698221, 1) ), ( (0, 1.0000000000295444, 0, 0), (0, 0, 1.0000000004647516, 0), (1.000000000157118, 0, 0, 0), (47.25210366853135, 2.1162056028842917, 97.96696090698215, 1) ), ( (0.6469816968615829, 0.28689014718941197, 0.7064762753800633, 0), (-0.4366893038386571, -0.6201162147167723, 0.6517348636274203, 0), (0.6250737046496754, -0.7301711605461514, -0.2759219822824667, 0), (50.27465556544702, 0.14089363334763094, 96.02621065748237, 1) ), ( (0.6469816968416056, 0.28689014719251, 0.7064762753587976, 0), (-0.43668930384654164, -0.6201162147154108, 0.6517348636381455, 0), (0.6250737046643834, -0.7301711605491771, -0.27592198228895903, 0), (51.543466664168314, -1.3412504171226742, 95.46612810898255, 0.9999999999999998) ), ( (0.6469816968222506, 0.2868901471901627, 0.7064762753372573, 0), (-0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (0.6250737046753021, -0.7301711605486086, -0.27592198243588745, 0), (52.70991897610777, -2.7038254734429046, 94.95122909493831, 0.9999999999999998) ), ( (0.6469816968222505, 0.28689014719016265, 0.7064762753372572, 0), (-0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (0.6250737046753021, -0.7301711605486086, -0.2759219824358874, 0), (53.960066385458354, -4.164167794540128, 94.39938513006652, 0.9999999999999996) ), ( (0.026176948271215503, 0.9996573249790067, 0, 0), (0, 0, 1.0000000002985485, 0), (0.9996573251629468, -0.026176948315707393, 0, 0), (54.3337440490717, -0.10787993670835805, 97.77806854248027, 1) ), ( (0.026167978075956444, 0.9993147673812869, 0.026176948328973652, 0), (-0.0006852326084623752, -0.02616797812294237, 0.9996573253232738, 0), (0.9996573253424612, -0.02617694832038239, 0, 0), (57.22994516142766, -0.18371963189422358, 97.7780685424803, 1) ), ( (0.026167978075957183, 0.9993147673813153, 0.02617694832897439, 0), (-0.0006852326084851222, -0.026167978123811046, 0.9996573253564588, 0), (0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (59.081010459248624, -0.23219148260777983, 97.7780685424803, 1) ), ( (0.02616797807595718, 0.9993147673813152, 0.026176948328974395, 0), (-0.000685232608485122, -0.026167978123811043, 0.9996573253564588, 0), (0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (61.08032510985742, -0.28454537924655066, 97.77806854248028, 1) ), ( (0, 1.0000000000010085, 0, 0), (0, 0, 1.0000000002987688, 0), (1.000000000294108, 0, 0, 0), (54.459676742553725, 1.5434340834617615, 97.96659851074199, 1) ), ( (0, 1.0000000000008984, 0, 0), (0, 0, 1.0000000003319653, 0), (1.0000000003315253, 0, 0, 0), (57.52327346781421, 1.543434083461762, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (1.0000000003689422, 0, 0, 0), (59.66699981675222, 1.5434340834617606, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (1.0000000003689422, 0, 0, 0), (61.6669998174901, 1.5434340834617608, 97.966598510742, 1) ), ( (-0.026176948271238346, 0.9996573249825574, 0, 0), (0, 0, 1.0000000002985485, 0), (0.999657325233953, 0.02617694831550867, 0, 0), (54.27372932434039, 3.1630603075159023, 97.81296539306622, 1) ), ( (-0.026167978146851577, 0.9993147673769568, -0.026176948329079006, 0), (-0.0006852326794135409, 0.02616797811814479, 0.9996573253232738, 0), (0.9996573252715901, 0.02617694831205334, 0, 0), (57.22904560946365, 3.2404479879727757, 97.81296539306625, 1) ), ( (-0.026167978146906794, 0.9993147673790654, -0.026176948329134246, 0), (-0.0006852326794362879, 0.02616797811901347, 0.999657325356459, 0), (0.9996573253045551, 0.026176948312916563, -9.081953359177041e-20, 0), (59.16203777941859, 3.2910651693221595, 97.81296539306624, 1) ), ( (-0.026167978146906797, 0.9993147673790657, -0.026176948329134257, 0), (-0.0006852326794362879, 0.02616797811901348, 0.9996573253564592, 0), (0.9996573253045553, 0.02617694831291657, -1.9920259798102258e-19, 0), (61.161352430027705, 3.3434190659479945, 97.81296539306629, 1.0000000000000002) ), ( (-0.05233595631041936, 0.9986295347329014, 0, 0), (0, 0, 1.000000000440657, 0), (0.9986295349162576, 0.0523359562457286, 0, 0), (53.77282524108701, 4.6762771606690485, 97.57617950439432, 1) ), ( (-0.052264231692480984, 0.9972609476656457, -0.052335956306147166, 0), (-0.0027390523415361345, 0.05226423163090791, 0.9986295352032881, 0), (0.998629534952695, 0.05233595625651998, 0, 0), (56.21677697260339, 4.8043592435936375, 97.5761795043943, 1) ), ( (-0.05226423169235918, 0.9972609476633214, -0.0523359563060252, 0), (-0.002739052341627062, 0.05226423163264291, 0.9986295352364392, 0), (0.9986295349856261, 0.05233595625824583, 4.330865246302378e-19, 0), (57.77703466957045, 4.886128884605941, 97.57617950439432, 1.0000000000000002) ), ( (-0.05226423169235917, 0.9972609476633213, -0.05233595630602519, 0), (-0.002739052341627062, 0.052264231632642905, 0.998629535236439, 0), (0.9986295349856259, 0.05233595625824582, 8.661730492748525e-19, 0), (59.774293739541676, 4.99080079712243, 97.57617950439429, 1) ), ( (0, 0, -1.0000000002987688, 0), (0, 1.0000000000189924, 0, 0), (-0.9999999999810244, 0, 0, 0), (-1.060518026351934, 2.1162056028842935, 97.96696090698222, 1) ), ( (0, 0, -1.0000000003319653, 0), (0, 1.000000000021103, 0, 0), (-0.9999999999695919, 0, 0, 0), (-9.672762393955217, 2.116205602884292, 97.96696090698224, 1) ), ( (0, 0, -1.0000000003983585, 0), (0, 1.0000000000253235, 0, 0), (-0.9999999999579389, 0, 0, 0), (-29.752457618900586, 2.11620560288429, 97.96696090698221, 1) ), ( (0, 1.0000000000295444, 0, 0), (0, 0, 1.0000000004647516, 0), (-1.000000000157118, 0, 0, 0), (-47.25210366853135, 2.1162056028842917, 97.96696090698215, 1) ), ( (-0.6469816968615829, 0.28689014718941197, 0.7064762753800633, 0), (0.4366893038386571, -0.6201162147167723, 0.6517348636274203, 0), (-0.6250737046496754, -0.7301711605461514, -0.2759219822824667, 0), (-50.27465556544702, 0.14089363334763094, 96.02621065748237, 1) ), ( (-0.6469816968416056, 0.28689014719251, 0.7064762753587976, 0), (0.43668930384654164, -0.6201162147154108, 0.6517348636381455, 0), (-0.6250737046643834, -0.7301711605491771, -0.27592198228895903, 0), (-51.543466664168314, -1.3412504171226742, 95.46612810898255, 0.9999999999999998) ), ( (-0.6469816968222506, 0.2868901471901627, 0.7064762753372573, 0), (0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (-0.6250737046753021, -0.7301711605486086, -0.27592198243588745, 0), (-52.70991897610777, -2.7038254734429046, 94.95122909493831, 0.9999999999999998) ), ( (-0.6469816968222505, 0.28689014719016265, 0.7064762753372572, 0), (0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (-0.6250737046753021, -0.7301711605486086, -0.2759219824358874, 0), (-53.960066385458354, -4.164167794540128, 94.39938513006652, 0.9999999999999996) ), ( (-0.026176948271215503, 0.9996573249790067, 0, 0), (0, 0, 1.0000000002985485, 0), (-0.9996573251629468, -0.026176948315707393, 0, 0), (-54.3337440490717, -0.10787993670835805, 97.77806854248027, 1) ), ( (-0.026167978075956444, 0.9993147673812869, 0.026176948328973652, 0), (0.0006852326084623752, -0.02616797812294237, 0.9996573253232738, 0), (-0.9996573253424612, -0.02617694832038239, 0, 0), (-57.22994516142766, -0.18371963189422358, 97.7780685424803, 1) ), ( (-0.026167978075957183, 0.9993147673813153, 0.02617694832897439, 0), (0.0006852326084851222, -0.026167978123811046, 0.9996573253564588, 0), (-0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (-59.081010459248624, -0.23219148260777983, 97.7780685424803, 1) ), ( (-0.02616797807595718, 0.9993147673813152, 0.026176948328974395, 0), (0.000685232608485122, -0.026167978123811043, 0.9996573253564588, 0), (-0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (-61.08032510985742, -0.28454537924655066, 97.77806854248028, 1) ), ( (0, 1.0000000000010085, 0, 0), (0, 0, 1.0000000002987688, 0), (-1.000000000294108, 0, 0, 0), (-54.459676742553725, 1.5434340834617615, 97.96659851074199, 1) ), ( (0, 1.0000000000008984, 0, 0), (0, 0, 1.0000000003319653, 0), (-1.0000000003315253, 0, 0, 0), (-57.52327346781421, 1.543434083461762, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (-1.0000000003689422, 0, 0, 0), (-59.66699981675222, 1.5434340834617606, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (-1.0000000003689422, 0, 0, 0), (-61.6669998174901, 1.5434340834617608, 97.966598510742, 1) ), ( (0.026176948271238346, 0.9996573249825574, 0, 0), (0, 0, 1.0000000002985485, 0), (-0.999657325233953, 0.02617694831550867, 0, 0), (-54.27372932434039, 3.1630603075159023, 97.81296539306622, 1) ), ( (0.026167978146851577, 0.9993147673769568, -0.026176948329079006, 0), (0.0006852326794135409, 0.02616797811814479, 0.9996573253232738, 0), (-0.9996573252715901, 0.02617694831205334, 0, 0), (-57.22904560946365, 3.2404479879727757, 97.81296539306625, 1) ), ( (0.026167978146906794, 0.9993147673790654, -0.026176948329134246, 0), (0.0006852326794362879, 0.02616797811901347, 0.999657325356459, 0), (-0.9996573253045551, 0.026176948312916563, -9.081953359177041e-20, 0), (-59.16203777941859, 3.2910651693221595, 97.81296539306624, 1) ), ( (0.026167978146906797, 0.9993147673790657, -0.026176948329134257, 0), (0.0006852326794362879, 0.02616797811901348, 0.9996573253564592, 0), (-0.9996573253045553, 0.02617694831291657, -1.9920259798102258e-19, 0), (-61.161352430027705, 3.3434190659479945, 97.81296539306629, 1.0000000000000002) ), ( (0.05233595631041936, 0.9986295347329014, 0, 0), (0, 0, 1.000000000440657, 0), (-0.9986295349162576, 0.0523359562457286, 0, 0), (-53.77282524108701, 4.6762771606690485, 97.57617950439432, 1) ), ( (0.052264231692480984, 0.9972609476656457, -0.052335956306147166, 0), (0.0027390523415361345, 0.05226423163090791, 0.9986295352032881, 0), (-0.998629534952695, 0.05233595625651998, 0, 0), (-56.21677697260339, 4.8043592435936375, 97.5761795043943, 1) ), ( (0.05226423169235918, 0.9972609476633214, -0.0523359563060252, 0), (0.002739052341627062, 0.05226423163264291, 0.9986295352364392, 0), (-0.9986295349856261, 0.05233595625824583, 4.330865246302378e-19, 0), (-57.77703466957045, 4.886128884605941, 97.57617950439432, 1.0000000000000002) ), ( (0.05226423169235917, 0.9972609476633213, -0.05233595630602519, 0), (0.002739052341627062, 0.052264231632642905, 0.998629535236439, 0), (-0.9986295349856259, 0.05233595625824582, 8.661730492748525e-19, 0), (-59.774293739541676, 4.99080079712243, 97.57617950439429, 1) ), ( (0.9999999999790243, 0, 0, 0), (0, -0.9999999999990085, 0, 0), (0, 0, -1.000000000298769, 0), (4.230487048625947, 1.3654502630233762, 65.01936531066877, 1) ), ( (0.9999999999766939, 0, 0, 0), (0, -0.9999999999988985, 0, 0), (0, 0, -1.0000000003273044, 0), (4.230487048625946, 1.3654502630233945, 33.39325141171807, 1) ), ( (0.9999999999697025, 0, 0, 0), (0, -0.9999999999985683, 0, 0), (0, 0, -1.000000000204409, 0), (4.230487048625945, 1.3654502630234238, 6.637357460981253, 1) ), ( (0.9999999999603801, 0, 0, 0), (0, 0, 1.000000000217071, 0), (0, -1.000000000006789, 0, 0), (4.230487048625945, -3.6891079745778153, 2.3969536624796044, 1.0000000000000002) ), ( (-0.999999999972033, 0, 0, 0), (0, 0, 1.0000000001228027, 0), (0, 0.9999999999808046, 0, 0), (4.230487048625946, -16.043196972408186, -1.473434431453445, 1.0000000000000002) ), ( (-0.9999999999790243, 0, 0, 0), (0, -0.9999999999990085, 0, 0), (0, 0, -1.000000000298769, 0), (-4.230487048625947, 1.3654502630233762, 65.01936531066877, 1) ), ( (-0.9999999999766939, 0, 0, 0), (0, -0.9999999999988985, 0, 0), (0, 0, -1.0000000003273044, 0), (-4.230487048625946, 1.3654502630233945, 33.39325141171807, 1) ), ( (-0.9999999999697025, 0, 0, 0), (0, -0.9999999999985683, 0, 0), (0, 0, -1.000000000204409, 0), (-4.230487048625945, 1.3654502630234238, 6.637357460981253, 1) ), ( (-0.9999999999603801, 0, 0, 0), (0, 0, 1.000000000217071, 0), (0, -1.000000000006789, 0, 0), (-4.230487048625945, -3.6891079745778153, 2.3969536624796044, 1.0000000000000002) ), ( (0.999999999972033, 0, 0, 0), (0, 0, 1.0000000001228027, 0), (0, 0.9999999999808046, 0, 0), (-4.230487048625946, -16.043196972408186, -1.473434431453445, 1.0000000000000002) )]
24
+ uniform token[] jointNames = ["Hips", "Torso", "Chest", "UpChest", "Neck", "Head", "LEye", "LUpLidInner", "LUpLidOuter", "LUpLidTip", "LUpLidTipInner", "LUpLidTipOuter", "LLoLidInner", "LLoLidOuter", "LLoLidTip", "LLoLidTipInner", "LLoLidTipOuter", "LLidInnerCorner", "LLidOuterCorner", "REye", "RUpLidInner", "RUpLidOuter", "RUpLidTip", "RUpLidTipInner", "RUpLidTipOuter", "RLoLidInner", "RLoLidOuter", "RLoLidTip", "RLoLidTipInner", "RLoLidTipOuter", "RLidInnerCorner", "RLidOuterCorner", "Nose", "Chin", "LChin", "RChin", "LCheek", "RCheek", "LEar", "REar", "Mouth", "UpLip", "LUpLip", "RUpLip", "LLipCorner", "RLipCorner", "LoLip", "LLoLip", "RLoLip", "LBrow", "RBrow", "LShldr", "LArm", "LElbow", "LHand", "LThumb", "LThumbMid", "LThumbTip", "LThumbEnd", "LIndex", "LIndexMid", "LIndexTip", "LIndexEnd", "LMiddle", "LMiddleMid", "LMiddleTip", "LMiddleEnd", "LRing", "LRingMid", "LRingTip", "LRingEnd", "LPinky", "LPinkyMid", "LPinkyTip", "LPinkyEnd", "RShldr", "RArm", "RElbow", "RHand", "RThumb", "RThumbMid", "RThumbTip", "RThumbEnd", "RIndex", "RIndexMid", "RIndexTip", "RIndexEnd", "RMiddle", "RMiddleMid", "RMiddleTip", "RMiddleEnd", "RRing", "RRingMid", "RRingTip", "RRingEnd", "RPinky", "RPinkyMid", "RPinkyTip", "RPinkyEnd", "LLeg", "LKnee", "LFoot", "LToes", "LTip", "RLeg", "RKnee", "RFoot", "RToes", "RTip"]
25
+ uniform token[] joints = ["Hips", "Hips/Torso", "Hips/Torso/Chest", "Hips/Torso/Chest/UpChest", "Hips/Torso/Chest/UpChest/Neck", "Hips/Torso/Chest/UpChest/Neck/Head", "Hips/Torso/Chest/UpChest/Neck/Head/LEye", "Hips/Torso/Chest/UpChest/Neck/Head/LUpLidInner", "Hips/Torso/Chest/UpChest/Neck/Head/LUpLidOuter", "Hips/Torso/Chest/UpChest/Neck/Head/LUpLidTip", "Hips/Torso/Chest/UpChest/Neck/Head/LUpLidTipInner", "Hips/Torso/Chest/UpChest/Neck/Head/LUpLidTipOuter", "Hips/Torso/Chest/UpChest/Neck/Head/LLoLidInner", "Hips/Torso/Chest/UpChest/Neck/Head/LLoLidOuter", "Hips/Torso/Chest/UpChest/Neck/Head/LLoLidTip", "Hips/Torso/Chest/UpChest/Neck/Head/LLoLidTipInner", "Hips/Torso/Chest/UpChest/Neck/Head/LLoLidTipOuter", "Hips/Torso/Chest/UpChest/Neck/Head/LLidInnerCorner", "Hips/Torso/Chest/UpChest/Neck/Head/LLidOuterCorner", "Hips/Torso/Chest/UpChest/Neck/Head/REye", "Hips/Torso/Chest/UpChest/Neck/Head/RUpLidInner", "Hips/Torso/Chest/UpChest/Neck/Head/RUpLidOuter", "Hips/Torso/Chest/UpChest/Neck/Head/RUpLidTip", "Hips/Torso/Chest/UpChest/Neck/Head/RUpLidTipInner", "Hips/Torso/Chest/UpChest/Neck/Head/RUpLidTipOuter", "Hips/Torso/Chest/UpChest/Neck/Head/RLoLidInner", "Hips/Torso/Chest/UpChest/Neck/Head/RLoLidOuter", "Hips/Torso/Chest/UpChest/Neck/Head/RLoLidTip", "Hips/Torso/Chest/UpChest/Neck/Head/RLoLidTipInner", "Hips/Torso/Chest/UpChest/Neck/Head/RLoLidTipOuter", "Hips/Torso/Chest/UpChest/Neck/Head/RLidInnerCorner", "Hips/Torso/Chest/UpChest/Neck/Head/RLidOuterCorner", "Hips/Torso/Chest/UpChest/Neck/Head/Nose", "Hips/Torso/Chest/UpChest/Neck/Head/Chin", "Hips/Torso/Chest/UpChest/Neck/Head/LChin", "Hips/Torso/Chest/UpChest/Neck/Head/RChin", "Hips/Torso/Chest/UpChest/Neck/Head/LCheek", "Hips/Torso/Chest/UpChest/Neck/Head/RCheek", "Hips/Torso/Chest/UpChest/Neck/Head/LEar", "Hips/Torso/Chest/UpChest/Neck/Head/REar", "Hips/Torso/Chest/UpChest/Neck/Head/Mouth", "Hips/Torso/Chest/UpChest/Neck/Head/UpLip", "Hips/Torso/Chest/UpChest/Neck/Head/LUpLip", "Hips/Torso/Chest/UpChest/Neck/Head/RUpLip", "Hips/Torso/Chest/UpChest/Neck/Head/LLipCorner", "Hips/Torso/Chest/UpChest/Neck/Head/RLipCorner", "Hips/Torso/Chest/UpChest/Neck/Head/LoLip", "Hips/Torso/Chest/UpChest/Neck/Head/LLoLip", "Hips/Torso/Chest/UpChest/Neck/Head/RLoLip", "Hips/Torso/Chest/UpChest/Neck/Head/LBrow", "Hips/Torso/Chest/UpChest/Neck/Head/RBrow", "Hips/Torso/Chest/UpChest/LShldr", "Hips/Torso/Chest/UpChest/LShldr/LArm", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb/LThumbMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb/LThumbMid/LThumbTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb/LThumbMid/LThumbTip/LThumbEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex/LIndexMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex/LIndexMid/LIndexTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex/LIndexMid/LIndexTip/LIndexEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle/LMiddleMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle/LMiddleMid/LMiddleTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle/LMiddleMid/LMiddleTip/LMiddleEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing/LRingMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing/LRingMid/LRingTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing/LRingMid/LRingTip/LRingEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky/LPinkyMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky/LPinkyMid/LPinkyTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky/LPinkyMid/LPinkyTip/LPinkyEnd", "Hips/Torso/Chest/UpChest/RShldr", "Hips/Torso/Chest/UpChest/RShldr/RArm", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb/RThumbMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb/RThumbMid/RThumbTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb/RThumbMid/RThumbTip/RThumbEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex/RIndexMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex/RIndexMid/RIndexTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex/RIndexMid/RIndexTip/RIndexEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle/RMiddleMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle/RMiddleMid/RMiddleTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle/RMiddleMid/RMiddleTip/RMiddleEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing/RRingMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing/RRingMid/RRingTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing/RRingMid/RRingTip/RRingEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky/RPinkyMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky/RPinkyMid/RPinkyTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky/RPinkyMid/RPinkyTip/RPinkyEnd", "Hips/LLeg", "Hips/LLeg/LKnee", "Hips/LLeg/LKnee/LFoot", "Hips/LLeg/LKnee/LFoot/LToes", "Hips/LLeg/LKnee/LFoot/LToes/LTip", "Hips/RLeg", "Hips/RLeg/RKnee", "Hips/RLeg/RKnee/RFoot", "Hips/RLeg/RKnee/RFoot/RToes", "Hips/RLeg/RKnee/RFoot/RToes/RTip"]
26
+ uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491195, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, -1.4210854715202004e-14, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000004, 0, 0), (0, 0, 1.000000000030866, 0), (0, -6.505213034913027e-19, 12.465595241636976, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000004, 0, 0), (0, 0, 1.000000000030866, 0), (0, 2.168404344971009e-19, 6.706321714941211, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999993382, 0, 0), (0, 0, 1.000000000097259, 0), (0, 0.7721412181854214, 10.346576688353423, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000002, 0, 0), (0, 0, 0.9999999999976695, 0), (0, -2.220446049250313e-16, 10.646293634934665, 1) ), ( (3.294367333847379, 0.5808858453183953, 0, 0), (-0.5808858453205927, 3.2943673337615422, 0, 0), (0, 0, 3.3451882600293827, 0), (3.3285450935363787, -5.3564672470128, 8.152614592680635, 1) ), ( (-0.3139689701404085, 0.33297616224314774, 0.8891289898572076, 0), (-0.9491096445815721, -0.08561226979145832, -0.30308649220651607, 0), (-0.024800226052423505, -0.939040653707374, 0.3429104830565529, 0), (3.3800594973152327, -8.921871983748554, 9.124237817538884, 1) ), ( (-0.7299084179793295, -0.6425748414790229, 0.23309069999253546, 0), (-0.06310506920123528, -0.2762000034419776, -0.9590262288829792, 0), (0.6806257793806073, -0.714710522532565, 0.1610509776623161, 0), (5.8376254144043855, -7.8034201838759145, 9.136025051351325, 1) ), ( (-0.9088988801386423, -0.4026306248884093, -0.10858823866568183, 0), (-0.2802086261715577, 0.7825034111807727, -0.5560319568966753, 0), (0.30884616154290373, -0.47494946193905213, -0.8240370480877723, 0), (4.605607916693468, -8.739217433261807, 7.957080093048205, 1) ), ( (-0.9292994790720599, 0.3619498488394005, -0.07344920093416692, 0), (0.3692997510308916, 0.9082511195738208, -0.1967170497312748, 0), (-0.004491387435702873, -0.2099338235330897, -0.9777052810001843, 0), (2.847422928271013, -8.827129727778315, 7.800870866641802, 1) ), ( (-0.7252617924239311, -0.6838795377722451, -0.07939842733063174, 0), (-0.535623335774552, 0.6329362683867209, -0.559016388053724, 0), (0.43255401353330236, -0.3629055772214442, -0.8253463314956528, 0), (5.639872500024073, -7.928267032284199, 8.057032810400187, 1) ), ( (0.21351491275939466, -0.05288342925349152, 0.9755074188660525, 0), (-0.9647331623325851, 0.14594169213918062, 0.21906836366122587, 0), (-0.1539522897696568, -0.9878787199890822, -0.0198576702665798, 0), (2.9285657330211965, -8.939625905467262, 7.080138229347469, 1) ), ( (0.3705140301465095, 0.08461370943138372, -0.9249647955636834, 0), (0.6423537211402113, 0.6959583736333927, 0.3209729568580929, 0), (0.6708957075337832, -0.7130795624216931, 0.20351041064386424, 0), (6.140745897338191, -7.718174998067857, 7.407782997145432, 1) ), ( (-0.42261357561429486, 0.8012360478139889, 0.4235782823317505, 0), (-0.8992704270822215, -0.42885358383985017, -0.08600757291108266, 0), (0.11274069665338064, -0.4172593909217928, 0.9017672290715422, 0), (4.6140593978110145, -8.700565240665853, 7.605971684471186, 1) ), ( (-0.10646319848942101, -0.8687275885537986, -0.48371268754027086, 0), (0.9918834017222834, -0.1268013229804443, 0.00942029077037947, 0), (-0.06951907523164423, -0.4787836718581895, 0.8751761498100245, 0), (2.8952091080067577, -8.833623432702923, 7.583443895379062, 1) ), ( (-0.7628269228948914, 0.5974270122770517, 0.24733792807689756, 0), (-0.6435746108535019, -0.7384879248814683, -0.20111515368307686, 0), (0.06250444788366277, -0.31259646475440095, 0.9478273279341443, 0), (5.76621513604476, -7.844458521448486, 7.786573166999972, 1) ), ( (0.6761039865739371, 0.7367769791876739, -0.0065637092104588075, 0), (0.10508432639162332, -0.08760580592198591, 0.9905970454314137, 0), (0.7292740799489162, -0.6704363547044889, -0.13665434714096716, 0), (1.9141796583992525, -8.607113610941056, 7.739279697220638, 1) ), ( (-0.07152106325935147, 0.03361234293920454, 0.9968725832348764, 0), (-0.9648527349194759, -0.2557080617028677, -0.060601873700764974, 0), (0.25287138515191965, -0.9661695490873313, 0.05071947345084399, 0), (6.423422958372391, -7.047380408623446, 8.125210448098343, 1) ), ( (-3.294367333847379, 0.5808858453183953, 0, 0), (0.5808858453205927, 3.2943673337615422, 0, 0), (0, 0, 3.3451882600293827, 0), (-3.3285450935363787, -5.3564672470128, 8.152614592680635, 1) ), ( (0.9496822547804394, -0.07666815161590483, -0.3036866961480768, 0), (0.31204723236833076, 0.31524043703854937, 0.8962421497874673, 0), (0.027021097801637268, -0.9459098590166302, 0.32330233345205844, 0), (-3.3745289080529863, -8.890504979674617, 9.124237777556559, 1) ), ( (0.06326810282124576, -0.2761110731377138, -0.9590410949494653, 0), (0.7303024355534905, -0.6421408169740381, 0.2330526201578858, 0), (-0.6801878415133906, -0.7151348448272559, 0.16101755790434358, 0), (-5.837619812988426, -7.803388335744508, 9.136023371262667, 1) ), ( (0.28018502818227986, 0.7361617449134253, -0.6160862237050804, 0), (0.8919509338580828, -0.43689214096476847, -0.11639926435990305, 0), (-0.354851914977235, -0.5169053515899888, -0.7790307923973189, 0), (-4.599987901157871, -8.732813162862747, 7.962041444019377, 1) ), ( (-0.40707718309116786, 0.8870989694873171, -0.21758581136749822, 0), (0.913277020614965, 0.39911630634632794, -0.0814325341654595, 0), (0.014603328210630116, -0.23186544823648303, -0.9726382452105615, 0), (-2.8434608110269197, -8.804659286957548, 7.80086981599834, 1) ), ( (0.5526477076976287, 0.7028593304152058, -0.447849609448081, 0), (0.7512689709515014, -0.6527702680257217, -0.09739563881874873, 0), (-0.3607983432082545, -0.2826300387988897, -0.8887883978455214, 0), (-5.613008637821342, -7.892342191612293, 8.031853048567456, 1) ), ( (-0.9663418707344236, -0.12072172321158282, -0.22717758334312288, 0), (0.23816357058594814, -0.085911995959146, -0.9674178217968828, 0), (0.0972710669252766, -0.9889617724556178, 0.11177187550122099, 0), (-2.7832579004676408, -8.894271313579084, 7.109273331545836, 1) ), ( (-0.5711583388668012, 0.7245182759143128, 0.3858126743691259, 0), (-0.450440360001614, 0.11628305484153456, -0.8852015209436034, 0), (-0.686208156406664, -0.6793758304426502, 0.25993623649630576, 0), (-6.298886752031013, -7.525083581234014, 7.521651939307745, 1) ), ( (0.881240796114956, -0.46482258645661445, -0.08575909501337989, 0), (0.4478887452665885, 0.7632095225762628, 0.4657326447210677, 0), (-0.15103089460841884, -0.4488331402314169, 0.8807601719833527, 0), (-4.6100565185226525, -8.67787801179657, 7.605909300465825, 1) ), ( (-0.9909879670736875, -0.1338582791417587, 0.0049809858836287356, 0), (0.10957462381514917, -0.831476508395291, -0.5446468742152174, 0), (0.07704706610062999, -0.539192709189311, 0.8386506850067942, 0), (-2.8908812554748424, -8.809080896227142, 7.583440842034221, 1) ), ( (0.7620932116121756, 0.5981882054435932, 0.24775957628235376, 0), (-0.6444950056562452, 0.7374817292033973, 0.20185858105874394, 0), (-0.061968738408494456, -0.3135148639597521, 0.9475591300270875, 0), (-5.766190973918513, -7.844321844533047, 7.786573168579636, 1) ), ( (-0.6761047775044041, 0.7367760743587197, -0.006583774674015314, 0), (0.10510830306697945, 0.08760106951476555, -0.990594920513991, 0), (-0.7292698913720412, -0.6704379679538016, -0.13666878448091707, 0), (-1.9141796916479166, -8.607113632373268, 7.739277999268978, 1) ), ( (0.9648510732296488, -0.2557123504412823, -0.06061023277353539, 0), (0.07152911203446644, 0.03360920869728122, 0.9968721114141422, 0), (-0.25287544882638635, -0.9661685230454649, 0.05071875842720671, 0), (-6.423423024521913, -7.04738075776472, 8.125213613202874, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999816824, 0, 0), (0, 0, 0.9999999998427886, 0), (0, -12.48366832731798, 4.5721473699270945, 1) ), ( (0.9999999998912805, -0.000005217275513845772, -0.000013791994986456688, 0), (0.00000889845244842374, -0.5323061230378539, 0.8465519421675983, 0), (-0.000011758258103442888, -0.8465519424999896, -0.5323061227438487, 0), (2.6856988855072927e-14, -8.901987923103524, -2.984525661385632, 1) ), ( (-0.12171535735507574, 0.5730761434453631, -0.8104129226085206, 0), (0.7969969808754539, 0.5430715332269473, 0.2643276796414311, 0), (0.5915920758927709, -0.6137239148137726, -0.5228401016874562, 0), (2.3141851283116175, -7.962562443106502, -2.5456426926271547, 1) ), ( (-0.7970838502266654, 0.5429499502605432, 0.2643155068674406, 0), (0.12154756197471492, 0.572998446280122, -0.810493041470218, 0), (-0.5915095315255857, -0.613904008843941, -0.5227220502770271, 0), (-2.3132236553304697, -7.963388485330951, -2.5457596982736277, 1) ), ( (0.7988820129059706, 0.5602782885895623, 0.21880532159160912, 0), (0.06278198672517436, -0.43945909692232404, 0.8960659148210333, 0), (0.5982022664602207, -0.7021139091833197, -0.3862513518781245, 0), (5.2352675368358685, -8.439387235215273, 1.6954055332856655, 1) ), ( (-0.0627796715191902, -0.4394631750455344, 0.8960640769787857, 0), (-0.7988803767098623, 0.5602785496227398, 0.21881062704287776, 0), (-0.5982046945250856, -0.7021111483325508, -0.386252609997397, 0), (-5.235266763461781, -8.439387251269265, 1.6954031565444296, 1) ), ( (0.9999999999991189, 0, 0, 0), (0, 0.9999999999997766, 0, 0), (0, 0, 0.9999999998386786, 0), (9.10751318412261, 0.5929081851781894, 5.33098400339864, 1) ), ( (-0.9999999999991189, 0, 0, 0), (0, 0.9999999999997766, 0, 0), (0, 0, 0.9999999998386786, 0), (-9.10751318412261, 0.5929081851781894, 5.33098400339864, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999997766, 0, 0), (0, 0, 0.999999999843258, 0), (0, -0.47896230802983025, 0.09429234843969425, 1) ), ( (0.000007307800311821259, 0.18271825227495853, -0.9831653164877812, 0), (0.9999999999644404, 0.000002802851428491597, 0.000007953832677005002, 0), (0.000004208976718885465, -0.9831653168613329, -0.18271825218285992, 0), (-1.6497952507500377e-9, -11.381413142247528, 1.0778997248399662, 1) ), ( (0.8880742243448193, 0.4487010990299704, -0.09995746983993092, 0), (0.1955373965222982, -0.17192291478849447, 0.965509004240106, 0), (0.4160399719038307, -0.8769890837664813, -0.24041815383322665, 0), (1.0746527675849524, -11.083439862136673, 0.9903799363231229, 1) ), ( (-0.19553814756768118, -0.1719243898400986, 0.9655085894805502, 0), (-0.8880744310530598, 0.4487006521077407, -0.09995763953309957, 0), (-0.4160391776766895, -0.8769890232618761, -0.24041974893126727, 0), (-1.0746526763148654, -11.083440063520444, 0.9903813258341501, 1) ), ( (0.9798734345018166, 0.1805391619187255, -0.08516844113978443, 0), (0.14107654486423887, -0.324457968299516, 0.9353204983714705, 0), (0.14122839957608468, -0.928510978837587, -0.34339758480292476, 0), (2.626581109249555, -9.207667774347017, 0.03650994372578964, 1) ), ( (-0.13490990106765235, -0.3325791814082018, 0.9333758118079215, 0), (-0.9812251038396792, 0.1758723376924555, -0.07915943673993957, 0), (-0.13782820534548795, -0.9265311699720329, -0.35006196136604656, 0), (-2.626260059401881, -9.208056710854699, 0.037423329971488783, 1) ), ( (-0.9999999999218181, 0.000004163021974508094, 0.000011791231803380823, 0), (-0.0000069654557832628825, 0.5976668439052498, -0.8017445623083258, 0), (-0.000010384908532201138, -0.801744562613507, -0.5976668436165248, 0), (-2.4286129490855912e-17, -10.313267855119761, -1.0735539951481883, 1) ), ( (-0.9507591822032494, -0.2567401557794982, -0.17361298869949066, 0), (-0.0066635257455310475, 0.5769710733800315, -0.8167373980865485, 0), (0.309858959368365, -0.775363706335949, -0.5502713403235686, 0), (0.9229703850172619, -10.193846449461242, -0.9901251715387929, 1) ), ( (0.006688000824810549, 0.5771069610113421, -0.8166411854193892, 0), (0.9507548669874752, -0.25673508283866114, -0.17364411915780106, 0), (-0.30987167240278585, -0.7752642498840494, -0.5504042962035103, 0), (-0.9230282571018357, -10.19376878758446, -0.990201629124627, 1) ), ( (0.999999999980914, 0, 0, 0), (0, 0.9999999999768007, 0, 0), (0, 0, 0.9999999999045206, 0), (1.7621619701925706, -9.694923400872987, 11.092914579455979, 1) ), ( (-0.999999999980914, 0, 0, 0), (0, 0.9999999999768007, 0, 0), (0, 0, 0.9999999999045206, 0), (-1.7621619701925706, -9.694923400872987, 11.092914579455979, 1) ), ( (0, 0, -1.0000000000378577, 0), (0, 1.0000000000189888, 0, 0), (0.9999999999810244, 0, 0, 0), (1.060518026351934, 2.1175128519535, 7.803989409430301, 1) ), ( (1.0000000000331966, 0, 0, 0), (0, 1.0000000000021105, 0, 0), (0, 0, 0.9999999999885675, 0), (-1.4210854715202004e-14, -1.3322676295501878e-15, 8.612244367766706, 1) ), ( (1.0000000000663931, 0, 0, 0), (0, 1.0000000000042206, 0, 0), (0, 0, 0.999999999988347, 0), (2.842170943040401e-14, -2.220446049250313e-15, 20.079695225555955, 1) ), ( (0, 1.0000000000042208, 0, 0), (-1.0000000000663931, 0, 0, 0), (0, 0, 1.0000000001991793, 0), (5.684341886080802e-14, 1.7763568394002505e-15, 17.499646050366813, 1) ), ( (0.286890147180936, 0.7064762750517274, 0.6469816967599303, 0), (-0.6201162146984514, 0.6517348633245255, -0.43668930377004533, 0), (-0.730171160524579, -0.2759219821542315, 0.6250737045514649, 0), (-1.9753119694783015, -1.9407502485978227, 3.022551896440774, 1) ), ( (0.9999999999729401, -7.056855100273651e-12, -8.881756441425637e-12, 0), (2.866540338430923e-12, 1.0000000000095888, -8.881811952576868e-12, 0), (4.06108480177636e-12, -8.77778405516949e-12, 1.0000000000131943, 0), (7.87281351222191e-12, -1.4289014416135615e-11, 2.0298583819344698, 0.9999999999999998) ), ( (0.9999999999715865, -4.130862318874051e-12, -4.4409476096518574e-12, 0), (2.5480173526659655e-12, 1.0000000000102776, -6.661227125448477e-12, 0), (-9.657416533137564e-11, -1.008789163314816e-10, 1.0000000000469507, 0), (-9.281109214498429e-11, -8.100187187665142e-11, 1.8661036342753023, 1) ), ( (0.9999999999999999, 0, 0, 0), (0, 1, 2.7755575615628914e-17, 0), (2.7755575615628914e-17, 2.7755575615628914e-17, 1, 0), (-1.4210854715202004e-14, 0, 2.0000000000000036, 0.9999999999999998) ), ( (0.9996573249494725, 0, 0.02617694826710263, 0), (0, 0.999999999833797, 0, 0), (-0.02617694831493401, 0, 0.9996573250058826, 0), (-2.2240855395269405, -0.1888923644140874, 7.0816403794276965, 1) ), ( (0.9996573249758766, 0.026176948321158564, -8.881784197001252e-12, 0), (-0.026176948308904918, 0.9996573250248275, 1.3322676295501878e-11, 0), (2.574676583044777e-14, 0, 1.0000000001795752, 0), (-6.392664175791651e-13, 2.842170943040401e-14, 2.8971939078062476, 1) ), ( (1.0000000000000284, -3.469446951953614e-18, -2.9117822128269775e-18, 0), (3.469446951953614e-18, 1.0000000000331963, 7.374336163542982e-20, 0), (3.469446951953614e-18, 0, 0.9999999999619218, 0), (0, 0, 1.851699828425538, 1) ), ( (0.9999999999999999, 6.938893903907228e-18, 5.576630767884501e-19, 0), (3.469446951953614e-18, 1, 7.367987875459065e-20, 0), (0, 0, 1, 0), (0, -1.4210854715202004e-14, 2, 1) ), ( (0.9999999999714642, 0, 0, 0), (0, 0.9999999998340172, 0, 0), (0, 0, 1.00000000013699, 0), (-0.572771519405608, -0.00036239623999279047, 7.207573072889936, 1) ), ( (0.9999999999998899, 0, 0, 0), (0, 1.0000000000331966, 0, 0), (0, 0, 1.0000000000374172, 0), (4.440892098500626e-16, 1.4210854715202004e-14, 3.0635967243594493, 1) ), ( (0.9999999999998899, 0, 0, 0), (0, 1.0000000000331966, 0, 0), (0, 0, 1.000000000037417, 0), (-1.3322676295501878e-15, 0, 2.143726348227311, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (2.220446049250313e-16, 0, 2, 1) ), ( (0.9996573249530232, 0, -0.026176948267125473, 0), (0, 0.999999999833797, 0, 0), (0.02617694831473529, 0, 0.9996573250768888, 0), (1.046854704600682, -0.1539955138443645, 7.021625654705815, 1) ), ( (0.9996573249698549, -0.026176948321263917, -6.217248937900877e-11, 0), (0.026176948305873336, 0.9996573250248275, -5.773159738892836e-11, 0), (-4.4393690112887185e-12, 0, 1.0000000000375338, 0), (-7.460698725481052e-14, 2.842170943040401e-14, 2.9563293445897756, 1) ), ( (1.00000000000211, -3.469446951953614e-18, 7.351895333116303e-19, 0), (-6.938893903907228e-18, 1.0000000000331966, 7.125877280043622e-20, 0), (3.469446951953614e-18, 0, 1.0000000000329763, 0), (-1.7763568394002505e-15, -1.4210854715202004e-14, 1.9336547845830907, 1) ), ( (1.0000000000000002, -3.469446951953614e-18, 4.204736731841057e-18, 0), (3.469446951953614e-18, 1.0000000000000002, 1.7585072708825736e-19, 0), (0, -1.0842021724855044e-19, 1.0000000000000002, 0), (4.440892098500626e-16, 2.842170943040401e-14, 1.999999999999993, 1.0000000000000002) ), ( (0.9986295347033975, 0, -0.05233595630219643, 0), (0, 0.9999999999759055, 0, 0), (0.052335956244182365, 0, 0.9986295347593548, 0), (2.560071557709121, -0.39078140240621906, 6.520721571531141, 1) ), ( (0.9986295347572645, -0.052335956283084954, 8.881791135895156e-12, 0), (0.05233595624232049, 0.9986295347632349, -2.220446049250313e-11, 0), (8.869606438199895e-12, 0, 1.0000000000369522, 0), (1.4773959833291883e-11, -1.4210854715202004e-14, 2.447305678498779, 1) ), ( (0.9999999999976694, -6.938893903907228e-18, 3.263233468546644e-18, 0), (6.938893903907228e-18, 1.0000000000331966, 1.793172794767537e-19, 0), (0, 4.336808689942018e-19, 1.0000000000329763, 0), (-4.440892098500626e-16, -1.4210854715202004e-14, 1.56239891006323, 1.0000000000000002) ), ( (0.9999999999999999, 6.938893903907228e-18, 3.286006213877891e-18, 0), (0, 0.9999999999999999, -2.552125870186572e-19, 0), (0, 4.336808689942018e-19, 0.9999999999999998, 0), (-4.440892098500626e-16, 0, 1.999999999999993, 0.9999999999999998) ), ( (0, 0, -1.0000000000378577, 0), (0, 1.0000000000189888, 0, 0), (-0.9999999999810244, 0, 0, 0), (-1.060518026351934, 2.1175128519535, 7.803989409430301, 1) ), ( (1.0000000000331966, 0, 0, 0), (0, 1.0000000000021105, 0, 0), (0, 0, 0.9999999999885675, 0), (-1.4210854715202004e-14, -1.3322676295501878e-15, 8.612244367766706, 1) ), ( (1.0000000000663931, 0, 0, 0), (0, 1.0000000000042206, 0, 0), (0, 0, 0.999999999988347, 0), (2.842170943040401e-14, -2.220446049250313e-15, 20.079695225555955, 1) ), ( (0, 1.0000000000042208, 0, 0), (-1.0000000000663931, 0, 0, 0), (0, 0, 1.0000000001991793, 0), (5.684341886080802e-14, 1.7763568394002505e-15, 17.499646050366813, 1) ), ( (0.286890147180936, 0.7064762750517274, 0.6469816967599303, 0), (-0.6201162146984514, 0.6517348633245255, -0.43668930377004533, 0), (-0.730171160524579, -0.2759219821542315, 0.6250737045514649, 0), (-1.9753119694783015, -1.9407502485978227, 3.022551896440774, 1) ), ( (0.9999999999729401, -7.056855100273651e-12, -8.881756441425637e-12, 0), (2.866540338430923e-12, 1.0000000000095888, -8.881811952576868e-12, 0), (4.06108480177636e-12, -8.77778405516949e-12, 1.0000000000131943, 0), (7.87281351222191e-12, -1.4289014416135615e-11, 2.0298583819344698, 0.9999999999999998) ), ( (0.9999999999715865, -4.130862318874051e-12, -4.4409476096518574e-12, 0), (2.5480173526659655e-12, 1.0000000000102776, -6.661227125448477e-12, 0), (-9.657416533137564e-11, -1.008789163314816e-10, 1.0000000000469507, 0), (-9.281109214498429e-11, -8.100187187665142e-11, 1.8661036342753023, 1) ), ( (0.9999999999999999, 0, 0, 0), (0, 1, 2.7755575615628914e-17, 0), (2.7755575615628914e-17, 2.7755575615628914e-17, 1, 0), (-1.4210854715202004e-14, 0, 2.0000000000000036, 0.9999999999999998) ), ( (0.9996573249494725, 0, 0.02617694826710263, 0), (0, 0.999999999833797, -0, 0), (-0.02617694831493401, 0, 0.9996573250058826, 0), (-2.2240855395269405, -0.1888923644140874, 7.0816403794276965, 1) ), ( (0.9996573249758766, 0.026176948321158564, -8.881784197001252e-12, 0), (-0.026176948308904918, 0.9996573250248275, 1.3322676295501878e-11, 0), (2.574676583044777e-14, 0, 1.0000000001795752, 0), (-6.392664175791651e-13, 2.842170943040401e-14, 2.8971939078062476, 1) ), ( (1.0000000000000284, -3.469446951953614e-18, -2.9117822128269775e-18, 0), (3.469446951953614e-18, 1.0000000000331963, 7.374336163542982e-20, 0), (3.469446951953614e-18, 0, 0.9999999999619218, 0), (0, 0, 1.851699828425538, 1) ), ( (0.9999999999999999, 6.938893903907228e-18, 5.576630767884501e-19, 0), (3.469446951953614e-18, 1, 7.367987875459065e-20, 0), (0, 0, 1, 0), (0, -1.4210854715202004e-14, 2, 1) ), ( (0.9999999999714642, 0, -0, 0), (0, 0.9999999998340172, -0, 0), (0, 0, 1.00000000013699, 0), (-0.572771519405608, -0.00036239623999279047, 7.207573072889936, 1) ), ( (0.9999999999998899, 0, -0, 0), (0, 1.0000000000331966, -0, 0), (0, 0, 1.0000000000374172, 0), (4.440892098500626e-16, 1.4210854715202004e-14, 3.0635967243594493, 1) ), ( (0.9999999999998899, 0, -0, 0), (0, 1.0000000000331966, -0, 0), (0, 0, 1.000000000037417, 0), (-1.3322676295501878e-15, 0, 2.143726348227311, 1) ), ( (1, 0, -0, 0), (0, 1, -0, 0), (0, 0, 1, 0), (2.220446049250313e-16, 0, 2, 1) ), ( (0.9996573249530232, 0, -0.026176948267125473, 0), (0, 0.999999999833797, -0, 0), (0.02617694831473529, 0, 0.9996573250768888, 0), (1.046854704600682, -0.1539955138443645, 7.021625654705815, 1) ), ( (0.9996573249698549, -0.026176948321263917, -6.217248937900877e-11, 0), (0.026176948305873336, 0.9996573250248275, -5.773159738892836e-11, 0), (-4.4393690112887185e-12, 0, 1.0000000000375338, 0), (-7.460698725481052e-14, 2.842170943040401e-14, 2.9563293445897756, 1) ), ( (1.00000000000211, -3.469446951953614e-18, 7.351895333116303e-19, 0), (-6.938893903907228e-18, 1.0000000000331966, 7.125877280043622e-20, 0), (3.469446951953614e-18, 0, 1.0000000000329763, 0), (-1.7763568394002505e-15, -1.4210854715202004e-14, 1.9336547845830907, 1) ), ( (1.0000000000000002, -3.469446951953614e-18, 4.204736731841057e-18, 0), (3.469446951953614e-18, 1.0000000000000002, 1.7585072708825736e-19, 0), (0, -1.0842021724855044e-19, 1.0000000000000002, 0), (4.440892098500626e-16, 2.842170943040401e-14, 1.999999999999993, 1.0000000000000002) ), ( (0.9986295347033975, 0, -0.05233595630219643, 0), (0, 0.9999999999759055, -0, 0), (0.052335956244182365, 0, 0.9986295347593548, 0), (2.560071557709121, -0.39078140240621906, 6.520721571531141, 1) ), ( (0.9986295347572645, -0.052335956283084954, 8.881791135895156e-12, 0), (0.05233595624232049, 0.9986295347632349, -2.220446049250313e-11, 0), (8.869606438199895e-12, 0, 1.0000000000369522, 0), (1.4773959833291883e-11, -1.4210854715202004e-14, 2.447305678498779, 1) ), ( (0.9999999999976694, -6.938893903907228e-18, 3.263233468546644e-18, 0), (6.938893903907228e-18, 1.0000000000331966, 1.793172794767537e-19, 0), (0, 4.336808689942018e-19, 1.0000000000329763, 0), (-4.440892098500626e-16, -1.4210854715202004e-14, 1.56239891006323, 1.0000000000000002) ), ( (0.9999999999999999, 6.938893903907228e-18, 3.286006213877891e-18, 0), (0, 0.9999999999999999, -2.552125870186572e-19, 0), (0, 4.336808689942018e-19, 0.9999999999999998, 0), (-4.440892098500626e-16, 0, 1.999999999999993, 0.9999999999999998) ), ( (0.9999999999790243, 0, 0, 0), (0, -0.9999999999990058, 0, 0), (0, 0, -1.00000000009959, 0), (4.230487048625947, 1.3667575120925866, -5.971689223053744, 1) ), ( (0.9999999999976695, 0, 0, 0), (0, 0.9999999999998901, 0, 0), (0, 0, 1.0000000000285354, 0), (-8.881784197001252e-16, -1.8207657603852567e-14, 31.626113889501802, 1) ), ( (0.9999999999930086, 0, 0, 0), (0, 0.9999999999996697, 0, 0), (0, 0, 0.9999999998771046, 0), (-8.881784197001252e-16, -2.930988785010413e-14, 26.755893941979494, 1) ), ( (0.9999999999906777, 0, 0, 0), (0, 0, -1.000000000012662, 0), (0, 1.0000000000082208, 0, 0), (-8.881784197001252e-16, 5.054558237608476, 4.240403797634874, 1.0000000000000002) ), ( (-1.000000000011653, 0, 0, 0), (0, 0.9999999999057316, 0, 0), (0, 0, -0.9999999999740156, 0), (8.881784197001252e-16, -3.8703880930929, 12.354088997746498, 1) ), ( (-0.9999999999790243, 0, 0, 0), (0, -0.9999999999990058, 0, 0), (0, 0, -1.00000000009959, 0), (-4.230487048625947, 1.3667575120925866, -5.971689223053744, 1) ), ( (0.9999999999976695, 0, 0, 0), (0, 0.9999999999998901, 0, 0), (0, 0, 1.0000000000285354, 0), (-8.881784197001252e-16, -1.8207657603852567e-14, 31.626113889501802, 1) ), ( (0.9999999999930086, 0, 0, 0), (0, 0.9999999999996697, 0, 0), (0, 0, 0.9999999998771046, 0), (-8.881784197001252e-16, -2.930988785010413e-14, 26.755893941979494, 1) ), ( (0.9999999999906777, 0, 0, 0), (-0, 0, -1.000000000012662, 0), (0, 1.0000000000082208, 0, 0), (-8.881784197001252e-16, 5.054558237608476, 4.240403797634874, 1.0000000000000002) ), ( (-1.000000000011653, 0, -0, 0), (0, 0.9999999999057316, -0, 0), (0, 0, -0.9999999999740156, 0), (8.881784197001252e-16, -3.8703880930929, 12.354088997746498, 1) )]
27
+ }
28
+
29
+ }
30
+ "high" {
31
+ def Skeleton "Skel"
32
+ {
33
+ uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491195, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491194, 1) ), ( (1, 0, 0, 0), (0, 1.000000000000003, 0, 0), (0, 0, 1.000000000230045, 0), (0, -0.0013072490692138678, 83.4566497790318, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000036, 0, 0), (0, 0, 1.000000000260911, 0), (0, -0.0013072490692138676, 90.16297149551578, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999993417, 0, 0), (0, 0, 1.0000000003581702, 0), (0, 0.7708339691162103, 100.50954818656874, 1) ), ( (1, 0, 0, 0), (0, 0.999999999999342, 0, 0), (0, 0, 1.0000000003558396, 0), (0, 0.77083396911621, 111.15584182531659, 1) ), ( (3.294367333847379, 0.580885845318013, 0, 0), (-0.5808858453205927, 3.2943673337593746, 0, 0), (0, 0, 3.3451882612197332, 0), (3.3285450935363787, -4.5856332778930655, 119.30845642089824, 1) ), ( (-3.294367333847379, 0.580885845318013, 0, 0), (0.5808858453205927, 3.2943673337593746, 0, 0), (0, 0, 3.3451882612197332, 0), (-3.3285450935363787, -4.5856332778930655, 119.30845642089824, 1) ), ( (0, 0, -1.0000000002987688, 0), (0, 1.0000000000189924, 0, 0), (0.9999999999810244, 0, 0, 0), (1.060518026351934, 2.1162056028842935, 97.96696090698222, 1) ), ( (0, 0, -1.0000000003319653, 0), (0, 1.000000000021103, 0, 0), (0.9999999999695919, 0, 0, 0), (9.672762393955217, 2.116205602884292, 97.96696090698224, 1) ), ( (0, 0, -1.0000000003983585, 0), (0, 1.0000000000253235, 0, 0), (0.9999999999579389, 0, 0, 0), (29.752457618900586, 2.11620560288429, 97.96696090698221, 1) ), ( (0, 1.0000000000295444, 0, 0), (0, 0, 1.0000000004647516, 0), (1.000000000157118, 0, 0, 0), (47.25210366853135, 2.1162056028842917, 97.96696090698215, 1) ), ( (0.6469816968615829, 0.28689014718941197, 0.7064762753800633, 0), (-0.4366893038386571, -0.6201162147167723, 0.6517348636274203, 0), (0.6250737046496754, -0.7301711605461514, -0.2759219822824667, 0), (50.27465556544702, 0.14089363334763094, 96.02621065748237, 1) ), ( (0.6469816968416056, 0.28689014719251, 0.7064762753587976, 0), (-0.43668930384654164, -0.6201162147154108, 0.6517348636381455, 0), (0.6250737046643834, -0.7301711605491771, -0.27592198228895903, 0), (51.543466664168314, -1.3412504171226742, 95.46612810898255, 0.9999999999999998) ), ( (0.6469816968222506, 0.2868901471901627, 0.7064762753372573, 0), (-0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (0.6250737046753021, -0.7301711605486086, -0.27592198243588745, 0), (52.70991897610777, -2.7038254734429046, 94.95122909493831, 0.9999999999999998) ), ( (0.6469816968222505, 0.28689014719016265, 0.7064762753372572, 0), (-0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (0.6250737046753021, -0.7301711605486086, -0.2759219824358874, 0), (53.960066385458354, -4.164167794540128, 94.39938513006652, 0.9999999999999996) ), ( (0.026176948271215503, 0.9996573249790067, 0, 0), (0, 0, 1.0000000002985485, 0), (0.9996573251629468, -0.026176948315707393, 0, 0), (54.3337440490717, -0.10787993670835805, 97.77806854248027, 1) ), ( (0.026167978075956444, 0.9993147673812869, 0.026176948328973652, 0), (-0.0006852326084623752, -0.02616797812294237, 0.9996573253232738, 0), (0.9996573253424612, -0.02617694832038239, 0, 0), (57.22994516142766, -0.18371963189422358, 97.7780685424803, 1) ), ( (0.026167978075957183, 0.9993147673813153, 0.02617694832897439, 0), (-0.0006852326084851222, -0.026167978123811046, 0.9996573253564588, 0), (0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (59.081010459248624, -0.23219148260777983, 97.7780685424803, 1) ), ( (0.02616797807595718, 0.9993147673813152, 0.026176948328974395, 0), (-0.000685232608485122, -0.026167978123811043, 0.9996573253564588, 0), (0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (61.08032510985742, -0.28454537924655066, 97.77806854248028, 1) ), ( (0, 1.0000000000010085, 0, 0), (0, 0, 1.0000000002987688, 0), (1.000000000294108, 0, 0, 0), (54.459676742553725, 1.5434340834617615, 97.96659851074199, 1) ), ( (0, 1.0000000000008984, 0, 0), (0, 0, 1.0000000003319653, 0), (1.0000000003315253, 0, 0, 0), (57.52327346781421, 1.543434083461762, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (1.0000000003689422, 0, 0, 0), (59.66699981675222, 1.5434340834617606, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (1.0000000003689422, 0, 0, 0), (61.6669998174901, 1.5434340834617608, 97.966598510742, 1) ), ( (-0.026176948271238346, 0.9996573249825574, 0, 0), (0, 0, 1.0000000002985485, 0), (0.999657325233953, 0.02617694831550867, 0, 0), (54.27372932434039, 3.1630603075159023, 97.81296539306622, 1) ), ( (-0.026167978146851577, 0.9993147673769568, -0.026176948329079006, 0), (-0.0006852326794135409, 0.02616797811814479, 0.9996573253232738, 0), (0.9996573252715901, 0.02617694831205334, 0, 0), (57.22904560946365, 3.2404479879727757, 97.81296539306625, 1) ), ( (-0.026167978146906794, 0.9993147673790654, -0.026176948329134246, 0), (-0.0006852326794362879, 0.02616797811901347, 0.999657325356459, 0), (0.9996573253045551, 0.026176948312916563, -9.081953359177041e-20, 0), (59.16203777941859, 3.2910651693221595, 97.81296539306624, 1) ), ( (-0.026167978146906797, 0.9993147673790657, -0.026176948329134257, 0), (-0.0006852326794362879, 0.02616797811901348, 0.9996573253564592, 0), (0.9996573253045553, 0.02617694831291657, -1.9920259798102258e-19, 0), (61.161352430027705, 3.3434190659479945, 97.81296539306629, 1.0000000000000002) ), ( (-0.05233595631041936, 0.9986295347329014, 0, 0), (0, 0, 1.000000000440657, 0), (0.9986295349162576, 0.0523359562457286, 0, 0), (53.77282524108701, 4.6762771606690485, 97.57617950439432, 1) ), ( (-0.052264231692480984, 0.9972609476656457, -0.052335956306147166, 0), (-0.0027390523415361345, 0.05226423163090791, 0.9986295352032881, 0), (0.998629534952695, 0.05233595625651998, 0, 0), (56.21677697260339, 4.8043592435936375, 97.5761795043943, 1) ), ( (-0.05226423169235918, 0.9972609476633214, -0.0523359563060252, 0), (-0.002739052341627062, 0.05226423163264291, 0.9986295352364392, 0), (0.9986295349856261, 0.05233595625824583, 4.330865246302378e-19, 0), (57.77703466957045, 4.886128884605941, 97.57617950439432, 1.0000000000000002) ), ( (-0.05226423169235917, 0.9972609476633213, -0.05233595630602519, 0), (-0.002739052341627062, 0.052264231632642905, 0.998629535236439, 0), (0.9986295349856259, 0.05233595625824582, 8.661730492748525e-19, 0), (59.774293739541676, 4.99080079712243, 97.57617950439429, 1) ), ( (0, 0, -1.0000000002987688, 0), (0, 1.0000000000189924, 0, 0), (-0.9999999999810244, 0, 0, 0), (-1.060518026351934, 2.1162056028842935, 97.96696090698222, 1) ), ( (0, 0, -1.0000000003319653, 0), (0, 1.000000000021103, 0, 0), (-0.9999999999695919, 0, 0, 0), (-9.672762393955217, 2.116205602884292, 97.96696090698224, 1) ), ( (0, 0, -1.0000000003983585, 0), (0, 1.0000000000253235, 0, 0), (-0.9999999999579389, 0, 0, 0), (-29.752457618900586, 2.11620560288429, 97.96696090698221, 1) ), ( (0, 1.0000000000295444, 0, 0), (0, 0, 1.0000000004647516, 0), (-1.000000000157118, 0, 0, 0), (-47.25210366853135, 2.1162056028842917, 97.96696090698215, 1) ), ( (-0.6469816968615829, 0.28689014718941197, 0.7064762753800633, 0), (0.4366893038386571, -0.6201162147167723, 0.6517348636274203, 0), (-0.6250737046496754, -0.7301711605461514, -0.2759219822824667, 0), (-50.27465556544702, 0.14089363334763094, 96.02621065748237, 1) ), ( (-0.6469816968416056, 0.28689014719251, 0.7064762753587976, 0), (0.43668930384654164, -0.6201162147154108, 0.6517348636381455, 0), (-0.6250737046643834, -0.7301711605491771, -0.27592198228895903, 0), (-51.543466664168314, -1.3412504171226742, 95.46612810898255, 0.9999999999999998) ), ( (-0.6469816968222506, 0.2868901471901627, 0.7064762753372573, 0), (0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (-0.6250737046753021, -0.7301711605486086, -0.27592198243588745, 0), (-52.70991897610777, -2.7038254734429046, 94.95122909493831, 0.9999999999999998) ), ( (-0.6469816968222505, 0.28689014719016265, 0.7064762753372572, 0), (0.436689303853545, -0.6201162147161892, 0.6517348636484818, 0), (-0.6250737046753021, -0.7301711605486086, -0.2759219824358874, 0), (-53.960066385458354, -4.164167794540128, 94.39938513006652, 0.9999999999999996) ), ( (-0.026176948271215503, 0.9996573249790067, 0, 0), (0, 0, 1.0000000002985485, 0), (-0.9996573251629468, -0.026176948315707393, 0, 0), (-54.3337440490717, -0.10787993670835805, 97.77806854248027, 1) ), ( (-0.026167978075956444, 0.9993147673812869, 0.026176948328973652, 0), (0.0006852326084623752, -0.02616797812294237, 0.9996573253232738, 0), (-0.9996573253424612, -0.02617694832038239, 0, 0), (-57.22994516142766, -0.18371963189422358, 97.7780685424803, 1) ), ( (-0.026167978075957183, 0.9993147673813153, 0.02617694832897439, 0), (0.0006852326084851222, -0.026167978123811046, 0.9996573253564588, 0), (-0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (-59.081010459248624, -0.23219148260777983, 97.7780685424803, 1) ), ( (-0.02616797807595718, 0.9993147673813152, 0.026176948328974395, 0), (0.000685232608485122, -0.026167978123811043, 0.9996573253564588, 0), (-0.9996573253043961, -0.026176948319385614, 9.081953359140489e-20, 0), (-61.08032510985742, -0.28454537924655066, 97.77806854248028, 1) ), ( (0, 1.0000000000010085, 0, 0), (0, 0, 1.0000000002987688, 0), (-1.000000000294108, 0, 0, 0), (-54.459676742553725, 1.5434340834617615, 97.96659851074199, 1) ), ( (0, 1.0000000000008984, 0, 0), (0, 0, 1.0000000003319653, 0), (-1.0000000003315253, 0, 0, 0), (-57.52327346781421, 1.543434083461762, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (-1.0000000003689422, 0, 0, 0), (-59.66699981675222, 1.5434340834617606, 97.966598510742, 1) ), ( (0, 1.0000000000007883, 0, 0), (0, 0, 1.000000000365162, 0), (-1.0000000003689422, 0, 0, 0), (-61.6669998174901, 1.5434340834617608, 97.966598510742, 1) ), ( (0.026176948271238346, 0.9996573249825574, 0, 0), (0, 0, 1.0000000002985485, 0), (-0.999657325233953, 0.02617694831550867, 0, 0), (-54.27372932434039, 3.1630603075159023, 97.81296539306622, 1) ), ( (0.026167978146851577, 0.9993147673769568, -0.026176948329079006, 0), (0.0006852326794135409, 0.02616797811814479, 0.9996573253232738, 0), (-0.9996573252715901, 0.02617694831205334, 0, 0), (-57.22904560946365, 3.2404479879727757, 97.81296539306625, 1) ), ( (0.026167978146906794, 0.9993147673790654, -0.026176948329134246, 0), (0.0006852326794362879, 0.02616797811901347, 0.999657325356459, 0), (-0.9996573253045551, 0.026176948312916563, -9.081953359177041e-20, 0), (-59.16203777941859, 3.2910651693221595, 97.81296539306624, 1) ), ( (0.026167978146906797, 0.9993147673790657, -0.026176948329134257, 0), (0.0006852326794362879, 0.02616797811901348, 0.9996573253564592, 0), (-0.9996573253045553, 0.02617694831291657, -1.9920259798102258e-19, 0), (-61.161352430027705, 3.3434190659479945, 97.81296539306629, 1.0000000000000002) ), ( (0.05233595631041936, 0.9986295347329014, 0, 0), (0, 0, 1.000000000440657, 0), (-0.9986295349162576, 0.0523359562457286, 0, 0), (-53.77282524108701, 4.6762771606690485, 97.57617950439432, 1) ), ( (0.052264231692480984, 0.9972609476656457, -0.052335956306147166, 0), (0.0027390523415361345, 0.05226423163090791, 0.9986295352032881, 0), (-0.998629534952695, 0.05233595625651998, 0, 0), (-56.21677697260339, 4.8043592435936375, 97.5761795043943, 1) ), ( (0.05226423169235918, 0.9972609476633214, -0.0523359563060252, 0), (0.002739052341627062, 0.05226423163264291, 0.9986295352364392, 0), (-0.9986295349856261, 0.05233595625824583, 4.330865246302378e-19, 0), (-57.77703466957045, 4.886128884605941, 97.57617950439432, 1.0000000000000002) ), ( (0.05226423169235917, 0.9972609476633213, -0.05233595630602519, 0), (0.002739052341627062, 0.052264231632642905, 0.998629535236439, 0), (-0.9986295349856259, 0.05233595625824582, 8.661730492748525e-19, 0), (-59.774293739541676, 4.99080079712243, 97.57617950439429, 1) ), ( (0.9999999999790243, 0, 0, 0), (0, -0.9999999999990085, 0, 0), (0, 0, -1.000000000298769, 0), (4.230487048625947, 1.3654502630233762, 65.01936531066877, 1) ), ( (0.9999999999766939, 0, 0, 0), (0, -0.9999999999988985, 0, 0), (0, 0, -1.0000000003273044, 0), (4.230487048625946, 1.3654502630233945, 33.39325141171807, 1) ), ( (0.9999999999697025, 0, 0, 0), (0, -0.9999999999985683, 0, 0), (0, 0, -1.000000000204409, 0), (4.230487048625945, 1.3654502630234238, 6.637357460981253, 1) ), ( (0.9999999999603801, 0, 0, 0), (0, 0, 1.000000000217071, 0), (0, -1.000000000006789, 0, 0), (4.230487048625945, -3.6891079745778153, 2.3969536624796044, 1.0000000000000002) ), ( (-0.999999999972033, 0, 0, 0), (0, 0, 1.0000000001228027, 0), (0, 0.9999999999808046, 0, 0), (4.230487048625946, -16.043196972408186, -1.473434431453445, 1.0000000000000002) ), ( (-0.9999999999790243, 0, 0, 0), (0, -0.9999999999990085, 0, 0), (0, 0, -1.000000000298769, 0), (-4.230487048625947, 1.3654502630233762, 65.01936531066877, 1) ), ( (-0.9999999999766939, 0, 0, 0), (0, -0.9999999999988985, 0, 0), (0, 0, -1.0000000003273044, 0), (-4.230487048625946, 1.3654502630233945, 33.39325141171807, 1) ), ( (-0.9999999999697025, 0, 0, 0), (0, -0.9999999999985683, 0, 0), (0, 0, -1.000000000204409, 0), (-4.230487048625945, 1.3654502630234238, 6.637357460981253, 1) ), ( (-0.9999999999603801, 0, 0, 0), (0, 0, 1.000000000217071, 0), (0, -1.000000000006789, 0, 0), (-4.230487048625945, -3.6891079745778153, 2.3969536624796044, 1.0000000000000002) ), ( (0.999999999972033, 0, 0, 0), (0, 0, 1.0000000001228027, 0), (0, 0.9999999999808046, 0, 0), (-4.230487048625946, -16.043196972408186, -1.473434431453445, 1.0000000000000002) )]
34
+ uniform token[] jointNames = ["Hips", "Torso", "Chest", "UpChest", "Neck", "Head", "LEye", "REye", "LShldr", "LArm", "LElbow", "LHand", "LThumb", "LThumbMid", "LThumbTip", "LThumbEnd", "LIndex", "LIndexMid", "LIndexTip", "LIndexEnd", "LMiddle", "LMiddleMid", "LMiddleTip", "LMiddleEnd", "LRing", "LRingMid", "LRingTip", "LRingEnd", "LPinky", "LPinkyMid", "LPinkyTip", "LPinkyEnd", "RShldr", "RArm", "RElbow", "RHand", "RThumb", "RThumbMid", "RThumbTip", "RThumbEnd", "RIndex", "RIndexMid", "RIndexTip", "RIndexEnd", "RMiddle", "RMiddleMid", "RMiddleTip", "RMiddleEnd", "RRing", "RRingMid", "RRingTip", "RRingEnd", "RPinky", "RPinkyMid", "RPinkyTip", "RPinkyEnd", "LLeg", "LKnee", "LFoot", "LToes", "LTip", "RLeg", "RKnee", "RFoot", "RToes", "RTip"]
35
+ uniform token[] joints = ["Hips", "Hips/Torso", "Hips/Torso/Chest", "Hips/Torso/Chest/UpChest", "Hips/Torso/Chest/UpChest/Neck", "Hips/Torso/Chest/UpChest/Neck/Head", "Hips/Torso/Chest/UpChest/Neck/Head/LEye", "Hips/Torso/Chest/UpChest/Neck/Head/REye", "Hips/Torso/Chest/UpChest/LShldr", "Hips/Torso/Chest/UpChest/LShldr/LArm", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb/LThumbMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb/LThumbMid/LThumbTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LThumb/LThumbMid/LThumbTip/LThumbEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex/LIndexMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex/LIndexMid/LIndexTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LIndex/LIndexMid/LIndexTip/LIndexEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle/LMiddleMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle/LMiddleMid/LMiddleTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LMiddle/LMiddleMid/LMiddleTip/LMiddleEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing/LRingMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing/LRingMid/LRingTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LRing/LRingMid/LRingTip/LRingEnd", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky/LPinkyMid", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky/LPinkyMid/LPinkyTip", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand/LPinky/LPinkyMid/LPinkyTip/LPinkyEnd", "Hips/Torso/Chest/UpChest/RShldr", "Hips/Torso/Chest/UpChest/RShldr/RArm", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb/RThumbMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb/RThumbMid/RThumbTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RThumb/RThumbMid/RThumbTip/RThumbEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex/RIndexMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex/RIndexMid/RIndexTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RIndex/RIndexMid/RIndexTip/RIndexEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle/RMiddleMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle/RMiddleMid/RMiddleTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RMiddle/RMiddleMid/RMiddleTip/RMiddleEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing/RRingMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing/RRingMid/RRingTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RRing/RRingMid/RRingTip/RRingEnd", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky/RPinkyMid", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky/RPinkyMid/RPinkyTip", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand/RPinky/RPinkyMid/RPinkyTip/RPinkyEnd", "Hips/LLeg", "Hips/LLeg/LKnee", "Hips/LLeg/LKnee/LFoot", "Hips/LLeg/LKnee/LFoot/LToes", "Hips/LLeg/LKnee/LFoot/LToes/LTip", "Hips/RLeg", "Hips/RLeg/RKnee", "Hips/RLeg/RKnee/RFoot", "Hips/RLeg/RKnee/RFoot/RToes", "Hips/RLeg/RKnee/RFoot/RToes/RTip"]
36
+ uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491195, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, -1.4210854715202004e-14, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000004, 0, 0), (0, 0, 1.000000000030866, 0), (0, -6.505213034913027e-19, 12.465595241636976, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000004, 0, 0), (0, 0, 1.000000000030866, 0), (0, 2.168404344971009e-19, 6.706321714941211, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999993382, 0, 0), (0, 0, 1.000000000097259, 0), (0, 0.7721412181854214, 10.346576688353423, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000002, 0, 0), (0, 0, 0.9999999999976695, 0), (0, -2.220446049250313e-16, 10.646293634934665, 1) ), ( (3.294367333847379, 0.5808858453183953, 0, 0), (-0.5808858453205927, 3.2943673337615422, 0, 0), (0, 0, 3.3451882600293827, 0), (3.3285450935363787, -5.3564672470128, 8.152614592680635, 1) ), ( (-3.294367333847379, 0.5808858453183953, 0, 0), (0.5808858453205927, 3.2943673337615422, 0, 0), (0, 0, 3.3451882600293827, 0), (-3.3285450935363787, -5.3564672470128, 8.152614592680635, 1) ), ( (0, 0, -1.0000000000378577, 0), (0, 1.0000000000189888, 0, 0), (0.9999999999810244, 0, 0, 0), (1.060518026351934, 2.1175128519535, 7.803989409430301, 1) ), ( (1.0000000000331966, 0, 0, 0), (0, 1.0000000000021105, 0, 0), (0, 0, 0.9999999999885675, 0), (-1.4210854715202004e-14, -1.3322676295501878e-15, 8.612244367766706, 1) ), ( (1.0000000000663931, 0, 0, 0), (0, 1.0000000000042206, 0, 0), (0, 0, 0.999999999988347, 0), (2.842170943040401e-14, -2.220446049250313e-15, 20.079695225555955, 1) ), ( (0, 1.0000000000042208, 0, 0), (-1.0000000000663931, 0, 0, 0), (0, 0, 1.0000000001991793, 0), (5.684341886080802e-14, 1.7763568394002505e-15, 17.499646050366813, 1) ), ( (0.286890147180936, 0.7064762750517274, 0.6469816967599303, 0), (-0.6201162146984514, 0.6517348633245255, -0.43668930377004533, 0), (-0.730171160524579, -0.2759219821542315, 0.6250737045514649, 0), (-1.9753119694783015, -1.9407502485978227, 3.022551896440774, 1) ), ( (0.9999999999729401, -7.056855100273651e-12, -8.881756441425637e-12, 0), (2.866540338430923e-12, 1.0000000000095888, -8.881811952576868e-12, 0), (4.06108480177636e-12, -8.77778405516949e-12, 1.0000000000131943, 0), (7.87281351222191e-12, -1.4289014416135615e-11, 2.0298583819344698, 0.9999999999999998) ), ( (0.9999999999715865, -4.130862318874051e-12, -4.4409476096518574e-12, 0), (2.5480173526659655e-12, 1.0000000000102776, -6.661227125448477e-12, 0), (-9.657416533137564e-11, -1.008789163314816e-10, 1.0000000000469507, 0), (-9.281109214498429e-11, -8.100187187665142e-11, 1.8661036342753023, 1) ), ( (0.9999999999999999, 0, 0, 0), (0, 1, 2.7755575615628914e-17, 0), (2.7755575615628914e-17, 2.7755575615628914e-17, 1, 0), (-1.4210854715202004e-14, 0, 2.0000000000000036, 0.9999999999999998) ), ( (0.9996573249494725, 0, 0.02617694826710263, 0), (0, 0.999999999833797, 0, 0), (-0.02617694831493401, 0, 0.9996573250058826, 0), (-2.2240855395269405, -0.1888923644140874, 7.0816403794276965, 1) ), ( (0.9996573249758766, 0.026176948321158564, -8.881784197001252e-12, 0), (-0.026176948308904918, 0.9996573250248275, 1.3322676295501878e-11, 0), (2.574676583044777e-14, 0, 1.0000000001795752, 0), (-6.392664175791651e-13, 2.842170943040401e-14, 2.8971939078062476, 1) ), ( (1.0000000000000284, -3.469446951953614e-18, -2.9117822128269775e-18, 0), (3.469446951953614e-18, 1.0000000000331963, 7.374336163542982e-20, 0), (3.469446951953614e-18, 0, 0.9999999999619218, 0), (0, 0, 1.851699828425538, 1) ), ( (0.9999999999999999, 6.938893903907228e-18, 5.576630767884501e-19, 0), (3.469446951953614e-18, 1, 7.367987875459065e-20, 0), (0, 0, 1, 0), (0, -1.4210854715202004e-14, 2, 1) ), ( (0.9999999999714642, 0, 0, 0), (0, 0.9999999998340172, 0, 0), (0, 0, 1.00000000013699, 0), (-0.572771519405608, -0.00036239623999279047, 7.207573072889936, 1) ), ( (0.9999999999998899, 0, 0, 0), (0, 1.0000000000331966, 0, 0), (0, 0, 1.0000000000374172, 0), (4.440892098500626e-16, 1.4210854715202004e-14, 3.0635967243594493, 1) ), ( (0.9999999999998899, 0, 0, 0), (0, 1.0000000000331966, 0, 0), (0, 0, 1.000000000037417, 0), (-1.3322676295501878e-15, 0, 2.143726348227311, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (2.220446049250313e-16, 0, 2, 1) ), ( (0.9996573249530232, 0, -0.026176948267125473, 0), (0, 0.999999999833797, 0, 0), (0.02617694831473529, 0, 0.9996573250768888, 0), (1.046854704600682, -0.1539955138443645, 7.021625654705815, 1) ), ( (0.9996573249698549, -0.026176948321263917, -6.217248937900877e-11, 0), (0.026176948305873336, 0.9996573250248275, -5.773159738892836e-11, 0), (-4.4393690112887185e-12, 0, 1.0000000000375338, 0), (-7.460698725481052e-14, 2.842170943040401e-14, 2.9563293445897756, 1) ), ( (1.00000000000211, -3.469446951953614e-18, 7.351895333116303e-19, 0), (-6.938893903907228e-18, 1.0000000000331966, 7.125877280043622e-20, 0), (3.469446951953614e-18, 0, 1.0000000000329763, 0), (-1.7763568394002505e-15, -1.4210854715202004e-14, 1.9336547845830907, 1) ), ( (1.0000000000000002, -3.469446951953614e-18, 4.204736731841057e-18, 0), (3.469446951953614e-18, 1.0000000000000002, 1.7585072708825736e-19, 0), (0, -1.0842021724855044e-19, 1.0000000000000002, 0), (4.440892098500626e-16, 2.842170943040401e-14, 1.999999999999993, 1.0000000000000002) ), ( (0.9986295347033975, 0, -0.05233595630219643, 0), (0, 0.9999999999759055, 0, 0), (0.052335956244182365, 0, 0.9986295347593548, 0), (2.560071557709121, -0.39078140240621906, 6.520721571531141, 1) ), ( (0.9986295347572645, -0.052335956283084954, 8.881791135895156e-12, 0), (0.05233595624232049, 0.9986295347632349, -2.220446049250313e-11, 0), (8.869606438199895e-12, 0, 1.0000000000369522, 0), (1.4773959833291883e-11, -1.4210854715202004e-14, 2.447305678498779, 1) ), ( (0.9999999999976694, -6.938893903907228e-18, 3.263233468546644e-18, 0), (6.938893903907228e-18, 1.0000000000331966, 1.793172794767537e-19, 0), (0, 4.336808689942018e-19, 1.0000000000329763, 0), (-4.440892098500626e-16, -1.4210854715202004e-14, 1.56239891006323, 1.0000000000000002) ), ( (0.9999999999999999, 6.938893903907228e-18, 3.286006213877891e-18, 0), (0, 0.9999999999999999, -2.552125870186572e-19, 0), (0, 4.336808689942018e-19, 0.9999999999999998, 0), (-4.440892098500626e-16, 0, 1.999999999999993, 0.9999999999999998) ), ( (0, 0, -1.0000000000378577, 0), (0, 1.0000000000189888, 0, 0), (-0.9999999999810244, 0, 0, 0), (-1.060518026351934, 2.1175128519535, 7.803989409430301, 1) ), ( (1.0000000000331966, 0, 0, 0), (0, 1.0000000000021105, 0, 0), (0, 0, 0.9999999999885675, 0), (-1.4210854715202004e-14, -1.3322676295501878e-15, 8.612244367766706, 1) ), ( (1.0000000000663931, 0, 0, 0), (0, 1.0000000000042206, 0, 0), (0, 0, 0.999999999988347, 0), (2.842170943040401e-14, -2.220446049250313e-15, 20.079695225555955, 1) ), ( (0, 1.0000000000042208, 0, 0), (-1.0000000000663931, 0, 0, 0), (0, 0, 1.0000000001991793, 0), (5.684341886080802e-14, 1.7763568394002505e-15, 17.499646050366813, 1) ), ( (0.286890147180936, 0.7064762750517274, 0.6469816967599303, 0), (-0.6201162146984514, 0.6517348633245255, -0.43668930377004533, 0), (-0.730171160524579, -0.2759219821542315, 0.6250737045514649, 0), (-1.9753119694783015, -1.9407502485978227, 3.022551896440774, 1) ), ( (0.9999999999729401, -7.056855100273651e-12, -8.881756441425637e-12, 0), (2.866540338430923e-12, 1.0000000000095888, -8.881811952576868e-12, 0), (4.06108480177636e-12, -8.77778405516949e-12, 1.0000000000131943, 0), (7.87281351222191e-12, -1.4289014416135615e-11, 2.0298583819344698, 0.9999999999999998) ), ( (0.9999999999715865, -4.130862318874051e-12, -4.4409476096518574e-12, 0), (2.5480173526659655e-12, 1.0000000000102776, -6.661227125448477e-12, 0), (-9.657416533137564e-11, -1.008789163314816e-10, 1.0000000000469507, 0), (-9.281109214498429e-11, -8.100187187665142e-11, 1.8661036342753023, 1) ), ( (0.9999999999999999, 0, 0, 0), (0, 1, 2.7755575615628914e-17, 0), (2.7755575615628914e-17, 2.7755575615628914e-17, 1, 0), (-1.4210854715202004e-14, 0, 2.0000000000000036, 0.9999999999999998) ), ( (0.9996573249494725, 0, 0.02617694826710263, 0), (0, 0.999999999833797, -0, 0), (-0.02617694831493401, 0, 0.9996573250058826, 0), (-2.2240855395269405, -0.1888923644140874, 7.0816403794276965, 1) ), ( (0.9996573249758766, 0.026176948321158564, -8.881784197001252e-12, 0), (-0.026176948308904918, 0.9996573250248275, 1.3322676295501878e-11, 0), (2.574676583044777e-14, 0, 1.0000000001795752, 0), (-6.392664175791651e-13, 2.842170943040401e-14, 2.8971939078062476, 1) ), ( (1.0000000000000284, -3.469446951953614e-18, -2.9117822128269775e-18, 0), (3.469446951953614e-18, 1.0000000000331963, 7.374336163542982e-20, 0), (3.469446951953614e-18, 0, 0.9999999999619218, 0), (0, 0, 1.851699828425538, 1) ), ( (0.9999999999999999, 6.938893903907228e-18, 5.576630767884501e-19, 0), (3.469446951953614e-18, 1, 7.367987875459065e-20, 0), (0, 0, 1, 0), (0, -1.4210854715202004e-14, 2, 1) ), ( (0.9999999999714642, 0, -0, 0), (0, 0.9999999998340172, -0, 0), (0, 0, 1.00000000013699, 0), (-0.572771519405608, -0.00036239623999279047, 7.207573072889936, 1) ), ( (0.9999999999998899, 0, -0, 0), (0, 1.0000000000331966, -0, 0), (0, 0, 1.0000000000374172, 0), (4.440892098500626e-16, 1.4210854715202004e-14, 3.0635967243594493, 1) ), ( (0.9999999999998899, 0, -0, 0), (0, 1.0000000000331966, -0, 0), (0, 0, 1.000000000037417, 0), (-1.3322676295501878e-15, 0, 2.143726348227311, 1) ), ( (1, 0, -0, 0), (0, 1, -0, 0), (0, 0, 1, 0), (2.220446049250313e-16, 0, 2, 1) ), ( (0.9996573249530232, 0, -0.026176948267125473, 0), (0, 0.999999999833797, -0, 0), (0.02617694831473529, 0, 0.9996573250768888, 0), (1.046854704600682, -0.1539955138443645, 7.021625654705815, 1) ), ( (0.9996573249698549, -0.026176948321263917, -6.217248937900877e-11, 0), (0.026176948305873336, 0.9996573250248275, -5.773159738892836e-11, 0), (-4.4393690112887185e-12, 0, 1.0000000000375338, 0), (-7.460698725481052e-14, 2.842170943040401e-14, 2.9563293445897756, 1) ), ( (1.00000000000211, -3.469446951953614e-18, 7.351895333116303e-19, 0), (-6.938893903907228e-18, 1.0000000000331966, 7.125877280043622e-20, 0), (3.469446951953614e-18, 0, 1.0000000000329763, 0), (-1.7763568394002505e-15, -1.4210854715202004e-14, 1.9336547845830907, 1) ), ( (1.0000000000000002, -3.469446951953614e-18, 4.204736731841057e-18, 0), (3.469446951953614e-18, 1.0000000000000002, 1.7585072708825736e-19, 0), (0, -1.0842021724855044e-19, 1.0000000000000002, 0), (4.440892098500626e-16, 2.842170943040401e-14, 1.999999999999993, 1.0000000000000002) ), ( (0.9986295347033975, 0, -0.05233595630219643, 0), (0, 0.9999999999759055, -0, 0), (0.052335956244182365, 0, 0.9986295347593548, 0), (2.560071557709121, -0.39078140240621906, 6.520721571531141, 1) ), ( (0.9986295347572645, -0.052335956283084954, 8.881791135895156e-12, 0), (0.05233595624232049, 0.9986295347632349, -2.220446049250313e-11, 0), (8.869606438199895e-12, 0, 1.0000000000369522, 0), (1.4773959833291883e-11, -1.4210854715202004e-14, 2.447305678498779, 1) ), ( (0.9999999999976694, -6.938893903907228e-18, 3.263233468546644e-18, 0), (6.938893903907228e-18, 1.0000000000331966, 1.793172794767537e-19, 0), (0, 4.336808689942018e-19, 1.0000000000329763, 0), (-4.440892098500626e-16, -1.4210854715202004e-14, 1.56239891006323, 1.0000000000000002) ), ( (0.9999999999999999, 6.938893903907228e-18, 3.286006213877891e-18, 0), (0, 0.9999999999999999, -2.552125870186572e-19, 0), (0, 4.336808689942018e-19, 0.9999999999999998, 0), (-4.440892098500626e-16, 0, 1.999999999999993, 0.9999999999999998) ), ( (0.9999999999790243, 0, 0, 0), (0, -0.9999999999990058, 0, 0), (0, 0, -1.00000000009959, 0), (4.230487048625947, 1.3667575120925866, -5.971689223053744, 1) ), ( (0.9999999999976695, 0, 0, 0), (0, 0.9999999999998901, 0, 0), (0, 0, 1.0000000000285354, 0), (-8.881784197001252e-16, -1.8207657603852567e-14, 31.626113889501802, 1) ), ( (0.9999999999930086, 0, 0, 0), (0, 0.9999999999996697, 0, 0), (0, 0, 0.9999999998771046, 0), (-8.881784197001252e-16, -2.930988785010413e-14, 26.755893941979494, 1) ), ( (0.9999999999906777, 0, 0, 0), (0, 0, -1.000000000012662, 0), (0, 1.0000000000082208, 0, 0), (-8.881784197001252e-16, 5.054558237608476, 4.240403797634874, 1.0000000000000002) ), ( (-1.000000000011653, 0, 0, 0), (0, 0.9999999999057316, 0, 0), (0, 0, -0.9999999999740156, 0), (8.881784197001252e-16, -3.8703880930929, 12.354088997746498, 1) ), ( (-0.9999999999790243, 0, 0, 0), (0, -0.9999999999990058, 0, 0), (0, 0, -1.00000000009959, 0), (-4.230487048625947, 1.3667575120925866, -5.971689223053744, 1) ), ( (0.9999999999976695, 0, 0, 0), (0, 0.9999999999998901, 0, 0), (0, 0, 1.0000000000285354, 0), (-8.881784197001252e-16, -1.8207657603852567e-14, 31.626113889501802, 1) ), ( (0.9999999999930086, 0, 0, 0), (0, 0.9999999999996697, 0, 0), (0, 0, 0.9999999998771046, 0), (-8.881784197001252e-16, -2.930988785010413e-14, 26.755893941979494, 1) ), ( (0.9999999999906777, 0, 0, 0), (-0, 0, -1.000000000012662, 0), (0, 1.0000000000082208, 0, 0), (-8.881784197001252e-16, 5.054558237608476, 4.240403797634874, 1.0000000000000002) ), ( (-1.000000000011653, 0, -0, 0), (0, 0.9999999999057316, -0, 0), (0, 0, -0.9999999999740156, 0), (8.881784197001252e-16, -3.8703880930929, 12.354088997746498, 1) )]
37
+ }
38
+
39
+ }
40
+ "reduced" {
41
+ def Skeleton "Skel"
42
+ {
43
+ uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491195, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491194, 1) ), ( (1, 0, 0, 0), (0, 1.000000000000003, 0, 0), (0, 0, 1.000000000230045, 0), (0, -0.0013072490692138678, 83.4566497790318, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000036, 0, 0), (0, 0, 1.000000000260911, 0), (0, -0.0013072490692138676, 90.16297149551578, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999993417, 0, 0), (0, 0, 1.0000000003581702, 0), (0, 0.7708339691162103, 100.50954818656874, 1) ), ( (1, 0, 0, 0), (0, 0.999999999999342, 0, 0), (0, 0, 1.0000000003558396, 0), (0, 0.77083396911621, 111.15584182531659, 1) ), ( (3.294367333847379, 0.580885845318013, 0, 0), (-0.5808858453205927, 3.2943673337593746, 0, 0), (0, 0, 3.3451882612197332, 0), (3.3285450935363787, -4.5856332778930655, 119.30845642089824, 1) ), ( (-3.294367333847379, 0.580885845318013, 0, 0), (0.5808858453205927, 3.2943673337593746, 0, 0), (0, 0, 3.3451882612197332, 0), (-3.3285450935363787, -4.5856332778930655, 119.30845642089824, 1) ), ( (0, 0, -1.0000000002987688, 0), (0, 1.0000000000189924, 0, 0), (0.9999999999810244, 0, 0, 0), (1.060518026351934, 2.1162056028842935, 97.96696090698222, 1) ), ( (0, 0, -1.0000000003319653, 0), (0, 1.000000000021103, 0, 0), (0.9999999999695919, 0, 0, 0), (9.672762393955217, 2.116205602884292, 97.96696090698224, 1) ), ( (0, 0, -1.0000000003983585, 0), (0, 1.0000000000253235, 0, 0), (0.9999999999579389, 0, 0, 0), (29.752457618900586, 2.11620560288429, 97.96696090698221, 1) ), ( (0, 1.0000000000295444, 0, 0), (0, 0, 1.0000000004647516, 0), (1.000000000157118, 0, 0, 0), (47.25210366853135, 2.1162056028842917, 97.96696090698215, 1) ), ( (0, 0, -1.0000000002987688, 0), (0, 1.0000000000189924, 0, 0), (-0.9999999999810244, 0, 0, 0), (-1.060518026351934, 2.1162056028842935, 97.96696090698222, 1) ), ( (0, 0, -1.0000000003319653, 0), (0, 1.000000000021103, 0, 0), (-0.9999999999695919, 0, 0, 0), (-9.672762393955217, 2.116205602884292, 97.96696090698224, 1) ), ( (0, 0, -1.0000000003983585, 0), (0, 1.0000000000253235, 0, 0), (-0.9999999999579389, 0, 0, 0), (-29.752457618900586, 2.11620560288429, 97.96696090698221, 1) ), ( (0, 1.0000000000295444, 0, 0), (0, 0, 1.0000000004647516, 0), (-1.000000000157118, 0, 0, 0), (-47.25210366853135, 2.1162056028842917, 97.96696090698215, 1) ), ( (0.9999999999790243, 0, 0, 0), (0, -0.9999999999990085, 0, 0), (0, 0, -1.000000000298769, 0), (4.230487048625947, 1.3654502630233762, 65.01936531066877, 1) ), ( (0.9999999999766939, 0, 0, 0), (0, -0.9999999999988985, 0, 0), (0, 0, -1.0000000003273044, 0), (4.230487048625946, 1.3654502630233945, 33.39325141171807, 1) ), ( (0.9999999999697025, 0, 0, 0), (0, -0.9999999999985683, 0, 0), (0, 0, -1.000000000204409, 0), (4.230487048625945, 1.3654502630234238, 6.637357460981253, 1) ), ( (0.9999999999603801, 0, 0, 0), (0, 0, 1.000000000217071, 0), (0, -1.000000000006789, 0, 0), (4.230487048625945, -3.6891079745778153, 2.3969536624796044, 1.0000000000000002) ), ( (-0.999999999972033, 0, 0, 0), (0, 0, 1.0000000001228027, 0), (0, 0.9999999999808046, 0, 0), (4.230487048625946, -16.043196972408186, -1.473434431453445, 1.0000000000000002) ), ( (-0.9999999999790243, 0, 0, 0), (0, -0.9999999999990085, 0, 0), (0, 0, -1.000000000298769, 0), (-4.230487048625947, 1.3654502630233762, 65.01936531066877, 1) ), ( (-0.9999999999766939, 0, 0, 0), (0, -0.9999999999988985, 0, 0), (0, 0, -1.0000000003273044, 0), (-4.230487048625946, 1.3654502630233945, 33.39325141171807, 1) ), ( (-0.9999999999697025, 0, 0, 0), (0, -0.9999999999985683, 0, 0), (0, 0, -1.000000000204409, 0), (-4.230487048625945, 1.3654502630234238, 6.637357460981253, 1) ), ( (-0.9999999999603801, 0, 0, 0), (0, 0, 1.000000000217071, 0), (0, -1.000000000006789, 0, 0), (-4.230487048625945, -3.6891079745778153, 2.3969536624796044, 1.0000000000000002) ), ( (0.999999999972033, 0, 0, 0), (0, 0, 1.0000000001228027, 0), (0, 0.9999999999808046, 0, 0), (-4.230487048625946, -16.043196972408186, -1.473434431453445, 1.0000000000000002) )]
44
+ uniform token[] jointNames = ["Hips", "Torso", "Chest", "UpChest", "Neck", "Head", "LEye", "REye", "LShldr", "LArm", "LElbow", "LHand", "RShldr", "RArm", "RElbow", "RHand", "LLeg", "LKnee", "LFoot", "LToes", "LTip", "RLeg", "RKnee", "RFoot", "RToes", "RTip"]
45
+ uniform token[] joints = ["Hips", "Hips/Torso", "Hips/Torso/Chest", "Hips/Torso/Chest/UpChest", "Hips/Torso/Chest/UpChest/Neck", "Hips/Torso/Chest/UpChest/Neck/Head", "Hips/Torso/Chest/UpChest/Neck/Head/LEye", "Hips/Torso/Chest/UpChest/Neck/Head/REye", "Hips/Torso/Chest/UpChest/LShldr", "Hips/Torso/Chest/UpChest/LShldr/LArm", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow", "Hips/Torso/Chest/UpChest/LShldr/LArm/LElbow/LHand", "Hips/Torso/Chest/UpChest/RShldr", "Hips/Torso/Chest/UpChest/RShldr/RArm", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow", "Hips/Torso/Chest/UpChest/RShldr/RArm/RElbow/RHand", "Hips/LLeg", "Hips/LLeg/LKnee", "Hips/LLeg/LKnee/LFoot", "Hips/LLeg/LKnee/LFoot/LToes", "Hips/LLeg/LKnee/LFoot/LToes/LTip", "Hips/RLeg", "Hips/RLeg/RKnee", "Hips/RLeg/RKnee/RFoot", "Hips/RLeg/RKnee/RFoot/RToes", "Hips/RLeg/RKnee/RFoot/RToes/RTip"]
46
+ uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1.0000000000000027, 0, 0), (0, 0, 1.0000000001991791, 0), (0, -0.0013072490692138672, 70.99105453491195, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, -1.4210854715202004e-14, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000004, 0, 0), (0, 0, 1.000000000030866, 0), (0, -6.505213034913027e-19, 12.465595241636976, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000004, 0, 0), (0, 0, 1.000000000030866, 0), (0, 2.168404344971009e-19, 6.706321714941211, 1) ), ( (1, 0, 0, 0), (0, 0.9999999999993382, 0, 0), (0, 0, 1.000000000097259, 0), (0, 0.7721412181854214, 10.346576688353423, 1) ), ( (1, 0, 0, 0), (0, 1.0000000000000002, 0, 0), (0, 0, 0.9999999999976695, 0), (0, -2.220446049250313e-16, 10.646293634934665, 1) ), ( (3.294367333847379, 0.5808858453183953, 0, 0), (-0.5808858453205927, 3.2943673337615422, 0, 0), (0, 0, 3.3451882600293827, 0), (3.3285450935363787, -5.3564672470128, 8.152614592680635, 1) ), ( (-3.294367333847379, 0.5808858453183953, 0, 0), (0.5808858453205927, 3.2943673337615422, 0, 0), (0, 0, 3.3451882600293827, 0), (-3.3285450935363787, -5.3564672470128, 8.152614592680635, 1) ), ( (0, 0, -1.0000000000378577, 0), (0, 1.0000000000189888, 0, 0), (0.9999999999810244, 0, 0, 0), (1.060518026351934, 2.1175128519535, 7.803989409430301, 1) ), ( (1.0000000000331966, 0, 0, 0), (0, 1.0000000000021105, 0, 0), (0, 0, 0.9999999999885675, 0), (-1.4210854715202004e-14, -1.3322676295501878e-15, 8.612244367766706, 1) ), ( (1.0000000000663931, 0, 0, 0), (0, 1.0000000000042206, 0, 0), (0, 0, 0.999999999988347, 0), (2.842170943040401e-14, -2.220446049250313e-15, 20.079695225555955, 1) ), ( (0, 1.0000000000042208, 0, 0), (-1.0000000000663931, 0, 0, 0), (0, 0, 1.0000000001991793, 0), (5.684341886080802e-14, 1.7763568394002505e-15, 17.499646050366813, 1) ), ( (0, 0, -1.0000000000378577, 0), (0, 1.0000000000189888, 0, 0), (-0.9999999999810244, 0, 0, 0), (-1.060518026351934, 2.1175128519535, 7.803989409430301, 1) ), ( (1.0000000000331966, 0, 0, 0), (0, 1.0000000000021105, 0, 0), (0, 0, 0.9999999999885675, 0), (-1.4210854715202004e-14, -1.3322676295501878e-15, 8.612244367766706, 1) ), ( (1.0000000000663931, 0, 0, 0), (0, 1.0000000000042206, 0, 0), (0, 0, 0.999999999988347, 0), (2.842170943040401e-14, -2.220446049250313e-15, 20.079695225555955, 1) ), ( (0, 1.0000000000042208, 0, 0), (-1.0000000000663931, 0, 0, 0), (0, 0, 1.0000000001991793, 0), (5.684341886080802e-14, 1.7763568394002505e-15, 17.499646050366813, 1) ), ( (0.9999999999790243, 0, 0, 0), (0, -0.9999999999990058, 0, 0), (0, 0, -1.00000000009959, 0), (4.230487048625947, 1.3667575120925866, -5.971689223053744, 1) ), ( (0.9999999999976695, 0, 0, 0), (0, 0.9999999999998901, 0, 0), (0, 0, 1.0000000000285354, 0), (-8.881784197001252e-16, -1.8207657603852567e-14, 31.626113889501802, 1) ), ( (0.9999999999930086, 0, 0, 0), (0, 0.9999999999996697, 0, 0), (0, 0, 0.9999999998771046, 0), (-8.881784197001252e-16, -2.930988785010413e-14, 26.755893941979494, 1) ), ( (0.9999999999906777, 0, 0, 0), (0, 0, -1.000000000012662, 0), (0, 1.0000000000082208, 0, 0), (-8.881784197001252e-16, 5.054558237608476, 4.240403797634874, 1.0000000000000002) ), ( (-1.000000000011653, 0, 0, 0), (0, 0.9999999999057316, 0, 0), (0, 0, -0.9999999999740156, 0), (8.881784197001252e-16, -3.8703880930929, 12.354088997746498, 1) ), ( (-0.9999999999790243, 0, 0, 0), (0, -0.9999999999990058, 0, 0), (0, 0, -1.00000000009959, 0), (-4.230487048625947, 1.3667575120925866, -5.971689223053744, 1) ), ( (0.9999999999976695, 0, 0, 0), (0, 0.9999999999998901, 0, 0), (0, 0, 1.0000000000285354, 0), (-8.881784197001252e-16, -1.8207657603852567e-14, 31.626113889501802, 1) ), ( (0.9999999999930086, 0, 0, 0), (0, 0.9999999999996697, 0, 0), (0, 0, 0.9999999998771046, 0), (-8.881784197001252e-16, -2.930988785010413e-14, 26.755893941979494, 1) ), ( (0.9999999999906777, 0, 0, 0), (-0, 0, -1.000000000012662, 0), (0, 1.0000000000082208, 0, 0), (-8.881784197001252e-16, 5.054558237608476, 4.240403797634874, 1.0000000000000002) ), ( (-1.000000000011653, 0, -0, 0), (0, 0.9999999999057316, -0, 0), (0, 0, -0.9999999999740156, 0), (8.881784197001252e-16, -3.8703880930929, 12.354088997746498, 1) )]
47
+ }
48
+
49
+ }
50
+ }
51
+ }
52
+
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/background.jpg ADDED

Git LFS Details

  • SHA256: 5fe72f054172ddbe1bc404c0599d8324b63c694fe353bdf6b8220442a24809f5
  • Pointer size: 130 Bytes
  • Size of remote file: 12.8 kB
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/category_qa.py ADDED
@@ -0,0 +1,1327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Helper script to perform batch QA on OmniGibson objects.
3
+ """
4
+
5
+ import hashlib
6
+ import os
7
+ import pathlib
8
+ import sys
9
+ import json
10
+ import argparse
11
+ import time
12
+ from omnigibson.prims.xform_prim import XFormPrim
13
+ import trimesh
14
+ import omnigibson as og
15
+ from omnigibson.utils.asset_utils import (
16
+ get_all_object_categories,
17
+ get_all_object_category_models,
18
+ )
19
+ from omnigibson.objects.dataset_object import DatasetObject
20
+ import omnigibson.utils.transform_utils as T
21
+ import omnigibson.lazy as lazy
22
+ from omnigibson.utils.ui_utils import (
23
+ KeyboardEventHandler,
24
+ draw_text,
25
+ clear_debug_drawing,
26
+ )
27
+ from omnigibson.macros import gm
28
+
29
+ import multiprocessing
30
+ from fs.zipfs import ZipFS
31
+ from PIL import Image
32
+ from bddl.knowledge_base import KnowledgeBase
33
+ from pathlib import Path
34
+ from nltk.corpus import wordnet as wn
35
+ import torch as th
36
+ import math
37
+
38
+
39
+ gm.USE_GPU_DYNAMICS = False
40
+
41
+ PI = th.tensor(th.pi)
42
+ LOW_PRECISION_ANGLE_INCREMENT = PI / 4
43
+ ANGLE_INCREMENT = PI / 90
44
+ FIXED_Y_SPACING = 0.1
45
+ INTERESTING_ABILITIES = {
46
+ "fillable",
47
+ "openable",
48
+ "cloth",
49
+ "heatSource",
50
+ "coldSource",
51
+ "particleApplier",
52
+ "particleRemover",
53
+ "toggleable",
54
+ "particleSource",
55
+ "particleSink",
56
+ }
57
+ JOINT_SECONDS_PER_CYCLE = 4.0
58
+
59
+
60
+ def add_keyboard_callback(key, callback_fn, description):
61
+ KeyboardEventHandler.add_keyboard_callback(key=key, callback_fn=callback_fn)
62
+ key_name = str(key).replace("KeyboardInput.", "").replace("_", " ")
63
+ print(f"Press {key_name} to {description}.")
64
+
65
+
66
+ class BatchQAViewer:
67
+ def __init__(self, record_path, your_id, total_ids, seed, pipeline_root):
68
+ self.env = None
69
+ self.pipeline_root = pipeline_root
70
+ self.record_path = record_path
71
+ self.your_id = your_id
72
+ self.total_ids = total_ids
73
+ self.seed = seed
74
+ self.all_objs = {
75
+ (cat, model)
76
+ for cat in get_all_object_categories()
77
+ for model in get_all_object_category_models(cat)
78
+ }
79
+ filtered_objs_by_id = {
80
+ this_id: sorted(
81
+ {
82
+ (cat, model)
83
+ for cat, model in self.all_objs
84
+ if int(hashlib.md5((cat + self.seed).encode()).hexdigest(), 16)
85
+ % self.total_ids
86
+ == this_id
87
+ }
88
+ )
89
+ for this_id in range(self.total_ids)
90
+ }
91
+ # print("Filtered objects by id:", {k: len(v) for k, v in filtered_objs_by_id.items()})
92
+ self.filtered_objs = filtered_objs_by_id[self.your_id]
93
+ self.processed_objects = self.load_processed_objects()
94
+ print("-" * 80)
95
+ print("IMPORTANT: VERIFY THIS NUMBER!")
96
+ print("There are a total of", len(self.filtered_objs), "objects in this batch.")
97
+ print("You are running the 5.0.2 version of this script.")
98
+ print("-" * 80)
99
+ input("Press Enter to continue...")
100
+ self.complaint_handler = ObjectComplaintHandler(pipeline_root)
101
+
102
+ # Reference objects
103
+ self.human = None
104
+ self.phone = None
105
+
106
+ # Precision mode
107
+ self.precision_mode = False
108
+
109
+ # Camera parameters
110
+ self.pan = th.tensor(0.0)
111
+ self.tilt = th.tensor(0.0)
112
+ self.dist = th.tensor(3.0)
113
+
114
+ @property
115
+ def angle_increment(self):
116
+ return ANGLE_INCREMENT if self.precision_mode else LOW_PRECISION_ANGLE_INCREMENT
117
+
118
+ @property
119
+ def scale_increment(self):
120
+ return th.tensor(1.1) if self.precision_mode else th.tensor(10.0)
121
+
122
+ def _toggle_precision(self):
123
+ self.precision_mode = not self.precision_mode
124
+ print(f"Precision mode: {'ON' if self.precision_mode else 'OFF'}")
125
+
126
+ def load_processed_objects(self):
127
+ processed_objs = set()
128
+ for cat, mdl in self.filtered_objs:
129
+ path = os.path.join(self.record_path, cat, mdl + ".json")
130
+ if os.path.exists(path):
131
+ processed_objs.add(mdl)
132
+ return processed_objs
133
+
134
+ @property
135
+ def remaining_objects(self):
136
+ return sorted(
137
+ {
138
+ (cat, model)
139
+ for cat, model in self.filtered_objs
140
+ if model not in self.processed_objects
141
+ }
142
+ )
143
+
144
+ def group_objects_by_category(self, objects):
145
+ grouped_objs = {}
146
+ for cat, model in objects:
147
+ if cat not in grouped_objs:
148
+ grouped_objs[cat] = []
149
+ grouped_objs[cat].append(model)
150
+ return grouped_objs
151
+
152
+ def import_objects(self, category, batch):
153
+ all_objects = []
154
+ for i, obj_model in enumerate(batch):
155
+ obj = DatasetObject(
156
+ name="obj_" + obj_model,
157
+ category=category,
158
+ model=obj_model,
159
+ visual_only=True,
160
+ )
161
+ self.env.scene.add_object(obj)
162
+ all_objects.append(obj)
163
+
164
+ # Make the collision meshes also visible
165
+ for link in obj.links.values():
166
+ for mesh in link.visual_meshes.values():
167
+ mesh.purpose = "default"
168
+ mesh.visible = not link.is_meta_link
169
+ for mesh in link.collision_meshes.values():
170
+ mesh.purpose = "default"
171
+ mesh.visible = False
172
+
173
+ return all_objects
174
+
175
+ def position_objects(self, all_objects, should_draw=True):
176
+ y_coordinate = 0
177
+ prev_obj_radius = 0
178
+
179
+ if should_draw:
180
+ clear_debug_drawing()
181
+
182
+ for index, obj in enumerate(all_objects):
183
+ obj_radius = th.linalg.norm(obj.aabb_extent[:2]) / 2.0
184
+ if index != 0:
185
+ y_coordinate += prev_obj_radius + FIXED_Y_SPACING + obj_radius
186
+ obj_in_min = obj.get_position_orientation()[0] - obj.aabb[0]
187
+
188
+ obj.set_position_orientation(
189
+ position=[obj_in_min[0], y_coordinate, obj_in_min[2] + 0.05]
190
+ )
191
+
192
+ if should_draw:
193
+ draw_text(
194
+ obj.name.replace("obj_", ""),
195
+ [0, y_coordinate, -0.1],
196
+ T.euler2quat(th.tensor([th.pi / 2, 0, th.pi / 2])),
197
+ color=(1.0, 0.0, 0.0, 1.0),
198
+ line_size=3.0,
199
+ anchor="topcenter",
200
+ max_width=obj_radius,
201
+ max_height=0.2,
202
+ )
203
+
204
+ prev_obj_radius = obj_radius
205
+
206
+ # Write the category name across the total dimension
207
+ min_y = all_objects[0].aabb[0][1]
208
+ max_y = all_objects[-1].aabb[1][1]
209
+ center_y = (min_y + max_y) / 2
210
+ length_y = max_y - min_y
211
+ if should_draw:
212
+ draw_text(
213
+ obj.category,
214
+ [0, center_y, -0.3],
215
+ T.euler2quat(th.tensor([th.pi / 2, 0, th.pi / 2])),
216
+ color=(1.0, 0.0, 0.0, 1.0),
217
+ line_size=3.0,
218
+ anchor="topcenter",
219
+ max_width=length_y,
220
+ )
221
+ og.sim.step()
222
+ og.sim.step()
223
+ og.sim.step()
224
+
225
+ def save_object_results(self, obj, orientation, scale, complaints):
226
+ orientation = obj.get_position_orientation()[1]
227
+ scale = obj.scale
228
+ if not os.path.exists(os.path.join(self.record_path, obj.category)):
229
+ os.makedirs(os.path.join(self.record_path, obj.category))
230
+ with open(
231
+ os.path.join(self.record_path, obj.category, obj.model + ".json"), "w"
232
+ ) as f:
233
+ json.dump(
234
+ {
235
+ "orientation": orientation.tolist(),
236
+ "scale": scale.tolist(),
237
+ "complaints": complaints,
238
+ },
239
+ f,
240
+ indent=4,
241
+ )
242
+
243
+ def set_camera_bindings(self, default_dist=3.0):
244
+ self.pan, self.tilt, self.dist = PI, th.tensor(0.0), th.tensor(default_dist)
245
+
246
+ def update_camera(d_pan, d_tilt, d_dist):
247
+ self.pan = (self.pan + d_pan) % (2 * th.pi)
248
+ self.tilt = th.clip(self.tilt + d_tilt, -th.pi / 2, th.pi / 2)
249
+ self.dist = th.clip(self.dist + d_dist, 0, 100)
250
+
251
+ def reset_camera():
252
+ self.pan, self.tilt, self.dist = PI, th.tensor(0.0), th.tensor(default_dist)
253
+
254
+ add_keyboard_callback(
255
+ key=lazy.carb.input.KeyboardInput.UP,
256
+ callback_fn=lambda: update_camera(0, ANGLE_INCREMENT, 0),
257
+ description="tilt camera up",
258
+ )
259
+ add_keyboard_callback(
260
+ key=lazy.carb.input.KeyboardInput.DOWN,
261
+ callback_fn=lambda: update_camera(0, -ANGLE_INCREMENT, 0),
262
+ description="tilt camera down",
263
+ )
264
+ add_keyboard_callback(
265
+ key=lazy.carb.input.KeyboardInput.LEFT,
266
+ callback_fn=lambda: update_camera(-ANGLE_INCREMENT, 0, 0),
267
+ description="pan camera left",
268
+ )
269
+ add_keyboard_callback(
270
+ key=lazy.carb.input.KeyboardInput.RIGHT,
271
+ callback_fn=lambda: update_camera(ANGLE_INCREMENT, 0, 0),
272
+ description="pan camera right",
273
+ )
274
+ add_keyboard_callback(
275
+ key=lazy.carb.input.KeyboardInput.PAGE_DOWN,
276
+ callback_fn=lambda: update_camera(0, 0, 0.1),
277
+ description="zoom in",
278
+ )
279
+ add_keyboard_callback(
280
+ key=lazy.carb.input.KeyboardInput.PAGE_UP,
281
+ callback_fn=lambda: update_camera(0, 0, -0.1),
282
+ description="zoom out",
283
+ )
284
+ add_keyboard_callback(
285
+ key=lazy.carb.input.KeyboardInput.END,
286
+ callback_fn=lambda: reset_camera(),
287
+ description="reset camera",
288
+ )
289
+
290
+ def update_camera(self, target):
291
+ # Get the camera position by starting at the target point and moving back by the distance
292
+ # along the negative pan / tilt direction
293
+ camera_pos = target - self.dist * th.tensor(
294
+ [
295
+ th.cos(self.pan) * th.cos(self.tilt),
296
+ th.sin(self.pan) * th.cos(self.tilt),
297
+ -th.sin(self.tilt),
298
+ ]
299
+ )
300
+ # Camera matrix: note that this is the OpenGL frame, so the camera is looking down the negative z-axis
301
+ # and the up vector is the positive y-axis.
302
+ weird_camera_frame = T.mat2quat(
303
+ th.tensor(
304
+ [
305
+ [0, 0, -1],
306
+ [-1, 0, 0],
307
+ [0, 1, 0],
308
+ ]
309
+ )
310
+ )
311
+ camera_orn = T.euler2quat(th.tensor([0.0, self.tilt, self.pan]))
312
+ camera_orn = T.quat_multiply(camera_orn, weird_camera_frame)
313
+ og.sim.viewer_camera.set_position_orientation(camera_pos, camera_orn)
314
+
315
+ def whole_batch_preview(self, all_objects):
316
+ KeyboardEventHandler.initialize()
317
+
318
+ params = og.sim.viewer_camera.camera_parameters
319
+ focal_length = params["cameraFocalLength"]
320
+ width, height = params["renderProductResolution"]
321
+ horizontal_aperture = params["cameraAperture"][0]
322
+ horizontal_fov = 2 * math.atan(horizontal_aperture / (2 * focal_length))
323
+ vertical_fov = horizontal_fov * height / width
324
+ obj = all_objects[0]
325
+ obj_x, obj_y, obj_z = obj.aabb_extent
326
+ self.set_camera_bindings(
327
+ default_dist=max(
328
+ obj_x / 2 + ((obj_y / 2) / math.tan(horizontal_fov / 2)) * 1.1,
329
+ obj_x / 2 + ((obj_z / 2) / math.tan(vertical_fov / 2)) * 1.1,
330
+ )
331
+ )
332
+
333
+ done = False
334
+ skip = False
335
+ y_min = th.min(th.tensor([obj.aabb[0][1] for obj in all_objects]))
336
+ y_max = th.max(th.tensor([obj.aabb[1][1] for obj in all_objects]))
337
+ average_pos = th.mean(th.stack([obj.aabb_center for obj in all_objects]), dim=0)
338
+
339
+ offset = 0.0
340
+
341
+ def _set_done():
342
+ nonlocal done
343
+ done = True
344
+
345
+ def _set_skip():
346
+ nonlocal skip
347
+ skip = True
348
+ _set_done()
349
+
350
+ def change_offset(d_offset):
351
+ nonlocal offset
352
+ offset += d_offset
353
+
354
+ # Set done when the user presses 'C'
355
+ add_keyboard_callback(
356
+ key=lazy.carb.input.KeyboardInput.NUMPAD_ENTER,
357
+ callback_fn=_set_done,
358
+ description="continue to object editing",
359
+ )
360
+ add_keyboard_callback(
361
+ key=lazy.carb.input.KeyboardInput.HOME,
362
+ callback_fn=_set_skip,
363
+ description="skip to next category",
364
+ )
365
+ add_keyboard_callback(
366
+ key=lazy.carb.input.KeyboardInput.NUMPAD_7,
367
+ callback_fn=lambda: change_offset(-1),
368
+ description="pan camera left",
369
+ )
370
+ add_keyboard_callback(
371
+ key=lazy.carb.input.KeyboardInput.NUMPAD_9,
372
+ callback_fn=lambda: change_offset(1),
373
+ description="pan camera right",
374
+ )
375
+
376
+ def _rotate_category(axis, angle):
377
+ current_rot = all_objects[0].get_position_orientation()[1]
378
+ rotation_delta = th.zeros(3)
379
+ rotation_delta["xyz".index(axis)] = angle
380
+ new_rot = T.quat_multiply(T.euler2quat(rotation_delta), current_rot)
381
+ # Round the new rotation to the nearest degree
382
+ rounded_rot = T.euler2quat(
383
+ th.deg2rad(th.round(th.rad2deg(T.quat2euler(new_rot))))
384
+ )
385
+
386
+ for obj in all_objects:
387
+ obj.set_position_orientation(orientation=rounded_rot)
388
+
389
+ # Reposition everything
390
+ self.position_objects(all_objects)
391
+ self.position_reference_objects(target_y=all_objects[0].aabb_center[1])
392
+
393
+ add_keyboard_callback(
394
+ key=lazy.carb.input.KeyboardInput.NUMPAD_3,
395
+ callback_fn=lambda: _rotate_category("z", self.angle_increment),
396
+ description="rotate category counterclockwise around z-axis",
397
+ )
398
+ add_keyboard_callback(
399
+ key=lazy.carb.input.KeyboardInput.NUMPAD_1,
400
+ callback_fn=lambda: _rotate_category("z", -self.angle_increment),
401
+ description="rotate category clockwise around z-axis",
402
+ )
403
+ add_keyboard_callback(
404
+ key=lazy.carb.input.KeyboardInput.NUMPAD_2,
405
+ callback_fn=lambda: _rotate_category("y", self.angle_increment),
406
+ description="rotate category counterclockwise around y-axis",
407
+ )
408
+ add_keyboard_callback(
409
+ key=lazy.carb.input.KeyboardInput.NUMPAD_8,
410
+ callback_fn=lambda: _rotate_category("y", -self.angle_increment),
411
+ description="rotate category clockwise around y-axis",
412
+ )
413
+ add_keyboard_callback(
414
+ key=lazy.carb.input.KeyboardInput.NUMPAD_4,
415
+ callback_fn=lambda: _rotate_category("x", self.angle_increment),
416
+ description="rotate category counterclockwise around x-axis",
417
+ )
418
+ add_keyboard_callback(
419
+ key=lazy.carb.input.KeyboardInput.NUMPAD_6,
420
+ callback_fn=lambda: _rotate_category("x", -self.angle_increment),
421
+ description="rotate category clockwise around x-axis",
422
+ )
423
+ add_keyboard_callback(
424
+ key=lazy.carb.input.KeyboardInput.NUMPAD_MULTIPLY,
425
+ callback_fn=lambda: [
426
+ obj.set_position_orientation(orientation=[0, 0, 0, 1])
427
+ for obj in all_objects
428
+ ],
429
+ description="reset category orientation",
430
+ )
431
+
432
+ while not done:
433
+ y = th.clip(y_min + offset, y_min, y_max)
434
+ target = th.tensor([average_pos[0], y, average_pos[2]])
435
+ self.update_camera(target)
436
+ og.sim.step()
437
+
438
+ KeyboardEventHandler.reset()
439
+ return skip
440
+
441
+ def evaluate_single_object(self, all_objects, i):
442
+ obj = all_objects[i]
443
+ print(f"\n\n\n\nNow editing object {obj.name.replace('obj_', '')}\n")
444
+
445
+ KeyboardEventHandler.initialize()
446
+
447
+ params = og.sim.viewer_camera.camera_parameters
448
+ focal_length = params["cameraFocalLength"]
449
+ width, height = params["renderProductResolution"]
450
+ horizontal_aperture = params["cameraAperture"][0]
451
+ horizontal_fov = 2 * math.atan(horizontal_aperture / (2 * focal_length))
452
+ vertical_fov = horizontal_fov * height / width
453
+ obj_x, obj_y, obj_z = obj.aabb_extent
454
+ self.set_camera_bindings(
455
+ default_dist=max(
456
+ obj_x / 2 + ((obj_y / 2) / math.tan(horizontal_fov / 2)) * 1.1,
457
+ obj_x / 2 + ((obj_z / 2) / math.tan(vertical_fov / 2)) * 1.1,
458
+ )
459
+ )
460
+
461
+ done = False
462
+ should_show_photo = False
463
+ quick_complaints = []
464
+ scale_queue = [] # We queue scales to apply them all at once to avoid .play getting called from .step
465
+ obj_first_pca_angle_map = {}
466
+ obj_second_pca_angle_map = {}
467
+
468
+ def _set_done():
469
+ nonlocal done
470
+ done = True
471
+
472
+ def _set_complaint(message):
473
+ quick_complaints.append(
474
+ {
475
+ "object": f"{obj.category}-{obj.model}",
476
+ "message": "QC: " + message,
477
+ "complaint": "quick complaint added during category & collision QA",
478
+ "processed": False,
479
+ "new": True,
480
+ }
481
+ )
482
+ print("Added", message, "complaint.\n")
483
+
484
+ def _toggle_gravity():
485
+ obj.visual_only = not obj.visual_only
486
+
487
+ # Reposition everything
488
+ self.position_objects(all_objects)
489
+ self.position_reference_objects(target_y=obj.aabb_center[1])
490
+
491
+ collision_visibility = True
492
+
493
+ def _toggle_collision_visibility():
494
+ # Disable all the visual meshes and enable all the collision ones
495
+ nonlocal collision_visibility
496
+ collision_visibility = not collision_visibility
497
+ for link in obj.links.values():
498
+ for mesh in link.visual_meshes.values():
499
+ mesh.visible = not collision_visibility
500
+ for mesh in link.collision_meshes.values():
501
+ mesh.visible = collision_visibility
502
+
503
+ # Warm this up
504
+ _toggle_collision_visibility()
505
+
506
+ meta_visibility = True
507
+
508
+ def _toggle_meta_visibility():
509
+ # Toggle the visibility of all the links
510
+ nonlocal meta_visibility
511
+ meta_visibility = not meta_visibility
512
+ for link in obj.links.values():
513
+ if not link.is_meta_link:
514
+ continue
515
+ for mesh in link.visual_meshes.values():
516
+ mesh.visible = meta_visibility
517
+ for mesh in link.collision_meshes.values():
518
+ mesh.visible = meta_visibility
519
+
520
+ # Warm this up
521
+ _toggle_meta_visibility()
522
+
523
+ joint_position_seed = th.tensor(
524
+ 0.0
525
+ ) # monotonically increasing, to be passed into th.sin
526
+ joints_moving = False
527
+
528
+ def _toggle_joints():
529
+ nonlocal joints_moving
530
+ joints_moving = not joints_moving
531
+
532
+ def _align_to_pca(pca_axis):
533
+ if pca_axis == 1 and obj in obj_first_pca_angle_map:
534
+ angle = obj_first_pca_angle_map[obj]
535
+ elif pca_axis == 2 and obj in obj_second_pca_angle_map:
536
+ angle = obj_second_pca_angle_map[obj]
537
+ else:
538
+ # Collecting points from the object
539
+ points = []
540
+ for link in obj.links.values():
541
+ for mesh in link.visual_meshes.values():
542
+ mesh_points = mesh.prim.GetAttribute("points").Get()
543
+ pos, ori = mesh.get_position_orientation()
544
+ transform = T.pose2mat((pos, ori))
545
+ if mesh_points is None or len(mesh_points) == 0:
546
+ continue
547
+ points.append(
548
+ trimesh.transformations.transform_points(
549
+ mesh_points, transform
550
+ )
551
+ )
552
+ points = th.concat(points, dim=0)
553
+
554
+ # Apply PCA to 3D points
555
+ from sklearn.decomposition import PCA
556
+
557
+ pca = PCA(n_components=3)
558
+ pca.fit(points)
559
+
560
+ if pca_axis == 1:
561
+ # The first principal component
562
+ pc = pca.components_[0]
563
+ else:
564
+ # The second principal component
565
+ pc = pca.components_[1]
566
+
567
+ # Compute the angle between the first principal component and the x-axis
568
+ angle = th.arctan2(pc[1], pc[0])
569
+
570
+ if pca_axis == 1:
571
+ obj_first_pca_angle_map[obj] = angle
572
+ else:
573
+ obj_second_pca_angle_map[obj] = angle
574
+
575
+ # Create a quaternion from this angle
576
+ rot = T.euler2quat(th.tensor([0, 0, angle]))
577
+
578
+ # Apply the rotation to the object
579
+ obj.set_position_orientation(orientation=rot)
580
+
581
+ # Reposition everything
582
+ self.position_objects(all_objects)
583
+ self.position_reference_objects(target_y=obj.aabb_center[1])
584
+
585
+ def _rotate_object(axis, angle):
586
+ current_rot = obj.get_position_orientation()[1]
587
+ rotation_delta = th.zeros(3)
588
+ rotation_delta["xyz".index(axis)] = angle
589
+ new_rot = T.quat_multiply(T.euler2quat(rotation_delta), current_rot)
590
+ # Round the new rotation to the nearest degree
591
+ rounded_rot = T.euler2quat(
592
+ th.deg2rad(th.round(th.rad2deg(T.quat2euler(new_rot))))
593
+ )
594
+ obj.set_position_orientation(orientation=rounded_rot)
595
+
596
+ # Reposition everything
597
+ self.position_objects(all_objects)
598
+ self.position_reference_objects(target_y=obj.aabb_center[1])
599
+
600
+ def _set_scale(new_scale):
601
+ object_poses = {
602
+ o: o.get_position_orientation() for o in self.env.scene.objects
603
+ }
604
+ og.sim.stop()
605
+ scale_ratio = new_scale[0] / obj.scale[0]
606
+ obj.scale = new_scale
607
+ og.sim.play()
608
+ for o, pose in object_poses.items():
609
+ o.set_position_orientation(*pose)
610
+
611
+ # Reposition everything
612
+ self.position_objects(all_objects)
613
+ self.position_reference_objects(target_y=obj.aabb_center[1])
614
+ self.dist *= scale_ratio
615
+
616
+ def _show_photo():
617
+ nonlocal should_show_photo
618
+ should_show_photo = True
619
+
620
+ # Other controls
621
+ add_keyboard_callback(
622
+ key=lazy.carb.input.KeyboardInput.NUMPAD_ENTER,
623
+ callback_fn=_set_done,
624
+ description="continue to complaint process",
625
+ )
626
+ # add_keyboard_callback(
627
+ # key=lazy.carb.input.KeyboardInput.NUMPAD_7,
628
+ # callback_fn=lambda: _align_to_pca(1),
629
+ # description="align object to first principal component"
630
+ # )
631
+ # add_keyboard_callback(
632
+ # key=lazy.carb.input.KeyboardInput.NUMPAD_9,
633
+ # callback_fn=lambda: _align_to_pca(2),
634
+ # description="align object to second principal component"
635
+ # )
636
+ add_keyboard_callback(
637
+ key=lazy.carb.input.KeyboardInput.NUMPAD_3,
638
+ callback_fn=lambda: _rotate_object("z", self.angle_increment),
639
+ description="rotate object counterclockwise around z-axis",
640
+ )
641
+ add_keyboard_callback(
642
+ key=lazy.carb.input.KeyboardInput.NUMPAD_1,
643
+ callback_fn=lambda: _rotate_object("z", -self.angle_increment),
644
+ description="rotate object clockwise around z-axis",
645
+ )
646
+ add_keyboard_callback(
647
+ key=lazy.carb.input.KeyboardInput.NUMPAD_2,
648
+ callback_fn=lambda: _rotate_object("y", self.angle_increment),
649
+ description="rotate object counterclockwise around y-axis",
650
+ )
651
+ add_keyboard_callback(
652
+ key=lazy.carb.input.KeyboardInput.NUMPAD_8,
653
+ callback_fn=lambda: _rotate_object("y", -self.angle_increment),
654
+ description="rotate object clockwise around y-axis",
655
+ )
656
+ add_keyboard_callback(
657
+ key=lazy.carb.input.KeyboardInput.NUMPAD_4,
658
+ callback_fn=lambda: _rotate_object("x", self.angle_increment),
659
+ description="rotate object counterclockwise around x-axis",
660
+ )
661
+ add_keyboard_callback(
662
+ key=lazy.carb.input.KeyboardInput.NUMPAD_6,
663
+ callback_fn=lambda: _rotate_object("x", -self.angle_increment),
664
+ description="rotate object clockwise around x-axis",
665
+ )
666
+ add_keyboard_callback(
667
+ key=lazy.carb.input.KeyboardInput.NUMPAD_MULTIPLY,
668
+ callback_fn=lambda: obj.set_position_orientation(orientation=[0, 0, 0, 1]),
669
+ description="reset object orientation",
670
+ )
671
+ add_keyboard_callback(
672
+ key=lazy.carb.input.KeyboardInput.NUMPAD_0,
673
+ callback_fn=_toggle_gravity,
674
+ description="toggle gravity for selected object",
675
+ )
676
+ add_keyboard_callback(
677
+ key=lazy.carb.input.KeyboardInput.NUMPAD_DEL,
678
+ callback_fn=lambda: self._toggle_precision(),
679
+ description="toggle precision mode",
680
+ )
681
+ add_keyboard_callback(
682
+ key=lazy.carb.input.KeyboardInput.NUMPAD_ADD,
683
+ callback_fn=lambda: scale_queue.append(self.scale_increment),
684
+ description="increase object scale",
685
+ )
686
+ add_keyboard_callback(
687
+ key=lazy.carb.input.KeyboardInput.NUMPAD_SUBTRACT,
688
+ callback_fn=lambda: scale_queue.append(1 / self.scale_increment),
689
+ description="decrease object scale",
690
+ )
691
+ add_keyboard_callback(
692
+ key=lazy.carb.input.KeyboardInput.NUMPAD_DIVIDE,
693
+ callback_fn=lambda: scale_queue.append(th.tensor(0)),
694
+ description="reset object scale",
695
+ )
696
+ add_keyboard_callback(
697
+ key=lazy.carb.input.KeyboardInput.C,
698
+ callback_fn=_toggle_collision_visibility,
699
+ description="toggle collision mesh visibility",
700
+ )
701
+ add_keyboard_callback(
702
+ key=lazy.carb.input.KeyboardInput.M,
703
+ callback_fn=_toggle_meta_visibility,
704
+ description="toggle meta link mesh visibility",
705
+ )
706
+ add_keyboard_callback(
707
+ key=lazy.carb.input.KeyboardInput.J,
708
+ callback_fn=_toggle_joints,
709
+ description="toggle joint movement",
710
+ )
711
+ add_keyboard_callback(
712
+ key=lazy.carb.input.KeyboardInput.KEY_1,
713
+ callback_fn=lambda: _set_complaint("category"),
714
+ description="add a category or synset complaint",
715
+ )
716
+ add_keyboard_callback(
717
+ key=lazy.carb.input.KeyboardInput.KEY_2,
718
+ callback_fn=lambda: _set_complaint("appearance"),
719
+ description="add a visual appearance complaint",
720
+ )
721
+ add_keyboard_callback(
722
+ key=lazy.carb.input.KeyboardInput.KEY_3,
723
+ callback_fn=lambda: _set_complaint("handle"),
724
+ description="add a handle-specific collision mesh complaint",
725
+ )
726
+ add_keyboard_callback(
727
+ key=lazy.carb.input.KeyboardInput.KEY_4,
728
+ callback_fn=lambda: _set_complaint("collision"),
729
+ description="add a general collision complaint",
730
+ )
731
+ add_keyboard_callback(
732
+ key=lazy.carb.input.KeyboardInput.KEY_5,
733
+ callback_fn=lambda: _set_complaint("joint"),
734
+ description="add a joint complaint",
735
+ )
736
+ add_keyboard_callback(
737
+ key=lazy.carb.input.KeyboardInput.KEY_6,
738
+ callback_fn=lambda: _set_complaint("metalink"),
739
+ description="add a meta link complaint",
740
+ )
741
+ add_keyboard_callback(
742
+ key=lazy.carb.input.KeyboardInput.KEY_7,
743
+ callback_fn=lambda: _set_complaint("unknown"),
744
+ description="add a generic complaint to be re-examined by the team",
745
+ )
746
+ print("-" * 80)
747
+
748
+ print(
749
+ "\nEdit the currently selected object to match the realistic size of the category."
750
+ )
751
+ print(
752
+ "It should also face the same way as the other objects, and should be stable in its"
753
+ )
754
+ print("canonical orientation.\n")
755
+
756
+ # position reference objects to be next to the inspected object
757
+ self.position_reference_objects(target_y=obj.aabb_center[1])
758
+
759
+ # Prompt the user to fix the scale and orientation of the object. Keep the camera in position, too.
760
+ step = 0
761
+ while not done:
762
+ og.sim.step()
763
+
764
+ if should_show_photo:
765
+ should_show_photo = False
766
+ # First, load the background image
767
+ background_path = os.path.join(
768
+ self.pipeline_root, "b1k_pipeline", "tools", "background.jpg"
769
+ )
770
+ background = Image.open(background_path).resize((800, 800))
771
+
772
+ # Open the zip file
773
+ zip_path = os.path.join(
774
+ self.pipeline_root, "artifacts", "pipeline", "max_object_images.zip"
775
+ )
776
+ with ZipFS(zip_path) as zip_fs:
777
+ # Find and show photos of this object.
778
+ image_paths = sorted(
779
+ [
780
+ x
781
+ for x in zip_fs.listdir("/")
782
+ if obj.name.replace("obj_", "") in x
783
+ ]
784
+ )
785
+ for image_path in image_paths:
786
+ with zip_fs.open(image_path, "rb") as f:
787
+ image = background.copy()
788
+ max_image = Image.open(f)
789
+ image.paste(max_image, (0, 0), mask=max_image)
790
+ image.show()
791
+
792
+ # Apply any scale changes
793
+ if len(scale_queue) > 0:
794
+ scale = th.tensor(obj.scale)
795
+ if any(s == 0 for s in scale_queue):
796
+ scale = th.ones(3) # Reset the scale
797
+ else:
798
+ scale *= th.prod(th.tensor(scale_queue))
799
+ _set_scale(scale)
800
+ scale_queue.clear()
801
+
802
+ # Apply joint motion
803
+ if obj.n_dof > 0:
804
+ if joints_moving:
805
+ joint_position_seed += (
806
+ 2 * th.pi * og.sim.get_rendering_dt() / JOINT_SECONDS_PER_CYCLE
807
+ )
808
+ joint_positions = th.ones(obj.n_dof) * th.sin(joint_position_seed)
809
+ obj.set_joint_positions(
810
+ positions=joint_positions, normalized=True, drive=False
811
+ )
812
+
813
+ self.update_camera(obj.aabb_center)
814
+ if step % 100 == 0:
815
+ scale_str = (
816
+ f"{obj.scale[0]:.2f}, {obj.scale[1]:.2f}, {obj.scale[2]:.2f}"
817
+ )
818
+ rotation = th.rad2deg(T.quat2euler(obj.get_position_orientation()[1]))
819
+ rotation_str = (
820
+ f"{rotation[0]:.2f}, {rotation[1]:.2f}, {rotation[2]:.2f}"
821
+ )
822
+ bbox_str = f"{obj.aabb_extent[0] * 100:.2f}cm, {obj.aabb_extent[1] * 100:.2f}cm, {obj.aabb_extent[2] * 100:.2f}cm"
823
+ print(
824
+ f"Bounding box extent: {bbox_str}. Scale: {scale_str}. Rotation: {rotation_str} ",
825
+ end="\r",
826
+ )
827
+ step += 1
828
+ print()
829
+ print("-" * 80)
830
+
831
+ # Now we're done with bbox and scale and orientation. Save the data.
832
+ orientation = obj.get_position_orientation()[1]
833
+ scale = obj.scale
834
+
835
+ # Set the object back to visual only and reposition everything
836
+ obj.visual_only = True
837
+ self.position_objects(all_objects)
838
+ self.position_reference_objects(target_y=obj.aabb_center[1])
839
+
840
+ # Set the keyboard bindings back to camera only
841
+ KeyboardEventHandler.reset()
842
+ KeyboardEventHandler.initialize()
843
+ self.set_camera_bindings(
844
+ default_dist=max(
845
+ obj_x / 2 + ((obj_y / 2) / math.tan(horizontal_fov / 2)) * 1.1,
846
+ obj_x / 2 + ((obj_z / 2) / math.tan(vertical_fov / 2)) * 1.1,
847
+ )
848
+ )
849
+
850
+ step = 0
851
+
852
+ def update():
853
+ nonlocal step
854
+ step += 1
855
+ og.sim.step()
856
+ self.update_camera(obj.aabb_center)
857
+
858
+ # Launch the complaint thread
859
+ questions = self.complaint_handler.get_questions(obj)
860
+ complaints = self.complaint_handler.process_complaints(
861
+ obj.category,
862
+ obj.name.replace("obj_", ""),
863
+ questions,
864
+ quick_complaints,
865
+ sys.stdin.fileno(),
866
+ update,
867
+ )
868
+
869
+ # Save the object results
870
+ self.save_object_results(obj, orientation, scale, complaints)
871
+
872
+ # Mark the object as processed
873
+ self.processed_objects.add(obj.name.replace("obj_", ""))
874
+
875
+ KeyboardEventHandler.reset()
876
+
877
+ def evaluate_batch(self, batch, category):
878
+ all_objects = self.import_objects(category, batch)
879
+ og.sim.step()
880
+ self.position_objects(all_objects)
881
+ self.position_reference_objects(target_y=0.0)
882
+
883
+ # Phase 1: Continuously pan across the full category to show the user all objects
884
+ skip = self.whole_batch_preview(all_objects)
885
+ if not skip:
886
+ # Phase 2: Allow the user to interact with the objects one by one
887
+ for i in range(len(all_objects)):
888
+ self.evaluate_single_object(all_objects, i)
889
+
890
+ # Clean up.
891
+ for obj in all_objects:
892
+ self.env.scene.remove_object(obj)
893
+
894
+ return skip
895
+
896
+ def position_reference_objects(self, target_y):
897
+ obj_in_center_frame = (
898
+ self.phone.get_position_orientation()[0] - self.phone.aabb_center
899
+ )
900
+ obj_in_min_frame = self.phone.get_position_orientation()[0] - self.phone.aabb[0]
901
+ obj_in_max_frame = self.phone.get_position_orientation()[0] - self.phone.aabb[1]
902
+ self.phone.set_position_orientation(
903
+ position=[
904
+ -0.05 + obj_in_max_frame[0],
905
+ target_y + obj_in_center_frame[1],
906
+ obj_in_min_frame[2],
907
+ ]
908
+ )
909
+
910
+ human_in_center_frame = (
911
+ self.human.get_position_orientation()[0] - self.human.aabb_center
912
+ )
913
+ human_in_min_frame = (
914
+ self.human.get_position_orientation()[0] - self.human.aabb[0]
915
+ )
916
+ human_in_max_frame = (
917
+ self.human.get_position_orientation()[0] - self.human.aabb[1]
918
+ )
919
+ self.human.set_position_orientation(
920
+ position=[
921
+ -0.1 + self.phone.aabb_extent[0] + human_in_max_frame[0],
922
+ target_y + human_in_center_frame[1],
923
+ human_in_min_frame[2],
924
+ ]
925
+ )
926
+
927
+ def add_reference_objects(self):
928
+ # Add a cellphone into the scene
929
+ phone = DatasetObject(
930
+ name="dbhfuh",
931
+ category="cell_phone",
932
+ model="dbhfuh",
933
+ visual_only=True,
934
+ )
935
+ self.env.scene.add_object(phone)
936
+ og.sim.step()
937
+ phone.links["meta__base_link_togglebutton_0_0_link"].visible = False
938
+ phone.set_position_orientation(
939
+ orientation=T.euler2quat(th.tensor([th.pi / 2, th.pi / 2, 0]))
940
+ )
941
+
942
+ # Add a human into the scene
943
+ curr_dir = os.path.dirname(os.path.realpath(__file__))
944
+ human_usd_path = os.path.join(curr_dir, "HumanFemale/HumanFemale.usd")
945
+ human_prim_path = "/World/scene_0/human"
946
+ lazy.omni.isaac.core.utils.stage.add_reference_to_stage(
947
+ usd_path=human_usd_path, prim_path=human_prim_path, prim_type="Xform"
948
+ )
949
+ human_prim = XFormPrim(name="human", relative_prim_path="/human")
950
+ human_prim.load(self.env.scene)
951
+ human_prim.set_position_orientation(
952
+ orientation=T.euler2quat(th.tensor([0, 0, th.pi / 2]))
953
+ )
954
+ human_prim.scale = [0.012, 0.012, 0.012]
955
+ og.sim.step()
956
+
957
+ return human_prim, phone
958
+
959
+ def run(self):
960
+ if self.your_id < 0 or self.your_id >= self.total_ids:
961
+ print("Invalid id!")
962
+ sys.exit(1)
963
+
964
+ print(
965
+ f"{len(self.processed_objects)}/{len(self.filtered_objs)} objects processed. {len(self.remaining_objects)} objects remaining."
966
+ )
967
+
968
+ # Load the environment and set the lighting parameters.
969
+ cfg = {"scene": {"type": "Scene", "floor_plane_visible": False}}
970
+ self.env = og.Environment(configs=cfg)
971
+ dome_light = og.sim.skybox
972
+ dome_light.intensity = 7.5e2
973
+ dome_light.color = [1.0, 1.0, 1.0]
974
+ dome_light.light_link.prim.GetAttribute("inputs:texture:file").Clear()
975
+
976
+ self.human, self.phone = self.add_reference_objects()
977
+
978
+ remaining_objs_by_cat = self.group_objects_by_category(self.remaining_objects)
979
+
980
+ batch_size = 20
981
+
982
+ for cat, models in remaining_objs_by_cat.items():
983
+ print(f"Processing category {cat}...")
984
+ sorted_models = sorted(models)
985
+ for batch_start in range(0, len(sorted_models), batch_size):
986
+ batch = sorted_models[batch_start : batch_start + batch_size]
987
+ skip = self.evaluate_batch(batch, cat)
988
+ if skip:
989
+ print("Skipping the rest of the category", cat)
990
+ break
991
+ print(
992
+ f"\n\n{len(self.processed_objects)}/{len(self.filtered_objs)} objects processed. {len(self.remaining_objects)} objects remaining.\n"
993
+ )
994
+ # time.sleep(0.1)
995
+
996
+
997
+ class ObjectComplaintHandler:
998
+ def __init__(self, pipeline_root):
999
+ self.pipeline_root = Path(pipeline_root)
1000
+ self.inventory_dict = self._load_inventory()
1001
+ self.kb = KnowledgeBase(populate=True)
1002
+
1003
+ def _load_inventory(self):
1004
+ inventory_path = self.pipeline_root / "artifacts/pipeline/object_inventory.json"
1005
+ with open(inventory_path, "r") as file:
1006
+ return json.load(file)["providers"]
1007
+
1008
+ def _get_existing_complaints(self, model):
1009
+ provider = None
1010
+ for obj, provider_candidate in self.inventory_dict.items():
1011
+ if obj.split("-")[-1] == model:
1012
+ provider = provider_candidate
1013
+ break
1014
+ assert provider is not None, f"Provider not found for object {model}"
1015
+
1016
+ complaints_file = self.pipeline_root / "cad" / provider / "complaints.json"
1017
+ if not complaints_file.exists():
1018
+ return []
1019
+ with open(complaints_file, "r") as file:
1020
+ all_complaints = json.load(file)
1021
+ filtered_complaints = []
1022
+ for complaint in all_complaints:
1023
+ if complaint["object"].split("-")[-1] != model:
1024
+ continue
1025
+ filtered_complaints.append(complaint)
1026
+ return filtered_complaints
1027
+
1028
+ def create_unresolve_complaint(self, existing_complaints, idx):
1029
+ def unresolve_complaint():
1030
+ nonlocal existing_complaints, idx
1031
+ print(f"Unresolved complaint {idx + 1}")
1032
+ existing_complaints[idx]["processed"] = False
1033
+
1034
+ return unresolve_complaint
1035
+
1036
+ def process_complaints(
1037
+ self, category, model, messages, quick_complaints, stdin_fileno, update
1038
+ ):
1039
+ sys.stdin = os.fdopen(stdin_fileno)
1040
+
1041
+ # Get existing complaints.
1042
+ existing_complaints = self._get_existing_complaints(model)
1043
+
1044
+ # Take note of the unresolved ones.
1045
+ unresolved_indices = [
1046
+ idx
1047
+ for idx, complaint in enumerate(existing_complaints)
1048
+ if not complaint["processed"]
1049
+ ]
1050
+
1051
+ # Mark all as resolved
1052
+ for complaint in existing_complaints:
1053
+ complaint["processed"] = True
1054
+
1055
+ # Allow the user to pick which complaints to keep unresolved.
1056
+ if len(unresolved_indices) > 0:
1057
+ print(f"Found {len(unresolved_indices)} unresolved complaints.")
1058
+ for i, idx in enumerate(unresolved_indices, start=1):
1059
+ print(f"\nComplaint {i}:")
1060
+ complaint = existing_complaints[idx]
1061
+ print(f"Prompt: {complaint['message']}\n")
1062
+ print(f"Complaint: {complaint['complaint']}\n")
1063
+
1064
+ print(
1065
+ "\nALL complaints except the ones you enter below will be marked as RESOLVED."
1066
+ )
1067
+
1068
+ assert len(unresolved_indices) < 10
1069
+ KEYS = {
1070
+ lazy.carb.input.KeyboardInput.KEY_1: 0,
1071
+ lazy.carb.input.KeyboardInput.KEY_2: 1,
1072
+ lazy.carb.input.KeyboardInput.KEY_3: 2,
1073
+ lazy.carb.input.KeyboardInput.KEY_4: 3,
1074
+ lazy.carb.input.KeyboardInput.KEY_5: 4,
1075
+ lazy.carb.input.KeyboardInput.KEY_6: 5,
1076
+ lazy.carb.input.KeyboardInput.KEY_7: 6,
1077
+ lazy.carb.input.KeyboardInput.KEY_8: 7,
1078
+ lazy.carb.input.KeyboardInput.KEY_9: 8,
1079
+ }
1080
+ KEYS_LIST = list(KEYS.keys())
1081
+ for i in range(len(unresolved_indices)):
1082
+ add_keyboard_callback(
1083
+ key=KEYS_LIST[i],
1084
+ callback_fn=self.create_unresolve_complaint(existing_complaints, i),
1085
+ description=f"unresolve complaint {i + 1}",
1086
+ )
1087
+
1088
+ done = False
1089
+
1090
+ def _set_done():
1091
+ nonlocal done
1092
+ done = True
1093
+
1094
+ # Set done when the user presses 'C'
1095
+ add_keyboard_callback(
1096
+ key=lazy.carb.input.KeyboardInput.NUMPAD_ENTER,
1097
+ callback_fn=_set_done,
1098
+ description="finish complaints",
1099
+ )
1100
+
1101
+ while not done:
1102
+ update()
1103
+
1104
+ else:
1105
+ print("No unresolved complaints found.")
1106
+
1107
+ print("-" * 80)
1108
+
1109
+ for message in messages:
1110
+ complaint = self._process_single_complaint(message, category, model)
1111
+ if complaint:
1112
+ existing_complaints.append(complaint)
1113
+ print("-" * 80)
1114
+
1115
+ all_complaints = existing_complaints + quick_complaints
1116
+
1117
+ return all_complaints
1118
+
1119
+ def _process_single_complaint(self, message, category, model):
1120
+ print(message)
1121
+ response = input("Enter a complaint (or hit enter if all's good): ")
1122
+ if response:
1123
+ return {
1124
+ "object": f"{category}-{model}",
1125
+ "message": message,
1126
+ "complaint": response,
1127
+ "processed": False,
1128
+ "new": True,
1129
+ }
1130
+
1131
+ return None
1132
+
1133
+ def get_questions(self, obj):
1134
+ messages = [
1135
+ # self._get_synset_question(obj),
1136
+ # self._get_substanceness_question(obj),
1137
+ # self._get_ability_question(obj),
1138
+ # self._get_category_question(obj),
1139
+ # self._get_single_rigid_body_question(obj),
1140
+ # self._get_appearance_question(obj),
1141
+ # self._get_articulation_question(obj),
1142
+ # self._get_collision_question(obj),
1143
+ ]
1144
+
1145
+ # if "cloth" in self._get_synset_and_abilities(obj.category)[1]:
1146
+ # self._get_unfolded_question(obj),
1147
+
1148
+ return messages
1149
+
1150
+ def _get_synset_and_abilities(self, category):
1151
+ cat = self.kb.get_category(category)
1152
+ synset = cat.synset.name if cat else None
1153
+ if synset is None:
1154
+ ps = self.kb.get_particle_system(category)
1155
+ synset = ps.synset.name if ps else None
1156
+ assert synset is not None, f"Synset not found for category {category}"
1157
+ return synset, self.kb.get_synset(synset).abilities
1158
+
1159
+ def _get_synset_and_definition(self, category):
1160
+ synset, _ = self._get_synset_and_abilities(category)
1161
+ try:
1162
+ s = wn.synset(synset)
1163
+ return s.name(), s.definition()
1164
+ except:
1165
+ s = wn.synset([p.name for p in self.kb.get_synset(synset).parents][0])
1166
+ return (
1167
+ f"{synset} (custom synset)",
1168
+ f"(hypernyms: {s.name()}): {s.definition()}",
1169
+ )
1170
+
1171
+ def _get_synset_question(self, obj):
1172
+ synset, definition = self._get_synset_and_definition(obj.category)
1173
+ message = (
1174
+ "SYNSET: Confirm object synset assignment.\n\n"
1175
+ f"Object assigned to synset: {synset}\n"
1176
+ f"Definition: {definition}\n\n"
1177
+ "Reminder: synset should match the object and not its contents.\n"
1178
+ "(e.g., orange_juice.n.01 is the fluid orange juice and not a bottle).\n"
1179
+ "For containers, note that usable containers (e.g. ones that have an open cap and\n"
1180
+ "can be filled should be assigned to x__bottle.n.01 etc. synsets/categories while\n"
1181
+ "non-usable containers should be assigned to bottle__of__x.n.01 etc. synsets/categories).\n\n"
1182
+ "If the synset is wrong, please type in the name of the correct synset the object\n"
1183
+ "should be assigned to. In the next question also type in the correct category."
1184
+ )
1185
+ return message
1186
+
1187
+ def _get_category_question(self, obj):
1188
+ message = (
1189
+ "CATEGORY: Confirm object category assignment.\n\n"
1190
+ f"Object assigned to category: {obj.category}\n\n"
1191
+ "If the object is not compatible with the rest of the objects in this category,\n"
1192
+ "(e.g. tabletop sink vs regular sink), change the category here.\n"
1193
+ "Confirm that the object is the same kind of object as the rest of the objects\n"
1194
+ "in this category.\n\n"
1195
+ "If the category is wrong, please type in the correct category."
1196
+ )
1197
+ return message
1198
+
1199
+ def _get_substanceness_question(self, obj):
1200
+ _, abilities = self._get_synset_and_abilities(obj.category)
1201
+ substance_types = set(abilities.keys()) & {
1202
+ "rigidBody",
1203
+ "liquid",
1204
+ "macroPhysicalSubstance",
1205
+ "microPhysicalSubstance",
1206
+ "visualSubstance",
1207
+ "cloth",
1208
+ "softBody",
1209
+ "rope",
1210
+ }
1211
+ assert (
1212
+ len(substance_types) == 1
1213
+ ), f"Multiple substance types found for object {obj.name.replace('obj_', '')}"
1214
+ (substance_type,) = substance_types
1215
+ message = (
1216
+ "SUBSTANCE: Confirm if object should be a rigid body, cloth, or substance.\n"
1217
+ "If it's marked softBody or rope, that means it will be a rigid body for now, which is OK.\n\n"
1218
+ f"Currently, it is annotated as: {substance_type}.\n\n"
1219
+ 'Enter one of "rigidBody", "liquid", "macroPhysicalSubstance", "microPhysicalSubstance", "visualSubstance", "cloth", "softBody", "rope" to change.'
1220
+ )
1221
+ return message
1222
+
1223
+ def _get_ability_question(self, obj):
1224
+ _, abilities = self._get_synset_and_abilities(obj.category)
1225
+ interesting_abilities = [
1226
+ f" {a}: {a in abilities}" for a in sorted(INTERESTING_ABILITIES)
1227
+ ]
1228
+ message = (
1229
+ "ABILITIES: Confirm that this object can support all of the abilities seen below.\n\n"
1230
+ "Abilities to evaluate (subset of all abilities): \n"
1231
+ )
1232
+ message += "\n".join(sorted(interesting_abilities))
1233
+ message += (
1234
+ "\n\nIf this object looks like it should have some of these abilities flipped, please\n"
1235
+ "list the abilities that we should flip for this object as a comma separated list.\n"
1236
+ "For example, for an unopenable window you would put in 'openable'."
1237
+ )
1238
+ return message
1239
+
1240
+ def _get_single_rigid_body_question(self, obj):
1241
+ message = "CONNECTED: Confirm object is a single body. An object cannot contain disconnected parts."
1242
+ return message
1243
+
1244
+ def _get_appearance_question(self, obj):
1245
+ message = (
1246
+ "APPEARANCE: Confirm object visual appearance.\n"
1247
+ "Requirements:\n"
1248
+ "- make sure the object has a valid texture or appearance (e.g., texture not UNEXPECTEDLY black,\n"
1249
+ " transparency rendered correctly, etc).\n"
1250
+ "- make sure any glass parts are transparent (would this object contain glass? e.g.\n"
1251
+ " wall pictures, clocks, etc. - anything wrong)\n"
1252
+ )
1253
+ return message
1254
+
1255
+ def _get_collision_question(self, obj):
1256
+ message = (
1257
+ "COLLISION: Confirm object collision meshes (C to toggle on/off).\n"
1258
+ "Requirements:\n"
1259
+ "- make sure the collision meshes well approximate the original visual meshes\n"
1260
+ "- make sure the collision meshes don't lose any affordance (e.g., holes and handles are preserved)."
1261
+ )
1262
+ return message
1263
+
1264
+ def _get_articulation_question(self, obj):
1265
+ message = "ARTICULATION: Confirm articulation:\n"
1266
+ message += "This object has the below movable links annotated:\n"
1267
+ if len(obj.joints) == 0:
1268
+ message += "- None\n"
1269
+ else:
1270
+ for j_name, j in obj.joints.items():
1271
+ message += f"- {j_name}, {j.joint_type}\n"
1272
+ message += "\nVerify that the joint limits look reasonable and that the object is not\n"
1273
+ message += "missing articulations that would make it useless. Do NOT be overly ambitious - we\n"
1274
+ message += "only care about MUST-HAVE articulations here."
1275
+ return message
1276
+
1277
+ def _get_unfolded_question(self, obj):
1278
+ message = "Confirm the default state of the rope/cloth object is unfolded."
1279
+ return message
1280
+
1281
+ def _get_meta_link_question(self, obj):
1282
+ meta_links = sorted(
1283
+ {
1284
+ meta_name
1285
+ for link_metas in obj.metadata["meta_links"].values()
1286
+ for meta_name in link_metas
1287
+ }
1288
+ )
1289
+ message = "Confirm object meta links listed below:\n"
1290
+ if len(meta_links) == 0:
1291
+ message += "- None\n"
1292
+ else:
1293
+ for meta_link in meta_links:
1294
+ message += f"- {meta_link}\n"
1295
+ message += "Make sure these match mechanisms you expect from this object."
1296
+ return message
1297
+
1298
+
1299
+ if __name__ == "__main__":
1300
+ parser = argparse.ArgumentParser(description="Process some integers.")
1301
+ parser.add_argument(
1302
+ "--record_path",
1303
+ type=str,
1304
+ required=True,
1305
+ help="The path to save recorded orientations and scales.",
1306
+ )
1307
+ parser.add_argument(
1308
+ "--id",
1309
+ type=int,
1310
+ required=True,
1311
+ help=f"Your assigned id in range (0, total_ids-1).",
1312
+ )
1313
+ parser.add_argument(
1314
+ "--total_ids", type=int, required=True, help=f"Total number of IDs."
1315
+ )
1316
+ parser.add_argument("--seed", type=str, required=True, help=f"The shuffling seed.")
1317
+ args = parser.parse_args()
1318
+
1319
+ pipeline_root = Path(__file__).resolve().parents[2]
1320
+ viewer = BatchQAViewer(
1321
+ args.record_path,
1322
+ args.id,
1323
+ args.total_ids,
1324
+ args.seed,
1325
+ pipeline_root=str(pipeline_root),
1326
+ )
1327
+ viewer.run()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/category_qa_josiah.py ADDED
@@ -0,0 +1,1494 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Helper script to perform batch QA on OmniGibson objects.
3
+ """
4
+
5
+ import hashlib
6
+ import os
7
+ import pathlib
8
+ import sys
9
+ import json
10
+ import argparse
11
+ import time
12
+ from omnigibson.prims.xform_prim import XFormPrim
13
+ import trimesh
14
+ import omnigibson as og
15
+ from omnigibson.utils.asset_utils import (
16
+ get_all_object_categories,
17
+ get_all_object_category_models,
18
+ )
19
+ from omnigibson.objects.dataset_object import DatasetObject
20
+ from omnigibson.object_states import REGISTERED_OBJECT_STATES, Open
21
+ from omnigibson.object_states.link_based_state_mixin import LinkBasedStateMixin
22
+ import omnigibson.utils.transform_utils as T
23
+ import omnigibson.lazy as lazy
24
+ from omnigibson.utils.asset_utils import decrypted
25
+ from omnigibson.utils.ui_utils import (
26
+ KeyboardEventHandler,
27
+ draw_text,
28
+ clear_debug_drawing,
29
+ )
30
+ from omnigibson.macros import gm
31
+ from nltk.corpus import wordnet
32
+
33
+ import multiprocessing
34
+ from fs.zipfs import ZipFS
35
+ from PIL import Image
36
+ from bddl.knowledge_base import KnowledgeBase
37
+ from pathlib import Path
38
+ from nltk.corpus import wordnet as wn
39
+ import torch as th
40
+
41
+
42
+ gm.USE_GPU_DYNAMICS = False
43
+
44
+ PI = th.tensor(th.pi)
45
+ LOW_PRECISION_ANGLE_INCREMENT = PI / 4
46
+ ANGLE_INCREMENT = PI / 90
47
+ FIXED_Y_SPACING = 0.1
48
+ INTERESTING_ABILITIES = {
49
+ "fillable",
50
+ "openable",
51
+ "cloth",
52
+ "heatSource",
53
+ "coldSource",
54
+ "particleApplier",
55
+ "particleRemover",
56
+ "toggleable",
57
+ "particleSource",
58
+ "particleSink",
59
+ }
60
+ JOINT_SECONDS_PER_CYCLE = 4.0
61
+
62
+ ANNOTATION_TYPE_MAPPING = {
63
+ 0: "canonical scale + ori tuning",
64
+ 1: "synset interchangeability checking",
65
+ 2: "visual mesh + collision mesh checking",
66
+ 5: "joints checking",
67
+ 6: "metalink checking",
68
+ 7: "previous complaint checking",
69
+ }
70
+
71
+ IGNORE_METALINK_TYPES = {"attachment"}
72
+ CUSTOM_INCLUDE_METALINK_TYPES = {"fillable"}
73
+ METALINK_STATES = [
74
+ state
75
+ for state in REGISTERED_OBJECT_STATES.values()
76
+ if issubclass(state, LinkBasedStateMixin) and state.requires_meta_link
77
+ ]
78
+ METALINK_TYPES = (
79
+ {state.meta_link_type for state in METALINK_STATES} - IGNORE_METALINK_TYPES
80
+ ).union(CUSTOM_INCLUDE_METALINK_TYPES)
81
+
82
+
83
+ def add_keyboard_callback(key, callback_fn, description):
84
+ KeyboardEventHandler.add_keyboard_callback(key=key, callback_fn=callback_fn)
85
+ key_name = str(key).replace("KeyboardInput.", "").replace("_", " ")
86
+ print(f"Press {key_name} to {description}.")
87
+
88
+
89
+ class BatchQAViewer:
90
+ def __init__(
91
+ self, record_path, your_id, total_ids, seed, pipeline_root, annotation_type
92
+ ):
93
+ self.env = None
94
+ self.pipeline_root = pipeline_root
95
+ assert (
96
+ annotation_type in ANNOTATION_TYPE_MAPPING
97
+ ), f"Got invalid annotation_type. Expected one of: {ANNOTATION_TYPE_MAPPING}"
98
+ self.annotation_type = annotation_type
99
+ self.kb = KnowledgeBase(populate=True)
100
+ self.record_path = record_path + f"_{self.annotation_type}"
101
+ self.your_id = your_id
102
+ self.total_ids = total_ids
103
+ self.seed = seed
104
+ self.all_objs = {
105
+ (cat, model)
106
+ for cat in get_all_object_categories()
107
+ for model in get_all_object_category_models(cat)
108
+ }
109
+ filtered_objs_by_id = {
110
+ this_id: sorted(
111
+ {
112
+ (cat, model)
113
+ for cat, model in self.all_objs
114
+ if int(hashlib.md5((cat + self.seed).encode()).hexdigest(), 16)
115
+ % self.total_ids
116
+ == this_id
117
+ }
118
+ )
119
+ for this_id in range(self.total_ids)
120
+ }
121
+ # print("Filtered objects by id:", {k: len(v) for k, v in filtered_objs_by_id.items()})
122
+ self.filtered_objs = filtered_objs_by_id[self.your_id]
123
+ self.processed_objects = self.load_processed_objects()
124
+ print("-" * 80)
125
+ print("IMPORTANT: VERIFY THIS NUMBER!")
126
+ print("There are a total of", len(self.filtered_objs), "objects in this batch.")
127
+ print(
128
+ f"You are running with annotation type: {self.annotation_type}: {ANNOTATION_TYPE_MAPPING[self.annotation_type]}"
129
+ )
130
+ print("You are running the 5.0.3 version of this script.")
131
+ print("-" * 80)
132
+ input("Press Enter to continue...")
133
+ self.complaint_handler = ObjectComplaintHandler(pipeline_root)
134
+
135
+ # Reference objects
136
+ self.human = None
137
+ self.phone = None
138
+
139
+ # Precision mode
140
+ self.precision_mode = False
141
+
142
+ # Camera parameters
143
+ self.pan = th.tensor(0.0)
144
+ self.tilt = th.tensor(0.0)
145
+ self.dist = th.tensor(3.0)
146
+
147
+ @property
148
+ def angle_increment(self):
149
+ return ANGLE_INCREMENT if self.precision_mode else LOW_PRECISION_ANGLE_INCREMENT
150
+
151
+ @property
152
+ def scale_increment(self):
153
+ return th.tensor(1.1) if self.precision_mode else th.tensor(10.0)
154
+
155
+ def _toggle_precision(self):
156
+ self.precision_mode = not self.precision_mode
157
+ print(f"Precision mode: {'ON' if self.precision_mode else 'OFF'}")
158
+
159
+ def load_processed_objects(self):
160
+ processed_objs = set()
161
+ for cat, mdl in self.filtered_objs:
162
+ path = os.path.join(self.record_path, cat, mdl + ".json")
163
+ if os.path.exists(path):
164
+ processed_objs.add(mdl)
165
+ return processed_objs
166
+
167
+ @property
168
+ def remaining_objects(self):
169
+ return sorted(
170
+ {
171
+ (cat, model)
172
+ for cat, model in self.filtered_objs
173
+ if model not in self.processed_objects
174
+ }
175
+ )
176
+
177
+ def group_objects_by_category(self, objects):
178
+ grouped_objs = {}
179
+ for cat, model in objects:
180
+ if cat not in grouped_objs:
181
+ grouped_objs[cat] = []
182
+ grouped_objs[cat].append(model)
183
+ return grouped_objs
184
+
185
+ def import_objects(self, category, batch):
186
+ all_objects = []
187
+ for i, obj_model in enumerate(batch):
188
+ obj = DatasetObject(
189
+ name="obj_" + obj_model,
190
+ category=category,
191
+ model=obj_model,
192
+ visual_only=True,
193
+ )
194
+ self.env.scene.add_object(obj)
195
+ all_objects.append(obj)
196
+
197
+ # Make the collision meshes also visible
198
+ for link in obj.links.values():
199
+ for mesh in link.visual_meshes.values():
200
+ mesh.purpose = "default"
201
+ mesh.visible = not link.is_meta_link
202
+ for mesh in link.collision_meshes.values():
203
+ mesh.purpose = "default"
204
+ mesh.visible = False
205
+
206
+ return all_objects
207
+
208
+ def position_objects(self, all_objects, should_draw=True):
209
+ y_coordinate = 0
210
+ prev_obj_radius = 0
211
+
212
+ if should_draw:
213
+ clear_debug_drawing()
214
+
215
+ for index, obj in enumerate(all_objects):
216
+ obj_radius = th.linalg.norm(obj.aabb_extent[:2]) / 2.0
217
+ if index != 0:
218
+ y_coordinate += prev_obj_radius + FIXED_Y_SPACING + obj_radius
219
+ obj_in_min = obj.get_position_orientation()[0] - obj.aabb[0]
220
+
221
+ obj.set_position_orientation(
222
+ position=[obj_in_min[0], y_coordinate, obj_in_min[2] + 0.05]
223
+ )
224
+
225
+ if should_draw:
226
+ draw_text(
227
+ obj.name.replace("obj_", ""),
228
+ [0, y_coordinate, -0.1],
229
+ T.euler2quat(th.tensor([th.pi / 2, 0, th.pi / 2])),
230
+ color=(1.0, 0.0, 0.0, 1.0),
231
+ line_size=3.0,
232
+ anchor="topcenter",
233
+ max_width=obj_radius,
234
+ max_height=0.2,
235
+ )
236
+
237
+ prev_obj_radius = obj_radius
238
+
239
+ # Write the category name across the total dimension
240
+ min_y = all_objects[0].aabb[0][1]
241
+ max_y = all_objects[-1].aabb[1][1]
242
+ center_y = (min_y + max_y) / 2
243
+ length_y = max_y - min_y
244
+ if should_draw:
245
+ draw_text(
246
+ obj.category,
247
+ [0, center_y, -0.3],
248
+ T.euler2quat(th.tensor([th.pi / 2, 0, th.pi / 2])),
249
+ color=(1.0, 0.0, 0.0, 1.0),
250
+ line_size=3.0,
251
+ anchor="topcenter",
252
+ max_width=length_y,
253
+ )
254
+ og.sim.step()
255
+ og.sim.step()
256
+ og.sim.step()
257
+
258
+ def save_object_results(self, obj, orientation, scale, complaints):
259
+ orientation = obj.get_position_orientation()[1]
260
+ scale = obj.scale
261
+ if not os.path.exists(os.path.join(self.record_path, obj.category)):
262
+ os.makedirs(os.path.join(self.record_path, obj.category))
263
+ with open(
264
+ os.path.join(self.record_path, obj.category, obj.model + ".json"), "w"
265
+ ) as f:
266
+ json.dump(
267
+ {
268
+ "orientation": orientation.tolist(),
269
+ "scale": scale.tolist(),
270
+ "complaints": complaints,
271
+ },
272
+ f,
273
+ indent=4,
274
+ )
275
+
276
+ def save_empty_results(self, category, model):
277
+ if not os.path.exists(os.path.join(self.record_path, category)):
278
+ os.makedirs(os.path.join(self.record_path, category))
279
+ with open(os.path.join(self.record_path, category, model + ".json"), "w") as f:
280
+ json.dump(
281
+ {
282
+ "orientation": [0, 0, 0, 1],
283
+ "scale": [1, 1, 1],
284
+ "complaints": [],
285
+ },
286
+ f,
287
+ indent=4,
288
+ )
289
+
290
+ def set_camera_bindings(self, default_dist=3.0):
291
+ self.pan, self.tilt, self.dist = PI, th.tensor(0.0), th.tensor(default_dist)
292
+
293
+ def update_camera(d_pan, d_tilt, d_dist):
294
+ self.pan = (self.pan + d_pan) % (2 * th.pi)
295
+ self.tilt = th.clip(self.tilt + d_tilt, -th.pi / 2, th.pi / 2)
296
+ self.dist = th.clip(self.dist + d_dist, 0, 100)
297
+
298
+ def reset_camera():
299
+ self.pan, self.tilt, self.dist = PI, th.tensor(0.0), th.tensor(default_dist)
300
+
301
+ add_keyboard_callback(
302
+ key=lazy.carb.input.KeyboardInput.UP,
303
+ callback_fn=lambda: update_camera(0, ANGLE_INCREMENT, 0),
304
+ description="tilt camera up",
305
+ )
306
+ add_keyboard_callback(
307
+ key=lazy.carb.input.KeyboardInput.DOWN,
308
+ callback_fn=lambda: update_camera(0, -ANGLE_INCREMENT, 0),
309
+ description="tilt camera down",
310
+ )
311
+ add_keyboard_callback(
312
+ key=lazy.carb.input.KeyboardInput.LEFT,
313
+ callback_fn=lambda: update_camera(-ANGLE_INCREMENT, 0, 0),
314
+ description="pan camera left",
315
+ )
316
+ add_keyboard_callback(
317
+ key=lazy.carb.input.KeyboardInput.RIGHT,
318
+ callback_fn=lambda: update_camera(ANGLE_INCREMENT, 0, 0),
319
+ description="pan camera right",
320
+ )
321
+ add_keyboard_callback(
322
+ key=lazy.carb.input.KeyboardInput.PAGE_DOWN,
323
+ callback_fn=lambda: update_camera(0, 0, 0.1),
324
+ description="zoom in",
325
+ )
326
+ add_keyboard_callback(
327
+ key=lazy.carb.input.KeyboardInput.PAGE_UP,
328
+ callback_fn=lambda: update_camera(0, 0, -0.1),
329
+ description="zoom out",
330
+ )
331
+ add_keyboard_callback(
332
+ key=lazy.carb.input.KeyboardInput.END,
333
+ callback_fn=lambda: reset_camera(),
334
+ description="reset camera",
335
+ )
336
+
337
+ def update_camera(self, target):
338
+ # Get the camera position by starting at the target point and moving back by the distance
339
+ # along the negative pan / tilt direction
340
+ camera_pos = target - self.dist * th.tensor(
341
+ [
342
+ th.cos(self.pan) * th.cos(self.tilt),
343
+ th.sin(self.pan) * th.cos(self.tilt),
344
+ -th.sin(self.tilt),
345
+ ]
346
+ )
347
+ # Camera matrix: note that this is the OpenGL frame, so the camera is looking down the negative z-axis
348
+ # and the up vector is the positive y-axis.
349
+ weird_camera_frame = T.mat2quat(
350
+ th.tensor(
351
+ [
352
+ [0, 0, -1],
353
+ [-1, 0, 0],
354
+ [0, 1, 0],
355
+ ]
356
+ )
357
+ )
358
+ camera_orn = T.euler2quat(th.tensor([0.0, self.tilt, self.pan]))
359
+ camera_orn = T.quat_multiply(camera_orn, weird_camera_frame)
360
+ og.sim.viewer_camera.set_position_orientation(camera_pos, camera_orn)
361
+
362
+ def whole_batch_preview(self, all_objects):
363
+ KeyboardEventHandler.initialize()
364
+ self.set_camera_bindings()
365
+
366
+ done = False
367
+ skip = False
368
+ y_min = th.min(th.tensor([obj.aabb[0][1] for obj in all_objects]))
369
+ y_max = th.max(th.tensor([obj.aabb[1][1] for obj in all_objects]))
370
+ average_pos = th.mean(th.stack([obj.aabb_center for obj in all_objects]), dim=0)
371
+
372
+ offset = 0.0
373
+
374
+ def _set_done():
375
+ nonlocal done
376
+ done = True
377
+
378
+ def _set_skip():
379
+ nonlocal skip
380
+ skip = True
381
+ _set_done()
382
+
383
+ def change_offset(d_offset):
384
+ nonlocal offset
385
+ offset += d_offset
386
+
387
+ # Set done when the user presses 'C'
388
+ add_keyboard_callback(
389
+ key=lazy.carb.input.KeyboardInput.ENTER,
390
+ callback_fn=_set_done,
391
+ description="continue to object editing",
392
+ )
393
+ add_keyboard_callback(
394
+ key=lazy.carb.input.KeyboardInput.HOME,
395
+ callback_fn=_set_skip,
396
+ description="skip to next category",
397
+ )
398
+ add_keyboard_callback(
399
+ key=lazy.carb.input.KeyboardInput.LEFT_BRACKET,
400
+ callback_fn=lambda: change_offset(-1),
401
+ description="pan camera left",
402
+ )
403
+ add_keyboard_callback(
404
+ key=lazy.carb.input.KeyboardInput.RIGHT_BRACKET,
405
+ callback_fn=lambda: change_offset(1),
406
+ description="pan camera right",
407
+ )
408
+
409
+ def _rotate_category(axis, angle):
410
+ current_rot = all_objects[0].get_position_orientation()[1]
411
+ rotation_delta = th.zeros(3)
412
+ rotation_delta["xyz".index(axis)] = angle
413
+ new_rot = T.quat_multiply(T.euler2quat(rotation_delta), current_rot)
414
+ # Round the new rotation to the nearest degree
415
+ rounded_rot = T.euler2quat(
416
+ th.deg2rad(th.round(th.rad2deg(T.quat2euler(new_rot))))
417
+ )
418
+
419
+ for obj in all_objects:
420
+ obj.set_position_orientation(orientation=rounded_rot)
421
+
422
+ # Reposition everything
423
+ self.position_objects(all_objects)
424
+ self.position_reference_objects(target_y=all_objects[0].aabb_center[1])
425
+
426
+ add_keyboard_callback(
427
+ key=lazy.carb.input.KeyboardInput.O,
428
+ callback_fn=lambda: _rotate_category("z", self.angle_increment),
429
+ description="rotate category counterclockwise around z-axis",
430
+ )
431
+ add_keyboard_callback(
432
+ key=lazy.carb.input.KeyboardInput.P,
433
+ callback_fn=lambda: _rotate_category("z", -self.angle_increment),
434
+ description="rotate category clockwise around z-axis",
435
+ )
436
+ add_keyboard_callback(
437
+ key=lazy.carb.input.KeyboardInput.K,
438
+ callback_fn=lambda: _rotate_category("y", self.angle_increment),
439
+ description="rotate category counterclockwise around y-axis",
440
+ )
441
+ add_keyboard_callback(
442
+ key=lazy.carb.input.KeyboardInput.L,
443
+ callback_fn=lambda: _rotate_category("y", -self.angle_increment),
444
+ description="rotate category clockwise around y-axis",
445
+ )
446
+ add_keyboard_callback(
447
+ key=lazy.carb.input.KeyboardInput.COMMA,
448
+ callback_fn=lambda: _rotate_category("x", self.angle_increment),
449
+ description="rotate category counterclockwise around x-axis",
450
+ )
451
+ add_keyboard_callback(
452
+ key=lazy.carb.input.KeyboardInput.PERIOD,
453
+ callback_fn=lambda: _rotate_category("x", -self.angle_increment),
454
+ description="rotate category clockwise around x-axis",
455
+ )
456
+ add_keyboard_callback(
457
+ key=lazy.carb.input.KeyboardInput.BACKSLASH,
458
+ callback_fn=lambda: [
459
+ obj.set_position_orientation(orientation=[0, 0, 0, 1])
460
+ for obj in all_objects
461
+ ],
462
+ description="reset category orientation",
463
+ )
464
+
465
+ while not done:
466
+ y = th.clip(y_min + offset, y_min, y_max)
467
+ target = th.tensor([average_pos[0], y, average_pos[2]])
468
+ self.update_camera(target)
469
+ og.sim.step()
470
+
471
+ KeyboardEventHandler.reset()
472
+ return skip
473
+
474
+ def evaluate_single_object(self, all_objects, i):
475
+ obj = all_objects[i]
476
+ print(f"\n\n\n\nNow editing object {obj.name.replace('obj_', '')}\n")
477
+
478
+ # If we're checking joints and the object has none, skip
479
+ synset = self.kb.get_category(obj.category).synset.name if self.kb.get_category(obj.category) else None
480
+ terminate_early = False
481
+ metalink_types = None
482
+ if self.annotation_type == 5 and obj.n_joints == 0: # joints checking
483
+ terminate_early = True
484
+ elif self.annotation_type == 6:
485
+ metalink_types = set()
486
+ for link_name in obj.links.keys():
487
+ for metalink_type in METALINK_TYPES:
488
+ if metalink_type in link_name:
489
+ metalink_types.add(metalink_type)
490
+ # metalink_types = {state.meta_link_type for state in obj.states.keys() if issubclass(state, LinkBasedStateMixin) and state.requires_meta_link} - IGNORE_METALINK_TYPES
491
+ if len(metalink_types) == 0:
492
+ terminate_early = True
493
+ elif self.annotation_type == 7:
494
+ previous_complaints = self.complaint_handler._get_existing_complaints(
495
+ obj.model
496
+ )
497
+ if len(previous_complaints) == 0:
498
+ terminate_early = True
499
+
500
+ if terminate_early:
501
+ self.save_empty_results(obj.category, obj.model)
502
+ self.processed_objects.add(obj.name.replace("obj_", ""))
503
+ return # skip this model
504
+
505
+ KeyboardEventHandler.initialize()
506
+ self.set_camera_bindings(default_dist=obj.aabb_extent[0] * 2.5)
507
+
508
+ done = False
509
+ should_show_photo = False
510
+ quick_complaints = []
511
+ scale_queue = [] # We queue scales to apply them all at once to avoid .play getting called from .step
512
+ obj_first_pca_angle_map = {}
513
+ obj_second_pca_angle_map = {}
514
+
515
+ # Immediately set done to be True if we're only handling prior complaints
516
+ if self.annotation_type == 7:
517
+ done = True
518
+
519
+ def _set_done():
520
+ nonlocal done
521
+ done = True
522
+
523
+ def _set_complaint(message):
524
+ quick_complaints.append(
525
+ {
526
+ "object": f"{obj.category}-{obj.model}",
527
+ "message": "QC: " + message,
528
+ "complaint": "quick complaint added during category & collision QA",
529
+ "processed": False,
530
+ "new": True,
531
+ }
532
+ )
533
+ print("Added", message, "complaint.\n")
534
+
535
+ def _toggle_gravity():
536
+ obj.visual_only = not obj.visual_only
537
+
538
+ # Reposition everything
539
+ self.position_objects(all_objects)
540
+ self.position_reference_objects(target_y=obj.aabb_center[1])
541
+
542
+ collision_visibility = True
543
+
544
+ def _toggle_collision_visibility():
545
+ # Disable all the visual meshes and enable all the collision ones
546
+ nonlocal collision_visibility
547
+ collision_visibility = not collision_visibility
548
+ for link in obj.links.values():
549
+ for mesh in link.visual_meshes.values():
550
+ mesh.visible = not collision_visibility
551
+ for mesh in link.collision_meshes.values():
552
+ mesh.visible = collision_visibility
553
+
554
+ # Warm this up
555
+ _toggle_collision_visibility()
556
+
557
+ meta_visibility = True
558
+
559
+ def _toggle_meta_visibility():
560
+ # Toggle the visibility of all the links
561
+ nonlocal meta_visibility
562
+ meta_visibility = not meta_visibility
563
+ for link in obj.links.values():
564
+ if not link.is_meta_link:
565
+ continue
566
+ for mesh in link.visual_meshes.values():
567
+ mesh.visible = meta_visibility
568
+ for mesh in link.collision_meshes.values():
569
+ mesh.visible = meta_visibility
570
+
571
+ # Warm this up
572
+ _toggle_meta_visibility()
573
+
574
+ joint_position_seed = th.tensor(
575
+ 0.0
576
+ ) # monotonically increasing, to be passed into th.sin
577
+ joints_moving = False
578
+
579
+ def _toggle_joints():
580
+ nonlocal joints_moving
581
+ joints_moving = not joints_moving
582
+
583
+ def _align_to_pca(pca_axis):
584
+ if pca_axis == 1 and obj in obj_first_pca_angle_map:
585
+ angle = obj_first_pca_angle_map[obj]
586
+ elif pca_axis == 2 and obj in obj_second_pca_angle_map:
587
+ angle = obj_second_pca_angle_map[obj]
588
+ else:
589
+ # Collecting points from the object
590
+ points = []
591
+ for link in obj.links.values():
592
+ for mesh in link.visual_meshes.values():
593
+ mesh_points = mesh.prim.GetAttribute("points").Get()
594
+ pos, ori = mesh.get_position_orientation()
595
+ transform = T.pose2mat((pos, ori))
596
+ if mesh_points is None or len(mesh_points) == 0:
597
+ continue
598
+ points.append(
599
+ trimesh.transformations.transform_points(
600
+ mesh_points, transform
601
+ )
602
+ )
603
+ points = th.concat(points, dim=0)
604
+
605
+ # Apply PCA to 3D points
606
+ from sklearn.decomposition import PCA
607
+
608
+ pca = PCA(n_components=3)
609
+ pca.fit(points)
610
+
611
+ if pca_axis == 1:
612
+ # The first principal component
613
+ pc = pca.components_[0]
614
+ else:
615
+ # The second principal component
616
+ pc = pca.components_[1]
617
+
618
+ # Compute the angle between the first principal component and the x-axis
619
+ angle = th.arctan2(pc[1], pc[0])
620
+
621
+ if pca_axis == 1:
622
+ obj_first_pca_angle_map[obj] = angle
623
+ else:
624
+ obj_second_pca_angle_map[obj] = angle
625
+
626
+ # Create a quaternion from this angle
627
+ rot = T.euler2quat(th.tensor([0, 0, angle]))
628
+
629
+ # Apply the rotation to the object
630
+ obj.set_position_orientation(orientation=rot)
631
+
632
+ # Reposition everything
633
+ self.position_objects(all_objects)
634
+ self.position_reference_objects(target_y=obj.aabb_center[1])
635
+
636
+ def _rotate_object(axis, angle):
637
+ current_rot = obj.get_position_orientation()[1]
638
+ rotation_delta = th.zeros(3)
639
+ rotation_delta["xyz".index(axis)] = angle
640
+ new_rot = T.quat_multiply(T.euler2quat(rotation_delta), current_rot)
641
+ # Round the new rotation to the nearest degree
642
+ rounded_rot = T.euler2quat(
643
+ th.deg2rad(th.round(th.rad2deg(T.quat2euler(new_rot))))
644
+ )
645
+ obj.set_position_orientation(orientation=rounded_rot)
646
+
647
+ # Reposition everything
648
+ self.position_objects(all_objects)
649
+ self.position_reference_objects(target_y=obj.aabb_center[1])
650
+
651
+ def _set_scale(new_scale):
652
+ object_poses = {
653
+ o: o.get_position_orientation() for o in self.env.scene.objects
654
+ }
655
+ og.sim.stop()
656
+ obj.scale = new_scale
657
+ og.sim.play()
658
+ for o, pose in object_poses.items():
659
+ o.set_position_orientation(*pose)
660
+
661
+ # Reposition everything
662
+ self.position_objects(all_objects)
663
+ self.position_reference_objects(target_y=obj.aabb_center[1])
664
+ self.dist = obj.aabb_extent[0] * 2.5
665
+
666
+ def _show_photo():
667
+ nonlocal should_show_photo
668
+ should_show_photo = True
669
+
670
+ # Other controls
671
+ add_keyboard_callback(
672
+ key=lazy.carb.input.KeyboardInput.ENTER,
673
+ callback_fn=_set_done,
674
+ description="continue to complaint process",
675
+ )
676
+ # add_keyboard_callback(
677
+ # key=lazy.carb.input.KeyboardInput.NUMPAD_7,
678
+ # callback_fn=lambda: _align_to_pca(1),
679
+ # description="align object to first principal component"
680
+ # )
681
+ # add_keyboard_callback(
682
+ # key=lazy.carb.input.KeyboardInput.NUMPAD_9,
683
+ # callback_fn=lambda: _align_to_pca(2),
684
+ # description="align object to second principal component"
685
+ # )
686
+
687
+ if self.annotation_type == 0:
688
+ add_keyboard_callback(
689
+ key=lazy.carb.input.KeyboardInput.O,
690
+ callback_fn=lambda: _rotate_object("z", self.angle_increment),
691
+ description="rotate object counterclockwise around z-axis",
692
+ )
693
+ add_keyboard_callback(
694
+ key=lazy.carb.input.KeyboardInput.P,
695
+ callback_fn=lambda: _rotate_object("z", -self.angle_increment),
696
+ description="rotate object clockwise around z-axis",
697
+ )
698
+ add_keyboard_callback(
699
+ key=lazy.carb.input.KeyboardInput.K,
700
+ callback_fn=lambda: _rotate_object("y", self.angle_increment),
701
+ description="rotate object counterclockwise around y-axis",
702
+ )
703
+ add_keyboard_callback(
704
+ key=lazy.carb.input.KeyboardInput.L,
705
+ callback_fn=lambda: _rotate_object("y", -self.angle_increment),
706
+ description="rotate object clockwise around y-axis",
707
+ )
708
+ add_keyboard_callback(
709
+ key=lazy.carb.input.KeyboardInput.COMMA,
710
+ callback_fn=lambda: _rotate_object("x", self.angle_increment),
711
+ description="rotate object counterclockwise around x-axis",
712
+ )
713
+ add_keyboard_callback(
714
+ key=lazy.carb.input.KeyboardInput.PERIOD,
715
+ callback_fn=lambda: _rotate_object("x", -self.angle_increment),
716
+ description="rotate object clockwise around x-axis",
717
+ )
718
+ add_keyboard_callback(
719
+ key=lazy.carb.input.KeyboardInput.BACKSLASH,
720
+ callback_fn=lambda: obj.set_position_orientation(
721
+ orientation=[0, 0, 0, 1]
722
+ ),
723
+ description="reset object orientation",
724
+ )
725
+ add_keyboard_callback(
726
+ key=lazy.carb.input.KeyboardInput.G,
727
+ callback_fn=_toggle_gravity,
728
+ description="toggle gravity for selected object",
729
+ )
730
+ add_keyboard_callback(
731
+ key=lazy.carb.input.KeyboardInput.T,
732
+ callback_fn=lambda: self._toggle_precision(),
733
+ description="toggle precision mode",
734
+ )
735
+ add_keyboard_callback(
736
+ key=lazy.carb.input.KeyboardInput.RIGHT_BRACKET,
737
+ callback_fn=lambda: scale_queue.append(self.scale_increment),
738
+ description="increase object scale",
739
+ )
740
+ add_keyboard_callback(
741
+ key=lazy.carb.input.KeyboardInput.LEFT_BRACKET,
742
+ callback_fn=lambda: scale_queue.append(1 / self.scale_increment),
743
+ description="decrease object scale",
744
+ )
745
+ add_keyboard_callback(
746
+ key=lazy.carb.input.KeyboardInput.KEY_0,
747
+ callback_fn=lambda: scale_queue.append(th.tensor(0)),
748
+ description="reset object scale",
749
+ )
750
+
751
+ elif self.annotation_type == 1:
752
+ add_keyboard_callback(
753
+ key=lazy.carb.input.KeyboardInput.KEY_1,
754
+ callback_fn=lambda: _set_complaint("category"),
755
+ description="add a category or synset complaint",
756
+ )
757
+
758
+ elif self.annotation_type == 2:
759
+ add_keyboard_callback(
760
+ key=lazy.carb.input.KeyboardInput.C,
761
+ callback_fn=_toggle_collision_visibility,
762
+ description="toggle collision mesh visibility",
763
+ )
764
+ add_keyboard_callback(
765
+ key=lazy.carb.input.KeyboardInput.KEY_2,
766
+ callback_fn=lambda: _set_complaint("appearance"),
767
+ description="add a visual appearance complaint",
768
+ )
769
+ add_keyboard_callback(
770
+ key=lazy.carb.input.KeyboardInput.KEY_3,
771
+ callback_fn=lambda: _set_complaint("handle"),
772
+ description="add a handle-specific collision mesh complaint",
773
+ )
774
+ add_keyboard_callback(
775
+ key=lazy.carb.input.KeyboardInput.KEY_4,
776
+ callback_fn=lambda: _set_complaint("collision"),
777
+ description="add a general collision complaint",
778
+ )
779
+
780
+ elif self.annotation_type == 5:
781
+ add_keyboard_callback(
782
+ key=lazy.carb.input.KeyboardInput.J,
783
+ callback_fn=_toggle_joints,
784
+ description="toggle joint movement",
785
+ )
786
+ add_keyboard_callback(
787
+ key=lazy.carb.input.KeyboardInput.KEY_5,
788
+ callback_fn=lambda: _set_complaint("joint"),
789
+ description="add a joint complaint",
790
+ )
791
+ elif self.annotation_type == 6:
792
+ add_keyboard_callback(
793
+ key=lazy.carb.input.KeyboardInput.M,
794
+ callback_fn=_toggle_meta_visibility,
795
+ description="toggle meta link mesh visibility",
796
+ )
797
+ add_keyboard_callback(
798
+ key=lazy.carb.input.KeyboardInput.KEY_6,
799
+ callback_fn=lambda: _set_complaint("metalink"),
800
+ description="add a meta link complaint",
801
+ )
802
+
803
+ add_keyboard_callback(
804
+ key=lazy.carb.input.KeyboardInput.KEY_7,
805
+ callback_fn=lambda: _set_complaint("unknown"),
806
+ description="add a generic complaint to be re-examined by the team",
807
+ )
808
+ print("-" * 80)
809
+
810
+ if self.annotation_type == 0:
811
+ print(
812
+ "\nEdit the currently selected object to match the realistic size of the category."
813
+ )
814
+ print(
815
+ "It should also face the same way as the other objects, and should be stable in its"
816
+ )
817
+ print("canonical orientation.\n")
818
+
819
+ # position reference objects to be next to the inspected object
820
+ self.position_reference_objects(target_y=obj.aabb_center[1])
821
+
822
+ # Prompt the user to fix the scale and orientation of the object. Keep the camera in position, too.
823
+ step = 0
824
+ while not done:
825
+ og.sim.step()
826
+
827
+ if should_show_photo:
828
+ should_show_photo = False
829
+ # First, load the background image
830
+ background_path = os.path.join(
831
+ self.pipeline_root, "b1k_pipeline", "tools", "background.jpg"
832
+ )
833
+ background = Image.open(background_path).resize((800, 800))
834
+
835
+ # Open the zip file
836
+ zip_path = os.path.join(
837
+ self.pipeline_root, "artifacts", "pipeline", "max_object_images.zip"
838
+ )
839
+ with ZipFS(zip_path) as zip_fs:
840
+ # Find and show photos of this object.
841
+ image_paths = sorted(
842
+ [
843
+ x
844
+ for x in zip_fs.listdir("/")
845
+ if obj.name.replace("obj_", "") in x
846
+ ]
847
+ )
848
+ for image_path in image_paths:
849
+ with zip_fs.open(image_path, "rb") as f:
850
+ image = background.copy()
851
+ max_image = Image.open(f)
852
+ image.paste(max_image, (0, 0), mask=max_image)
853
+ image.show()
854
+
855
+ # Apply any scale changes
856
+ if len(scale_queue) > 0:
857
+ scale = th.tensor(obj.scale)
858
+ if any(s == 0 for s in scale_queue):
859
+ scale = th.ones(3) # Reset the scale
860
+ else:
861
+ scale *= th.prod(th.tensor(scale_queue))
862
+ _set_scale(scale)
863
+ scale_queue.clear()
864
+
865
+ # Apply joint motion
866
+ if obj.n_dof > 0:
867
+ if joints_moving:
868
+ joint_position_seed += (
869
+ 2 * th.pi * og.sim.get_rendering_dt() / JOINT_SECONDS_PER_CYCLE
870
+ )
871
+ joint_positions = th.ones(obj.n_dof) * th.sin(joint_position_seed)
872
+ obj.set_joint_positions(
873
+ positions=joint_positions, normalized=True, drive=False
874
+ )
875
+
876
+ self.update_camera(obj.aabb_center)
877
+
878
+ if self.annotation_type == 0:
879
+ if step % 100 == 0:
880
+ scale_str = (
881
+ f"{obj.scale[0]:.2f}, {obj.scale[1]:.2f}, {obj.scale[2]:.2f}"
882
+ )
883
+ rotation = th.rad2deg(
884
+ T.quat2euler(obj.get_position_orientation()[1])
885
+ )
886
+ rotation_str = (
887
+ f"{rotation[0]:.2f}, {rotation[1]:.2f}, {rotation[2]:.2f}"
888
+ )
889
+ bbox_str = f"{obj.aabb_extent[0] * 100:.2f}cm, {obj.aabb_extent[1] * 100:.2f}cm, {obj.aabb_extent[2] * 100:.2f}cm"
890
+ print(
891
+ f"Bounding box extent: {bbox_str}. Scale: {scale_str}. Rotation: {rotation_str} ",
892
+ end="\r",
893
+ )
894
+ elif self.annotation_type == 1:
895
+ if step == 0:
896
+ wordnet_synsets = wordnet.synsets(synset.split(".")[0])
897
+ definition = None
898
+ for wordnet_synset in wordnet_synsets:
899
+ if wordnet_synset.name() == synset:
900
+ definition = wordnet_synset.definition()
901
+ break
902
+ print(f"expected category / synset: {obj.category} / {synset}")
903
+ print(f"Definition: {definition}")
904
+ elif self.annotation_type == 6:
905
+ if step == 0:
906
+ print(f"Object has metalinks: {metalink_types}")
907
+ step += 1
908
+ print()
909
+ print("-" * 80)
910
+
911
+ # Now we're done with bbox and scale and orientation. Save the data.
912
+ orientation = obj.get_position_orientation()[1]
913
+ scale = obj.scale
914
+
915
+ # Set the object back to visual only and reposition everything
916
+ obj.visual_only = True
917
+ self.position_objects(all_objects)
918
+ self.position_reference_objects(target_y=obj.aabb_center[1])
919
+
920
+ # Set the keyboard bindings back to camera only
921
+ KeyboardEventHandler.reset()
922
+ KeyboardEventHandler.initialize()
923
+ self.set_camera_bindings(default_dist=obj.aabb_extent[0] * 2.5)
924
+
925
+ # Launch the complaint thread
926
+ multiprocess_queue = multiprocessing.Queue()
927
+ questions = self.complaint_handler.get_questions(obj)
928
+ handle_previous_complaints = self.annotation_type == 7
929
+ complaint_process = multiprocessing.Process(
930
+ target=self.complaint_handler.process_complaints,
931
+ args=[
932
+ multiprocess_queue,
933
+ obj.category,
934
+ obj.name.replace("obj_", ""),
935
+ questions,
936
+ quick_complaints,
937
+ sys.stdin.fileno(),
938
+ handle_previous_complaints,
939
+ ],
940
+ daemon=True,
941
+ )
942
+ complaint_process.start()
943
+
944
+ # Wait to receive the complaints
945
+ step = 0
946
+ while complaint_process.is_alive():
947
+ step += 1
948
+ og.sim.step()
949
+ self.update_camera(obj.aabb_center)
950
+
951
+ # During this part, we want to be moving the joints
952
+ # for joint in obj.joints.values():
953
+ # seconds_since_start = step * og.sim.get_rendering_dt()
954
+ # interpolation_point = 0.5 * th.sin(seconds_since_start / JOINT_SECONDS_PER_CYCLE * 2 * PI) + 0.5
955
+ # target_pos = joint.lower_limit + interpolation_point * (joint.upper_limit - joint.lower_limit)
956
+ # joint.set_pos(target_pos)
957
+
958
+ if not multiprocess_queue.empty():
959
+ # Got a response, we can stop.
960
+ break
961
+
962
+ # Wait for the complaint process to finish to not have to kill it
963
+ time.sleep(0.1)
964
+
965
+ # If the complaint process is still alive, kill it.
966
+ if complaint_process.is_alive():
967
+ # Join the finished thread
968
+ complaint_process.join()
969
+ assert (
970
+ complaint_process.exitcode == 0
971
+ ), "Complaint process exited with error code."
972
+
973
+ assert (
974
+ not multiprocess_queue.empty()
975
+ ), "Complaint process did not return a message."
976
+ message = multiprocess_queue.get()
977
+ complaints = json.loads(message)
978
+
979
+ # Save the object results / mark the object as processed
980
+ self.save_object_results(obj, orientation, scale, complaints)
981
+ self.processed_objects.add(obj.name.replace("obj_", ""))
982
+
983
+ KeyboardEventHandler.reset()
984
+
985
+ def evaluate_batch(self, batch, category):
986
+ synset = self.kb.get_category(category).synset
987
+ abilities = synset.abilities
988
+
989
+ # If we're checking joints or metalinks, skip this entire batch is no object has either joints nor metalinks
990
+ if self.annotation_type in {5, 6, 7}:
991
+ if self.annotation_type == 5: # joints checking
992
+ check_is_valid = lambda prim, category, model: Open.is_compatible_asset(
993
+ prim
994
+ )[0]
995
+ elif self.annotation_type == 6:
996
+
997
+ def has_metalink_link(prim):
998
+ def _find_prims_with_condition(condition, root_prim):
999
+ found_prims = []
1000
+ if condition(root_prim):
1001
+ found_prims.append(root_prim)
1002
+
1003
+ for child in root_prim.GetChildren():
1004
+ found_prims += _find_prims_with_condition(
1005
+ condition=condition, root_prim=child
1006
+ )
1007
+
1008
+ return found_prims
1009
+
1010
+ def find_all_rigid_bodies(root_prim):
1011
+ return _find_prims_with_condition(
1012
+ condition=is_rigid_body,
1013
+ root_prim=root_prim,
1014
+ )
1015
+ return False
1016
+
1017
+ def is_rigid_body(prim):
1018
+ prim_type = prim.GetPrimTypeInfo().GetTypeName().lower()
1019
+ has_rigid_api = prim.HasAPI(lazy.pxr.UsdPhysics.RigidBodyAPI)
1020
+ return "xform" in prim_type and has_rigid_api
1021
+
1022
+ rb_prims = find_all_rigid_bodies(root_prim=prim)
1023
+ for rb_prim in rb_prims:
1024
+ name = rb_prim.GetName().lower()
1025
+ for metalink_type in METALINK_TYPES:
1026
+ if metalink_type in name:
1027
+ return True
1028
+
1029
+ return False
1030
+
1031
+ check_is_valid = lambda prim, category, model: has_metalink_link(prim)
1032
+
1033
+ elif self.annotation_type == 7:
1034
+ check_is_valid = (
1035
+ lambda prim, category, model: len(
1036
+ self.complaint_handler._get_existing_complaints(model)
1037
+ )
1038
+ > 0
1039
+ )
1040
+
1041
+ else:
1042
+ raise ValueError()
1043
+
1044
+ has_valid_model = False
1045
+ for model in batch:
1046
+ usd_path = DatasetObject.get_usd_path(category=category, model=model)
1047
+ usd_path = usd_path.replace(".usd", ".encrypted.usd")
1048
+ with decrypted(usd_path) as fpath:
1049
+ stage = lazy.pxr.Usd.Stage.Open(fpath)
1050
+ prim = stage.GetDefaultPrim()
1051
+ if check_is_valid(prim, category, model):
1052
+ has_valid_model = True
1053
+ break
1054
+
1055
+ if not has_valid_model:
1056
+ for model in batch:
1057
+ self.save_empty_results(category, model)
1058
+ self.processed_objects.add(model)
1059
+ return False # don't skip the rest of the category
1060
+
1061
+ all_objects = self.import_objects(category, batch)
1062
+ og.sim.step()
1063
+ self.position_objects(all_objects)
1064
+ self.position_reference_objects(target_y=0.0)
1065
+
1066
+ # Phase 1: Continuously pan across the full category to show the user all objects
1067
+ # Only need to show all objects for canonical orientation purposes
1068
+ skip = False
1069
+ if self.annotation_type == 0: # canonical orientation / scale checking
1070
+ skip = self.whole_batch_preview(all_objects)
1071
+
1072
+ if not skip:
1073
+ # Phase 2: Allow the user to interact with the objects one by one
1074
+ for i in range(len(all_objects)):
1075
+ self.evaluate_single_object(all_objects, i)
1076
+
1077
+ # Clean up.
1078
+ for obj in all_objects:
1079
+ self.env.scene.remove_object(obj)
1080
+
1081
+ return skip
1082
+
1083
+ def position_reference_objects(self, target_y):
1084
+ obj_in_center_frame = (
1085
+ self.phone.get_position_orientation()[0] - self.phone.aabb_center
1086
+ )
1087
+ obj_in_min_frame = self.phone.get_position_orientation()[0] - self.phone.aabb[0]
1088
+ obj_in_max_frame = self.phone.get_position_orientation()[0] - self.phone.aabb[1]
1089
+ self.phone.set_position_orientation(
1090
+ position=[
1091
+ -0.05 + obj_in_max_frame[0],
1092
+ target_y + obj_in_center_frame[1],
1093
+ obj_in_min_frame[2],
1094
+ ]
1095
+ )
1096
+
1097
+ human_in_center_frame = (
1098
+ self.human.get_position_orientation()[0] - self.human.aabb_center
1099
+ )
1100
+ human_in_min_frame = (
1101
+ self.human.get_position_orientation()[0] - self.human.aabb[0]
1102
+ )
1103
+ human_in_max_frame = (
1104
+ self.human.get_position_orientation()[0] - self.human.aabb[1]
1105
+ )
1106
+ self.human.set_position_orientation(
1107
+ position=[
1108
+ -0.1 + self.phone.aabb_extent[0] + human_in_max_frame[0],
1109
+ target_y + human_in_center_frame[1],
1110
+ human_in_min_frame[2],
1111
+ ]
1112
+ )
1113
+
1114
+ def add_reference_objects(self):
1115
+ # Add a cellphone into the scene
1116
+ phone = DatasetObject(
1117
+ name="dbhfuh",
1118
+ category="cell_phone",
1119
+ model="dbhfuh",
1120
+ visual_only=True,
1121
+ )
1122
+ self.env.scene.add_object(phone)
1123
+ og.sim.step()
1124
+ phone.links["meta__base_link_togglebutton_0_0_link"].visible = False
1125
+ phone.set_position_orientation(
1126
+ orientation=T.euler2quat(th.tensor([th.pi / 2, th.pi / 2, 0]))
1127
+ )
1128
+
1129
+ # Add a human into the scene
1130
+ curr_dir = os.path.dirname(os.path.realpath(__file__))
1131
+ human_usd_path = os.path.join(curr_dir, "HumanFemale/HumanFemale.usd")
1132
+ human_prim_path = "/World/scene_0/human"
1133
+ lazy.omni.isaac.core.utils.stage.add_reference_to_stage(
1134
+ usd_path=human_usd_path, prim_path=human_prim_path, prim_type="Xform"
1135
+ )
1136
+ human_prim = XFormPrim(name="human", relative_prim_path="/human")
1137
+ human_prim.load(self.env.scene)
1138
+ human_prim.set_position_orientation(
1139
+ orientation=T.euler2quat(th.tensor([0, 0, th.pi / 2]))
1140
+ )
1141
+ human_prim.scale = [0.012, 0.012, 0.012]
1142
+ og.sim.step()
1143
+
1144
+ return human_prim, phone
1145
+
1146
+ def run(self):
1147
+ if self.your_id < 0 or self.your_id >= self.total_ids:
1148
+ print("Invalid id!")
1149
+ sys.exit(1)
1150
+
1151
+ print(
1152
+ f"{len(self.processed_objects)}/{len(self.filtered_objs)} objects processed. {len(self.remaining_objects)} objects remaining."
1153
+ )
1154
+
1155
+ # Load the environment and set the lighting parameters.
1156
+ cfg = {"scene": {"type": "Scene", "floor_plane_visible": False}}
1157
+ self.env = og.Environment(configs=cfg)
1158
+ dome_light = og.sim.skybox
1159
+ dome_light.intensity = 7.5e2
1160
+ dome_light.color = [1.0, 1.0, 1.0]
1161
+ dome_light.light_link.prim.GetAttribute("inputs:texture:file").Clear()
1162
+
1163
+ self.human, self.phone = self.add_reference_objects()
1164
+
1165
+ remaining_objs_by_cat = self.group_objects_by_category(self.remaining_objects)
1166
+
1167
+ batch_size = 50
1168
+
1169
+ for cat, models in remaining_objs_by_cat.items():
1170
+ print(f"Processing category {cat}...")
1171
+ sorted_models = sorted(models)
1172
+ for batch_start in range(0, len(sorted_models), batch_size):
1173
+ batch = sorted_models[batch_start : batch_start + batch_size]
1174
+ skip = self.evaluate_batch(batch, cat)
1175
+ if skip:
1176
+ print("Skipping the rest of the category", cat)
1177
+ break
1178
+ print(
1179
+ f"\n\n{len(self.processed_objects)}/{len(self.filtered_objs)} objects processed. {len(self.remaining_objects)} objects remaining.\n"
1180
+ )
1181
+ # time.sleep(0.1)
1182
+
1183
+
1184
+ class ObjectComplaintHandler:
1185
+ def __init__(self, pipeline_root):
1186
+ self.pipeline_root = Path(pipeline_root)
1187
+ self.inventory_dict = self._load_inventory()
1188
+ self.kb = KnowledgeBase(populate=True)
1189
+
1190
+ def _load_inventory(self):
1191
+ inventory_path = self.pipeline_root / "artifacts/pipeline/object_inventory.json"
1192
+ with open(inventory_path, "r") as file:
1193
+ return json.load(file)["providers"]
1194
+
1195
+ def _get_existing_complaints(self, model):
1196
+ provider = None
1197
+ for obj, provider_candidate in self.inventory_dict.items():
1198
+ if obj.split("-")[-1] == model:
1199
+ provider = provider_candidate
1200
+ break
1201
+ assert provider is not None, f"Provider not found for object {model}"
1202
+
1203
+ complaints_file = self.pipeline_root / "cad" / provider / "complaints.json"
1204
+ if not complaints_file.exists():
1205
+ return []
1206
+ with open(complaints_file, "r") as file:
1207
+ all_complaints = json.load(file)
1208
+ filtered_complaints = []
1209
+ for complaint in all_complaints:
1210
+ if complaint["object"].split("-")[-1] != model:
1211
+ continue
1212
+ filtered_complaints.append(complaint)
1213
+ return filtered_complaints
1214
+
1215
+ def process_complaints(
1216
+ self,
1217
+ queue,
1218
+ category,
1219
+ model,
1220
+ messages,
1221
+ quick_complaints,
1222
+ stdin_fileno,
1223
+ parse_existing_complaints,
1224
+ ):
1225
+ sys.stdin = os.fdopen(stdin_fileno)
1226
+
1227
+ # Get existing complaints only if running the check on prior complaints
1228
+ existing_complaints = (
1229
+ self._get_existing_complaints(model) if parse_existing_complaints else []
1230
+ )
1231
+
1232
+ # Take note of the unresolved ones.
1233
+ unresolved_indices = [
1234
+ idx
1235
+ for idx, complaint in enumerate(existing_complaints)
1236
+ if not complaint["processed"]
1237
+ ]
1238
+
1239
+ # Mark all as resolved
1240
+ for complaint in existing_complaints:
1241
+ complaint["processed"] = True
1242
+
1243
+ # Allow the user to pick which complaints to keep unresolved.
1244
+ if len(unresolved_indices) > 0:
1245
+ print(f"Found {len(unresolved_indices)} unresolved complaints.")
1246
+ for i, idx in enumerate(unresolved_indices, start=1):
1247
+ print(f"\nComplaint {i}:")
1248
+ complaint = existing_complaints[idx]
1249
+ print(f"Prompt: {complaint['message']}\n")
1250
+ print(f"Complaint: {complaint['complaint']}\n")
1251
+
1252
+ print(
1253
+ "\nALL complaints except the ones you enter below will be marked as RESOLVED."
1254
+ )
1255
+ response = input(
1256
+ "Enter complaint numbers to KEEP as UNRESOLVED (e.g., 1,2,3): "
1257
+ )
1258
+ if response:
1259
+ response = response.split(",")
1260
+ for idx in response:
1261
+ complaint_idx = unresolved_indices[int(idx) - 1]
1262
+ existing_complaints[complaint_idx]["processed"] = False
1263
+ else:
1264
+ print("No unresolved complaints found.")
1265
+
1266
+ print("-" * 80)
1267
+
1268
+ for message in messages:
1269
+ complaint = self._process_single_complaint(message, category, model)
1270
+ if complaint:
1271
+ existing_complaints.append(complaint)
1272
+ print("-" * 80)
1273
+
1274
+ all_complaints = existing_complaints + quick_complaints
1275
+
1276
+ queue.put(json.dumps(all_complaints))
1277
+
1278
+ def _process_single_complaint(self, message, category, model):
1279
+ print(message)
1280
+ response = input("Enter a complaint (or hit enter if all's good): ")
1281
+ if response:
1282
+ return {
1283
+ "object": f"{category}-{model}",
1284
+ "message": message,
1285
+ "complaint": response,
1286
+ "processed": False,
1287
+ "new": True,
1288
+ }
1289
+
1290
+ return None
1291
+
1292
+ def get_questions(self, obj):
1293
+ messages = [
1294
+ # self._get_synset_question(obj),
1295
+ # self._get_substanceness_question(obj),
1296
+ # self._get_ability_question(obj),
1297
+ # self._get_category_question(obj),
1298
+ # self._get_single_rigid_body_question(obj),
1299
+ # self._get_appearance_question(obj),
1300
+ # self._get_articulation_question(obj),
1301
+ # self._get_collision_question(obj),
1302
+ ]
1303
+
1304
+ # if "cloth" in self._get_synset_and_abilities(obj.category)[1]:
1305
+ # self._get_unfolded_question(obj),
1306
+
1307
+ return messages
1308
+
1309
+ def _get_synset_and_abilities(self, category):
1310
+ cat = self.kb.get_category(category)
1311
+ synset = cat.synset.name if cat else None
1312
+ if synset is None:
1313
+ ps = self.kb.get_particle_system(category)
1314
+ synset = ps.synset.name if ps else None
1315
+ assert synset is not None, f"Synset not found for category {category}"
1316
+ return synset, self.kb.get_synset(synset).abilities
1317
+
1318
+ def _get_synset_and_definition(self, category):
1319
+ synset, _ = self._get_synset_and_abilities(category)
1320
+ try:
1321
+ s = wn.synset(synset)
1322
+ return s.name(), s.definition()
1323
+ except:
1324
+ s = wn.synset([p.name for p in self.kb.get_synset(synset).parents][0])
1325
+ return (
1326
+ f"{synset} (custom synset)",
1327
+ f"(hypernyms: {s.name()}): {s.definition()}",
1328
+ )
1329
+
1330
+ def _get_synset_question(self, obj):
1331
+ synset, definition = self._get_synset_and_definition(obj.category)
1332
+ message = (
1333
+ "SYNSET: Confirm object synset assignment.\n\n"
1334
+ f"Object assigned to synset: {synset}\n"
1335
+ f"Definition: {definition}\n\n"
1336
+ "Reminder: synset should match the object and not its contents.\n"
1337
+ "(e.g., orange_juice.n.01 is the fluid orange juice and not a bottle).\n"
1338
+ "For containers, note that usable containers (e.g. ones that have an open cap and\n"
1339
+ "can be filled should be assigned to x__bottle.n.01 etc. synsets/categories while\n"
1340
+ "non-usable containers should be assigned to bottle__of__x.n.01 etc. synsets/categories).\n\n"
1341
+ "If the synset is wrong, please type in the name of the correct synset the object\n"
1342
+ "should be assigned to. In the next question also type in the correct category."
1343
+ )
1344
+ return message
1345
+
1346
+ def _get_category_question(self, obj):
1347
+ message = (
1348
+ "CATEGORY: Confirm object category assignment.\n\n"
1349
+ f"Object assigned to category: {obj.category}\n\n"
1350
+ "If the object is not compatible with the rest of the objects in this category,\n"
1351
+ "(e.g. tabletop sink vs regular sink), change the category here.\n"
1352
+ "Confirm that the object is the same kind of object as the rest of the objects\n"
1353
+ "in this category.\n\n"
1354
+ "If the category is wrong, please type in the correct category."
1355
+ )
1356
+ return message
1357
+
1358
+ def _get_substanceness_question(self, obj):
1359
+ _, abilities = self._get_synset_and_abilities(obj.category)
1360
+ substance_types = set(abilities.keys()) & {
1361
+ "rigidBody",
1362
+ "liquid",
1363
+ "macroPhysicalSubstance",
1364
+ "microPhysicalSubstance",
1365
+ "visualSubstance",
1366
+ "cloth",
1367
+ "softBody",
1368
+ "rope",
1369
+ }
1370
+ assert (
1371
+ len(substance_types) == 1
1372
+ ), f"Multiple substance types found for object {obj.name.replace('obj_', '')}"
1373
+ (substance_type,) = substance_types
1374
+ message = (
1375
+ "SUBSTANCE: Confirm if object should be a rigid body, cloth, or substance.\n"
1376
+ "If it's marked softBody or rope, that means it will be a rigid body for now, which is OK.\n\n"
1377
+ f"Currently, it is annotated as: {substance_type}.\n\n"
1378
+ 'Enter one of "rigidBody", "liquid", "macroPhysicalSubstance", "microPhysicalSubstance", "visualSubstance", "cloth", "softBody", "rope" to change.'
1379
+ )
1380
+ return message
1381
+
1382
+ def _get_ability_question(self, obj):
1383
+ _, abilities = self._get_synset_and_abilities(obj.category)
1384
+ interesting_abilities = [
1385
+ f" {a}: {a in abilities}" for a in sorted(INTERESTING_ABILITIES)
1386
+ ]
1387
+ message = (
1388
+ "ABILITIES: Confirm that this object can support all of the abilities seen below.\n\n"
1389
+ "Abilities to evaluate (subset of all abilities): \n"
1390
+ )
1391
+ message += "\n".join(sorted(interesting_abilities))
1392
+ message += (
1393
+ "\n\nIf this object looks like it should have some of these abilities flipped, please\n"
1394
+ "list the abilities that we should flip for this object as a comma separated list.\n"
1395
+ "For example, for an unopenable window you would put in 'openable'."
1396
+ )
1397
+ return message
1398
+
1399
+ def _get_single_rigid_body_question(self, obj):
1400
+ message = "CONNECTED: Confirm object is a single body. An object cannot contain disconnected parts."
1401
+ return message
1402
+
1403
+ def _get_appearance_question(self, obj):
1404
+ message = (
1405
+ "APPEARANCE: Confirm object visual appearance.\n"
1406
+ "Requirements:\n"
1407
+ "- make sure the object has a valid texture or appearance (e.g., texture not UNEXPECTEDLY black,\n"
1408
+ " transparency rendered correctly, etc).\n"
1409
+ "- make sure any glass parts are transparent (would this object contain glass? e.g.\n"
1410
+ " wall pictures, clocks, etc. - anything wrong)\n"
1411
+ )
1412
+ return message
1413
+
1414
+ def _get_collision_question(self, obj):
1415
+ message = (
1416
+ "COLLISION: Confirm object collision meshes (C to toggle on/off).\n"
1417
+ "Requirements:\n"
1418
+ "- make sure the collision meshes well approximate the original visual meshes\n"
1419
+ "- make sure the collision meshes don't lose any affordance (e.g., holes and handles are preserved)."
1420
+ )
1421
+ return message
1422
+
1423
+ def _get_articulation_question(self, obj):
1424
+ message = "ARTICULATION: Confirm articulation:\n"
1425
+ message += "This object has the below movable links annotated:\n"
1426
+ if len(obj.joints) == 0:
1427
+ message += "- None\n"
1428
+ else:
1429
+ for j_name, j in obj.joints.items():
1430
+ message += f"- {j_name}, {j.joint_type}\n"
1431
+ message += "\nVerify that the joint limits look reasonable and that the object is not\n"
1432
+ message += "missing articulations that would make it useless. Do NOT be overly ambitious - we\n"
1433
+ message += "only care about MUST-HAVE articulations here."
1434
+ return message
1435
+
1436
+ def _get_unfolded_question(self, obj):
1437
+ message = "Confirm the default state of the rope/cloth object is unfolded."
1438
+ return message
1439
+
1440
+ def _get_meta_link_question(self, obj):
1441
+ meta_links = sorted(
1442
+ {
1443
+ meta_name
1444
+ for link_metas in obj.metadata["meta_links"].values()
1445
+ for meta_name in link_metas
1446
+ }
1447
+ )
1448
+ message = "Confirm object meta links listed below:\n"
1449
+ if len(meta_links) == 0:
1450
+ message += "- None\n"
1451
+ else:
1452
+ for meta_link in meta_links:
1453
+ message += f"- {meta_link}\n"
1454
+ message += "Make sure these match mechanisms you expect from this object."
1455
+ return message
1456
+
1457
+
1458
+ if __name__ == "__main__":
1459
+ parser = argparse.ArgumentParser(description="Process some integers.")
1460
+ parser.add_argument(
1461
+ "--record_path",
1462
+ type=str,
1463
+ required=True,
1464
+ help="The path to save recorded orientations and scales.",
1465
+ )
1466
+ parser.add_argument(
1467
+ "--id",
1468
+ type=int,
1469
+ required=True,
1470
+ help=f"Your assigned id in range (0, total_ids-1).",
1471
+ )
1472
+ parser.add_argument(
1473
+ "--total_ids", type=int, required=True, help=f"Total number of IDs."
1474
+ )
1475
+ parser.add_argument("--seed", type=str, required=True, help=f"The shuffling seed.")
1476
+ parser.add_argument(
1477
+ "--annotation_type",
1478
+ type=int,
1479
+ required=True,
1480
+ help=f"Subtype of annotation: [{ANNOTATION_TYPE_MAPPING}]",
1481
+ )
1482
+ args = parser.parse_args()
1483
+
1484
+ pipeline_root = Path(__file__).resolve().parents[2]
1485
+ viewer = BatchQAViewer(
1486
+ args.record_path,
1487
+ args.id,
1488
+ args.total_ids,
1489
+ args.seed,
1490
+ pipeline_root=str(pipeline_root),
1491
+ annotation_type=args.annotation_type,
1492
+ )
1493
+ viewer.run()
1494
+ og.shutdown()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/tools/compare_position.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import xml.etree.ElementTree as ET
2
+ import os
3
+ from collections import defaultdict
4
+ import numpy as np
5
+
6
+ SCENE_NAME = "Benevolence_0_int"
7
+
8
+
9
+ SCENES = [
10
+ "Beechwood_0_int",
11
+ "Beechwood_1_int",
12
+ "Benevolence_0_int",
13
+ "Benevolence_1_int",
14
+ "Benevolence_2_int",
15
+ "Ihlen_0_int",
16
+ "Ihlen_1_int",
17
+ "Merom_0_int",
18
+ "Merom_1_int",
19
+ "Pomaria_0_int",
20
+ "Pomaria_1_int",
21
+ "Pomaria_2_int",
22
+ "Rs_int",
23
+ "Wainscott_0_int",
24
+ "Wainscott_1_int",
25
+ ]
26
+
27
+
28
+ def get_unique_coords(p):
29
+ tree = ET.parse(p)
30
+ root = tree.getroot()
31
+ link_dict = defaultdict(list)
32
+ for child in root.findall("link"):
33
+ if child.attrib["name"] in ("world", "walls", "floors", "ceilings"):
34
+ continue
35
+ category = child.attrib["category"]
36
+ if category:
37
+ link_dict[category].append(child.attrib["name"])
38
+
39
+ unique_names = {k: v[0] for k, v in link_dict.items() if len(v) == 1}
40
+ unique_coords = {}
41
+
42
+ for cat, unique_name in unique_names.items():
43
+ joint_name = "j_" + unique_name
44
+ joint = root.find(f"joint[@name='{joint_name}']")
45
+ assert joint
46
+ coordinates_str = joint.find("origin").attrib["xyz"]
47
+ coordinates = np.array([float(x) for x in coordinates_str.split()])
48
+ unique_coords[cat] = coordinates
49
+
50
+ return unique_coords
51
+
52
+
53
+ def process_scene(scene_name):
54
+ path_new = os.path.join(
55
+ f"D:/BEHAVIOR-1K/asset_pipeline/cad/scenes/{scene_name}/artifacts/scene/urdf/{scene_name}_best.urdf"
56
+ )
57
+ path_old = os.path.join(
58
+ f"C:/Users/Cem/research/iGibson-dev/igibson/data/ig_dataset/scenes/{scene_name}/urdf/{scene_name}_best.urdf"
59
+ )
60
+ unique_new = get_unique_coords(path_new)
61
+ # print("new keys", unique_new.keys())
62
+ unique_old = get_unique_coords(path_old)
63
+ # print("old keys", unique_old.keys())
64
+ common_keys = set(unique_new.keys()) & set(unique_old.keys())
65
+
66
+ diffs = []
67
+ for key in common_keys:
68
+ diffs.append(unique_old[key] - unique_new[key])
69
+
70
+ print("\n", scene_name)
71
+ print("avg %.3f %.3f %.3f" % tuple(np.mean(diffs, axis=0)))
72
+ print("med %.3f %.3f %.3f" % tuple(np.median(diffs, axis=0)))
73
+ print("std %.3f %.3f %.3f" % tuple(np.std(diffs, axis=0)))
74
+
75
+
76
+ def main():
77
+ for scene_name in SCENES:
78
+ process_scene(scene_name)
79
+
80
+
81
+ if __name__ == "__main__":
82
+ main()
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/urdfpy/__init__.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from .urdf import (
2
+ URDFType,
3
+ Box,
4
+ Cylinder,
5
+ Sphere,
6
+ Mesh,
7
+ Geometry,
8
+ Texture,
9
+ Material,
10
+ Collision,
11
+ Visual,
12
+ Inertial,
13
+ JointCalibration,
14
+ JointDynamics,
15
+ JointLimit,
16
+ JointMimic,
17
+ SafetyController,
18
+ Actuator,
19
+ TransmissionJoint,
20
+ Transmission,
21
+ Joint,
22
+ Link,
23
+ URDF,
24
+ )
25
+ from .utils import rpy_to_matrix, matrix_to_rpy, xyz_rpy_to_matrix, matrix_to_xyz_rpy
26
+ from .version import __version__
27
+
28
+ __all__ = [
29
+ "URDFType",
30
+ "Box",
31
+ "Cylinder",
32
+ "Sphere",
33
+ "Mesh",
34
+ "Geometry",
35
+ "Texture",
36
+ "Material",
37
+ "Collision",
38
+ "Visual",
39
+ "Inertial",
40
+ "JointCalibration",
41
+ "JointDynamics",
42
+ "JointLimit",
43
+ "JointMimic",
44
+ "SafetyController",
45
+ "Actuator",
46
+ "TransmissionJoint",
47
+ "Transmission",
48
+ "Joint",
49
+ "Link",
50
+ "URDF",
51
+ "rpy_to_matrix",
52
+ "matrix_to_rpy",
53
+ "xyz_rpy_to_matrix",
54
+ "matrix_to_xyz_rpy",
55
+ "__version__",
56
+ ]
source_data/pinned/behavior-1k-bddl/v3.9.3-post2/asset_pipeline/b1k_pipeline/urdfpy/urdf.py ADDED
The diff for this file is too large to render. See raw diff