Thank you @KevinDietrich I managed to implement it but using ATTR_STD_MOTION_VERTEX_POSITION I got weird artifacts and also it becomes extremely slow (about 20 times slower than without mb).
If I disable object->geometry->use_motion_blur it comes back to a normal behaviour, also if I do not add ATTR_STD_MOTION_VERTEX_NORMAL it works ok too.
My rough aproximation was finding the attribute if it exists:
ccl::Attribute* attr_vert = cyclesMesh->attributes.find(attributeName);
if (attr_vert == nullptr)
attr_vert = cyclesMesh->attributes.add(ccl::ATTR_STD_MOTION_VERTEX_POSITION, attributeName);
ccl::float3* attr_data_vert = attr_vert->data_float3();
And after that I fill the attr_data_vert.
Also I fill it twice one with an offset 0 and another time with offset NumVertex, my intention is that the first offset is the previous frame and the second pass is the next frame, notice that for testing I also tried by filling the vertex with the current position so it shouldn’t generate any motion blur.
And just for finish it:
I’m driving nuts about that the implementation, in brief I have set the current vertex and I have the previous and next frame but I’m getting weird results everytime and probably I’ve missed a step.
Any tip is welcome!