[Bug?] Entering or exiting fullscreen mode stops the camera animation

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
kwahoo
Posts: 680
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

[Bug?] Entering or exiting fullscreen mode stops the camera animation

Post by kwahoo »

Hi,

I use following code to animate the camera:

Code: Select all

import sys
import FreeCAD as App, FreeCADGui as Gui, Part, time, sys, math
from PySide2 import QtGui,QtCore
from pivy import coin

class Animation(object):
    def __init__(self):
        #Gui.runCommand('Std_ViewDockUndockFullscreen',2)
        Gui.activeDocument().activeView().setCameraType("Perspective")
        self.camera = Gui.ActiveDocument.ActiveView.getCameraNode()
        App.Console.PrintMessage('init')
        App.ActiveDocument.recompute()
        self.timer = QtCore.QTimer()
        self.angle = 0.0
        QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.my_update)
        self.timer.start(16) #60 fps
        App.Console.PrintMessage('timer started')

    def my_update(self):
        rotation = coin.SbRotation(coin.SbVec3f(0, 0, 1), self.angle)
        self.camera.orientation.setValue(rotation)
        Gui.updateGui()
        self.angle = self.angle + 0.1

    def stop(self):
      self.timer.stop()

animation = Animation() 

#To stop the animation, type:
#animation.stop()
If I press F11 to enter the fullscreen mode, the animation stops. Alternatively, If I uncomment

Code: Select all

Gui.runCommand('Std_ViewDockUndockFullscreen',2)
in the script to start directly in the fullscreen mode, the animation will stop after exiting the fullscreen mode with F11.
Is this a bug or by design?

Code: Select all

OS: Ubuntu 21.10 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: 12d0974525afe812e81ad623f7d915cb1784118e
Python version: 3.9.6
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.2
Locale: Polish/Poland (pl_PL)
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: [Bug?] Entering or exiting fullscreen mode stops the camera animation

Post by Syres »

kwahoo wrote: Fri Jan 28, 2022 7:48 pm Is this a bug or by design?
I'll be honest, the first test I carried out was using the Gui, (Tools>View Turntable) and Full Screen doesn't work there so I conclude you've found a bug. So the joyous job is determining when this regression was introduced as I'm fairly certain it worked in the distant past (I don't use it very often).

Firstly, I'll try a few of my old Windows builds (I only retain one old Linux build) and if unsuccessful then it's going to be 'old school' graft.

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.27308 (Git)
Build type: Release
Branch: master
Hash: 38321cc2e90b36c13821d11e986a3e562d510893
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: [Bug?] Entering or exiting fullscreen mode stops the camera animation

Post by Syres »

Update, it doesn't appear to be a bug with the core code but something with my Linux driver setup (NVidia GeForce GTX 690), all my Windows builds back to 0.16 work fine with the Gui and I'm using exactly the same hardware. It doesn't work with the AppImage on my box which was surprising.

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.27078 (Git) AppImage
Build type: Release
Branch: (HEAD detached at bcdd926)
Hash: bcdd926686f2245fe60baface1cce1ab3dff7a5b
Python version: 3.9.9
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: English/United Kingdom (en_GB)
User avatar
kwahoo
Posts: 680
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: [Bug?] Entering or exiting fullscreen mode stops the camera animation

Post by kwahoo »

Syres wrote: Sat Jan 29, 2022 5:29 pm I'll be honest, the first test I carried out was using the Gui, (Tools>View Turntable) and Full Screen doesn't work there so I conclude you've found a bug.
Good catch. View Turntable does work in this release https://github.com/FreeCAD/FreeCAD/releases/tag/0.18.1 (on Windows, since Linux version crashes at start). In 19.3 and 20, View Turntable is broken for me. Both Linux and Windows.
Post Reply