Node Custom UI

193 views
Skip to first unread message

Nicolas Lambert

unread,
Aug 23, 2012, 9:46:43 AM8/23/12
to cora...@googlegroups.com
Hello everyone, 

First of all, thank you Andrea and all the contributors for this great openSource project!
I want to make a node with a custom UI, imagine adding a label with the state of the node, like in pipeline's demo, and a custom nodeInspector's behavior (add some buttons...)
Is it possible to make it in python or do I have to compile some classes??

Thank you

nico

Dorian FEVRIER

unread,
Aug 23, 2012, 10:13:08 AM8/23/12
to cora...@googlegroups.com
Hello Nicolas.

You should look at the sound node.

https://code.google.com/p/coral-repo/source/browse/#git%2Fcoral%2Fexperiments%2FSoundNode

It seems to use custom QWidgets.

Good luck! :D

Dorian



De : Nicolas Lambert <nicolas.l...@gmail.com>
À : cora...@googlegroups.com
Envoyé le : Jeudi 23 août 2012 15h46
Objet : [coral-app] Node Custom UI

Andrea Interguglielmi

unread,
Aug 23, 2012, 12:23:58 PM8/23/12
to cora...@googlegroups.com
Hi Niciolas,

To add custom widgets to the inspector you can refer to the link that Dorian highlighted, and there's also an example here:
http://code.google.com/p/coral-repo/source/browse/coral/examples/jitternNode/jitterNodePluginUi.py

Customizing the node-editor nodes is just as simple but less documented, have a look at this cluttered file:
http://code.google.com/p/coral-repo/source/browse/coral/coralUi/py/coralUi/builtinUis.py

Look for the registration point loadPluginUi and then look at
plugin.registerNodeUi("CollapsedNode", CollapsedNodeUi)

This is how coral pairs a NodeUi subclass to a node name, you should be able to figure things out from there.

Nicolas Lambert

unread,
Aug 23, 2012, 12:51:09 PM8/23/12
to cora...@googlegroups.com, ainterg...@gmail.com
Thank you, I'll take a look on. But for the jitterNode, I can't manage to run it... Perhaps I have to put it in a plugin folder?
Sorry for my newbies questions...

Nicolas Lambert

unread,
Aug 23, 2012, 1:02:29 PM8/23/12
to cora...@googlegroups.com, ainterg...@gmail.com
Do I have to add th ui class in builtinUis.py, or there is a way like in the jitter example to load an UI file?
It seems there is a way using plugin, but I don't find the way to correctly load plugin at the startup?

Andrea Interguglielmi

unread,
Aug 23, 2012, 1:19:27 PM8/23/12
to Nicolas Lambert, cora...@googlegroups.com
To load a plugin or a pluginUi from a running coral instance fire this in the script editor:

from coral.coralUi import coralUi
coralUi.loadPluginUi("myPluginUi.py")

from coral import coralApp
coralApp.loadPlugin("myPlugin.py")

Nicolas Lambert

unread,
Aug 23, 2012, 1:23:17 PM8/23/12
to cora...@googlegroups.com, Nicolas Lambert, ainterg...@gmail.com
Ok thank you!

Just to know, if I want to have my nodes loading at the startup, I have to implement them directly in the core, or there is a folder scanned a the startup?

Andrea Interguglielmi

unread,
Aug 23, 2012, 1:25:47 PM8/23/12
to Nicolas Lambert, cora...@googlegroups.com
You can set this environment var before to launch coral:
CORAL_PLUGINS_PATH = "/myCoralPlugins"

Nicolas Lambert

unread,
Aug 23, 2012, 1:28:47 PM8/23/12
to cora...@googlegroups.com, Nicolas Lambert, ainterg...@gmail.com
Great!!
Thank you for your reactivity, and enjoy Dreamworks!! 

Andrea Interguglielmi

unread,
Aug 23, 2012, 1:28:50 PM8/23/12
to Nicolas Lambert, cora...@googlegroups.com
And there's also this other env you can set:
CORAL_STARTUP_SCRIPT = "/blah.py"
That lets you do whatever you need to customize coral at startup, you can load plugins, customize menus, whatever.
Reply all
Reply to author
Forward
0 new messages