Fixed bevel modifier script error when Blender non-English language is 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.
pull/17/head v0.1.1
Michael Davies 2016-06-21 14:56:20 +10:00
rodzic 18af577502
commit 6c38d4b2c9
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -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