Diffuse martensitic transitions and the plasticity of crystals with a shape memory effect