-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offscreen rendering #6808
Offscreen rendering #6808
Conversation
@wwmayer this looks interesting, what does it do? |
It renders a scene off-screen :) Coin has an integrated off-screen rendering mechanism but it always lacked the possibility to support anti-aliasing or correctly handle transparent backgrounds and for several years it has stopped working for me completely. So, the alternative we have implemented several years ago is using Qt's off-screen rendering capabilities combined with framebuffer objects. Now this PR only exposes the corresponding C++ class to Python. This allows it to create high-quality images of a scene in true headless mode and thus could be used as the groundwork for a thumbnailer for XFCE that supports any file format that FreeCAD supports. |
Fantastic! BTW, could this be used as an alternate (one-directional, STDOUT-esque if you will) GUI for running FC in headless mode? |
What do you mean with alternative GUI? |
Meaning, not using the FreeCAD regular GUI, but like a unix pipe (if you will) to a dialog of some sort showing the model being manipulated through the headless instance of FreeCAD |
You could show the rendered image in a widget and use some buttons to control the headless FreeCAD. But an interaction with the scene won't be possible and also the rendering might be a bit slow. |
Fantastic! There are a lot of possibilities there... I also think it would be impractical to run FreeCAD in another GUI that way, as it would need to re-render the scene 30 times per second or something like that, no sure that would be achievable... Better path would be to export the coin scene directly to some other format (webgl, etc...) and let the other app do the rendering |
CC @ickby (you may be interested in this since you've been working on https://github.com/OpenCollaborationPlatform/CollaborativeFC) |
does that mean it could be also used to generate thumbnails even for FCStd files that don't have the embedded thumbnail? |
Basically yes. However, it's not my primary goal to implement a general thumbnailer. I just wanted to make the real off-screen rendering working again. The thumbnailer is just a side-product of it. For a thumbnailer there are a few points to consider:
|
Thank you for creating a pull request to contribute to FreeCAD! To ease integration, we ask you to conform to the following items. Pull requests which don't satisfy all the items below might be rejected. If you are in doubt with any of the items below, don't hesitate to ask for help in the FreeCAD forum!
App
,Base
,Gui
or one of theMod
subfolders. If you need to make changes in several locations, make several pull requests and wait for the first one to be merged before submitting the next onesgit pull --rebase upstream master
./bin/FreeCAD --run-test 0
Fixes typo in Draft Move command text
Draft: Fixed typos
issue #<id>
orfixes #<id>
where<id>
is the issue ID number from our Issues database in case a particular commit solves or is related to an existing issue. Ex:Draft: fix typos - fixes #4805
And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 0.20 Changelog Forum Thread.