Skip to content

Commit

Permalink
Merge pull request #200 from kshepherd2013/render_tab_depth_fix
Browse files Browse the repository at this point in the history
Fix for Render tab showing depth incorrect image
  • Loading branch information
joepal1976 committed Jul 14, 2022
2 parents 7378f19 + a4345b5 commit d7e0c21
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions makehuman/lib/glmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ def renderToBuffer(width, height, productionRender = True):
# Neutral background color
oldClearColor = G.clearColor
G.clearColor = (0.5,0.5,0.5, 1)
glEnable(GL_DEPTH_TEST);

# Draw scene as usual
draw(productionRender)
Expand Down Expand Up @@ -967,6 +968,7 @@ def renderAlphaMask(width, height, productionRender = True):
# Transparent background color
oldClearColor = G.clearColor
G.clearColor = (0.5, 0.5, 0.5, 0)
glEnable(GL_DEPTH_TEST);
# Change blend func to accumulate alpha
glBlendFunc(GL_ONE, GL_ONE)
# Disable multisampling
Expand Down
2 changes: 1 addition & 1 deletion makehuman/lib/image_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def resized(img, width, height, filter=0):
transform = QtCore.Qt.SmoothTransformation
else:
transform = QtCore.Qt.FastTransformation
qi = qi.scaled(QtCore.QSize(width, height),
qi = qi.scaled(QtCore.QSize(int(width), int(height)),
transformMode=transform)
return load(qi)

10 changes: 6 additions & 4 deletions makehuman/lib/qtgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,7 @@ def __init__(self):
self.workingWidth = None
self.ratio = 1.0
self.minratio = 0.1
self.mdown = None

def setImage(self, img):
pixmap = getPixmap(img)
Expand Down Expand Up @@ -2247,10 +2248,11 @@ def mouseMoveEvent(self, event):
event.buttons(), event.modifiers()), False)
self.mdown = event.pos()
else:
self.horizontalScrollBar().setValue(
self.horizontalScrollBar().value() + 2*(self.mdown.x() - event.pos().x()))
self.verticalScrollBar().setValue(
self.verticalScrollBar().value() + 2*(self.mdown.y() - event.pos().y()))
if self.mdown is not None:
self.horizontalScrollBar().setValue(
self.horizontalScrollBar().value() + 2*(self.mdown.x() - event.pos().x()))
self.verticalScrollBar().setValue(
self.verticalScrollBar().value() + 2*(self.mdown.y() - event.pos().y()))
self.mdown = event.pos()
self.refreshImage()

Expand Down
1 change: 1 addition & 0 deletions makehuman/lib/qtui.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def __init__(self, parent, app):
format.setSwapBehavior(QtGui.QSurfaceFormat.DoubleBuffer)
#if not G.preStartupSettings["noSampleBuffers"]:
# format.setSamples(4)
format.setSamples(0)
super(Canvas, self).__init__(parent)
self.setFormat(format)
self.create()
Expand Down

0 comments on commit d7e0c21

Please sign in to comment.