All pastes #218962 Raw Edit

Someone

public text v1 · immutable
#218962 ·published 2006-10-24 13:10 UTC
rendered paste body
!/usr/bin/python
# created Tue Oct 24 10:56:15 2006

from fd.world.land import TileModel
# local cerealizer
# saveable User [<class 'fd.world.user.User'>]
# saveable TileModel [<class 'fd.world.land.TileModel'>]
# saveable TileTexture [<class 'fd.world.land.TileTexture'>]
# saveable Patch [<class 'fd.world.land.Patch'>]
t =
#   File "<console>", line 1
#     t =
#         ^
# SyntaxError: invalid syntax
t = TileModel.loadFromDisk('wall0')
t.verts
# [(1.0, 0.0, 0.40000003576278687), (1.0, 0.0, -0.39999997615814209), (-1.0000002384185791, 0.0, -0.39999985694885254), (-0.99999964237213135, 0.0, 0.40000021457672119), (-0.99999964237213135, 1.0, 0.40000021457672119), (-1.0000002384185791, 1.0, -0.39999985694885254), (1.0, 1.0, -0.39999997615814209), (1.0, 1.0, 0.40000003576278687)]
nv = []
for x,y,z in t.verts:
    nv.append((x/2, y/2, z/2))

nv
# [(0.5, 0.0, 0.20000001788139343), (0.5, 0.0, -0.19999998807907104), (-0.50000011920928955, 0.0, -0.19999992847442627), (-0.49999982118606567, 0.0, 0.2000001072883606), (-0.49999982118606567, 0.5, 0.2000001072883606), (-0.50000011920928955, 0.5, -0.19999992847442627), (0.5, 0.5, -0.19999998807907104), (0.5, 0.5, 0.20000001788139343)]
t.verts = nv
t.saveToDisk()
# Traceback (most recent call last):
#   File "<console>", line 1, in ?
# AttributeError: 'TileModel' object has no attribute 'saveToDisk'
t.save()
# saving TileModel/wall0