Download Version 2.0: jj_bgsnap.py

Introduction

JJ_bgsnap.py will snap points on foreground layers to the nearest point on background layers. It's very similar to the old Lightwave tool BG_Conform.

  • Works with poly, edge and vert selections or all components of a layer if nothing is selected.
  • It works across multiple foreground and background layers - whatever is in the foreground gets snapped to the nearest point in the background irrespective of layer.
  • It works with any and all item transforms applied to layers (scale, rotate, translate).
  • It retains all the selections you've set

Edge to Background
Here the points of the selected edges are 'snapped' to the nearest background points.



Polys to Background
Here the points of the selected polys are 'snapped' to the neares background points.

Useful for cleaning up rough alignment
Here you can see how the script is working - verts are just pushed to the position of the nearest bg vert.


Works across layers and with any item transforms applied..
These three items are set to different positions using the item move tool and they're on different layers. The script will iterate across layers in both the background and foreground assuming that you want all foreground geometry snapped to all background geometry (as though you have a single foreground and single background layer).

One warning, though, because this script is iterating over many layers and compensating for numerous item transforms it can take some time. This one took about 8s.


Note on Speed
As noted, the script has been designed to compensate for any item transforms on the foreground or background layers. This compensation accounts for about 80% of the code and has an impact on speed especially with large component counts. Version 1.0 of this script (called jj_bgconform.py) only works on a single foreground and background layer and will not do any of this compensation but will be much quicker. Given that it's not the sort of task you'd tend to perform very frequently with large component counts, I'm not sure that this is a big problem. Anyway, you can download jj_bgconform.py below.


Versions

Version 2.0:
jj_bgsnap.py
- Original released version 21.06.2006

Version 1.0: jj_bgconform.py
- Original released version 13.06.2006


Julian Johnson
julian@exch.demon.co.uk