Author Topic: Parameters not set when saving the graph through  (Read 465 times)

Hi guys,

I'm having problems to save graphs on which the parameters were created via Python Script.

1 - I'm setting up my parameters values as follows:
Code: [Select]
self.sdGraph.setPropertyAnnotationValueFromId(graphInputTargetSwitch, 'clamp', SDValueBool.sNew(True))
            self.sdGraph.setPropertyAnnotationValueFromId(graphInputTargetSwitch, 'label', SDValueString.sNew('Tint White'))
            self.sdGraph.setPropertyAnnotationValueFromId(graphInputTargetSwitch, 'min', SDValueInt.sNew(1))
            self.sdGraph.setPropertyAnnotationValueFromId(graphInputTargetSwitch, 'max', SDValueInt.sNew(2))
            if(useColorMatch):
                self.sdGraph.setInputPropertyValueFromId('use_color_match', SDValueInt.sNew(2))
            else:
                self.sdGraph.setInputPropertyValueFromId('use_color_match', SDValueInt.sNew(1))

2- Saving my Package as follows:
Code: [Select]
self.sdPackageMgr.savePackageAs(self.sdPackage, packageAbsPath)
3-Then, I publish my new package as SBSAR

4- Once imported the SBSAR, my parameters on Painter are "broken", like this(non-sliders based)


5-However, if I open the package back on Designer and click on its Graph, after the Parameters Tab is loaded, the package identify as there was a changes that needs saving.


6- If I save the "new changes" and publish my SBSAR again. The parameters on Painter looks as expected(sliders based), respecting the constraints defined by code (Min, Max and Clamp).


Seems like there is a step missing on my code, before saving the package. The Editor apparently does apply additional steps on the graph parameters when the parameters tab is loaded.
Is it possible to force open the Parameters Tab by script or something similar?
Do I need to call something else before saving the package? The only process I call before saving is sdgraph.compute()


Many thanks in advance,

Cristiano da Silva
Last Edit: May 14, 2021, 12:04:05 pm

Well, I found the issue on my code.
Forgot to specify the 'editor' type to Slider.  :D

Code: [Select]
self.sdGraph.setPropertyAnnotationValueFromId(graphInputTargetSwitch, 'editor', SDValueString.sNew('slider'))
Cheers.