The Update function in AnimationJobBinder is called with a copy of your job (all C# job containers are structs). Therefore, changing somePos in this instance will only modify the copy and not the job evaluated in the PlayableGraph.
To change this value, you would need to register it in a NativeArray a little bit like so:
public struct SampleJob : IWeightedAnimationJob
{
public NativeArray<Vector3> somePos;
public void ProcessAnimation(AnimationStream stream)
{
// Fancy stuff with somePos[0]
}
public void ProcessRootMotion(AnimationStream stream)
{
}
public FloatProperty jobWeight { get; set; }
}
public class SampleJobBinder : AnimationJobBinder<SampleJob, SampleData>
{
public override SampleJob Create(Animator animator, ref SampleData data, Component component)
{
// Some init
return new SampleJob
{
somePos = new NativeArray<Vector3>(new Vector3[] {Vector3.zero}, Allocator.Persistent);
};
}
public override void Update(SampleJob job, ref SampleData data)
{
job.somePos[0] = Vector3.one * Random.Range(-6f, 6f);
}
public override void Destroy(SampleJob job)
{
}
}