add warning and place the relevent var on top

(posted from gitea)
This commit is contained in:
whosit 2024-02-01 10:36:48 +00:00
parent 6221c44836
commit 4c116ee89e

View File

@ -1,5 +1,13 @@
WRITE_LUA = True
# WARNING: running this file will directly modify .lua and .b3d files
# without creating backups. Running it again will _accumulate_ shift
# in b3d files (if there's any change in lua part).
# where the origin should be put between top and bottom of the box
RATIO = 2/3
WRITE_LUA = True
import os.path
import re
@ -12,7 +20,7 @@ def fix_box_coords(p1, p2):
p1 = copy.copy(p1)
p2 = copy.copy(p2)
height = p2[1] - p1[1]
ratio = 2/3
ratio = RATIO
#shift = p1 - ()
shift = -height * ratio - p1[1]
shift = round_to_base(shift, prec=2, base=0.05)