Gui: Revert breaking Python interface change for viewPosition()

This commit is contained in:
Rexbas
2023-10-24 20:32:47 +02:00
committed by wwmayer
parent 3a4fdbb3fd
commit a2c2bf5a4b
3 changed files with 18 additions and 8 deletions

View File

@@ -778,7 +778,9 @@ Py::Object View3DInventorPy::getCameraOrientation()
Py::Object View3DInventorPy::viewPosition(const Py::Tuple& args)
{
PyObject* p = nullptr;
if (!PyArg_ParseTuple(args.ptr(), "|O!", &Base::PlacementPy::Type, &p))
int steps; // Unused but kept as parameter to not break the Python interface
int duration = -1; // Duration in ms, will be replaced with User parameter:BaseApp/Preferences/View/AnimationDuration when not explicitly provided
if (!PyArg_ParseTuple(args.ptr(), "|O!ii", &Base::PlacementPy::Type, &p, &steps, &duration))
throw Py::Exception();
if (p) {
@@ -789,7 +791,7 @@ Py::Object View3DInventorPy::viewPosition(const Py::Tuple& args)
rot.getValue(q0,q1,q2,q3);
getView3DIventorPtr()->getViewer()->moveCameraTo(
SbRotation((float)q0, (float)q1, (float)q2, (float)q3),
SbVec3f((float)pos.x, (float)pos.y, (float)pos.z));
SbVec3f((float)pos.x, (float)pos.y, (float)pos.z), duration);
}
SoCamera* cam = getView3DIventorPtr()->getViewer()->getSoRenderManager()->getCamera();