I have a mesh that needs a corrective pose.
Rather than creating it within C4D, I export an uncorrected pose.
And received a corrected pose, from the modeler.
I now have the task to convert the corrected pose to a corrected shape.
Here is my planned workflow:
- Store points of the corrected pose
- Go to the uncorrected pose. Add a posemorph, while in edit mode
- Restore points from the corrected pose to the uncorrected pose.
It works as you can see here:
Both mesh should match 1 to 1. But not where the mesh is with Posemorph and Skin:
You can check the illustration file here: (Animated from 0 to 10)
Here is the working script so far:
import c4d from c4d import gui # Select Corrective Pose # Select Base Pose # Execute Script def main(): doc = c4d.documents.GetActiveDocument() obj_sel = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_SELECTIONORDER) driver = obj_sel driven = obj_sel driven_world_matrix = driven.GetMg() driver_world_matrix = driver.GetMg() driver_points = [point * driver_world_matrix for point in driver.GetAllPoints()] new_points = [point * ~driven_world_matrix for point in driver_points ] driven.SetAllPoints(new_points) driven.Message (c4d.MSG_UPDATE) print driver_points print new_points c4d.EventAdd() # Execute main() if __name__=='__main__': main()