Example #1
0
construction.camera_a_y = -0.46583
construction.camera_a_z = 0.29
construction.camera_fl = 40.
construction.camera_sensor_resolution = 19.9
construction.put()

# Deletes all block properties entries:
queries = [BlockProperties.all()]
for query in queries:
    for result in query:
        result.delete()

# Sets up the block properties (construction as parent is important so
# that the properties form one entity group with the construction,
# which is necessary when doing transactions):
blockProperties = BlockProperties(parent=construction)
blockProperties.data_version = '0'
blockProperties.has_2_fold_symmetry = False
blockProperties.pos_spacing_xy = 20.
blockProperties.pos_spacing_z = 10.
blockProperties.outline_bxy = '[[0, 0], [1, 0], [2, 1], [0, 1]]'
blockProperties.collision_offsets_list_bxy = \
    ['[[-1, 0], [0, 0], [1, 0]]',
     '[[0, 0], [1, 0], [0, -1], [1, -1]]',
     '[[0, 0], [1, 0]]',
     '[[0, 1], [1, 1], [0, 0], [1, 0]]']
blockProperties.attachment_offsets_list_b = \
    ['[[0, 0, -1], [0, 0, 1]]',
     '[[0, 0, -1], [0, 0, 1]]',
     '[[0, 0, -1], [0, 0, 1], [1, 0, -1], [1, 0, 1]]',
     '[[0, 0, -1], [0, 0, 1]]']