Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Esteban Tovagliari

Pages: 1 [2]
16
Hi,

Opening graphs is not available in the Python API at the moment.
Maybe you could simulate a double click in the item using Qt for Python but I am not sure how that would work.

Est.

17
Hi,

It is not possible to use Python to create your own custom nodes.

Pixel processors are the best way to implement color conversions in Designer.
There are in the library some color conversion nodes you can use directly or as a reference to implement your own.

You could also try colour-substance: https://github.com/colour-science/colour-substance
It seems very complete.

Est.


18
Yes, that is correct.

When using OpenColorIO, we use the color space defined as scene_linear in the OpenColorIO config as the working color space. For example when using the ACES config, your working color space will be ACES Cg.

Est.

19
Hi,

There are no before / after export callbacks currently in Designer.

In Designer, sd/tools/export.py there is a function called exportSDGraphOutputs that can be used to
export graph outputs. If it works for your use case, you can easily execute any python code before / after calling the function.

Est.

20
Hi,

It is not possible today to save presets, view all material outputs or load 3d view states using Python.

Exporting renders and textures from the 2d / 3d view is also not exposed in the Python API at the moment.

Depending on what you need to do, maybe there are some alternatives. If you need to take screenshots for
icons or thumbnails, you can use Qt to retrieve the widget image and save that to a file.

Something like this (untested):

Code: [Select]
def take3DViewScreenShot(uiMgr, fileName):
        all3DViews = []
        self.__findAll3DViews(uiMgr.getMainWindow(), all3DViews)

        if len(all3DViews):
            view = all3DViews[0]
            pixmap = view.grab()
            img = pixmap.toImage()

            img.save(fileName)
        else:
            print("No 3d views found!!!")

        return None

def __findAll3DViews(widget, widgets):
    if not isinstance(widget, QtWidgets.QWidget):
        return

    if isinstance(widget, QtWidgets.QOpenGLWidget):
        widgets.append(widget)

    for w in widget.children():
        __findAll3DViews(w, widgets)

Est.

21
Hi,

It seems it is not possible at the moment to delete graphs from packages from Python.

Est.

22
Hi,

To export the graph outputs from Python you can do something like this:

from sd.tools import export
export.exportSDGraphOutputs(graph, outputDir)

You can check the code in sd/tools/export.py and use it as a reference for your own version, adapted for your own needs, for example tracking the output images generated or running some kind of QA process before exporting graph outputs.

Does that help?

Est.

23
Hi,

We made some important changes to the way plugins work in Designer 2019.
Plugins for Designer 2018 and earlier are not compatible with the new version.

You need to modify your plugin to work with SD2019.
Check the documentation section about updating plugins:

https://docs.substance3d.com/sddoc/porting-previous-plugins-172825048.html

Esteban.

24
Hello,

Which version of Designer are you using?

Est.

25
Hi,

Can you set the QT_DEBUG_PLUGINS environment variable to 1, launch Designer

> export QT_DEBUG_PLUGINS=1
> "Substance Designer"

and post the output here?

It will help us know why the Qt platform plugin could not be loaded.

Est.

26
You can place your plugin in any of the predefined paths for your operating system, you can check them in
Preferences -> Projects -> Default project -> Python tab.

If you want to place your plugin in another directory, you can add a new path, in Preferences -> Projects -> User project, Python tab.
You need to add the folder that contains your plugin, not the plugin folder itself, and restart Designer.

In the Tools menu, you can use the Plugin Manager to check if your plugin was correctly loaded.
If it wasn't, check the console for any Python errors.

New plugins don't create automatically menu items or toolbar buttons. You need to create them using QtForPython in your plugin.
You can find some simple examples of creating UI elements here:
https://support.allegorithmic.com/documentation/sddoc/creating-user-interface-elements-172824940.html

Est.

Pages: 1 [2]