@@ -192,12 +192,6 @@ static PyObject* PyLAppModel_StartRandomMotion(PyLAppModelObject* self, PyObject
192192 Py_RETURN_NONE;
193193}
194194
195- static PyObject* PyLAppModel_ClearMotions (PyLAppModelObject* self, PyObject* args, PyObject* kwargs)
196- {
197- self->model ->ClearMotions ();
198- Py_RETURN_NONE;
199- }
200-
201195static PyObject* PyLAppModel_SetExpression (PyLAppModelObject* self, PyObject* args, PyObject* kwargs)
202196{
203197 const char * expressionID;
@@ -673,14 +667,31 @@ static PyObject* PyLAppModel_GetPartScreenColor(PyLAppModelObject* self, PyObjec
673667 return Py_BuildValue (" ffff" , r, g, b, a);
674668}
675669
670+ static PyObject* PyLAppModel_StopAllMotions (PyLAppModelObject* self, PyObject* args, PyObject* kwargs)
671+ {
672+ self->model ->StopAllMotions ();
673+ Py_RETURN_NONE;
674+ }
675+
676+ static PyObject* PyLAppModel_ResetParameters (PyLAppModelObject* self, PyObject* args, PyObject* kwargs)
677+ {
678+ self->model ->ResetParameters ();
679+ Py_RETURN_NONE;
680+ }
681+
682+ static PyObject* PyLAppModel_ResetPose (PyLAppModelObject* self, PyObject* args, PyObject* kwargs)
683+ {
684+ self->model ->ResetPose ();
685+ Py_RETURN_NONE;
686+ }
687+
676688// 包装模块方法的方法列表
677689static PyMethodDef PyLAppModel_methods[] = {
678690 {" LoadModelJson" , (PyCFunction)PyLAppModel_LoadModelJson, METH_VARARGS, " " },
679691 {" Resize" , (PyCFunction)PyLAppModel_Resize, METH_VARARGS, " " },
680692 {" Draw" , (PyCFunction)PyLAppModel_Draw, METH_VARARGS, " " },
681693 {" StartMotion" , (PyCFunction)PyLAppModel_StartMotion, METH_VARARGS | METH_KEYWORDS, " " },
682694 {" StartRandomMotion" , (PyCFunction)PyLAppModel_StartRandomMotion, METH_VARARGS | METH_KEYWORDS, " " },
683- {" ClearMotions" , (PyCFunction)PyLAppModel_ClearMotions, METH_VARARGS | METH_KEYWORDS, " " },
684695
685696 {" SetExpression" , (PyCFunction)PyLAppModel_SetExpression, METH_VARARGS | METH_KEYWORDS, " " },
686697 {" SetRandomExpression" , (PyCFunction)PyLAppModel_SetRandomExpression, METH_VARARGS | METH_KEYWORDS, " " },
@@ -715,6 +726,12 @@ static PyMethodDef PyLAppModel_methods[] = {
715726
716727 {" SetPartScreenColor" , (PyCFunction)PyLAppModel_SetPartScreenColor, METH_VARARGS, " " },
717728 {" GetPartScreenColor" , (PyCFunction)PyLAppModel_GetPartScreenColor, METH_VARARGS, " " },
729+
730+ // 复位
731+ {" StopAllMotions" , (PyCFunction)PyLAppModel_StopAllMotions, METH_VARARGS | METH_KEYWORDS, " " },
732+ {" ResetParameters" , (PyCFunction)PyLAppModel_ResetParameters, METH_VARARGS | METH_KEYWORDS, " " },
733+ {" ResetPose" , (PyCFunction)PyLAppModel_ResetPose, METH_VARARGS | METH_KEYWORDS, " " },
734+
718735 {NULL } // 方法列表结束的标志
719736};
720737
0 commit comments