mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-24 16:59:29 +08:00
Fix multitrack export
This commit is contained in:
parent
fb04969362
commit
ebaf0a71fa
@ -905,6 +905,8 @@ def build_glb_openpose(
|
|||||||
animations: List[dict] = []
|
animations: List[dict] = []
|
||||||
scene_root_indices: List[int] = []
|
scene_root_indices: List[int] = []
|
||||||
|
|
||||||
|
samplers: List[dict] = []
|
||||||
|
channels: List[dict] = []
|
||||||
for track_i, (person_k, frame_indices) in enumerate(tracks):
|
for track_i, (person_k, frame_indices) in enumerate(tracks):
|
||||||
body_seq = _extract_openpose_keypoints(pose_data, frame_indices, person_k)
|
body_seq = _extract_openpose_keypoints(pose_data, frame_indices, person_k)
|
||||||
n_frames = body_seq.shape[0]
|
n_frames = body_seq.shape[0]
|
||||||
@ -1105,8 +1107,6 @@ def build_glb_openpose(
|
|||||||
|
|
||||||
times = np.asarray(frame_indices, dtype=np.float32) / float(fps)
|
times = np.asarray(frame_indices, dtype=np.float32) / float(fps)
|
||||||
time_acc = w.add_scalar_f32(times)
|
time_acc = w.add_scalar_f32(times)
|
||||||
samplers: List[dict] = []
|
|
||||||
channels: List[dict] = []
|
|
||||||
for j in range(K):
|
for j in range(K):
|
||||||
t_j = kp_seq[:, j, :].astype(np.float32)
|
t_j = kp_seq[:, j, :].astype(np.float32)
|
||||||
if (np.ptp(t_j, axis=0) < 1e-6).all():
|
if (np.ptp(t_j, axis=0) < 1e-6).all():
|
||||||
@ -1167,8 +1167,9 @@ def build_glb_openpose(
|
|||||||
"target": {"node": person_root_idx, "path": "translation"},
|
"target": {"node": person_root_idx, "path": "translation"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if samplers:
|
||||||
animations.append({
|
animations.append({
|
||||||
"name": f"track{track_i:02d}",
|
"name": "all_tracks",
|
||||||
"samplers": samplers, "channels": channels,
|
"samplers": samplers, "channels": channels,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -284,6 +284,8 @@ def build_glb_skeletal(
|
|||||||
for e in range(NEXPR):
|
for e in range(NEXPR):
|
||||||
expr_morph_accs.append(w.add_vec3_f32_no_minmax(eb[e]))
|
expr_morph_accs.append(w.add_vec3_f32_no_minmax(eb[e]))
|
||||||
|
|
||||||
|
samplers: List[dict] = []
|
||||||
|
channels: List[dict] = []
|
||||||
for track_i, (person_k, frame_indices) in enumerate(tracks):
|
for track_i, (person_k, frame_indices) in enumerate(tracks):
|
||||||
person_root = {"name": f"track{track_i:02d}", "children": []}
|
person_root = {"name": f"track{track_i:02d}", "children": []}
|
||||||
nodes.append(person_root)
|
nodes.append(person_root)
|
||||||
@ -484,9 +486,6 @@ def build_glb_skeletal(
|
|||||||
times = np.asarray(frame_indices, dtype=np.float32) / float(fps)
|
times = np.asarray(frame_indices, dtype=np.float32) / float(fps)
|
||||||
time_acc = w.add_scalar_f32(times)
|
time_acc = w.add_scalar_f32(times)
|
||||||
|
|
||||||
samplers: List[dict] = []
|
|
||||||
channels: List[dict] = []
|
|
||||||
|
|
||||||
for j in range(NJ):
|
for j in range(NJ):
|
||||||
t_j = local_t[:, j, :]
|
t_j = local_t[:, j, :]
|
||||||
q_j = local_q[:, j, :]
|
q_j = local_q[:, j, :]
|
||||||
@ -556,8 +555,9 @@ def build_glb_skeletal(
|
|||||||
"target": {"node": body_mesh_node_idx, "path": "weights"},
|
"target": {"node": body_mesh_node_idx, "path": "weights"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if samplers:
|
||||||
animations.append({
|
animations.append({
|
||||||
"name": f"track{track_i:02d}",
|
"name": "all_tracks",
|
||||||
"samplers": samplers, "channels": channels,
|
"samplers": samplers, "channels": channels,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user