How to retreive position and control move in SofaPython3? #3002
-
I have tried the python code like this and "SofaTrainingScene-v15/16-python3-particle-interactive" , but still struggling with moving objects by changing its position. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @SalemTree self.MO = kwargs.get("MechanicalObject")
print(str(self.MO.position)) However, what do you mean by "controlling position with Sofapython3" ? do you want to impose the position of some nodes ? |
Beta Was this translation helpful? Give feedback.
-
Hi @hugtalbot |
Beta Was this translation helpful? Give feedback.
Hi @hugtalbot
Thanks for the example code!
I tried
self.MO = kwargs.get("MechanicalObject")
but it seems that it's not getting any object, when I print self.MO it shows "None". When I change it intoself.CFF = kwargs.get("ForceField")
it works perfectly well to print the force. Do you know what could be insufficient with the MechanicalObject part?