Random thought: nodal python

I suck at python and will probably never understand it. And Im probably not alone in that thought.

But I did think of a way of making it easier & accessible to noobs.

So its python in blender but using nodes to put together.

So…
node 1 for a script would add info. (click node to edit info.)
connect to
node 2 import whatever needed bpy ops (alt click to see the python code)
connect to node 3 get selected
node 4 do something add modifier
final node whatevers at the bottom register something i dunno.

for a modifier

add panel
add function, connect to that button or slider.

I know theres more to python than that and it would have to evolve in complexity. people adding more features over time.

Just a random thought I had whilst drinking coffee and have not thought through, feel free to beat it down.

It is an interesting idea and has been tried several times. This is called “Visual Programming” (http://en.wikipedia.org/wiki/Visual_programming_language) and you can see that there is a long list of languages and project that have tried this approach. I’m not sure why none of them have really caught on.

Because there’s more to programming than dealing with syntax.

I was going to say something but then I noticed your signature and found it interesting:

A guy who thinks of himself as intelligent for using needlessly complex and time-consuming methods of accomplishing simple tasks is truly the worst kind of idiot.

(Which I strongly disagree with, by the way.)

Try learning C++. It’s much easier than python.

that’s not a bad idea at all and it’s there in a few animation packages e.g. softimage (ICE), houdini (VEX) and I think Thinking Particles is also similar.

Well they are not object oriented but you have all the basic data types, all operations, loops and conditions and can read/write almost every important data.

That these are almost fully featured programming languages was once showcased by matt ebb as he build a path tracer inside houdini with vex which was also build in softimage ice. I’ve even seen someone building Space Invaders in softimage ICE.

The only difference is that they’re not build upon python. Afaik ICE is directly interpreted by softimage and the VEX editor builds a scripting language which is then compiled and interpreted.

I know there is more to python than blender & you probably couldnt have nodes for everything.

But with the notion of a custom node - double click opens text editor

You can input anything you want.

And more importantly it only takes one knowledgable person to write a node once, save node as .py and share.

The current system needs everyone to be experts at python.

example to select something apply modifer change setting.

you can find the bits of code to do that, and put them together but it wont work because you didnt define X.

There are only a few places to ask & if u dont get a reply thats it.

This way it already knows what x is cos x was already defined in a node.

For the experts it would save time by adding a header or no need to look up blender documentation.

I dont know the ins and outs of it, Im just thinking of way to get more people involved.

There may be great scripters out there who didnt get past step one because there was no explination of why something didnt work.

You seem to be mixing the idea of Python script-defined nodes and the opposite, nodes defining Python scripts.

Python-defined nodes, which are nodes defined by Python scripts that can be shared like addons are already in the works, I think by Lukas Toenne. Nodes that define Python scripts (Visual programming like someone already mentioned) aren’t really all that necessary as we can already do that stuff with the Python API. It’s a lot of work for little gain. Having the scripts in node form won’t make you a better programmer.

You would also do well to get the idea that you can’t learn Python out of your head. What prevents you from learning it?

I just found out that NodeBox (Open Source) uses Python as the underlying language: www.nodebox.net.
Here’s some information about the Architecture: http://research.nodebox.net/index.php/Architectuur
Maybe that would make the process of integrating it into Blender a bit easier…

Ill answer a few of these points.

I was only thinking of how it would be simpler for me firstly as someone who has struggled. the idea was to help people get into it by giving them all the same working tools.

I understand this doesnt do much for those who know how to script. I agree its of little gain to them.

I think I was thinking of it working both ways. at the moment u find the bit of code from random places online or in other scripts, this would put the code snippets inside blender and make them work by connecting them. so adding object x later on would adjust the scripting so that whatever functions added would be applied to object x.
The user wouldnt have to define this as the connection would.
the notion of saving it as .py was simply a throw away idea for the userbase in input their own nodes.

I realise now why its far more complex than I had initially thought but that was the purpose of the thread.

as for me, I know coding will never be my strong point. There are not enough hours in the day & I would rather spend them doing other things.

Try learning C++. It’s much easier than python

Reading nonsense like this makes me imagine you are specifically out to troll me

Regarding the nodes:
As soon as Lukas provides the ability to use the Node UI from python I’m sure someone will cook something up. However blenders architecture is not really designed to work well with a general node system. Nodes are very good at modeling functional/DAG-like processes and to a lesser extent Finite State Machines. For modeling something almost completely imperative like the Python API (where the inputs/outputs or states are not clearly defined, and anything can write anywhere at any time), it is almost useless.

non-programmers wanting to program. Even the easiest of programming languages (like Python) won’t help there…

it won’t help because the problem is not syntax: it’s algorithm. You don’t know how to think algorithmically, after you get your python nodes you stare at it and shake your head just as if it was regular python syntax.

Learn to program if you want to program.

http://www.heritems.info/avatar3.jpgTry learning C++. It’s much easier than python.

That’s definitely right. But don’t forget that Visual Programming is just another way of “regular” programming. For some people it’s easier to learn about programming and algorithms the visual way. And I think this is definitely the case in a visual-centric application like blender.

Imagine the complexity involved in say, writing a node for something simple like defining a Python class. :eek: Even if you could, wouldn’t the user still have to understand the concepts of classes, instances, methods, attributes, etc anyway? I’d prefer the skilled programmers spending their time developing for Blender itself, instead of designing a vpl!

Even if you could, wouldn’t the user still have to understand the concepts of classes, instances, methods, attributes, etc anyway?

If your problem space revolves around the transformation of well-defined data, you don’t need any of these things. There are a lot of areas where node systems can almost completely replace traditional programming tasks, as evidenced by programs like houdini, softimage, nuke etc. Turning the existing Python API into nodes makes little sense though. Operators can read and write anything, they don’t define their inputs or outputs, basically all you could do is carry the entire program state from one node to another to make it work in general, and that’s not really feasible.

Half of Houdini’s power lies in the ability to write python expressions for node parameters, and to write new nodes and tools using python. Imagine if we used visual nodes to program expressions for visual nodes. The result would be a small help to newbies and a major loss to professionals. Scripts are not replaced by nodes, they augment nodes.