Help turn off 2X multiply

Blitz3D Forums/Blitz3D Programming/Help turn off 2X multiply

I see a few problems with that code.. it'll only check one layer of children which you can easily get around by using a couple of functions (See Code Below). Also, when you're checking the surfaces you're texturing the whole entity instead of just the surface you checked. You need to use BrushTexture( ) and PaintSurface( ).

If GfxDriverCaps3D() = 110
	For extModel.EXT_Entity = Each EXT_Entity
		If extModel\root
			Remove2xBlend extModel\root
		EndIf
	Next
EndIf
	
Function Remove2xBlend( iEntity )
	
	If EntityClass( iEntity ) = "Mesh"
		brush = GetEntityBrush(iEntity)
		If brush
			For k = 0 To 7
				iTex = GetBrushTexture( brush, k )
				If iTex
					If GetTextureBlend( iTex ) = 5
						TextureBlend( iTex, 0 )
					EndIf
					BrushTexture brush, iTex, 0, k
					PaintEntity iEntity, brush
					FreeTexture iTex
				EndIf
			Next
			FreeBrush brush
		EndIf 
		For j = 1 To CountSurfaces(iEntity) 
			surface = GetSurface(iEntity,j)
			If surface
				surfaceBrush = GetSurfaceBrush(surface)
				If surfaceBrush
					For k = 0 To 7
						iTex = GetBrushTexture( surfaceBrush, k )
						If iTex
							If GetTextureBlend( iTex ) = 5
								TextureBlend( iTex, 0 )
							EndIf
							BrushTexture surfaceBrush, iTex, 0, k
							PaintSurface surface, surfaceBrush
							FreeTexture iTex
						EndIf
					Next
					FreeBrush surfaceBrush
				EndIf
			EndIf
		Next
	EndIf
	
	;Parse Children
	Remove2xBlendFromChildren iEntity
	
End Function

Function Remove2xBlendFromChildren( iEntity )
	
	For i = 1 To CountChildren( iEntity )
		iChild = GetChild( iEntity, i )
		
		Remove2xBlend iChild
	Next
	
End Function

Oh, and I added a loop to check every texture layer.