Skip to content

Commit 75616b8

Browse files
committed
Add alpha ctor kwarg for renderers
1 parent db21bb6 commit 75616b8

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

js/src/_base/Renderable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ var RenderableView = widgets.DOMWidgetView.extend({
296296

297297
var config = {
298298
antialias: this.model.get('_antialias'),
299+
alpha: this.model.get('_alpha'),
299300
};
300301
this.renderer = RendererPool.acquire(
301302
config,

js/src/core/Renderer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ var RendererModel = RenderableModel.extend({
1717

1818
_view_name: 'RendererView',
1919
_model_name: 'RendererModel',
20+
_antialias: false,
21+
_alpha: false,
2022

2123
scene: null,
2224
camera: null,

pythreejs/_base/renderable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class RenderableWidget(DOMWidget):
2020
_width = CInt(200).tag(sync=True)
2121
_height = CInt(200).tag(sync=True)
2222
_antialias = Bool(False).tag(sync=True)
23+
_alpha = Bool(False).tag(sync=True)
2324

2425
autoClear = Bool(True).tag(sync=True)
2526
autoClearColor = Bool(True).tag(sync=True)

pythreejs/core/Renderer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ class Renderer(RenderableWidget):
3232
background = Color('black', allow_none=True).tag(sync=True)
3333
background_opacity = Float(1.0, min=0.0, max=1.0).tag(sync=True)
3434

35-
def __init__(self, scene, camera, controls=None, antialias=False, **kwargs):
35+
def __init__(self, scene, camera, controls=None, antialias=False, alpha=False, **kwargs):
3636
super(Renderer, self).__init__(
3737
scene=scene,
3838
camera=camera,
3939
controls=controls or [],
4040
_antialias=antialias,
41+
_alpha=alpha,
4142
**kwargs)
4243
link((self, 'width'), (self, '_width'))
4344
link((self, 'height'), (self, '_height'))

pythreejs/renderers/WebGLRenderer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class WebGLRenderer(RenderableWidget):
1919
width = CInt(200)
2020
height = CInt(200)
2121

22-
def __init__(self, antialias=False, **kwargs):
23-
super(WebGLRenderer, self).__init__(_antialias=antialias, **kwargs)
22+
def __init__(self, antialias=False, alpha=False, **kwargs):
23+
super(WebGLRenderer, self).__init__(_antialias=antialias, _alpha=alpha, **kwargs)
2424
link((self, 'width'), (self, '_width'))
2525
link((self, 'height'), (self, '_height'))
2626

0 commit comments

Comments
 (0)