Two things:
Add the operation (ShapeOperation) field during your SubPathInfo object construction. It doesn't have a default value, so it is probably looking for it but can't find it, which is causing your error.
ppi.RightDirection should be ppi.rightDirection, with a lowercase "r".
Hopefully, this fixes your problem!