[Bf-blender-cvs] [18c9101acc5] blender2.8: Templates: tweak sculpt to work w/o opensubdiv
Campbell Barton
noreply at git.blender.org
Thu Nov 29 21:43:06 CET 2018
Commit: 18c9101acc58428fd02d6877c8b1c1711780826e
Author: Campbell Barton
Date: Fri Nov 30 07:10:52 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB18c9101acc58428fd02d6877c8b1c1711780826e
Templates: tweak sculpt to work w/o opensubdiv
===================================================================
M release/scripts/startup/bl_app_templates_system/Sculpting/__init__.py
===================================================================
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():
More information about the Bf-blender-cvs
mailing list