@@ -249,28 +249,19 @@ def generate_texture_unit(self, slot, name=None, uv_layer=None):
249
249
idx = find_uv_layer_index ( slot .uv_layer , self .material )
250
250
self .w .iword ('tex_coord_set' ).integer (idx ).nl ()
251
251
252
- rgba = False
253
- if texture .image .depth == 32 : rgba = True
254
252
btype = slot .blend_type # TODO - fix this hack if/when slots support pyRNA
255
253
ex = False ; texop = None
256
- if btype in TEXTURE_COLOUR_OP :
257
- if btype == 'MIX' and \
258
- ((slot .use_map_alpha and not slot .use_stencil ) or \
259
- (slot .texture .use_alpha and slot .texture .image .use_alpha and not slot .use_map_alpha )):
260
- if slot .diffuse_color_factor >= 1.0 :
261
- texop = 'alpha_blend'
262
- else :
263
- texop = TEXTURE_COLOUR_OP [ btype ]
264
- ex = True
265
- elif btype == 'MIX' and slot .use_map_alpha and slot .use_stencil :
266
- texop = 'blend_current_alpha' ; ex = True
267
- elif btype == 'MIX' and not slot .use_map_alpha and slot .use_stencil :
268
- texop = 'blend_texture_alpha' ; ex = True
269
- else :
270
- texop = TEXTURE_COLOUR_OP [ btype ]
271
- elif btype in TEXTURE_COLOUR_OP_EXcolour_op_ex :
272
- texop = TEXTURE_COLOUR_OP_EX [ btype ]
273
- ex = True
254
+ if btype == 'MIX' and \
255
+ ((slot .use_map_alpha and not slot .use_stencil ) or \
256
+ (slot .texture .use_alpha and slot .texture .image .use_alpha and not slot .use_map_alpha )):
257
+ if slot .diffuse_color_factor >= 1.0 :
258
+ texop = 'alpha_blend'
259
+ elif btype == 'MIX' and slot .use_map_alpha and slot .use_stencil :
260
+ texop = 'blend_current_alpha' ; ex = True
261
+ elif btype == 'MIX' and not slot .use_map_alpha and slot .use_stencil :
262
+ texop = 'blend_texture_alpha' ; ex = True
263
+ elif btype in TEXTURE_COLOUR_OP :
264
+ texop = TEXTURE_COLOUR_OP [ btype ]
274
265
275
266
if texop and ex :
276
267
if texop == 'blend_manual' :
@@ -362,16 +353,6 @@ def change_ext( self, name, image ):
362
353
'MIX' : 'modulate' , # Ogre Default - was "replace" but that kills lighting
363
354
'ADD' : 'add' ,
364
355
'MULTIPLY' : 'modulate' ,
365
- #'alpha_blend' : '',
366
- }
367
- TEXTURE_COLOUR_OP_EX = {
368
- 'MIX' : 'blend_manual' ,
369
- 'SCREEN' : 'modulate_x2' ,
370
- 'LIGHTEN' : 'modulate_x4' ,
371
- 'SUBTRACT' : 'subtract' ,
372
- 'OVERLAY' : 'add_signed' ,
373
- 'DIFFERENCE' : 'dotproduct' , # best match?
374
- 'VALUE' : 'blend_diffuse_colour' ,
375
356
}
376
357
377
358
TEXTURE_ADDRESS_MODE = {
0 commit comments