Blender 2.67 Pynodes

whoops link already posted

Atm I’m teaching my colleagues compositing in Blender. Since PyNodes integration group nodes behavior has changed. However, it doesn’t behave like this:

I’m referring to having Group Input Nodes with single inputs, and a name corresponding to the name on the left side of the Group node.
This gives for more clean interface.

Was this perhaps never implemented?

I doubt it is much related to normal group nodes.
I think that is the point of PyNodes, they offer up a way to implement non-standard connections. And by non-standard I mean non-material, non-compositing, non-world node trees. That is why I am looking for a way to deploy a node into a Custom Tree. I foresee AddOns working this way. Instead of appearing in a panel under a context the node tree itself will represent the context and nodes will be implemented to support such things as user input fields, drop downs and operators. This way leads to a more Houdini centric future.

Group behaviour as shown in my previous link seems like it could’ve been a new default, without any tinkering involved. But this was proposed over a year ago, so perhaps it never got used.

EDIT: or simply not completed yet

in my optimal World:

First:
Current Node System (Comp, Cycles, Image, (BI)) needs to be extended, so one can access every single value inside a Node, not just the ones someones thinks might make sense to use as Node (means basically add node Input to every Values in Nodes)
-alternatively extend the Drivers System to work with Nodes…

Together with this i wish for the ability to add more of current Node UI features in a Node Group UI, like a Color Wheel.
And we need the ability to change Node input types - currently it is the type of the Node you first link to Node Group input, but can’t be changed afterwards… This makes trying to make a nice UI with the already very limited possibilities very tedious…

Second:
Everything should be Node-able, except maybe Sequencer :wink:
I think PyNodes is a step in the right direction, but i still got my issues with it…
I haven’t seen anything usable made with PyNodes, except Render Material Setup?.. But this might be just cause they don’t exist yet?
You need Python to set it up… This prevents 90% (or whatever) of user base of creating Nodes and thus contributing contents to Blender…

In short i wish for something like Xpresso(C4D), Nuke or Softimage/Houdini Node Systems. (or PFTrack, even a camera Tracker can have Nodes…)

(And i want/wish a Iterator Node, like osx Quartz Composer :wink:

But i also want World Peace, so i know i’m not realistic :wink:

@Sago
afaik Lukas Toenne is currently working on it, but i don’t know the plans nor anything else…
(but i have to say i would not like it, if all Node input would have to be separate Nodes per se… in a lot of cases it makes sense to have them together. Again, i wish for the ability to let the user decide which way he wants to use…)

Agreed on it being optional. But it’s nice if there are too many long noodles. Currently it’s possible, but with a lot of duplicating the input node, re-connecting, collapsing, etc.

Renaming the sockets for the in/output nodes can also use improvement. Atm only happens in the properties panel.

Hey guys,

I could use some help creating a PyNode for the Compositor since I am not so much the python expoert.

My goal is to add a custom node to the Compositor node tree, in the “Color” category. How can I do that?

I started with the node example in the blender editor but I cannot find any reference on how to add pynodes to a specific category. One change I did was to change “bpy.types.Node” to “bpy.types.CompositorNode” to let this node be a compositor node.

Can anyone enlighten me?

UPDATE: It would be also nice to know on how to add actual functionality to the new pynodes. Just liek the “def call(self): self.output.var = self.input.var * 10;” functionality from the 2.4X pynodes!
http://wiki.blender.org/index.php/Dev:2.4/Py/Nodes/API

Here is my simple cut down standard node (no functionality yet):
http://www.pasteall.org/41924/python

Is there a way to get geometry nodes working? I see a link to the repository, but when I download them, the install doesn’t seem to work. I tried pointing to the directory, and zipping the directory up and pointing at that, but neither worked…

Also, is there supposed to be a geometry context, like there are Texture, Shader, and Compositor ones?

am trying to do exactly the same thing, find out how to install it! tired the preferences panel etc. Do we have to download the whole trunk and compile from there? is this not compatible with blender 2.67?

I’m trying to make it work too. I alredy see it in User Preferences, but I can’t enable it. I get this errors in console:

File "/usr/share/blender/2.67/scripts/modules/addon_utils.py", line 269, in enable    mod = __import__(module_name)
  File "/home/agustin/.config/blender/2.67/scripts/addons/geometry_nodes/__init__.py", line 53, in <module>
    from geometry_nodes import compiler, generate, mesh, modifiers, nodes, node_curve, node_generate, node_group, node_math, node_mesh, node_transform, node_random, runtime, ui, util
  File "/home/agustin/.config/blender/2.67/scripts/addons/geometry_nodes/compiler.py", line 21, in <module>
    from geometry_nodes import codegen, mesh, modifiers, parameter, util
  File "/home/agustin/.config/blender/2.67/scripts/addons/geometry_nodes/codegen.py", line 21, in <module>
    from geometry_nodes import mesh, modifiers, parameter, util
  File "/home/agustin/.config/blender/2.67/scripts/addons/geometry_nodes/parameter.py", line 445, in <module>
    register_mod_pass(item[0])
  File "/home/agustin/.config/blender/2.67/scripts/addons/geometry_nodes/parameter.py", line 439, in register_mod_pass
    mod_const.add_param("value_in", datatype, default_value=value_default(datatype), is_output=False)
  File "/home/agustin/.config/blender/2.67/scripts/addons/geometry_nodes/modifiers.py", line 63, in add_param
    param = Parameter(identifier, datatype, default_value, is_output)
  File "/home/agustin/.config/blender/2.67/scripts/addons/geometry_nodes/modifiers.py", line 47, in __init__
    raise TypeError("Expected TypeSpec datatype")
TypeError: Expected TypeSpec datatype

geometry nodes? is there a kind of thread or something on this forum about this project?

kinect & PyNodes working together by At Mind; http://www.atmind.nl/?p=607

Nice! :slight_smile:

If you want, you can up that question so that it get answered, more programmer from blender come to see and answer there than on this forum : http://blender.stackexchange.com/questions/563/getting-pynodes-geometric-node-to-work

Are those geometry nodes even in trunk? Haven’t been paying that much attention lately.

Probably need to track down Lukas’ git branch (wherever he hides it, gitorious?) and build from that to get them to work.

For the below error, I posted a (temporary) solution on Blender Stack Exchange: http://blender.stackexchange.com/a/670/97

I hope this thread isn’t dead already :slight_smile:
I read a lot about PyNodes lately and how they would be totally awesome but not of use for Cycles. I ask myself if this is true and if there is really no way to use them for the problem I’m describing now:

I want to calculate a dot product inside a cycles material. The reason is I want to check the surface if it’s rather facing the light source or not so I could assign different materials to the “light” and “dark” side.

Using the Geometry Node I get the surface normals but how do I get the light direction? One way would be the normal node, which I could set roughly the same way the light is coming from.


But wouldn’t it be nice if this vector changes dynamically matching the light source? I tried drivers, but couldn’t access the normal node nor could I link it to the light source… As I read about PyNodes I thought about the built-in Nodes we already have and how they work and how I would like to use a node accessing scene objects outside the material.

I came up with this idea:


This node is somehow a mix of the object info node and a string defining a object’s name so I could use this string in python. As far as I read a object’s location is given in vector format and could be accessed via

bpy.data.objects["ObjectName"].location

So why isn’t it possible to create a node doing the same thing a object info node does but extending it by the functionality of setting the object first?

What are you guys thinking?

Thanks, Robert

You’re looking for a Cycles shader. That’s not what Pynodes makes. You can make all the nodes you want, they’re just UIs. You have to actually implement the corresponding shader in Cycles for it do anything.

OK, but a UI-thing is what I need, since I won’t touch any shader specific things but an object’s location which is accessible via python anyway. I just thought about passing through a string to a function, so I could get a vector output, which would then be used with already existing shader-nodes.

It doesn’t matter if the data can be accessed through python. Cycles doesn’t use Python, it only sees its own shaders. Pynodes would just create a UI with no business end, since that’s all it ever does. (it’s up the scripter to code up a business end for whatever purpose they made the node for in the first place). OSL is actually more suited to what you are trying to do, and doesn’t require Pynodes anyway. Never worked with it though, so I’m not sure if it can actually do what you want.