Camera motion in Linux absent

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Camera motion in Linux absent

Post by Joel_graff »

wmayer wrote: Fri Aug 23, 2019 1:13 pm Could it be that you set a perspective camera on Linux? Because when doing so the test command stops with an error.
I don't think so. And I'm starting to think it has to do with the amount of geometry displayed / scale, or possibly video hardware.

To that point, I had no issues whatsoever zooming in on a cube. But when I loaded some highway alignment data from a LandXML file (which is a couple thousand feet in scale), the first attempt to zoom in yielded much the same result as before: I saw a little motion, but then it blanked until the routine finished and then redrew the screen. (edit: again, that's running the zoom from inside a Gui.Command call, not from the python console)

What's interesting is, if I zoomed out and reran the zoom macro, it worked perfectly, which immediately suggests some sort of caching is taking place that Linux needs but Windows does not.

This might also be related to my video card. NVidia is rather less-than-great on Linux, after all.

As for next steps.. I'm not really sure.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Camera motion in Linux absent

Post by DeepSOIC »

Try calling PySide.QtGui.qApp.processEvents() in the loop.
Strangely, on my system, qApp is ~None initially. It helps to construct one: Pyside.QtCore.QApplication(), then qApp is not none anymore.

HOWEVER.

When I type PySide.QtGui.qApp to console, it prints out "None" (regular None should not be printed at all). And if I compare PySide.QtGui.qApp is None, the result is FALSE :shock: . This is some very special None, I don't know what's going on. Using not bool(PySide.QtGui.qApp) seems to have worked, although my FreeCAD once crashed during these experiments. Can't reproduce anymore...
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Camera motion in Linux absent

Post by Joel_graff »

DeepSOIC wrote: Fri Aug 23, 2019 6:16 pm Try calling PySide.QtGui.qApp.processEvents() in the loop.
Strangely, on my system, qApp is ~None initially. It helps to construct one: Pyside.QtCore.QApplication(), then qApp is not none anymore.
I'm not sure what you mean by constructing "one" - QApplication() isn't a method of PySide.QtCore. IT is in QtGui, but trying to call it throws an error because I'm trying to instance a singleton that already exists.

Nevertheless, qApp (both QtGUi and QtCore) are None, as you say.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Camera motion in Linux absent

Post by Joel_graff »

I should also point out that when I load the data from the file and generate the geometry, I make a call to Gui.SendMsgToActiveView("ViewFit").

On windows, this smooth-zooms to fit the geometry to the view. On Linux, it behave just as my custom view code does - failing to render the zoom increments and just redrawing when the zoom is complete.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Post Reply