@@ -1320,6 +1320,23 @@ def has3DOutputAttribute(self):
13201320 if attr .enabled and attr .isOutput and hasSupportedExt :
13211321 return True
13221322 return False
1323+
1324+ def _countForLoop (self ):
1325+ """
1326+ Return in how many ForLoop nodes this node is.
1327+ """
1328+ count = 0
1329+ # Access to the input attributes of the node
1330+ for attr in self ._attributes :
1331+ if attr .isInput and attr .isLink :
1332+ # Access to the attribute connected to the input attribute
1333+ srcAttr = attr .getLinkParam ()
1334+ # If the srcAttr is a ListAttribute, it means that the node is in a ForLoop
1335+ if isinstance (srcAttr .root , ListAttribute ) and srcAttr .type == attr .type :
1336+ # Access the countForLoop of the node of the ListAttribute
1337+ count = srcAttr .root .node .countForLoop + 1
1338+ return count
1339+
13231340
13241341
13251342 name = Property (str , getName , constant = True )
@@ -1373,6 +1390,9 @@ def has3DOutputAttribute(self):
13731390 hasSequenceOutput = Property (bool , hasSequenceOutputAttribute , notify = outputAttrEnabledChanged )
13741391 has3DOutput = Property (bool , has3DOutputAttribute , notify = outputAttrEnabledChanged )
13751392
1393+ countForLoopChanged = Signal ()
1394+ countForLoop = Property (int , _countForLoop , notify = countForLoopChanged )
1395+
13761396class Node (BaseNode ):
13771397 """
13781398 A standard Graph node based on a node type.
0 commit comments