mnesarco utils ? Screen Jumps on arrows press

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
Outsourced
Posts: 81
Joined: Wed Feb 03, 2021 8:07 am

mnesarco utils ? Screen Jumps on arrows press

Post by Outsourced »

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/Australia (en_AU)
Installed mods: 
  * A2plus 0.4.59
  * AnimationFreeCAD 1.0.0
  * ArchTextures
  * Assembly3 0.11.3
  * Assembly4 0.12.4
  * BIM 2021.12.0
  * CfdOF 1.17.9
  * CubeMenu
  * CurvedShapes 1.0.4
  * Curves 0.5.8
  * Design456 0.0.1
  * dodo
  * EM
  * ExplodedAssembly
  * fasteners 0.4.6
  * fcgear 1.0.0
  * FeedsAndSpeeds 0.4.0
  * FEM_FrontISTR 0.1.0
  * frame 0.1.0
  * freecad-mbdyn-dynamics-workbench-master
  * freecad.gears 1.0.0
  * geodat
  * GitPython-main
  * kicadStepUpMod 10.15.1
  * lattice2 1.0.0
  * LCInterlocking
  * Manipulator 1.4.9
  * Material
  * Measure
  * MECHATRONICS-PARTS
  * MeshRemodel 1.8919.0
  * MnesarcoUtils 0.1.0
  * ModernUI
  * Nikra-DAP-main
  * nurbs
  * parts_library
  * parts_library.bak
  * Pyramids-and-Polyhedrons
  * Render 2022.2.0
  * sheetmetal 0.2.57
  * Trails 2022.1.0
  * workfeature
Hello FC
I truly enjoy the control the mnesarco utils, my only complaint(s) is that if I use the arrows on the keyboard to control the 'Open' slider(click on slider pointer first), the screen jumps as well as the models dynamics?

I wish there was a multiple slider option to control multiple slider options via the same popup window,(Mangojellys tutorial on writing a Python Script for custom slider is in P2 not P3? - I can not get past the first few lines of code, & have search high & low for more info) and also a way to map those variables to individual keys or controller buttons, would effectively be a game changer - Imagine controlling a excavator with the game controller (Maybe I have too much time on my hands?)

But otherwise many thx in advance.
Attachments
FC0.20.1_Lever_Throttle_15.09.22(2a).FCStd
(456.92 KiB) Downloaded 16 times
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: mnesarco utils ? Screen Jumps on arrows press

Post by Syres »

Outsourced wrote: Wed Sep 14, 2022 9:52 pm (Mangojellys tutorial on writing a Python Script for custom slider is in P2 not P3? - I can not get past the first few lines of code,
Not sure where you were looking but the Animation example I found was perfectly acceptable for Python3, here is the tested macro with a Cube(Box) being the only object in the project at the time of execution:

Code: Select all

from PySide.QtGui import *
from PySide.QtCore import *

class AnimationSliderWindow(QWidget):
    def __init__(self):
        rads = 6.283
        super(AnimationSliderWindow, self).__init__()
        self.setWindowFlags(Qt.WindowStaysOnTopHint)
        self.setWindowTitle("Animation Slider")
        self.slider1 = QSlider(Qt.Horizontal)
        self.slider1.setMinimum(0)
        self.slider1.setMaximum(rads * 1000)
        self.slider1.valueChanged.connect(self.sliderMoved)
        layout = QHBoxLayout()
        layout.addWidget(self.slider1)
        self.setLayout(layout)
        self.show()

    def sliderMoved(self):
        val = self.slider1.value()
        App.ActiveDocument.getObject("Box").Placement.Rotation.Angle = val /1000
        App.Console.PrintMessage(str(val)+"\n")

myWindow = AnimationSliderWindow()
using:

Code: Select all

OS: Linux Mint 20.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.9.13, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.59
  * Curves 0.5.8
  * ExtremeProDark 1.0.4
  * Plot 2022.4.17
  * fasteners 0.4.6
  * sheetmetal 0.2.57
Outsourced
Posts: 81
Joined: Wed Feb 03, 2021 8:07 am

Re: mnesarco utils ? Screen Jumps on arrows press

Post by Outsourced »

Syres_Slider is functional, my interest in coding is resumed thankyou. :D
Outsourced
Posts: 81
Joined: Wed Feb 03, 2021 8:07 am

Re: mnesarco utils ? Screen Jumps on arrows press

Post by Outsourced »

Where Should I be looking?
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: mnesarco utils ? Screen Jumps on arrows press

Post by mario52 »

Hi

Qt_Example

Python_Code

bienvenue au club

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Outsourced
Posts: 81
Joined: Wed Feb 03, 2021 8:07 am

Re: mnesarco utils ? Screen Jumps on arrows press

Post by Outsourced »

Thx
Post Reply