[Bf-python] test oops python script.

Campbell Barton cbarton at metavr.com
Sat Aug 7 05:46:34 CEST 2004


This script is for arranging selected objetcs in the oops view. This 
works in tuhopuu2 only.

Ill add sorting by name then type later on,


# Arrange objects in a row

from Blender import *

# Space the placement of oops blocks in the oops view
xspace = 5.0; yspace = 1.8

maxrow=100 # Max rows/cols before moving onto the next row.colum.

allign = 1 # 1:vert/0:hoz

origx, origy = Object.GetSelected()[0].oopsloc
x = y = 0
for ob in Object.GetSelected()[1:]:
  if allign: # Verticle
    if yspace *maxrow < y: x += xspace; y = 0
    else: y+= yspace

  else:
    if xspace *maxrow < x: y += xspace; x = 0
    else: x+= xspace   

  ob.oopsloc = (x+origx,y+origy)




More information about the Bf-python mailing list