Skip to content

iterating through g.nodes returns None eventually #19

Open
@claudiomartella

Description

@claudiomartella

(console script plugin)

I'm iterating over g.nodes and changing the color of a node according to its position

f = #scaling factor from X,Y range to RGB range
for v in g.nodes: color_node(v)

def color_node(v):
x, y = v.position
r = int(x_f)
b = int(y_f)
v.color = Color(r, 0 ,b)

it works for a few nodes until it throws an exception as NoneType has not position attribute. I don't see why it should eventually reach a None object. Data Table shows no empty rows, same iteration with only print(v) also doesn't fail. could be some concurrency related stuff.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions