PDA

View Full Version : The Python Node ??? and ???



jeric_synergy
09-20-2016, 05:48 PM
Does anyone have any examples of how to use the Python Node?

Here's the entirety of the text from the 2015.3 manual:



"Adding this gives you a node with no inputs or outputs initially. Double clicking on the node will
open a file requester to allow you to choose the python script of your choice."


:stumped: This seems like some details may have been skipped over.

prometheus
09-20-2016, 06:20 PM
I am no node wiz ..so maybe it is wrong of me to jump in..but

double click on the node and load the specular python script in scripts/python/layout/shader
probably you won´t se anything happening on the node, go to options in node editor and uncheck disable previews ..and it should show color,spec and glossiness for input and color for output.

seems buggy, since if you delete it and load a new one you always have to update for it to show up.

BeeVee
09-21-2016, 02:24 AM
To be honest, the documentation is an ample sufficiency. What else can I say? Given that the inputs and outputs depend on the script involved adding further detail would be too specific. Please bug that Prometheus so it can be fixed.

B

jeric_synergy
09-21-2016, 08:10 AM
To be honest, the documentation is an ample sufficiency. What else can I say? Given that the inputs and outputs depend on the script involved adding further detail would be too specific.
B
Are the details of creating these inputs/outputs in the SDK or Python documentation? I don't ask for extensive documentation of the Python procedures in the main dox, but a pointer (or better, a link) in the main dox would be appropriate.

I think it falls below the threshold of "ample" by a long chalk. "Minimal" is apropos.

A pointer to examples would be good too.

clintonman
09-21-2016, 08:52 AM
The only example I see is the one mentioned by prometheus. The Lightwave 2015 manual has the brief text on page 2074, but double clicking to assign a python script is all there is to it.
It does seem buggy.


If you want to write your own Node -
Python docs has the information. Check the Handler Interfaces - Node Class(Shader) and Global Classes - Node InputFuncs and Node OutputFuncs
I think the best way to find stuff is to open the python script text file and use the quick search inside the python docs. Code has "self._input_funcs = lwsdk.LWNodeInputFuncs()" so do a search for "LWNodeInputFuncs"

MonroePoteet
09-21-2016, 08:55 AM
Loading a Python plugin will define the inputs and outputs. I guess it would be good to explicitly say so, though:


"Adding this gives you a node with no inputs or outputs initially. Double clicking on the node will
open a file requester to allow you to choose the python script of your choice. The Python script will then
define the inputs and outputs available for it."

Below are pointers to the online Lighwave Python SDK documentation index and to the Node Input and Output Funcs global classes. Unless you're a plugin developer, providing such information in the Python Node description just becomes confusing by opening the plugin developer's SuperSize Can O' Worms. As always, IMO.

mTp


http://static.lightwave3d.com/sdk/2015/python/index.html

http://static.lightwave3d.com/sdk/2015/python/globalnodeinputfuncs.html
http://static.lightwave3d.com/sdk/2015/python/globalnodeoutputfuncs.html

jeric_synergy
09-21-2016, 08:58 AM
And if we had group enhanced moderated dox we could simply add the two above posts to the dox.

MonroePoteet
09-21-2016, 09:15 AM
And if we had group enhanced moderated dox we could simply add the two above posts to the dox.

Too much information, IMO, as I said. Someone wanting to USE a Python plugin has absolutely no use for the details of WRITING a Python plugin.

mTp

jeric_synergy
09-21-2016, 10:17 AM
The two posts above are all I think is necessary to add the main dox: pointers to where you could find the details.

If this were given a bit more space, perhaps we'd actually have some more Python nodes scripts.

prometheus
09-21-2016, 03:06 PM
Loading a Python plugin will define the inputs and outputs. I guess it would be good to explicitly say so, though:


"
[INDENT]"Adding this gives you a node with no inputs or outputs initially. Double clicking on the node will
open a file requester to allow you to choose the python script of your choice. The Python script will then
define the inputs and outputs available for it."

Yep..that is making more sense.

Sensei
09-21-2016, 03:21 PM
A pointer to examples would be good too.

Example is in .py file that you load,
that's it:
LightWave_2015.3\support\plugins\scripts\Python\La yout\Shader\specular_node.py

jeric_synergy
09-21-2016, 05:05 PM
#aflw --And it's only the one? One for each node editor would be nice.