Skip to content

Commit

Permalink
Fixed bevel modifier script error when Blender non-English language i…
Browse files Browse the repository at this point in the history
…s used and Translate New Data is enabled

Instead of creating a modifier then looking it up in the modifiers array
by name to set properties, now we new the modifier directly on the
object and use the return value to set desired properties instead.
  • Loading branch information
a1studmuffin committed Jun 21, 2016
1 parent 18af577 commit 6c38d4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spaceship_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,12 @@ def generate_spaceship(random_seed='',

# Add a fairly broad bevel modifier to angularize shape
if apply_bevel_modifier:
bpy.ops.object.modifier_add(type='BEVEL')
ob.modifiers["Bevel"].width = uniform(5, 20)
ob.modifiers["Bevel"].offset_type = 'PERCENT'
ob.modifiers["Bevel"].segments = 2
ob.modifiers["Bevel"].profile = 0.25
ob.modifiers["Bevel"].limit_method = 'NONE'
bevel_modifier = ob.modifiers.new('Bevel', 'BEVEL')
bevel_modifier.width = uniform(5, 20)
bevel_modifier.offset_type = 'PERCENT'
bevel_modifier.segments = 2
bevel_modifier.profile = 0.25
bevel_modifier.limit_method = 'NONE'

# Add materials to the spaceship
me = ob.data
Expand Down

0 comments on commit 6c38d4b

Please sign in to comment.