Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Render tab showing depth incorrect image #200

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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