                     # holds mesh -> armature transformation and use that in the code above
                     # but add an optimization pass at export to apply mesh transformations
                     # where possible.
-                when 86 # armature deform, 6 weights
+                when CD_ARMATURE_DEFORM_6 # armature deform, 6 weights
                     num_bones = a.count
                     @num_bone_uniforms = num_bones
                     attribute_decl += "attribute vec4 weights;\n"

        @alpha = params.alpha

class Material
    constructor: (@context, data, @scene) ->
        if @context.all_materials.indexOf(@) == -1
            @context.all_materials.push @

        if not gl.getShaderParameter(fragment_shader, gl.COMPILE_STATUS) and not gl.isContextLost()
            error_msg = """Error compiling fragment shader of material #{@name}
            #{gl.getShaderInfoLog fragment_shader}"""
            console.log fs
            # ext = gl.getExtension "WEBGL_debug_shaders"
            # if ext
            #     console.log  '\n' + ext.getTranslatedShaderSource(fragment_shader)).split('\n')
