33from typing import TYPE_CHECKING
44
55from numpy import float32
6- from numpy import frombuffer
76from numpy import identity
8- from numpy import uint8
97from OpenGL import GL
108from PySide6 import QtCore
119from PySide6 .QtGui import QKeyEvent
1715from compas .geometry import Frame
1816from compas .geometry import transform_points_numpy
1917from compas_viewer .scene import TagObject
18+ from compas_viewer .scene .buffermanager import BufferManager
2019from compas_viewer .scene .gridobject import GridObject
2120from compas_viewer .scene .vectorobject import VectorObject
22- from compas_viewer .scene .buffermanager import BufferManager
2321
2422from .camera import Camera
2523from .shaders import Shader
@@ -442,22 +440,9 @@ def update_projection(self, w=None, h=None):
442440 self .shader_model .uniform4x4 ("projection" , projection )
443441 self .shader_model .release ()
444442
445- # self.shader_tag.bind()
446- # self.shader_tag.uniform4x4("projection", projection)
447- # self.shader_tag.release()
448-
449- # self.shader_arrow.bind()
450- # self.shader_arrow.uniform4x4("projection", projection)
451- # self.shader_arrow.uniform1f("aspect", w / h)
452- # self.shader_arrow.release()
453-
454- # self.shader_instance.bind()
455- # self.shader_instance.uniform4x4("projection", projection)
456- # self.shader_instance.release()
457-
458- # self.shader_grid.bind()
459- # self.shader_grid.uniform4x4("projection", projection)
460- # self.shader_grid.release()
443+ self .shader_tag .bind ()
444+ self .shader_tag .uniform4x4 ("projection" , projection )
445+ self .shader_tag .release ()
461446
462447 def resize (self , w : int , h : int ):
463448 """
@@ -559,18 +544,17 @@ def paint(self, is_instance: bool = False):
559544
560545 self .shader_model .uniform4x4 ("viewworld" , viewworld )
561546 self .shader_model .uniform1i ("is_instance" , is_instance )
562-
563547
564548 if self .viewer .config .renderer .show_grid :
565549 self .grid .draw (self .shader_model )
566-
550+
567551 # Draw opaque objects
568552 self .buffer_manager .draw (
569553 self .shader_model ,
570554 self .rendermode ,
571555 is_instance = is_instance ,
572556 )
573-
557+
574558 self .shader_model .release ()
575559
576560 # Draw text tag sprites
@@ -680,9 +664,9 @@ def read_instance_color(self, box: tuple[int, int, int, int]):
680664 draw .rectangle ([x1 , y1 , x2 , y2 ], outline = "red" , width = 2 )
681665 full_image .save ("instance_debug_full_with_box.png" )
682666
683- print (f "Saved debug images:" )
684- print (f "- Full frame: instance_debug_full.png" )
685- print (f "- Full frame with box: instance_debug_full_with_box.png" )
667+ print ("Saved debug images:" )
668+ print ("- Full frame: instance_debug_full.png" )
669+ print ("- Full frame with box: instance_debug_full_with_box.png" )
686670 print (f"Box coordinates: x={ x } , y={ y } , width={ width } , height={ height } " )
687671 print (f"Original box: x1={ x1 } , y1={ y1 } , x2={ x2 } , y2={ y2 } " )
688672 print (f"Window size: { self .width ()} x{ self .height ()} " )
@@ -703,7 +687,7 @@ def read_instance_color(self, box: tuple[int, int, int, int]):
703687 box_image = Image .fromarray (box_map )
704688 box_image = box_image .transpose (Image .FLIP_TOP_BOTTOM )
705689 box_image .save ("instance_debug_box.png" )
706- print (f "- Box area: instance_debug_box.png" )
690+ print ("- Box area: instance_debug_box.png" )
707691
708692 # Restore previous render states
709693 if prev_blend :
0 commit comments