ID 533044 - Group Input/Output ports are not shown in the correct order if the nodes are created via Python

Follow

Problem summary
Group Input/Output ports are not shown in the correct order if the nodes are created via Python
 
Customer reported version
n/a
 
Customer reported platform
n/a
 
Steps to reproduce
 
1) Open the Node Graph palette

2) Run the following script in the Python Console:
 

current_ng = mari.geo.current().nodeGraph() group = current_ng.createNode("Misc/Group") child_ng = group.childNodeGraph() for i in range(10):     child_ng.createNode("Misc/Output")     child_ng.createNode("Misc/Input") 
 
3) Check the port order of the Group node that is created
 
Expected behaviour
A Group node should be created with Input and Output ports in the order of their vertical positions in the Group's child Node Graph
 
Actual behaviour
The port for the most recently created Input or Output node is always at the top of the Group node (except for the default Output node):
 
 

 
Workaround
Setting Input and Output nodes' positions to their current positions after creation seems to fix the port ordering, e.g.:
 
position = Node.nodeGraphPosition() Node.setNodeGraphPosition(position)
 
Reproduced by support
This bug has been reproduced in:
Mari 6.0v1 - Windows 10 - CentOS 7.9
Mari 4.7v1 - Windows 10 - CentOS 7.9
 
Unable to reproduce bug in:
Mari 4.6v4 - Windows 10 - CentOS 7.9 -  regression
 
Earliest version tested
Mari 4.6v4 - This issue doesn't appear in this version and has regressed
 

    We're sorry to hear that

    Please tell us why