I have compiled SOFA and SofaPython3 plugni in debug mode. In this scenario, I try to assign a numpy vector to the rest position of a mechanical object, but it fails. This is the python code I am executing:
xNObject = coarseObject.addChild("xN")
xN_mo = xNObject.addObject("MechanicalObject", template="Vec1", name="xN_MO")
xN_mo.rest_position = np.array([[0,0.25,0.75]]).T
and this is the error I am getting:
[ERROR] [vector] in vector<Vec<1, double>> 5555571952d0 size 0 : invalid index 0
I understand my MO has no size when created and therefore, assigning a numpy vector to the rest position triggers the error. How should I do this correctly? I have tried calling xN_mo.size = 3 but that also fails.