30
31
33
34 mesh_count = calibrated.getMeshCount()
35 print("Number of meshes: {}".format(mesh_count))
36
37 for mesh_index in range(mesh_count):
38 bs_tgt_count = calibrated.getBlendShapeTargetCount(mesh_index)
39 print("Number of blendshape targets for mesh {}({}): {}".format(calibrated.getMeshName(mesh_index), mesh_index, bs_tgt_count))
40 for bs_tgt_index in range(bs_tgt_count):
41 bs_tgt_delta_count = calibrated.getBlendShapeTargetDeltaCount(mesh_index, bs_tgt_index)
42 print("Number of blendshape target deltas for mesh {}({}), blend shape target {}: {}".format(calibrated.getMeshName(mesh_index), mesh_index, bs_tgt_index, bs_tgt_delta_count))
43
44 print("Blend shape channel LODs: {}".format(calibrated.getBlendShapeChannelLODs()))
45 print("Blend shape channel input indices: {}".format(calibrated.getBlendShapeChannelInputIndices()))
46 print("Blend shape channel output indices: {}".format(calibrated.getBlendShapeChannelOutputIndices()))
47
48
50
51 print("\n\nClearing blend shape data...\n\n")
52
53 command.run(calibrated)
54
55 for mesh_index in range(mesh_count):
56 bs_tgt_count = calibrated.getBlendShapeTargetCount(mesh_index)
57 for bs_tgt_index in range(bs_tgt_count):
58 bs_tgt_delta_count = calibrated.getBlendShapeTargetDeltaCount(mesh_index, bs_tgt_index)
59 if bs_tgt_delta_count != 0:
60 raise RuntimeError("Blend shape target deltas not removed properly!")
61
62 bs_channel_lods = calibrated.getBlendShapeChannelLODs()
63 bs_channel_input_indices = calibrated.getBlendShapeChannelInputIndices()
64 bs_channel_output_indices = calibrated.getBlendShapeChannelOutputIndices()
65
66 if (len(bs_channel_lods) != 0) or (len(bs_channel_input_indices) != 0) or (len(bs_channel_output_indices) != 0):
67 raise RuntimeError("Blend shape animation data not removed properly!")
68
69 print("Number of meshes: {}".format(mesh_count))
70
71 for mesh_index in range(mesh_count):
72 bs_tgt_count = calibrated.getBlendShapeTargetCount(mesh_index)
73 print("Number of blendshape targets for mesh {}({}): {}".format(calibrated.getMeshName(mesh_index), mesh_index, bs_tgt_count))
74 for bs_tgt_index in range(bs_tgt_count):
75 bs_tgt_delta_count = calibrated.getBlendShapeTargetDeltaCount(mesh_index, bs_tgt_index)
76 print("Number of blendshape target deltas for mesh {}({}), blend shape target {}: {}".format(calibrated.getMeshName(mesh_index), mesh_index, bs_tgt_index, bs_tgt_delta_count))
77
78 print("Blend shape channel LODs: {}".format(bs_channel_lods))
79 print("Blend shape channel input indices: {}".format(bs_channel_input_indices))
80 print("Blend shape channel output indices: {}".format(bs_channel_output_indices))
81
82 print("\n\nSuccessfully cleared blend shape data.")
83
84 print("Saving DNA...")
86 print("Done.")
87
ClearBlendShapesCommand is used to clear all blend shapes data from a DNA.
Definition: ClearBlendShapesCommand.h:19
Definition: DNACalibDNAReader.h:12
def saveDNA(reader, path)
Definition: clear_blend_shapes.py:18
def loadDNA(path)
Definition: clear_blend_shapes.py:8
def calibrateDNA(inputPath, outputPath)
Definition: clear_blend_shapes.py:28