I encountered a weird bug on creating FFD between Manually and through Script.
Creating Manually works as expected. But creating it through the script, somehow snaps the object to an actual box, despite the fact that both FFDs have the same parameters.
You can check the problem here:
You can check the illustration file here:
Here is the working script:
import c4d from c4d import gui # Select Object # Run Script def main(): doc = c4d.documents.GetActiveDocument() obj = doc.GetActiveObject() point_list = obj.GetAllPoints() # Populate Initial Variables min_x = point_list max_x = point_list min_y = point_list max_y = point_list min_z = point_list max_z = point_list for points in obj.GetAllPoints(): min_x = min(min_x, points) max_x = max(max_x, points) min_y = min(min_y, points) max_y = max(max_y, points) min_z = min(min_z, points) max_z = max(max_z, points) grid_x = abs(min_x - max_x) grid_y = abs(min_y - max_y) grid_z = abs(min_z - max_z) # Create Deformer deformer = c4d.BaseObject(5108) # FFD Deformer doc.AddUndo(c4d.UNDOTYPE_NEW, deformer) deformer.InsertUnder(obj) # Set Deformer Parameters bbox_center = obj.GetMp() # GetBoundingBoxCenter deformer_mat = obj.GetMg() deformer_mat.off = bbox_center * obj.GetMg() deformer.SetMg(deformer_mat) deformer[c4d.FFDOBJECT_SIZE] = c4d.Vector(grid_x, grid_y, grid_z) #Set FFD Grid Size deformer.Message (c4d.MSG_UPDATE) c4d.EventAdd() # Execute main() if __name__=='__main__': main()