Skip to content

Commit 8d6f3e7

Browse files
committed
remove alphas
1 parent 5e34252 commit 8d6f3e7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/meshcat/commands.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
if sys.version_info >= (3, 0):
55
unicode = str
66

7-
from .geometry import Geometry, Plane, Object, Mesh, MeshPhongMaterial, PointsMaterial, Points, TextTexture, Texts
8-
7+
from .geometry import (Geometry, Plane, Object, Mesh,
8+
MeshPhongMaterial, PointsMaterial, Points, TextTexture)
99

1010
class SetObject:
1111
__slots__ = ["object", "path"]

src/meshcat/geometry.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def lower(self, object_data):
221221
class MeshMaterial(Material):
222222

223223
def __init__(self, color=0xffffff, reflectivity=0.5, map=None,
224-
transparent = False, **kwargs):
224+
transparent = False, **kwargs):
225225
super(MeshMaterial, self).__init__()
226226
self.color = color
227227
self.reflectivity = reflectivity
@@ -279,20 +279,22 @@ def lower(self, object_data):
279279

280280
class CanvasImage(Image):
281281

282-
def __init__(self, alpha):
282+
def __init__(self):
283283
super(CanvasImage, self).__init__()
284284

285285
def lower(self, object_data):
286286
return {
287287
u"uuid": self.uuid,
288+
# hacky, needs a nominal "url" filed to get rid of JS side warning,
289+
# so putting an empty one here
290+
u"url": ""
288291
}
289292

290293

291294
class TextTexture(Texture):
292295

293296
def __init__(self, text, font_size = 96, font_face='sans-serif',
294-
width=200, height=100,
295-
position=[10, 10],alpha=True):
297+
width=200, height=100, position=[10, 10]):
296298
super(TextTexture, self).__init__()
297299
self.text = text
298300
# font_size will be passed to the JS side as is; however if the text
@@ -302,7 +304,7 @@ def __init__(self, text, font_size = 96, font_face='sans-serif',
302304
self.width = width
303305
self.height = height
304306
self.position = position
305-
self.image = CanvasImage(alpha)
307+
self.image = CanvasImage()
306308

307309
def lower(self, object_data):
308310
return {

0 commit comments

Comments
 (0)