To clarify this answer, as it is correct, but not descriptive. Basically anywhere it says “Primitive” replace that word and only that word with “GetPrimitiveData(Parameters.PrimitiveId)”
Here is the Documentation: Mesh Drawing Pipeline Conversion Guide for Unreal Engine 4.22 | Unreal Engine Documentation
Scroll all the way to the bottom.
Ex:
localcampos = (localcampos / (Primitive.LocalObjectBoundsMax.x)) ;
Becomes:
localcampos = (localcampos / (GetPrimitiveData(Parameters.PrimitiveId).LocalObjectBoundsMax.x;