Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-29 23:10:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-29 23:23:41 +0300
commit18c9101acc58428fd02d6877c8b1c1711780826e (patch)
tree9eb13b07848b8ea724227cb63766fd26728496c7 /release/scripts/startup/bl_app_templates_system/Sculpting
parent23284e4dde5e759d082e82d6cb666cb10f43e716 (diff)
Templates: tweak sculpt to work w/o opensubdiv
Diffstat (limited to 'release/scripts/startup/bl_app_templates_system/Sculpting')
-rw-r--r--release/scripts/startup/bl_app_templates_system/Sculpting/__init__.py11
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():