Pynodes, a few questions...

Hello to all.
I’m trying to write a couple of “utility nodes”. (mostly for things that can be done with multiple nodes already, but I’d love single nodes for ease of use)…All of these are essentially “input parameters” for gradient ramps (lightwave style).

(feed the output of my pynodes as input to gradient ramps. and from there to wherever!)

“Slope” and “Camera incidence” are easy, but I’d like to do “light incidence” and offer a pulldown list for the user to pick one of the lights in the scene. Same for “Distance to object”, though for this I’d also want to map the range, so…

1)Is it possible/how do I offer user buttons/pulldown lists in a pynode? (or do I just expect the user to edit the text?)

  1. Is it possible to “register” a pynode (so it is always available, even in new blends?)

Help appreciated :slight_smile:

EDIT: Duh, I can use PupMenu or PupBlock in the init section, so that’s sorted. It’d be nice to be able to print some info on the node to reflect choices though, but not a big problem! Anyone know about “registering” though?

1)Is it possible/how do I offer user buttons/pulldown lists in a pynode? (or do I just expect the user to edit the text?)

I don’t think it’s possible to use buttons/pulldown lists yet. At least there is no mention about this at the API (http://wiki.blender.org/index.php/BlenderDev/PyNodes/API). I have used inputs for this for now (ie. 0.0-2.0 mapped to axes (cast to int before using of course (int(foo+.5)))).

  1. Is it possible to “register” a pynode (so it is always available, even in new blends?)

I am not exactly sure about registering but you can store the nodes in the .blend containing your default settings so you can have the nodes at your disposal this way.

I just replied to another thread on a related subject, Incidence Angle, Slope, tied to specific Lamp/Light or Camera would be a great addition to the Pynodes tool set. I want to be able to generate light affected incident angle responsive shadows, so that they are faint and washed out on the light side and dark away from the light in a controlled, defined way. I can do this in Lightwave and thought I was just to Noobish. Maybe someone else knows how this could be done, wish I had the coding skills, does the API allow for such development?
Paul