Blender Manual: Develop a Script for Automated Screenshots #73397

Open
opened 2020-01-25 21:52:22 +01:00 by Aaron Carlisle · 9 comments
Member

Currently, the manual has lots of images however these are very difficult to make (time-consuming) and keep up to date. We want to create a script to automate this as much as possible.

Some work was done to make this work for nodes already but this can be implemented better.

I want this to work for two areas to start with:

  • Nodes
  • UI Panels

For the script, we want to name images by there class name:

BONE_PT_context_bone,
    BONE_PT_transform,
    BONE_PT_curved,
    BONE_PT_relations,
    BONE_PT_inverse_kinematics,
    BONE_PT_deform,
    BONE_PT_display,
    BONE_PT_custom_props,```

which can be referenced in the manual:


.. figure:: /images/BONE_PT_transform.png


The script should only create needed images.
The script should create all the panel images at a defined width i.e 200px and automatically calculate the height of the panel.
Currently, the manual has lots of images however these are very difficult to make (time-consuming) and keep up to date. We want to create a script to automate this as much as possible. Some work was done to make this work for nodes already but this can be implemented better. I want this to work for two areas to start with: - Nodes - UI Panels For the script, we want to name images by there class name: ``` BONE_PT_context_bone, BONE_PT_transform, BONE_PT_curved, BONE_PT_relations, BONE_PT_inverse_kinematics, BONE_PT_deform, BONE_PT_display, BONE_PT_custom_props,``` which can be referenced in the manual: ``` .. figure:: /images/BONE_PT_transform.png ``` The script should only create needed images. The script should create all the panel images at a defined width i.e 200px and automatically calculate the height of the panel.
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Aaron Carlisle changed title from Automated Screenshots to Blender Manual: Develop a Script for Automated Screenshots 2020-01-25 23:20:26 +01:00
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member
Related work: https://gist.github.com/JacquesLucke/65485586a86b2e1de6e3f3b92867947a rBM5111, rBM5112
Member

Added subscriber: @rdmo

Added subscriber: @rdmo

Added subscriber: @HUSCH

Added subscriber: @HUSCH

Attempt to improve the screenshot-creation process

Problem: the Blender docs contain many (annotated) screenshots. Updating these screenshots because of UI changes is difficult, especially if they are annotated (arrows, text, …). Most of the time, it requires the complete recreating of the Blender model with the specific user interface (zoom level, …), and re-adding the annotations.

Possible solution: each image in the docs has an accompanying blend-file that contains all the info to (re)create the screenshot. So, for each image in the docs, there are two files: xxx.blend and xxx.png.

Steps to (re)create the doc-image

  • Create a blend-file with two scenes. Let’s call them “source-scene” and “final-scene”.
  • Prepare the source-scene to create the screenshot; choose the correct workspace, zoom level, …. It’s good practice to run Blender in full-screen mode (Window > Toggle Window Fullscreen). This will remove the private file-location path in the header. The Resolution Scale (Edit > Preferences > Interface) can be set to 1.5 to have larger menu-texts, icons, …
  • Take a screenshot of the desired item with your favorite screen-grabber; eventually the complete main window with the menu Window > Save Screenshot. It’s imperative NOT to change anything (zooming, moving, adding/removing panels, …) AFTER the screenshot was made. Otherwise, it will be hard to recreate the image with the annotations at the correct location.
  • Switch to final-scene. Add an “image as plane” with the screenshot as source. With an addon “Image Paste” this could be done from the copy on the clipboard. Enable Automatically Pack Resources (File > External data). The screen-shot file will be packed within the blend-file and can thus be removed from your hard-disk.
  • Enable the Render Region and Crop to Render Region in the Output panel of the Properties editor to crop the render output to the desired area of the screenshot.
  • To annotate: add 3D Text objects for text and Grease Pencil objects for other shapes (arrows, boxes, …) Some common shapes (arrows, dashed lines, boxes, ...) could be created/saved in a seperate blend-file (functioning as a library) and re-used in later projects (menu File > Append.

Render final-scene and save the render as a png-file with the same name as the blend-file.

If anything has to be changed/updated later-on:

  • Due to a change in the UI: open the blend-file in the correct Blender-version, rename “source-scene” to “scene-old”, add a new source-scene (eventually as Full Copy of scene-old) , and repeat step 2 and 3. Change the source path of the image-as-plane object (from step 4) to point to the new screenshot.
  • Due to a change in the annotations: repeat step 5 - 7 with the correct info.

See attached blend-file for an example with the accopanying png-render output.
editors_vse_sequencer_timeline_sequencer.blend

editors_vse_sequencer_timeline_sequencer.png

**Attempt to improve the screenshot-creation process** Problem: the Blender docs contain many (annotated) screenshots. Updating these screenshots because of UI changes is difficult, especially if they are annotated (arrows, text, …). Most of the time, it requires the complete recreating of the Blender model with the specific user interface (zoom level, …), and re-adding the annotations. Possible solution: each image in the docs has an accompanying blend-file that contains all the info to (re)create the screenshot. So, for each image in the docs, there are two files: xxx.blend and xxx.png. *Steps to (re)create the doc-image* - Create a blend-file with two scenes. Let’s call them “source-scene” and “final-scene”. - Prepare the source-scene to create the screenshot; choose the correct workspace, zoom level, …. It’s good practice to run Blender in full-screen mode (Window > Toggle Window Fullscreen). This will remove the private file-location path in the header. The Resolution Scale (Edit > Preferences > Interface) can be set to 1.5 to have larger menu-texts, icons, … - Take a screenshot of the desired item with your favorite screen-grabber; eventually the complete main window with the menu Window > Save Screenshot. It’s imperative NOT to change anything (zooming, moving, adding/removing panels, …) AFTER the screenshot was made. Otherwise, it will be hard to recreate the image with the annotations at the correct location. - Switch to final-scene. Add an “image as plane” with the screenshot as source. With an addon “Image Paste” this could be done from the copy on the clipboard. Enable Automatically Pack Resources (File > External data). The screen-shot file will be packed within the blend-file and can thus be removed from your hard-disk. - Enable the Render Region and Crop to Render Region in the Output panel of the Properties editor to crop the render output to the desired area of the screenshot. - To annotate: add 3D Text objects for text and Grease Pencil objects for other shapes (arrows, boxes, …) Some common shapes (arrows, dashed lines, boxes, ...) could be created/saved in a seperate blend-file (functioning as a library) and re-used in later projects (menu File > Append. # Render final-scene and save the render as a png-file with the same name as the blend-file. If anything has to be changed/updated later-on: - Due to a change in the UI: open the blend-file in the correct Blender-version, rename “source-scene” to “scene-old”, add a new source-scene (eventually as Full Copy of scene-old) , and repeat step 2 and 3. Change the source path of the image-as-plane object (from step 4) to point to the new screenshot. - Due to a change in the annotations: repeat step 5 - 7 with the correct info. See attached blend-file for an example with the accopanying png-render output. [editors_vse_sequencer_timeline_sequencer.blend](https://archive.blender.org/developer/F10275884/editors_vse_sequencer_timeline_sequencer.blend) ![editors_vse_sequencer_timeline_sequencer.png](https://archive.blender.org/developer/F10275886/editors_vse_sequencer_timeline_sequencer.png)

Questions

  • Is it possible to freeze the UI layout of a scene? When the screenshot is made from the screen, no changes (e.g. resizing windows, adding workspaces, zoom level, ...) should be done. It is very easy to do that (for example zooming in) but it's difficult to restore the original setting.
  • Is there a possibility to add a library of Green Pencil shapes (Asset Manager?). Now, I have a workaround to create all shapes in a separate blend-file (in a scene-final) and append this scene to the project at hand.
Questions - Is it possible to freeze the UI layout of a scene? When the screenshot is made from the screen, no changes (e.g. resizing windows, adding workspaces, zoom level, ...) should be done. It is very easy to do that (for example zooming in) but it's difficult to restore the original setting. - Is there a possibility to add a library of Green Pencil shapes (Asset Manager?). Now, I have a workaround to create all shapes in a separate blend-file (in a scene-final) and append this scene to the project at hand.
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#73397
No description provided.