diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-29 23:10:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-29 23:23:41 +0300 |
commit | 18c9101acc58428fd02d6877c8b1c1711780826e (patch) | |
tree | 9eb13b07848b8ea724227cb63766fd26728496c7 | |
parent | 23284e4dde5e759d082e82d6cb666cb10f43e716 (diff) |
Templates: tweak sculpt to work w/o opensubdiv
-rw-r--r-- | release/scripts/startup/bl_app_templates_system/Sculpting/__init__.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_app_templates_system/Sculpting/__init__.py b/release/scripts/startup/bl_app_templates_system/Sculpting/__init__.py index 77f879addae..dc4eed8ef72 100644 --- a/release/scripts/startup/bl_app_templates_system/Sculpting/__init__.py +++ b/release/scripts/startup/bl_app_templates_system/Sculpting/__init__.py @@ -9,9 +9,14 @@ def load_handler(dummy): if bpy.data.filepath == "": # Apply subdivision modifier on startup bpy.ops.object.mode_set(mode='OBJECT') - bpy.ops.object.modifier_apply(modifier="Subdivision") - bpy.ops.object.mode_set(mode='EDIT') - bpy.ops.transform.tosphere(value=1.0) + if bpy.app.opensubdiv.supported: + bpy.ops.object.modifier_apply(modifier="Subdivision") + bpy.ops.object.mode_set(mode='EDIT') + bpy.ops.transform.tosphere(value=1.0) + else: + bpy.ops.object.modifier_remove(modifier="Subdivision") + bpy.ops.object.mode_set(mode='EDIT') + bpy.ops.mesh.subdivide(number_cuts=6, smoothness=1.0) bpy.ops.object.mode_set(mode='SCULPT') def register(): |