Author Topic: Custom Modules and the QML Import Path List  (Read 3200 times)

Is it possible to setup my own QML widget modules, to be referenced from some location other than the factory install location <C:\Program Files\Allegorithmic\Substance Painter\qml>?

For example, I have a bunch of QML widgets that need to be shared by multiple plugins, so I'll need to have them on a network or local folder, then add that location to the QmlImportPathList (I think). But can I do that through the plugin API?

Hi Brad,

Unfortunately, that's not currently possible. I agree that we should provide a way to specify custom locations to search for additional widget modules, particularly since the factory install path will be overwritten when installing a new version of Painter.
If we were to store those additional paths in Painter's settings, would that be ok with you ?

Dang, I was hoping that I just wasn't handling the qml import correctly.

Saving it in the settings could be good, if that setting is available through an .ini somewhere. Which is related to another issue I have: particularly around shelf deployment, where many of the settings are stored in the user's registry which I'd prefer to not edit.

Just re-pinging this thread to see if this is possible with the API yet?

Actually, I'm seeing this now in the AlgHelpers..
Code: [Select]
addImportPath(importPath)
Is this to be used in the main.qml file of a plugin? And if multiple plugins are to reference a single shared library, would only plugin be responsible for adding the importPath? What's the usage / best practice in regards to this?

thanks!

Actually, I'm seeing this now in the AlgHelpers..
Code: [Select]
addImportPath(importPath)
Is this to be used in the main.qml file of a plugin? And if multiple plugins are to reference a single shared library, would only plugin be responsible for adding the importPath? What's the usage / best practice in regards to this?

thanks!
Hi,Bradford Smith:
i suggestion you make the "exe" ,let "exe" form the web  get you want files,and  let the Plugin call exe !i try this way i find  so magic:)!
pjpeng

Hi Brad,

Unfortunately, that's not currently possible. I agree that we should provide a way to specify custom locations to search for additional widget modules, particularly since the factory install path will be overwritten when installing a new version of Painter.
If we were to store those additional paths in Painter's settings, would that be ok with you ?

Hey Cyrille.

It would be super awesome if we could define these locations with an environment variable. It's a pretty common pattern in other softwares like i.e. Maya. It makes Pipeline TD's life easier.

In Maya if you add a directory to the environment variable MAYA_SCRIPTS_PATH before you launch it every script you put into this directory is available for this instance of software.