Skip to content

Commit

Permalink
Update 28 Feb 2019
Browse files Browse the repository at this point in the history
Updated all nodes, removed "MIDI Index" Node as it is no longer required. Nodes now colour-coded to reflect which category they are in. Some more revisions and improved coding options as my knowledge of AN increases. DAW nodes still very experimental so not included in the menu.
  • Loading branch information
Clockmender authored Feb 28, 2019
1 parent f223590 commit e71a233
Show file tree
Hide file tree
Showing 57 changed files with 297 additions and 93 deletions.
3 changes: 3 additions & 0 deletions audio-amp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def create(self):
self.newOutput("Float List", "Output List", "output")

def execute(self,input):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.85,1,0.85)
addRem = True
negInp = False
if input < 0:
Expand Down
5 changes: 5 additions & 0 deletions audio-play.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ def draw(self,layout):
self.invokeFunction(col, "stopFile", icon = "NEW",
text = "Stop Playback")

def execute(self):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.85,1,0.85)

def loadFile(self,path):
pgm.music.load(path)
self.message = str(path)
Expand Down
3 changes: 3 additions & 0 deletions audio_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def create(self):
self.newOutput("Float", "Right Channel", "r_chan")

def execute(self):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.85,1,0.85)
inpDev = int(self.modeI)
outDev = int(self.modeO)
channI = sd.query_devices(int(inpDev)).get('max_input_channels')
Expand Down
3 changes: 3 additions & 0 deletions bone_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def create(self):
self.newOutput("Vector", "Scale", "scales")

def execute(self, bone):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bone:
locations = bone.location
rotations = bone.rotation_quaternion
Expand Down
3 changes: 3 additions & 0 deletions bone_trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def create(self):
self.newOutput("Vector", "W-Scale", "scale")

def execute(self, bone):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bone:
loc, rot, scale = bone.matrix.decompose()
else:
Expand Down
3 changes: 3 additions & 0 deletions bones_copyoffset.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def draw(self, layout):
layout.prop(self, "useZ")

def execute(self, source, targets, offset):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if source is None or targets is None:
return

Expand Down
30 changes: 17 additions & 13 deletions bones_locate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ def create(self):
else:
self.newInput("Bone List", "Bones List", "bones")
self.newOutput("Bone List", "Bones List", "bones")
self.newInput("Float", "X Loc", "loc_x")
self.newInput("Float", "Y Loc", "loc_y")
self.newInput("Float", "Z Loc", "loc_z")
self.newInput("Vector", "Location", "locV")

def draw(self, layout):
layout.prop(self, "use_s")
Expand All @@ -30,17 +28,23 @@ def getExecutionFunctionName(self):
else:
return "execute_bones"

def execute_bone(self, bone, loc_x, loc_y, loc_z):
def execute_bone(self, bone, locV):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bone:
bone.location.x = loc_x
bone.location.y = loc_y
bone.location.z = loc_z
bone.location = locV
return bone
else:
return None

def execute_bones(self, bones, loc_x, loc_y, loc_z):
def execute_bones(self, bones, locV):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bones:
for b in bones:
b.location.x = loc_x
b.location.y = loc_y
b.location.z = loc_z

return bones
b.location = locV
return bones
else:
return None
6 changes: 6 additions & 0 deletions bones_rotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def getExecutionFunctionName(self):
return "execute_bones"

def execute_bone(self, bone, loc_w, loc_x, loc_y, loc_z):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bone:
if bone.rotation_mode == 'QUATERNION':
bone.rotation_quaternion.w = loc_w
Expand All @@ -59,6 +62,9 @@ def execute_bone(self, bone, loc_w, loc_x, loc_y, loc_z):
return bone

def execute_bones(self, bones, loc_w, loc_x, loc_y, loc_z):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bones:
for b in bones:
if b.rotation_mode == 'QUATERNION':
Expand Down
32 changes: 17 additions & 15 deletions bones_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ def create(self):
else:
self.newInput("Bone List", "Bones List", "bones")
self.newOutput("Bone List", "Bones List", "bones")
self.newInput("Float", "X Scale", "loc_x")
self.newInput("Float", "Y Scale", "loc_y")
self.newInput("Float", "Z Scale", "loc_z")
self.newInput("Vector", "Scale", "sclV")

def draw(self, layout):
layout.prop(self, "use_s")
Expand All @@ -30,19 +28,23 @@ def getExecutionFunctionName(self):
else:
return "execute_bones"

def execute_bone(self, bone, loc_x, loc_y, loc_z):
def execute_bone(self, bone, sclV):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bone:
bone.scale.x = loc_x
bone.scale.y = loc_y
bone.scale.z = loc_z

return bone
bone.scale = sclV
return bone
else:
return None

def execute_bones(self, bones, loc_x, loc_y, loc_z):
def execute_bones(self, bones, sclV):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bones:
for b in bones:
b.scale.x = loc_x
b.scale.y = loc_y
b.scale.z = loc_z

return bones
b.scale = sclV
return bones
else:
return None
8 changes: 5 additions & 3 deletions bounce.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

class bounceNode(bpy.types.Node, AnimationNode):
bl_idname = "an_bounceNode"
bl_label = "Bounce Node"
bl_label = "Bounce Generator"
bl_width_default = 200

frm_s = IntProperty(name = "Start Frame", default = 1)
frm_s = IntProperty(name = "Start Frame", default = 2, min = 2)
frm_e = IntProperty(name = "End Frame", default = 10, min = 10)
speed = FloatProperty(name = "Cycle Speed", default = 4, min = 4)
spd_d = FloatProperty(name = "Speed Decay Factor", default = 1, precision = 3, min = 0.8, max = 1)
Expand All @@ -26,13 +26,15 @@ def draw(self, layout):
layout.prop(self, "frm_e")
layout.prop(self, "speed")
layout.prop(self, "spd_d")
layout.prop(self, "spd_v")
layout.prop(self, "hgt_s")
layout.prop(self, "hgt_b")
if (self.message1 != ""):
layout.label(self.message1, icon = "ERROR")

def execute(self):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
frm_c = bpy.context.scene.frame_current
if self.hgt_s <= (self.hgt_b + 0.1):
self.message1 = "Height Errors!"
Expand Down
3 changes: 3 additions & 0 deletions copy_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def draw(self, layout):
layout.prop(self, "useZ")

def execute(self, source, target, offset):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if source is None or target is None:
return

Expand Down
3 changes: 3 additions & 0 deletions copy_rot_bones.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def draw(self, layout):
layout.label(self.message1, icon = "ERROR")

def execute(self, source, targets, offset_e, offset_q):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if source is None or targets is None:
return

Expand Down
3 changes: 3 additions & 0 deletions copy_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def draw(self, layout):
layout.label(self.message1, icon = "ERROR")

def execute(self, source, target, offset_e, offset_q):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if source is None or target is None:
return

Expand Down
3 changes: 3 additions & 0 deletions cube_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def draw(self,layout):
layout.label(self.message1, icon = "INFO")

def execute(self, typ_b, frm_s, frm_e, dia, fac_x, fac_y, fac_z, u_seg, obj):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
frm_c = bpy.context.scene.frame_current
frm_i = frm_c - frm_s
if self.frm_j == 1:
Expand Down
6 changes: 4 additions & 2 deletions cumulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class cumNode(bpy.types.Node, AnimationNode):
bl_idname = "an_cumNode"
bl_label = "Accumulate Node"
bl_label = "Accumulate By Frame"
bl_width_default = 200

str_f = IntProperty(name="Reset Frame #")
Expand All @@ -17,10 +17,12 @@ def create(self):
self.newOutput("Float","Output","c_num")

def draw(self,layout):
layout.prop(self, "cum_v")
layout.prop(self, "str_f")

def execute(self,num_p,num_m):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if bpy.context.scene.frame_current == self.str_f:
self.cum_v = 0
elif num_p > 0 and num_m == 0:
Expand Down
3 changes: 3 additions & 0 deletions daw-cam_cont.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def create(self):
self.newOutput("Integer","Start Frame","osFrame")

def execute(self, sFrame, sShift, cZoom):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (1,0.8,1)
camObj = bpy.data.objects.get('Cam-Seq')
camCam = bpy.data.cameras.get('Cam_Seq')
#scObjs = [ob for ob in bpy.data.objects if ob.name.startswith('Scale')]
Expand Down
5 changes: 5 additions & 0 deletions daw-create_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def draw(self,layout):
if self.mess is not '':
layout.label(self.mess, icon='INFO')

def execute(self):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (1,0.8,1)

def createTrack(self):
numV = int(self.timS.split(',')[0]) # Sig Numerator
denV = int(self.timS.split(',')[1]) # Sig Denominator
Expand Down
3 changes: 3 additions & 0 deletions daw-flip_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def draw(self,layout):
layout.prop(self,'procN')

def execute(self):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (1,0.8,1)
matO = bpy.data.materials['open'] # Open Material
matP = bpy.data.materials['play'] # Play Material
# Get list of "Note" obejcts
Expand Down
3 changes: 3 additions & 0 deletions daw-played_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def create(self):
self.newOutput("Text List","Output Notes","outNotes")

def execute(self,sFrame):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (1,0.8,1)
outN = []
matP = bpy.data.materials['play'] # Play Material
frameC = (bpy.context.scene.frame_current - sFrame) * 0.1
Expand Down
3 changes: 3 additions & 0 deletions fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def create(self):
self.newOutput("Float", "Y Acceleration", "ay1")

def execute(self, obj, obb, dec, s_f, cyc, d_f):
self.use_custom_color = True
self.useNetworkColor = False
self.color = (0.8,0.9,1)
if obj is None or cyc == 0 or d_f < 0.79 or d_f > 1 or s_f < 0.1:
self.message1 = 'No Input Object/Bad Parameters'
return 0,0,0,0
Expand Down
Loading

0 comments on commit e71a233

Please sign in to comment.