This is a project I’ve been working on for a little while now, and I finally got something working.
I have a pynodes system that allows you to interact with the bge.
This is different from projects like hive in how it goes about doing that. Instead of integrating a custom node system directly into the bge, my solution uses python scripts as a buffer. Basically, when you create nodes, they generate a bge script. For now I have to manually add the script, but the plan is for it to automatically be assigned.
The end result of this is that I’m not editing the bge in any way. At runtime, the bge is just reading a static .py file, instead of parsing a node tree. This also means I can fully leverage the power of pynodes, instead of having to do my own parsing from scratch.
Yeah, I’m still here
So I spend a bunch of time the past couple of days working on gamenodes, and while it’s not ‘done’, I got it to a point where it’s usable.
below you can see the latest video (sorry about the low res, twitch changed their export settings, I’ll have to fix it for future videos)
because my system uses dynamic nodes, I had to figure out something to make. Lucky for me, Renaud already put together a simple mousemove system that really showed off nodal logic, so I just replicated it.
gamenodes doesn’t look quite as polished, but that’s because all the nodes are generated in realtime, node preconfigured. In future updates I’ll try and clean them up a little, as well as post an in-depth tutorial on how to use them.
Anyway, here’s the v0.0.1 release! [ATTACH]326579[/ATTACH]
simply install like any other addon
inside the zip there is an example blend showing the mouse move, as well as examples of custom logic (found in the copied_nodes folder)
finally, until I post a full tutorial, here is a quick rundown on how to make your own custom nodes.
The system works by looking for meta tags in the comments.
Step 1: make a new .py file with a function def node_name(out):
Inputs: in the function, add the tag #< input_name behind any variable you want an input for
ex: locationX = locX #< locX *this will create an input called locX, and replace the word locX with the correct value
Outputs: in the function, add the tag #> variable_name behind any variable you want an output for
ex: x = mouse.position #> x *this will create an output called x, and link it to the variable called x
Controllers: if you want code to run, you’ll need something to execute it. use the tag #~ function_name to call a function.
ex. if True: Pulse() #~ Pulse *this will create a pulse output, and trigger all connected nodes when Pulse() is called.
Execution: If you add the tag #` somewhere in a function, a pulse input will be created. when a pulse is sent to it, the function will automatically be ran.
Ok, Sorry. if the tutorial is vague, I’ll put something better together in the future. Anyway, have fun!
I spent some time today working on custom nodes. They aren’t functional yet, but I did make a lot of headway. I figured out how to have dynamic inputs and outputs, as well as how to build file selection into the nodes.
In the video below, when I change the node type from loc to rot, the inputs are actually being deleted and replaced, not just renamed.
Stay tuned for more
If you want to watch the full livestream, or see future programming streams, you can check out http://www.twitch.tv/cubedparadoxx/profile/
This video shows the addon in action.
I’ll also be posting updates here. Feel free to comment below