diff --git a/README.md b/README.md index f94921d..b4ae299 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,15 @@ https://youtu.be/RzVxKjc1AWU Currently requires CC3 Blender Tools version **1.1.6** [Link](https://github.com/soupday/cc3_blender_tools) +Links +===== +[CC3/iClone Blender Tools](https://github.com/soupday/cc3_blender_tools) +[CC3 Round-trip Import Plugin](https://github.com/soupday/CC3-Blender-Tools-Plugin) + ## Changelog +### 1.0.3 +- Fixed a crash invoking Baking operator from script. + ### 1.0.2 - Fixed a crash issue in Blender 2.93 when changing image file format. - Keeps and restores normal strength in baked materials. diff --git a/__init__.py b/__init__.py index 4bfaacf..93316a8 100644 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ bl_info = { "name": "CC3 Bake", "author": "Victor Soupday", - "version": (1, 0, 2), + "version": (1, 0, 3), "blender": (2, 80, 0), "category": "Character", "location": "3D View > Properties> CC3 Bake", diff --git a/bake.py b/bake.py index c6ada10..cbc8bcb 100644 --- a/bake.py +++ b/bake.py @@ -1248,8 +1248,11 @@ def bake_selected_objects(): # use mesh geometry this means we can bake the entirety of the textures with an even sampling. # go into wireframe mode: - shading = bpy.context.space_data.shading.type - bpy.context.space_data.shading.type = 'WIREFRAME' + try: + shading = bpy.context.space_data.shading.type + bpy.context.space_data.shading.type = 'WIREFRAME' + except: + pass # set cycles bake engine = bpy.context.scene.render.engine bpy.context.scene.render.engine = 'CYCLES' @@ -1267,7 +1270,10 @@ def bake_selected_objects(): bpy.data.objects.remove(bake_surface) bpy.context.scene.render.engine = engine - bpy.context.space_data.shading.type = shading + try: + bpy.context.space_data.shading.type = shading + except: + pass # restore selection utils.try_select_objects(objects, True)