Avindr / MxM-IssueTracking

7 stars 0 forks source link

Bug. Config Module - Adding new Pose Properties/Joints to an existing setup. #85

Closed Craigjw closed 3 years ago

Craigjw commented 3 years ago

When adding a new pose property to an existing setup, the Calibration module requires resetting with the updated pre-processed Anim data.

Lets say we setup a project with 3 pose properties for the Config Module; Hips, Left & Right Feet). The Anim data is generated and the Calibration Module is created using the anim data with 3 joints.

Now we want to add a 4th joint to the pose property. If the we just add this to the Config Module and Pre-process the anim data and then press play, we receive an Out of Range Exception @ MxMAnimator.cs line 1624. m_curCalibData.JointPositionWeights[] & m_curCalibData.JointVelocityWeights[]has only 3 joints and has not updated using 4. The loop expects 4, but the array has only 3.

To fix this, we must drag the rebuilt animdata using 4 joints into the Calibration Module/Target Anim Data. We do not have to copy calibration data to update using 4 joints.

I would suggest an update function within the Calibration Module, possibly called each time Pre-Process Animation Data is executed.

Avindr commented 3 years ago

I'm not able to make it automatically update after pre-processing as the calibration data has no way of knowing if the AnimData changed unless you have opened it's inspector. I've done some other things instead to make this easier in 2.2.8.

  1. Calibration Modules will now automatically validate when opening in the inspector, adding new joints if required.
  2. The MxMAnimator will also validate the calibration data when it plays and temporarily add additional joints if they are missing)

This should stop any of these errors occurring and it should behave as expected.