"Commanding" FC GUI, an idea to make easier tutorials.

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
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

"Commanding" FC GUI, an idea to make easier tutorials.

Post by onekk »

This is a rough idea, and probably is not original nor feasible.

The idea is to code a script that for a FC version will do the following:

1) make a screenshot of the FC window
2) simulate mouse click on a menu item (and retrieve position of the menu in the window (I think that Qt has a way to determine the rectangle occupied by a QWidget))
3) make a screenshot of the menu

... select a new item and itrate through the interface to make things taking screenshots (probably noting the given name)

4) at the end (a small windows with a stop button wil be created ouside the FC mainwindow) it produce a file with:

sequence number or timestamp
action performed
screenshot name
coordinate of the activated widget

An external Python script will take this file and the screenshots and compose something like new images with superimposed "highlighting marks", like coloured ovals or similar to visualize clearly the "button or the menu item" selected, and maybe some text to be added as description

And probably using these created images (original screenshots or modified ones) compose something, that could be a "video", or a "animated gif" or similar image.

I could see some "delicate point"

It is possible to:
  • determine the location of a menu item or a button in FC interface
  • record the "rectangle of the activated widget" (i.e it is returned in window coordinate as pixels?)
  • perform the relative action (i.e click a button or click a menu item)

Something similar was discussed as an idea some time ago, but now I don't remember the discussion, so I apologize if this post is duplicated.

TIA and Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: "Commanding" FC GUI, an idea to make easier tutorials.

Post by heda »

not overly hard to do these simulations as such and get images out of qt/fc this way (see for example the preference snip macro - somewhere on the forum...),
but what would you do with all these pictures?
likely you will end up needing to go through all of them by hand and make sure that they are what they should be before using them further.
not worth the effort imho.

why not put some time into MOOC_Workbench if you are inclined to work on training/tutorial side of things?
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: "Commanding" FC GUI, an idea to make easier tutorials.

Post by onekk »

Thanks @heda the MOOC WB was the project I remembered.

I will see what is offering actually.

For the other considerations, my post was a sort of declaration of intent, hoping to have some hints.

I know that at least on Linux you have wmctrl that could script WM actions. And other things, I use as example an OpenBox shortcut to take screenshots and similar things so it is feasible.


Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply