@@ -164,7 +164,7 @@ def lower(self, object_data):
164164# u"height": self.height,
165165# u"curveSegments": self.curveSegments
166166# }
167-
167+
168168
169169
170170
@@ -220,11 +220,13 @@ def lower(self, object_data):
220220
221221class MeshMaterial (Material ):
222222
223- def __init__ (self , color = 0xffffff , reflectivity = 0.5 , map = None , ** kwargs ):
223+ def __init__ (self , color = 0xffffff , reflectivity = 0.5 , map = None ,
224+ opacity = 1.0 , ** kwargs ):
224225 super (MeshMaterial , self ).__init__ ()
225226 self .color = color
226227 self .reflectivity = reflectivity
227228 self .map = map
229+ self .opacity = opacity
228230 self .properties = kwargs
229231
230232 def lower (self , object_data ):
@@ -233,6 +235,7 @@ def lower(self, object_data):
233235 u"type" : self ._type ,
234236 u"color" : self .color ,
235237 u"reflectivity" : self .reflectivity ,
238+ u"opacity" : self .opacity
236239 }
237240 data .update (self .properties )
238241 if self .map is not None :
@@ -276,27 +279,29 @@ def lower(self, object_data):
276279
277280class CanvasImage (Image ):
278281
279- def __init__ (self ):
282+ def __init__ (self , alpha ):
280283 super (CanvasImage , self ).__init__ ()
281- # self.data = data
284+ self .alpha = alpha
282285
283286 def lower (self , object_data ):
284287 return {
285288 u"uuid" : self .uuid ,
286- u"url" : u'place_holder'
289+ u"url" : u'place_holder' ,
290+ u"alpha" : self .alpha
287291 }
288292
289293
290294class TextTexture (Texture ):
291295
292- def __init__ (self , text , font = '96px sans-serif' , width = 200 , height = 100 , position = [10 , 10 ]):
296+ def __init__ (self , text , font = '96px sans-serif' , width = 200 , height = 100 ,
297+ position = [10 , 10 ],alpha = True ):
293298 super (TextTexture , self ).__init__ ()
294299 self .text = text
295300 self .font = font
296301 self .width = width
297302 self .height = height
298303 self .position = position
299- self .image = CanvasImage ()
304+ self .image = CanvasImage (alpha )
300305
301306 def lower (self , object_data ):
302307 return {
0 commit comments