MCPcopy Create free account
hub / github.com/Netflix/void-model / extract_object_data

Function extract_object_data

data_generation/scripts/extract_pk_data.py:59–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 return frame_data
58
59def extract_object_data():
60 object_data = {}
61 objects = get_all_objects()
62 scene = bpy.context.scene
63 for obj in objects:
64 scene.frame_set(scene.frame_start)
65 object_data[obj.name] = []
66 start_frame = scene.frame_start
67 end_frame = scene.frame_end
68 for frame in range(start_frame, end_frame + 1):
69 scene.frame_set(frame)
70 location = list(obj.location)
71 if obj.rotation_mode == 'QUATERNION':
72 rotation = list(obj.rotation_quaternion)
73 else:
74 quat = obj.rotation_euler.to_quaternion()
75 rotation = list(quat)
76 object_data[obj.name].append(rotation + location)
77 return object_data
78
79def extract_object_model_data():
80 """

Callers 1

extract_pk_data.pyFile · 0.85

Calls 1

get_all_objectsFunction · 0.85

Tested by

no test coverage detected