Skip to content
Snippets Groups Projects
Commit e08e21e3 authored by Erik Nygren's avatar Erik Nygren
Browse files

fixed issues with editor with refactored rendertools.py

removed prints for debugging
parent ded160fe
No related branches found
No related tags found
1 merge request!107103 fixing issues
Pipeline #1513 failed
...@@ -221,7 +221,8 @@ class PILGL(GraphicsLayer): ...@@ -221,7 +221,8 @@ class PILGL(GraphicsLayer):
def save_image(self, filename): def save_image(self, filename):
""" """
Renders the current scene into a image file Renders the current scene into a image file
:param filename: filename where to store the rendering output_generator (supported image format *.bmp , .. , *.png) :param filename: filename where to store the rendering output_generator
(supported image format *.bmp , .. , *.png)
""" """
img = self.alpha_composite_layers() img = self.alpha_composite_layers()
img.save(filename) img.save(filename)
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Railway Scene Editor # Railway Scene Editor
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from IPython.core.display import display, HTML from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>")) display(HTML("<style>.container { width:95% !important; }</style>"))
``` ```
%% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from flatland.utils.editor import EditorMVC from flatland.utils.editor import EditorMVC
mvc = EditorMVC(sGL="PILSVG" ) mvc = EditorMVC(sGL="PILSVG" )
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Instructions ## Instructions
- Drag to draw (improved dead-ends) - Drag to draw (improved dead-ends)
- ctrl-click to add agent or select agent - ctrl-click to add agent or select agent
- if agent is selected: - if agent is selected:
- ctrl-click to move agent position - ctrl-click to move agent position
- use rotate agent to rotate 90° - use rotate agent to rotate 90°
- ctrl-shift-click to set target for selected agent - ctrl-shift-click to set target for selected agent
- target can be moved by repeating - target can be moved by repeating
- to Resize the env (cannot preserve work): - to Resize the env (cannot preserve work):
- select "Regen" tab, set regen size slider, click regenerate. - select "Regen" tab, set regen size slider, click regenerate.
- alt-click remove all rails from cell - alt-click remove all rails from cell
Demo Scene: complex_scene.pkl Demo Scene: complex_scene.pkl
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
mvc.view.display() mvc.view.display()
``` ```
%% Output %% Output
redrawing outside
Output()
redrawing outside
Output()
redrawing outside
Output(outputs=({'output_type': 'stream', 'text': 'load file: complex_scene.pkl\nRegenerate size 50 20\n', 'name': 'stdout'},))
redrawing outside
Output(outputs=({'output_type': 'stream', 'text': 'load file: complex_scene.pkl\nRegenerate size 50 20\n', 'name': 'stdout'},))
redrawing outside
Output(outputs=({'output_type': 'stream', 'text': 'load file: complex_scene.pkl\nRegenerate size 50 20\n', 'name': 'stdout'},))
redrawing outside
Output(outputs=({'output_type': 'stream', 'text': 'load file: complex_scene.pkl\nRegenerate size 50 20\n', 'name': 'stdout'},))
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment