Everything related to SDK.
User avatar
By seghier
#395337
Brany wrote:
Wed Sep 06, 2017 1:09 pm
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)
parameters.append('-denoiseAutoconfig:' + v)
TypeError: cannot concatenate 'str' and 'int' objects

command accept number only
User avatar
By seghier
#395358
Brany wrote:
Fri Sep 08, 2017 10:37 am
My fault, you must convert the int value to str:
Code: Select all
parameters.append('-denoiseAutoconfig:' + str(v))
work fine now , thank you :)
in the settings unlike maxwell studio i set minimum start sl = 1
Image

nb "attachments in the forum have problem :
ERROR
Sorry, the board attachment quota has been reached
"
User avatar
By Brany
#395375
I don't reccomend to start denoising at at SL1. Due to render resume limitations, it can end up adding noise to the render. You can try and compare two renders denoised changing that start SL from 1 to 6, for example.
User avatar
By Brany
#395376
By the way, the tools you are writting are the kind of tools that we expected the user did when we released pymaxwell. pymaxwell can be really powerful to tune scenes and generate render batches as you can see.

You are doing a great work Seghier, thank you!
User avatar
By seghier
#395377
Brany wrote:
Mon Sep 11, 2017 1:59 pm
I don't reccomend to start denoising at at SL1. Due to render resume limitations, it can end up adding noise to the render. You can try and compare two renders denoised changing that start SL from 1 to 6, for example.
yes i don't mean that ; but when we choose at end sl = 0 ; when we choose each sl we don't need sl=0 so i set the minimum to 1
Brany wrote:
Mon Sep 11, 2017 2:03 pm
By the way, the tools you are writting are the kind of tools that we expected the user did when we released pymaxwell. pymaxwell can be really powerful to tune scenes and generate render batches as you can see.

You are doing a great work Seghier, thank you!
thank you very much for the kind words :)
; yes pymaxwell it's powerful and the scripts in maxwell folder very useful and of course your excellent help always ; without your help i can't create anything
User avatar
By seghier
#395552
hi ; i create code to load the cameras from a scene and get the resolution of each camera.
i have some difficulties and i use a simple solution with creating two spinbox and hide them but i prefer a professional solution.
the first one load the cameras and add them to a combobox
the second to get resolution of the cameras but here the width/height value always taken from the first camera
Code: Select all
    def camerasList(self):
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraNames = scene.getCameraNames();
        cameraCount = scene.getCamerasCount()
        if not len(self.edit_input_file.text()) == 0:
            for name in cameraNames:
                camera = scene.getCamera(name)
                self.cameras.addItem(name)


    def changeWH(self):
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraNames = scene.getCameraNames();
        cameraCount = scene.getCamerasCount()
        if not len(self.edit_input_file.text()) == 0:
            for name in cameraNames:
                camera = scene.getCamera(name)
                x = camera.getResolution()[0]
                y = camera.getResolution()[1]
                self.wvalue.addItem(str(x))
                self.hvalue.addItem(str(y))
                n = self.wvalue.currentText()
                m = self.hvalue.currentText()
                self.edit_width.setValue(int(n))
                self.edit_height.setValue(int(m))

        return;
User avatar
By Brany
#395578
I guess you want to show the resolution of the camera selected in self.cameras combobox. In that case you can do something like this:
Code: Select all
    def changeWH(self):
        scene = Cmaxwell(mwcallback);
        # the following line can be really slow on large scenes. one solution is to save the resolution list in a member variable of the class when you read the
        # scene in "camerasList(self)", or also you can avoid reading the scene objects calling readMXS this way:
        # scen.readMXS(scenePath,SKIP_OBJECTS)
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraName = self.cameras.currentText()
        if ok:
            camera = scene.getCamera(cameraName)
            x,y = camera.getResolution()
            self.edit_width.setValue(x)
            self.edit_height.setValue(y)

also you can use the signal "activated" (void QComboBox::activated(const QString & text)) of self.cameras to capture when the combobox current text has changed. If you use Qt I strongly reccomend you to get used to its signal/slot system ;)

Anyway, I am not sure why do you need the comboboxes for the resolution, and then the editors for the current resolution. Can you avoid the resolution's comboboxes and just show the current camera resolution in the edit_width/edit_height widgets?
User avatar
By seghier
#395583
Thanks Brany i will test that.
i will check if i used QComboBox::activated; and try
And yes i used the setResolution to show the active camera res .
-----
i tried your solution but sometimes i get error about too many camera names ; and this one don't work scene.readMXS(scenePath,SKIP_OBJECTS) :
ok = scene.readMXS(self.edit_input_file.text().toAscii().data(), SKIP_OBJECTS);
NameError: global name 'SKIP_OBJECTS' is not defined


i will try more with your code
Last edited by seghier on Tue Sep 26, 2017 5:38 am, edited 1 time in total.
User avatar
By seghier
#395585
Code: Select all
    def changeWH(self):
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraName = self.cameras.currentText()
        if ok:
            camera = scene.getCamera(str(cameraName))
            x = camera.getResolution()[0]
            y = camera.getResolution()[1]
            self.edit_width.setValue(x)
            self.edit_height.setValue(y)
it work fine now thanks Brany ; just the readOptions always the same error :global name 'SKIP_OBJECTS' is not defined
User avatar
By seghier
#395587
the app crashed when i open new scene without clear the fields; i don't know what is wrong here.
Code: Select all
    def open(self):
        inPath = QtGui.QFileDialog.getOpenFileName(self, 'Open file', 'C:/', filter='*.mxs');
        self.edit_input_file.setText(inPath);
        input_mxs = self.edit_input_file.text()
        filepath_mxs = os.path.splitext(input_mxs.toAscii().data())[0]
        file_ext_mxs = os.path.splitext(input_mxs.toAscii().data())[1]
        new_mxs = filepath_mxs + '_modified' + file_ext_mxs
        if not len(input_mxs) == 0:
            self.edit_mxs_file.setText(new_mxs)
        #self.cameras.clear()
        self.camerasList()
        self.changeWH()
        self.original()


    def camerasList(self):
        self.cameras.update()
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraNames = scene.getCameraNames();
        #if not len(self.edit_input_file.text()) == 0:
        for name in cameraNames:
             #camera = scene.getCamera(name)
             self.cameras.addItem(name)

    def changeWH(self):
        scene = Cmaxwell(mwcallback);
        ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
        cameraName = self.cameras.currentText()
        if ok:
            camera = scene.getCamera(str(cameraName))
            x = camera.getResolution()[0]
            y = camera.getResolution()[1]
            self.edit_width.setValue(x)
            self.edit_height.setValue(y)
            self.htext.setText(str(y))
            self.wtext.setText(str(x))
User avatar
By Brany
#395588
maybe you have to use Cmaxwell.SKIP_MESHES instead of SKIP_MESHES.

About the crash, I will need more info. What line of code crashes?
User avatar
By seghier
#395589
thanks with Cmaxwell the error gone .
after adding this to the code : def camerasList(self) and def changeWH(self) to load cameras list and resolutions when i open a new scene if i activate : self.cameras.clear() to clear the list the app crash ; if i deactivate clear list a new list of cameras from the new scene added to the old one .

def open(self):
inPath = QtGui.QFileDialog.getOpenFileName(self, 'Open file', 'C:/', filter='*.mxs');
self.edit_input_file.setText(inPath);
input_mxs = self.edit_input_file.text()
filepath_mxs = os.path.splitext(input_mxs.toAscii().data())[0]
file_ext_mxs = os.path.splitext(input_mxs.toAscii().data())[1]
new_mxs = filepath_mxs + '_modified' + file_ext_mxs
if not len(input_mxs) == 0:
self.edit_mxs_file.setText(new_mxs)
#self.cameras.clear()
self.camerasList()
self.changeWH()
self.original()


def camerasList(self):
self.cameras.update()
scene = Cmaxwell(mwcallback);
ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
cameraNames = scene.getCameraNames();
#if not len(self.edit_input_file.text()) == 0:
for name in cameraNames:
#camera = scene.getCamera(name)
self.cameras.addItem(name)

def changeWH(self):
scene = Cmaxwell(mwcallback);
ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
cameraName = self.cameras.currentText()
if ok:
camera = scene.getCamera(str(cameraName))
x = camera.getResolution()[0]
y = camera.getResolution()[1]
self.edit_width.setValue(x)
self.edit_height.setValue(y)
self.htext.setText(str(y))
self.wtext.setText(str(x))

Hi Artem. Your work looks great and I can't tell […]

I opened a support ticket regarding this issue and[…]

Normals don't render correctly from FormZ either. […]

Most difficult seem to be partially transparent cu[…]