Commit f8e3f48f authored by Dalai Felinto's avatar Dalai Felinto
Browse files

Minimizing the effect of changing the rest of blender default color

parent de36377a
Loading
Loading
Loading
Loading
+12 −1
Changes for space_view3d_virtual_reality/sandbox.py: 12 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -205,6 +205,9 @@ class VirtualRealitySandboxOperator(bpy.types.Operator):
        glLoadIdentity()
        gluLookAt(0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)

        current_color = Buffer(GL_FLOAT, 4)
        glGetFloatv(GL_CURRENT_COLOR, current_color);

        glEnable(GL_COLOR_MATERIAL)

        glBegin(GL_QUADS)
@@ -218,6 +221,9 @@ class VirtualRealitySandboxOperator(bpy.types.Operator):
        glVertex3f(-0.75,  0.75, 0.0)
        glEnd()

        glColor4fv(current_color)
        glDisable(GL_COLOR_MATERIAL)

        glMatrixMode(GL_PROJECTION)
        glPopMatrix()

@@ -250,6 +256,9 @@ class VirtualRealitySandboxOperator(bpy.types.Operator):
        """
        gl_data = self._gl_data

        current_color = Buffer(GL_FLOAT, 4)
        glGetFloatv(GL_CURRENT_COLOR, current_color);

        viewport = Buffer(GL_INT, 4)
        glGetIntegerv(GL_VIEWPORT, viewport)
        glViewport(300, 200, 256, 256)
@@ -289,8 +298,10 @@ class VirtualRealitySandboxOperator(bpy.types.Operator):
        glVertex2f( 1.0,-1.0)
        glEnd()

        glBindTexture(GL_TEXTURE_2D, 0)
        glColor4fv(current_color)

        glDisable(GL_TEXTURE_2D)
        glBindTexture(GL_TEXTURE_2D, 0)

        glMatrixMode(GL_PROJECTION)
        glPopMatrix()