4

I'm trying to make neural network in Blender nodes, and I'm currently stuck on getting the entire NodeTree to update after manually changing an input value.

value wont trigger update but link will

Is it at all possible to manually update the entire tree without pulling on a socket/updating a link?

LAK132
  • 351
  • 1
  • 8
  • 1
    Hey cool project. Any way to get more info about that? – Teck-freak Nov 28 '17 at 11:06
  • @Teck-freak I gave up on using Blender and started writing my own node-based language in C++ (https://github.com/LAK132/NetworkMaker). That said, the Blender version was nearly functional and I could upload it to GitHub if there is any interest in it – LAK132 Nov 29 '17 at 02:55
  • There is. Definitly. :-) And thanks for the link, I'll check it out. – Teck-freak Dec 02 '17 at 01:36
  • @Teck-freak https://github.com/LAK132/BPy-NN – LAK132 Jan 14 '18 at 12:19

1 Answers1

4

Looks like I forgot to add the update parameter in the custom property:

#Custom properties are basically a struct, you can have any number of built in (bpy) datatypes defined here:
weight= FloatProperty(default = 1.0) #no update triggered
value = FloatProperty(default = 1.0, update=uda) #update triggered

Additionally the node socket needed to have it's update callback initialised

def init(self, context):
    self.inputs.new("SynapseSocket", "Value 1").callback(self.name, "uda")

For anyone else that manages to stumble across this problem, see my previous question as well: Alternative update callback for PointerProperty?

LAK132
  • 351
  • 1
  • 8