Skip to content

Commit

Permalink
Update for fix to misnamed keyword arguments in Blender 3.0.
Browse files Browse the repository at this point in the history
Unfortunately this is not backward-compatible with pre-3.0 Blender.
  • Loading branch information
Lawrence D'Oliveiro committed Dec 18, 2021
1 parent fba9cf6 commit 734d05a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
"name" : "Spaceship Generator",
"author" : "Michael Davies, Lawrence D'Oliveiro",
"version" : (1, 6, 2),
"blender" : (2, 82, 0),
"version" : (1, 6, 3),
"blender" : (3, 0, 0),
"location" : "View3D > Add > Mesh",
"description" : "Procedurally generate 3D spaceships from a random seed.",
"wiki_url" : "https://github.com/a1studmuffin/SpaceshipGenerator/blob/master/README.md",
Expand Down
48 changes: 24 additions & 24 deletions spaceship_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,8 @@ def add_cylinders_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = num_segments,
diameter1 = cylinder_size,
diameter2 = cylinder_size,
radius1 = cylinder_size,
radius2 = cylinder_size,
depth = cylinder_depth,
matrix = cylinder_matrix
)
Expand Down Expand Up @@ -807,8 +807,8 @@ def add_weapons_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = num_segments,
diameter1 = weapon_size * 0.9,
diameter2 = weapon_size,
radius1 = weapon_size * 0.9,
radius2 = weapon_size,
depth = weapon_depth,
matrix = face_matrix
)
Expand All @@ -819,8 +819,8 @@ def add_weapons_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = num_segments,
diameter1 = weapon_size * 0.6,
diameter2 = weapon_size * 0.5,
radius1 = weapon_size * 0.6,
radius2 = weapon_size * 0.5,
depth = weapon_depth * 2,
matrix =
face_matrix
Expand All @@ -836,8 +836,8 @@ def add_weapons_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = num_segments,
diameter1 = weapon_size * 0.5,
diameter2 = weapon_size * 0.6,
radius1 = weapon_size * 0.5,
radius2 = weapon_size * 0.6,
depth = weapon_depth * 2,
matrix =
face_matrix
Expand All @@ -862,8 +862,8 @@ def add_weapons_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = 8,
diameter1 = weapon_size * 0.4,
diameter2 = weapon_size * 0.4,
radius1 = weapon_size * 0.4,
radius2 = weapon_size * 0.4,
depth = weapon_depth * 5,
matrix = turret_house_mat
)
Expand All @@ -874,8 +874,8 @@ def add_weapons_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = 8,
diameter1 = weapon_size * 0.1,
diameter2 = weapon_size * 0.1,
radius1 = weapon_size * 0.1,
radius2 = weapon_size * 0.1,
depth = weapon_depth * 6,
matrix =
turret_house_mat
Expand All @@ -888,8 +888,8 @@ def add_weapons_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = 8,
diameter1 = weapon_size * 0.1,
diameter2 = weapon_size * 0.1,
radius1 = weapon_size * 0.1,
radius2 = weapon_size * 0.1,
depth = weapon_depth * 6,
matrix =
turret_house_mat
Expand All @@ -916,7 +916,7 @@ def add_sphere_to_face(bm, face) :
(
bm,
subdivisions = 3,
diameter = sphere_size,
radius = sphere_size,
matrix = sphere_matrix
)
for vert in result["verts"] :
Expand Down Expand Up @@ -950,7 +950,7 @@ def add_surface_antenna_to_face(bm, face) :
face_size = math.sqrt(face.calc_area())
depth = geom_random.uniform(0.1, 1.5) * face_size
depth_short = depth * geom_random.uniform(0.02, 0.15)
base_diameter = geom_random.uniform(0.005, 0.05)
base_radius = geom_random.uniform(0.005, 0.05)
material_index = MATERIAL.HULL_METALLIC

# Spire
Expand All @@ -961,8 +961,8 @@ def add_surface_antenna_to_face(bm, face) :
cap_ends = False,
cap_tris = False,
segments = num_segments,
diameter1 = 0,
diameter2 = base_diameter,
radius1 = 0,
radius2 = base_radius,
depth = depth,
matrix = get_face_matrix(face, pos + face.normal * depth * 0.5)
)
Expand All @@ -979,8 +979,8 @@ def add_surface_antenna_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = num_segments,
diameter1 = base_diameter * geom_random.uniform(1, 1.5),
diameter2 = base_diameter * geom_random.uniform(1.5, 2),
radius1 = base_radius * geom_random.uniform(1, 1.5),
radius2 = base_radius * geom_random.uniform(1.5, 2),
depth = depth_short,
matrix = get_face_matrix(face, pos + face.normal * depth_short * 0.45)
)
Expand All @@ -1007,8 +1007,8 @@ def add_disc_to_face(bm, face) :
cap_ends = True,
cap_tris = False,
segments = 32,
diameter1 = depth * 3,
diameter2 = depth * 4,
radius1 = depth * 3,
radius2 = depth * 4,
depth=depth,
matrix = get_face_matrix(face, face.calc_center_bounds() + face.normal * depth * 0.5)
)
Expand All @@ -1018,8 +1018,8 @@ def add_disc_to_face(bm, face) :
cap_ends = False,
cap_tris = False,
segments = 32,
diameter1 = depth * 1.25,
diameter2 = depth * 2.25,
radius1 = depth * 1.25,
radius2 = depth * 2.25,
depth = 0.0,
matrix = get_face_matrix(face, face.calc_center_bounds() + face.normal * depth * 1.05)
)
Expand Down

0 comments on commit 734d05a

Please sign in to comment.