Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5871

__init__() takes exactly 2 arguments (3 given)

$
0
0

@mimosapudica wrote:

Hi, I am trying to create a 2d array that access points with two value [i][j]
But I am getting this error message: init() takes exactly 2 arguments (3 given)
could you give me a hint about the problem?
If needed, I can send the rest of the script.
thanks

class Network():
    def __init__(self, points, stiffness):
        self.stiffness=stiffness 
        self.nodes=[]
        self.points = points
        for point_row in self.points:
            nodes_row = []
            for point in point_row:
                nodes_row.append(Node(point,True))
            self.nodes.append(nodes_row)
        self.uniformforce = rg.Vector3d(0,0,0)
        self.calculate_neighbours()
        self.calculate_desired_distance()

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5871

Trending Articles