Error in tool_offsetview.py

More
27 Sep 2024 05:02 #310875 by cmorley
Replied by cmorley on topic Error in tool_offsetview.py
Ok. try again :) should work now.

Please Log in or Create an account to join the conversation.

More
27 Sep 2024 07:08 #310879 by MarkoPolo
Yes, it's ok now, thanks..

Please Log in or Create an account to join the conversation.

More
30 Sep 2024 11:22 #311059 by MennilTossFlykune
Would it be possible for qt5_graphics.py to use QOpenGLWidget instead of QGLWidget? It solves a weird issue with opacity for me.

QGLWidget:


QOpenGLWidget:


The files I've attached should contain the necessary changes
Attachments:

Please Log in or Create an account to join the conversation.

More
01 Oct 2024 04:40 #311111 by cmorley
Replied by cmorley on topic Error in tool_offsetview.py
Works on my laptop -I'll test a few other systems.
But next time, please start a new thread for a new subject.

Please Log in or Create an account to join the conversation.

More
02 Oct 2024 04:51 #311150 by cmorley
Replied by cmorley on topic Error in tool_offsetview.py
Pushed the changes to master. Thank you.
The following user(s) said Thank You: tommylight, MennilTossFlykune

Please Log in or Create an account to join the conversation.

More
02 Oct 2024 10:55 #311167 by MennilTossFlykune

Pushed the changes to master. Thank you. 

Thanks, I forgot one thing however, of course...
The views don't apply properly unless you call self.makeCurrent when you set them
    def set_current_view(self):
        self.makeCurrent()
        if self.current_view not in ['p', 'x', 'y', 'y2', 'z', 'z2']:
            return
        return getattr(self, 'set_view_%s' % self.current_view)()

Please Log in or Create an account to join the conversation.

More
02 Oct 2024 23:21 #311202 by snowgoer540

Thanks, I forgot one thing however, of course...


Clicking on a line segment in the preview no longer highlights it (and subsequently the gcode preview line as well), likewise clicking on a g code line doesn’t highlight in the preview window anymore either.

Please Log in or Create an account to join the conversation.

More
03 Oct 2024 04:35 #311210 by cmorley
Replied by cmorley on topic Error in tool_offsetview.py
In glcanon.py we are nit getting a buffer for some reason:
    def select(self, x_view, y_view):
        if self.canon is None: return
        pmatrix = glGetDoublev(GL_PROJECTION_MATRIX)
        glMatrixMode(GL_PROJECTION)
        glPushMatrix()
        glLoadIdentity()
        vport = glGetIntegerv(GL_VIEWPORT)
        gluPickMatrix(x_view, vport[3]-y_view, 5, 5, vport)
        glMultMatrixd(pmatrix)
        glMatrixMode(GL_MODELVIEW)

        glSelectBuffer(self.select_buffer_size)
        glRenderMode(GL_SELECT)
        glInitNames()
        glPushName(0)

        if self.get_show_rapids():
            glCallList(self.dlist('select_rapids', gen=self.make_selection_list))
        glCallList(self.dlist('select_norapids', gen=self.make_selection_list))
        
        try:
            buffer = glRenderMode(GL_RENDER)
        except Exception as e:
            print(e)
            buffer = []

        if buffer:
            print('buffer')
            min_depth, max_depth, names = (buffer[0].near, buffer[0].far, buffer[0].names)
            for point in buffer:
                if min_depth < point.near:
                    min_depth, max_depth, names = (point.near, point.far, point.names)
            self.set_highlight_line(names[0])
        else:
            print('No buffer')
            self.set_highlight_line(None)

        glMatrixMode(GL_PROJECTION)
        glPopMatrix()
        glMatrixMode(GL_MODELVIEW)

Please Log in or Create an account to join the conversation.

More
03 Oct 2024 08:20 #311214 by MennilTossFlykune
In gcode_graphics.py, yet another self.makeCurrent()
    def select_fire(self):
        if self.inhibit_selection: return
        if STATUS.is_auto_running(): return
        if not self.select_primed: return
        x, y = self.select_primed
        self.select_primed = None
        self.makeCurrent()
        self.select(x, y)
Does that work?

Please Log in or Create an account to join the conversation.

More
03 Oct 2024 09:06 #311215 by MarkoPolo
For me adding self.makeCurrent() to gcode_graphics.py solves the problem. it works
The following user(s) said Thank You: MennilTossFlykune

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.153 seconds
Powered by Kunena Forum