Gui: Revert breaking Python interface change for viewPosition()
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user