Skip to content

Commit

Permalink
Merge pull request #7 from soupday/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
soupday committed Jan 31, 2022
2 parents 65a74f1 + b7f20dc commit 42d04ce
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 9 additions & 3 deletions bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
Expand Down

0 comments on commit 42d04ce

Please sign in to comment.