Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- import math
- p_type = ['D_STAIR','S_LANDING','C_LANDING','S_LANDING','C_LANDING','S_LANDING']
- p_shape = ['CIRCLE','CIRCLE','RECTANGLE','CIRCLE','RECTANGLE','CIRCLE']
- p_radius = [2,2,2,2,1,2]
- p_angle = [3.14159,1,1.5708,1,1.5708,1]
- p_length = [1,0.5,1,1,1,1.5]
- parts = 24-4
- height = math.ceil(parts/6)*2.5
- d = bpy.context.object.data.StairProperty[0]
- d.presets = 'STAIR_USER'
- d.height = height
- #post
- d.left_post = True
- d.right_post = True
- d.post_spacing = 0.8
- d.post_y = 0.04
- d.post_x = 0.04
- d.post_z = 1
- d.post_offset_x = 0.02
- #subs
- d.left_subs = True
- d.right_subs = True
- d.subs_spacing = 0.3
- d.subs_y = 0.02
- d.subs_x = 0.02
- d.subs_z = 1
- #handrail
- d.left_handrail = True
- d.right_handrail = True
- d.handrail_alt = 1
- d.handrail_extend = 0.1
- #panel
- d.right_panel = True
- d.left_panel = True
- d.panel_dist = 0.05
- d.panel_x = 0.01
- d.panel_z = 0.6
- d.panel_alt = 0.33
- #rails 1
- d.right_rail = True
- d.left_rail = True
- d.rail_z[0] = 0.01
- d.rail_x[0] = 0.01
- d.rail_alt[0] = 0.33
- #rails 2
- d.rail_z[1] = 0.01
- d.rail_x[1] = 0.01
- d.rail_alt[1] = 0.93
- d.n_parts = parts
- c = 0
- for i in range(0,parts):
- d.parts[i].type = p_type[c]
- if p_type[c] == p_type[0]:
- d.parts[i].left_shape = 'CIRCLE'
- d.parts[i].right_shape = 'CIRCLE'
- d.parts[i].radius = p_radius[c]
- elif p_type[c] == p_type[2]:
- d.parts[i].left_shape = 'RECTANGLE'
- d.parts[i].right_shape = 'RECTANGLE'
- d.parts[i].radius = p_radius[c]
- d.parts[i].da = p_angle[c]
- d.parts[i].length = p_length[c]
- c += 1
- if c == 6:
- c = 0
- print ("c:",c,i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement