I tried to write a step_falloff node in animation nodes,but i failed,the consoul gave me an error:
and my code is:
import bpy
from ... base_types import AnimationNode
from . custom_falloff import CustomFalloff
class StepFalloffNode(bpy.types.Node, AnimationNode):
bl_idname = "an_StepFalloffNode"
bl_label = "Step Falloff"
def create(self):
self.newInput("Integer", "Iterations", "iterations", value = 10)
self.newInput("Float", "Factor", "factor", value = 1.0)
self.newInput("Float", "Fallback", "fallback", hide = True).setRange(0, 1)
self.newOutput("Falloff", "Falloff", "outFalloff")
def execute(self, iterations, factor, fallback):
strengths = []
for i in range(iterations):
fl = factor*i
strengths.append(fl)
return stepFalloff(strengths,fallback)
class stepFalloff:
def __new__(cls, strengths,fallback):
return CustomFalloff(strengths,fallback)
and i put this code into falloff folder in animationnodes ,how to fix this? anyone has an idea ,thank you!