GafferHQ / gaffer

Gaffer is a node-based application for lookdev, lighting and automation
http://www.gafferhq.org
BSD 3-Clause "New" or "Revised" License
945 stars 205 forks source link

Add method and hotkey to 'align' nodes in NodeGraph editor #155

Open bentoogood opened 11 years ago

bentoogood commented 11 years ago

With a set of nodes selected, calling the function should do something along the lines of

if nodes are connected:
  for node in nodes:
     if node type is Shader:
        align node horizontally with input and output connections
     if node type is not Shader:
        align node vertically with input and output connections
else:
   layout nodes horizontally aligned
johnhaddon commented 11 years ago

Note that the node type should be totally irrelevant to the implementation of this feature. Instead NodeGadget::noduleTangent() should be used to determine the appropriate axis for alignment.

johnhaddon commented 10 years ago

Is this actually any different to #638? If #638 allows the layout of only the selected nodes (with the others staying put) and lays out unconnected nodes horizontally anyway, will that cover this ticket too?

andrewkaufman commented 10 years ago

As far as I'm concerned. Ben might have more in mind?

bentoogood commented 10 years ago

I guess it depends on how the algorithm likes to layout nodes. If it has a notion of the direction of flow based on the plug orientation sounds fine.