Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #7

Merged
merged 2 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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