I am wondering if anyone could help me with some python for the macro window. I am trying to turn a single node into two nodes with handles in between them, all on top of each other. I am sure there is a way, but I am quite new to using the macro window so I am missing it.
for path in Layer.paths:
for index, node in enumerate(path.nodes):
if node.selected and node.type!=OFFCURVE:
for nodeType in (OFFCURVE, OFFCURVE, CURVE):
newNode = GSNode()
newNode.position = node.position
newNode.type = nodeType
path.nodes.insert(index, newNode)
Here is an improved version (the one above would not work with corner nodes:
for path in Layer.paths:
nodeindexes = reversed(range(len(path.nodes)))
for index in nodeindexes:
node = path.nodes[index]
if node.selected and node.type!=OFFCURVE:
for nodeType in (CURVE, OFFCURVE, OFFCURVE):
newNode = GSNode()
newNode.position = node.position
newNode.type = nodeType
path.nodes.insert(index+1, newNode)