Everything related to SDK.
User avatar
By seghier
#395286
i added other buttons ; the problem with check button assigned to output images always give error than the error disappear
i don't figure why this error

Image
Code: Select all
################################################################
# Launch Maxwell Render with the given parameters.
################################################################
import sys
from pymaxwell import *
import sys
import pymaxwell as mw

#import qdarkstyle

from PyQt4 import QtGui, QtCore

class RenderScene(QtGui.QWidget):

    # RenderScene init method
    def __init__(self):
        super(RenderScene, self).__init__()
        self.initUI()

    # User interface initialization method
    def initUI(self):

        # Create labels
        label_input_file = QtGui.QLabel('Input mxs')
        label_mxi_file = QtGui.QLabel('MXI')
        label_mxi_file.setFixedWidth(30)
        label_img_file = QtGui.QLabel('IMG')
        label_img_file.setFixedWidth(30)
        label_cam_res = QtGui.QLabel('Resolution')
        label_sl = QtGui.QLabel('SL')

        # Create lineedits
        self.edit_input_file = QtGui.QLineEdit()
        self.edit_mxi_file = QtGui.QLineEdit()
        self.edit_img_file = QtGui.QLineEdit()
        self.sl_file = QtGui.QLineEdit()


        # spin box
        self.spinw = QtGui.QSpinBox()
        self.spinw.setMaximum(50000)
        self.spinh = QtGui.QSpinBox()
        self.spinh.setMaximum(50000)
        self.spinsl = QtGui.QSpinBox()

        # check box
        self.c_mxi = QtGui.QCheckBox()
        self.c_img = QtGui.QCheckBox()

        # Spaces
        space1 = QtGui.QWidget()
        space1.setFixedWidth(200)

       
        # Create buttons
        button_in_path = QtGui.QPushButton('Open', self);
        button_mxi_path = QtGui.QPushButton('Save', self);
        button_img_path = QtGui.QPushButton('Save', self);
        button_rend = QtGui.QPushButton('Render', self);

        # Create grid layout
        grid1 = QtGui.QGridLayout()
        grid2 = QtGui.QGridLayout()
        grid3 = QtGui.QGridLayout()
        grid4 = QtGui.QGridLayout()

        # Populate grid with the labels, lineedits and buttons
        # grid3
        grid3.addWidget(self.c_mxi, 0, 0)
        grid3.addWidget(label_mxi_file, 0, 1)

        # grid4
        grid4.addWidget(self.c_img, 0, 0)
        grid4.addWidget(label_img_file, 0, 1)

        # grid2
        grid2.addWidget(self.spinw, 0, 0)
        grid2.addWidget(self.spinh, 0, 1)
        grid2.addWidget(space1, 0, 2)
        grid2.addWidget(label_sl, 0, 7)
        grid2.addWidget(self.spinsl, 0, 8)

        # grid1
        grid1.addWidget(label_input_file, 1, 0)
        grid1.addLayout(grid3, 2, 0)
        grid1.addLayout(grid4, 3, 0)
        grid1.addWidget(label_cam_res, 4, 0)

        grid1.addWidget(self.edit_input_file, 1, 1)
        grid1.addWidget(self.edit_mxi_file, 2, 1)
        grid1.addWidget(self.edit_img_file, 3, 1)
        grid1.addLayout(grid2, 4, 1)

        grid1.addWidget(button_in_path, 1, 2)
        grid1.addWidget(button_mxi_path, 2, 2)
        grid1.addWidget(button_img_path, 3, 2)
        grid1.addWidget(button_rend, 4, 2)

        # Set main layout with grid above and resize window
        self.setLayout(grid1)
        #self.resize(680, 240)
        self.setFixedSize(540, 150)
        self.setWindowTitle('Render Scene Views')

        # Connect buttons to methods to be called
        self.connect(button_in_path, QtCore.SIGNAL('clicked()'), self.open);
        self.connect(button_mxi_path, QtCore.SIGNAL('clicked()'), self.save1);
        self.connect(button_img_path, QtCore.SIGNAL('clicked()'), self.save2);
        self.connect(button_rend, QtCore.SIGNAL('clicked()'), self.rendering);
        self.connect(self.c_mxi, QtCore.SIGNAL('clicked()'), self.check_mxi);
        self.connect(self.c_img, QtCore.SIGNAL('clicked()'), self.check_img);




    # open scene
    def open(self):
        inPath = QtGui.QFileDialog.getOpenFileName(self, 'Open file', 'C:/', filter='*.mxs');
        self.edit_input_file.setText(inPath);

    # save scene
    def save1(self):
        outmxi = QtGui.QFileDialog.getSaveFileName(self, 'saveFlle', 'C:/', filter='Maxwell Image File (*.mxi)');
        #dirname = os.path.dirname(outmxi.toAscii().data())
        #filename = os.path.basename(outmxi.toAscii().data())
        filepath = os.path.splitext(outmxi.toAscii().data()) [0]
        file_ext = os.path.splitext(outmxi.toAscii().data())[1]
        outmxi_new = filepath + '_%camera%' + file_ext
        self.edit_mxi_file.setText(outmxi_new);


    # save scene
    def save2(self):
        outimg = QtGui.QFileDialog.getSaveFileName(self, 'saveFlle', 'C:/', filter='Image File (*.png *.jpg *.tga *.tif *.jp2 *.hdr *.exr *.bmp *.psd *.ppm *.pbm *.pgm)');
        filepath = os.path.splitext(outimg.toAscii().data())[0]
        file_ext = os.path.splitext(outimg.toAscii().data())[1]
        outimg_new = filepath + '_%camera%' + file_ext
        self.edit_img_file.setText(outimg_new);

    # check mxi
    def check_mxi(self):
        if self.c_mxi.isChecked():
            self.checker1 = 0
        else :
            self.checker1 = 1

    # check img
    def check_img(self):
        if self.c_img.isChecked():
            self.checker2 = 0
        else:
            self.checker2 = 1


    # render
    def rendering(self):
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraNames = scene.getCameraNames();
        for name in cameraNames:
            outPath = self.edit_input_file.text().toAscii().data()
            outMxi = self.edit_mxi_file.text().toAscii().data()
            outImg = self.edit_img_file.text().toAscii().data()
            camera = scene.getCamera(name)
            x = int(self.spinw.value())
            y = int(self.spinh.value())
            sl = int(self.spinsl.value())
            scene.setRenderParameter('SAMPLING LEVEL', sl)
            scene.setRenderParameter('DO NOT SAVE MXI FILE', self.checker1)
            scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.checker2)
            camera.setResolution(x, y)
            camera.setActive()
            ok = scene.writeMXS(outPath)

            parameters = []
            parameters.append('-mxs:' + outPath);
            parameters.append('-nowait');
            parameters.append('-nogui');
            #parameters.append('-s:SL');
            parameters.append('-o:' + outImg);
            parameters.append('-mxi:' + outMxi);
            parameters.append('-time:10');
            runMaxwell(parameters)




if __name__ == "__main__":
    # Create and show application
    app = QtGui.QApplication(sys.argv)
    app.setWindowIcon(QtGui.QIcon('C:/Users/archi/Desktop/script.ico'))
    window = RenderScene()
    #app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
    window.show()
    sys.exit(app.exec_())
User avatar
By Brany
#395287
You didnt declare checker1 and checker2, so they only will exist when you clic on the checkbox ( check_img(..) call ). You don't need to do that anyway, you can read the checker value right from the widget and set the render parameter, and save some code:
Code: Select all
scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.c_img.isChecked() and 0 or 1)
User avatar
By seghier
#395289
Brany wrote:
Fri Sep 01, 2017 3:03 pm
You didnt declare checker1 and checker2, so they only will exist when you clic on the checkbox ( check_img(..) call ). You don't need to do that anyway, you can read the checker value right from the widget and set the render parameter, and save some code:
Code: Select all
scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.c_img.isChecked() and 0 or 1)
thank you Brany ; thats excellent & veryand save time :)
with
scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.c_img.isChecked() and 0
it saves all images ; i switch positions of the two checkbox with value 1
User avatar
By seghier
#395296
i add denoiser command to the code
the exe work without error but the denoiser always use : at end and fast even i change them to each sl and accurate
Code: Select all
################################################################
# Launch Maxwell Render with the given parameters.
################################################################
from pymaxwell import *
import sys
import pymaxwell as mw

#import qdarkstyle

from PyQt4 import QtGui, QtCore

class RenderScene(QtGui.QWidget):

    # RenderScene init method
    def __init__(self):
        super(RenderScene, self).__init__()
        self.initUI()

    # User interface initialization method
    def initUI(self):

        # Create labels
        label_input_file = QtGui.QLabel('Input mxs')
        label_cam_res = QtGui.QLabel('Resolution')
        label_sl = QtGui.QLabel('SL')
        label_strt_sl_list = QtGui.QLabel('Starting with SL')
        label_app_den = QtGui.QLabel('Apply Denoise')
        label_W = QtGui.QLabel('  W')
        label_H= QtGui.QLabel('    H')

        # Create lineedits
        self.edit_input_file = QtGui.QLineEdit()
        self.edit_mxi_file = QtGui.QLineEdit()
        self.edit_img_file = QtGui.QLineEdit()
        self.edit_den_file = QtGui.QLineEdit()
        self.sl_file = QtGui.QLineEdit()

        # spin box
        self.spinw = QtGui.QSpinBox()
        self.spinw.setMaximum(50000)
        self.spinh = QtGui.QSpinBox()
        self.spinh.setMaximum(50000)
        self.spinsl = QtGui.QSpinBox()
        self.spinsl.setMaximum(50)
        self.strt_sl = QtGui.QSpinBox()
        self.strt_sl.setMaximum(50)

        # check box
        self.c_mxi = QtGui.QCheckBox('IMG', self)
        self.c_img = QtGui.QCheckBox('MXI', self)
        self.c_denoiser = QtGui.QCheckBox('Denoiser', self)
        self.c_d_shadow = QtGui.QCheckBox('Denoise Shadow', self)
        self.c_d_gpu = QtGui.QCheckBox('Use GPU', self)
        self.c_d_autoconfig = QtGui.QCheckBox('Auto configure', self)

        # combo box
        self.strt_sl_list = QtGui.QComboBox()
        self.strt_sl_list.addItem('Each SL')
        self.strt_sl_list.addItem('At end')
        self.auto_conf_list = QtGui.QComboBox()
        self.auto_conf_list.addItem('Fast')
        self.auto_conf_list.addItem('Accurate')

        # Spaces
        space1 = QtGui.QWidget()
        space1.setFixedWidth(400)
        self.space2 = QtGui.QFrame()
        self.space2.resize(300, 300)
        self.space2.setFrameShape(QtGui.QFrame.VLine)
        self.space2.setFrameShadow(QtGui.QFrame.Sunken)
        self.space3 = QtGui.QFrame()
        self.space3.resize(300, 300)
        self.space3.setFrameShape(QtGui.QFrame.VLine)
        self.space3.setFrameShadow(QtGui.QFrame.Sunken)
        self.space4 = QtGui.QFrame()
        self.space4.resize(300, 300)
        self.space4.setFrameShape(QtGui.QFrame.VLine)
        self.space4.setFrameShadow(QtGui.QFrame.Sunken)
        self.space5 = QtGui.QFrame()
        self.space5.resize(300, 300)
        self.space5.setFrameShape(QtGui.QFrame.VLine)
        self.space5.setFrameShadow(QtGui.QFrame.Sunken)



        # Create buttons
        button_in_path = QtGui.QPushButton('Open' ,self);
        button_mxi_path = QtGui.QPushButton('Save' ,self);
        button_img_path = QtGui.QPushButton('Save' ,self);
        button_rend = QtGui.QPushButton('Render' ,self);
        button_denoise = QtGui.QPushButton('Open' ,self);
        #button_in_path.setIcon(QtGui.QIcon(icon_open))
        #button_mxi_path.setIcon(QtGui.QIcon(icon_save_mxi))
        #button_img_path.setIcon(QtGui.QIcon(icon_save_img))
        #button_denoise.setIcon(QtGui.QIcon(icon_save_img))
        #button_rend.setIcon(QtGui.QIcon(icon_render))
        #button_in_path.setStyleSheet("background-color: transparent")
        #button_mxi_path.setStyleSheet("background-color: transparent")
        #button_img_path.setStyleSheet("background-color: transparent")
        #button_denoise.setStyleSheet("background-color: transparent")
        #button_rend.setStyleSheet("background-color: transparent")


        # Create grid layout
        grid1 = QtGui.QGridLayout()
        grid2 = QtGui.QGridLayout()
        grid3 = QtGui.QGridLayout()
        grid4 = QtGui.QGridLayout()
        grid5 = QtGui.QGridLayout()
        grid6 = QtGui.QGridLayout()
        grid = QtGui.QGridLayout()

        # Populate grid with the labels, lineedits and buttons
        # grid2
        grid2.addWidget(self.c_d_shadow, 0, 0)
        grid2.addWidget(self.space2, 0, 1)
        grid2.addWidget(self.c_d_gpu, 0, 2)
        grid2.addWidget(self.space3, 0, 3)
        grid2.addWidget(label_app_den, 0, 4)
        grid2.addWidget(self.strt_sl_list, 0, 5)
        grid2.addWidget(self.space4, 0, 6)
        grid2.addWidget(label_strt_sl_list , 0, 7)
        grid2.addWidget(self.strt_sl, 0, 8)
        grid2.addWidget(self.space5, 0, 9)
        grid2.addWidget(self.c_d_autoconfig , 0, 10)
        grid2.addWidget(self.auto_conf_list, 0, 11)
        # grid3
        grid3.addWidget(label_cam_res, 1, 0)
        grid3.addWidget(label_W, 1, 1)
        grid3.addWidget(self.spinw, 1, 2)
        grid3.addWidget(label_H, 1, 3)
        grid3.addWidget(self.spinh, 1, 4)
        # grid4
        grid4.addWidget(label_sl, 1, 0)
        grid4.addWidget(self.spinsl, 1, 1)
        grid4.addWidget(button_rend, 1, 2)
        # grid5 (grid3+grid4)
        grid5.addLayout(grid3, 1, 0)
        grid5.addWidget(space1, 1, 1)
        grid5.addLayout(grid4, 1, 2)

        # grid1
        # column 0
        grid1.addWidget(label_input_file, 1, 0)
        grid1.addWidget(self.c_img, 2, 0)
        grid1.addWidget(self.c_mxi, 3, 0)
        grid1.addWidget(self.c_denoiser, 4, 0)
        # column 1
        grid1.addWidget(self.edit_input_file, 1, 1)
        grid1.addWidget(self.edit_mxi_file, 2, 1)
        grid1.addWidget(self.edit_img_file, 3, 1)
        grid1.addWidget(self.edit_den_file, 4, 1)
        # column 2
        grid1.addWidget(button_in_path, 1, 2)
        grid1.addWidget(button_mxi_path, 2, 2)
        grid1.addWidget(button_img_path, 3, 2)
        grid1.addWidget(button_denoise, 4, 2)

        # grid6 ( grid1 + grid2 )
        grid6.addLayout(grid1, 1, 0)
        grid6.addLayout(grid2, 2, 0)

        # grid  ( grid5 + grid6 )
        grid.addLayout(grid6, 1, 0)
        grid.addLayout(grid5, 2, 0)

        # Set main layout with grid above and resize window
        self.setLayout(grid)
        #self.resize(700, 240)
        self.setFixedSize(680, 200)
        self.setWindowTitle('Render Scene Views')

        # Connect buttons to methods to be called
        self.connect(button_in_path, QtCore.SIGNAL('clicked()'), self.open);
        self.connect(button_mxi_path, QtCore.SIGNAL('clicked()'), self.save1);
        self.connect(button_img_path, QtCore.SIGNAL('clicked()'), self.save2);
        self.connect(button_rend, QtCore.SIGNAL('clicked()'), self.rendering);
        self.connect(button_denoise, QtCore.SIGNAL('clicked()'), self.save3);

        # open scene
    def open(self):
        inPath = QtGui.QFileDialog.getOpenFileName(self, 'Open file', 'C:/', filter='*.mxs');
        self.edit_input_file.setText(inPath);

    # save mxi
    def save1(self):
        outmxi = QtGui.QFileDialog.getSaveFileName(self, 'saveFlle', 'C:/', filter='Maxwell Image File (*.mxi)');
        #dirname = os.path.dirname(outmxi.toAscii().data())
        #filename = os.path.basename(outmxi.toAscii().data())
        filepath = os.path.splitext(outmxi.toAscii().data()) [0]
        file_ext = os.path.splitext(outmxi.toAscii().data())[1]
        outmxi_new = filepath + '_%camera%' + file_ext
        self.edit_mxi_file.setText(outmxi_new);

    # save image
    def save2(self):
        outimg = QtGui.QFileDialog.getSaveFileName(self, 'saveFlle', 'C:/', filter='Image File (*.png *.jpg *.tga *.tif *.jp2 *.hdr *.exr *.bmp *.psd *.ppm *.pbm *.pgm)');
        filepath = os.path.splitext(outimg.toAscii().data())[0]
        file_ext = os.path.splitext(outimg.toAscii().data())[1]
        outimg_new = filepath + '_%camera%' + file_ext
        self.edit_img_file.setText(outimg_new);

    # save denoised image
    def save3(self):
        outden = QtGui.QFileDialog.getSaveFileName(self, 'saveFlle', 'C:/',
                                                   filter='Image File (*.png *.jpg *.tga *.tif *.jp2 *.hdr *.exr *.bmp *.psd *.ppm *.pbm *.pgm)');
        filepath = os.path.splitext(outden.toAscii().data())[0]
        file_ext = os.path.splitext(outden.toAscii().data())[1]
        outden_new = filepath + '_%camera%' + file_ext
        self.edit_den_file.setText(outden_new);

    # render
    def rendering(self):
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraNames = scene.getCameraNames();
        for name in cameraNames:
            outPath = self.edit_input_file.text().toAscii().data()
            outMxi = self.edit_mxi_file.text().toAscii().data()
            outImg = self.edit_img_file.text().toAscii().data()
            outDen = self.edit_den_file.text().toAscii().data()
            camera = scene.getCamera(name)
            x = int(self.spinw.value())
            y = int(self.spinh.value())
            sl = int(self.spinsl.value())
            camera.setResolution(x, y)
            camera.setActive()
            scene.setRenderParameter('SAMPLING LEVEL', sl)
            scene.setRenderParameter('DO NOT SAVE MXI FILE', self.c_mxi.isChecked() and 1)
            scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.c_img.isChecked() and 1)
            scene.setRenderParameter('DENOISE ENABLED', self.c_denoiser.isChecked() and 1)
            scene.setRenderParameter('DENOISE SHADOW', self.c_d_shadow.isChecked() and 1)
            scene.setRenderParameter('DENOISE GPU', self.c_d_gpu.isChecked() and 1)
            SL = int(self.strt_sl.value())
            scene.setRenderParameter('DENOISE INTERVAL_START', self.strt_sl_list.currentIndex()+1 and SL)
            v = int(self.auto_conf_list.currentIndex())
            scene.setRenderParameter('DENOISE AUTOCONFIG SCENE', self.c_d_autoconfig.isChecked() and v)
            ok = scene.writeMXS(outPath)

            parameters = []
            parameters.append('-mxs:' + outPath);
            parameters.append('-nowait');
            parameters.append('-nogui');
            parameters.append('-o:' + outImg);
            parameters.append('-mxi:' + outMxi);
            parameters.append('-time:10');
            parameters.append('-denoisePath:' + outDen);
            runMaxwell(parameters)


if __name__ == "__main__":
    # Create and show application
    app = QtGui.QApplication(sys.argv)
    app.setWindowIcon(QtGui.QIcon('C:/Users/archi/Desktop/script.ico'))
    icon_save_mxi = 'C:/Program Files/Next Limit/Maxwell Render 4/images/savemxi.png'
    icon_save_img = 'C:/Program Files/Next Limit/Maxwell Render 4/images/saveimg.png'
    icon_open = 'C:/Program Files/Next Limit/Maxwell Render 4/images/openmxs.png'
    icon_render = 'C:/Program Files/Next Limit/Maxwell Render 4/images/camerablocked.png'
    window = RenderScene()
    #app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
    window.show()
    sys.exit(app.exec_())
User avatar
By seghier
#395309
Brany wrote:
Tue Sep 05, 2017 2:17 pm
What do you mean by "the exe work without error but the denoiser always use : at end"?
Hi Brany
i created executable file and when i tried it the denoiser used at end always even i choose each sl ;even i set start with sl :4 (for exp)
--------
i have other questions about lock camera resolution ; can i do that from pymaxwell command or i need create code with python .
and is there any way to connect a progress bar with the render progress ?
thanks for help
User avatar
By Brany
#395311
I think you misunderstood what the following code does:
Code: Select all
scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.c_img.isChecked() and 0 or 1)
See this part
Code: Select all
self.c_img.isChecked() and 0 or 1
returns 0 if self.c_img.isChecked() returns True
returns 1 if self.c_img.isChecked() returns False

so, the following code can be dangerous (and all that coded that way):
Code: Select all
scene.setRenderParameter('DO NOT SAVE MXI FILE', self.c_mxi.isChecked() and 1)
because
Code: Select all
self.c_mxi.isChecked() and 1
will return True if self.c_mxi.isChecked() returns True
will return 1 self.c_mxi.isChecked() returns False

and
Code: Select all
scene.setRenderParameter('DO NOT SAVE MXI FILE', ---value----)
expects "---value---" as 1 or 0 (not True or False).

In this case it may work without any inconvenience, but that leads me to the following one:
Code: Select all
scene.setRenderParameter('DENOISE INTERVAL_START', self.strt_sl_list.currentIndex()+1 and SL)
in this case
Code: Select all
self.strt_sl_list.currentIndex()+1 and SL
will ALWAYS return SL, because
Code: Select all
self.strt_sl_list.currentIndex()+1
is always True (not 0). See https://docs.python.org/2/reference/exp ... operations

So you have to set 'DENOISE INTERVAL_START' this way:
Code: Select all
ii = self.strt_sl_list.currentIndex()
if ii == 0: # Each SL
    denoise_interval_start = SL
elif ii == 1: # At end
    denoise_interval_start = 0
scene.setRenderParameter('DENOISE INTERVAL_START', denoise_interval_start)
the "clever" one is:
Code: Select all
scene.setRenderParameter('DENOISE INTERVAL_START', self.strt_sl_list.currentIndex() == 0 and SL or 0)
User avatar
By seghier
#395313
i changed the names of buttons and other elements
i modify the code but the problem still happen
in the pymaxwell help if starting with sl =0 apply noise will automatically use at end
else it will use each sl ; why we need apply denoise list in this case ?
'DENOISE INTERVAL_START': (SL) -> Configure the SLs at which Denoise process is going to start, 0 means only at end
when i check denoise shadow and auto configure (accurate) the render launched with apply denoise at end always ; if i don't check denoise shadow the render stopped
Code: Select all
    # render
    def rendering(self):
        if not self.errorMessage():
            return;
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraNames = scene.getCameraNames();
        for name in cameraNames:
            outPath = self.edit_input_file.text().toAscii().data()
            outMxi = self.edit_mxi_file.text().toAscii().data()
            outMxs = self.edit_mxs_file.text().toAscii().data()
            outImg = self.edit_img_file.text().toAscii().data()
            outDen = self.edit_den_file.text().toAscii().data()
            if len(outMxi) == 0:
                num1 = 1
            else:
                num1 = 0
            camera = scene.getCamera(name)
            x = int(self.edit_width.value())
            y = int(self.edit_height.value())
            sl = int(self.edit_sl.value())
            st = int(self.edit_time.value())*60
            camera.setResolution(x, y)
            camera.setActive()
            scene.setRenderParameter('SAMPLING LEVEL', sl)
            scene.setRenderParameter('STOP TIME', st)
            scene.setRenderParameter('DO NOT SAVE MXI FILE', self.check_img.isChecked() and num1)
            scene.setRenderParameter('MXI FULLNAME', outMxi)
            scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.check_mxi.isChecked() and 0)
            scene.setRenderParameter('DENOISE ENABLED', self.check_den.isChecked() and 1)
            scene.setRenderParameter('DENOISE SHADOW', self.den_shad.isChecked() and 1)
            scene.setRenderParameter('DENOISE GPU', self.use_gpu.isChecked() and 1)
            SL = int(self.strt_sl.value())
            scene.setRenderParameter('DENOISE INTERVAL_START', self.apply_den_lst.currentIndex() == 0 and SL or 0)
            v = int(self.auto_conf_lst.currentIndex())
            scene.setRenderParameter('DENOISE AUTOCONFIG SCENE', self.check_auto_conf.isChecked() and v)
            if len(outMxs) == 0:
                choice = outPath
            else:
                choice = outMxs
            ok = scene.writeMXS(choice)

            parameters = []
            parameters.append('-mxs:' + choice);
            parameters.append('-nowait');
            parameters.append('-nogui');
            parameters.append('-o:' + outImg);
            #parameters.append('-mxi:' + outMxi);
            parameters.append('-denoisePath:' + outDen);
            runMaxwell(parameters)
User avatar
By Brany
#395314
Did you opened the resulting MXS file into Maxwell Studio/Maxwell Render, so you can check that those parameters were all set properly?
User avatar
By seghier
#395315
in pymaxwell :
'DENOISE AUTOCONFIG SCENE': (0, 1 or 2) -> If setted the scene auto configures to improve denoise results
0 = disabled
1 = fast
2 = accurate
in the code v= int(self.auto_conf_lst.currentIndex()) and the list numbers are 0 or 1 ; so i need to add +1 but after that i get error :
RuntimeError: setRenderParameter: bad value ('DENOISE AUTOCONFIG SCENE' must be 1 or 0). /where is 2 (accurate) ?
if i choose v= 0 / fast>> autoconfig disabled ; v=1/accurate >> autoconfig / fast
if i add +1 v=1 /fast >> autoconfig / accurate ; v=2/ accurate >> autoconfig error
-----------
and always th denoiser choose at end ; in maxwell scene saved "At end" and in mxi file "Each SL" !
Image
Last edited by seghier on Wed Sep 06, 2017 1:54 pm, edited 1 time in total.
User avatar
By Brany
#395317
You have found a bug! ;)

That's right,
Code: Select all
setRenderParameter('DENOISE AUTOCONFIG SCENE', 0) # auto -> works fine
setRenderParameter('DENOISE AUTOCONFIG SCENE', 1) # fast -> works fine
setRenderParameter('DENOISE AUTOCONFIG SCENE', 2) # accurate-> FAILS
We over-checked the input values. Indeed the "DENOISE INTERVAL_START" has the very same problem:
Code: Select all
setRenderParameter('DENOISE INTERVAL_START', 0) # only at end -> works fine
setRenderParameter('DENOISE INTERVAL_START', 1) # from SL 1 -> works fine
setRenderParameter('DENOISE INTERVAL_START', 2) # from SL 2 FAILS
...
setRenderParameter('DENOISE INTERVAL_START', n) # from SL n FAILS
It will be fixed for the next release.

The only possible workaround is to set those parameters by command-line when you call maxwel.exe to render:

parameters = []
parameters.append('-mxs:' + choice);
parameters.append('-nowait');
parameters.append('-nogui');
parameters.append('-o:' + outImg);
#parameters.append('-mxi:' + outMxi);
parameters.append('-denoisePath:' + outDen);
...
parameters.append('-denoiseAutoconfig:'+autoconfigvalue)
parameters.append('-denoiseStartSL:'+startslfordenoiser)
runMaxwell(parameters)
User avatar
By Brany
#395326
It seems that the "MXS FULLNAME" doesn't work either, but "MXI FULLNAME" should work. I will check it tomorrow.

We really appreciate your feedback!
Will there be a Maxwell Render 6 ?

Let's be realistic. What's left of NL is only milk[…]