Hi, I have a problem, here is my code for one node:
class AudioTimeNode(bpy.types.Node):
bl_idname = "AudioTimeNode"
bl_label = "Time Info"
bl_icon = "SPEAKER"
time_num: bpy.props.FloatProperty(name="Time")
frame_num: bpy.props.FloatProperty(name="Frame")
def init(self, context):
self.outputs.new("FloatNodeSocket", "Time")
def draw_buttons(self, context, layout):
layout.prop(self, "time_num")
def execute(self):
self.time_num = (
bpy.context.scene.frame_current / bpy.context.scene.render.fps
) * bpy.context.scene.render.fps_base
return self.time_num
This one feeds the values into my debug node, but this one:
class AudioControlNode(bpy.types.Node):
bl_idname = "AudioControlNode"
bl_label = "CM Control"
bl_icon = "SPEAKER"
cm_data = {}
bpm : IntProperty(name="BPM", default=60)
time_sig_num: IntProperty(name="Time Sig N", default=4)
time_sig_den: IntProperty(name="Time Sig D", default=4)
note_den : IntProperty(name="Note Denom.",min=1,default=16,max=64)
message : StringProperty(name="Message")
def init(self, context):
self.outputs.new("GenericNodeSocket", "CM Data")
def draw_buttons(self, context, layout):
layout.label(text="Clockworx Control Node")
layout.context_pointer_set("audionode", self)
layout.operator("node.execute_start")
layout.operator("node.execute_stop")
layout.label(text="CM Constants")
layout.prop(self, "bpm")
layout.prop(self, "time_sig_num")
layout.prop(self, "time_sig_den")
layout.prop(self, "note_den")
layout.operator("node.set_constants")
layout.prop(self, "message")
def execute(self):
print(self.cm_data)
return self.cm_data
Does not, I am confused as to why this is as the print statement prints the data:
Here is the Blender view:
The lower debug shows nothing, but the other two work. Does anyone have any thoughts as to what might be wrong. I have made my own new Node Editor to make music using Aud library.
Cheers, Clock.
EDIT:
I also have other nodes for Integers, Floats, Booleans, etc. that also all work fine.
Also I don’t seem to be able to output to two output sockets, both always have the same result although I send two variables in the return line separated by a comma, this is also driving me mad…
This section of nodes works fine, I am just so confused: