mirror of
https://github.com/drewcassidy/TexTools-Blender
synced 2024-09-01 14:54:44 +00:00
Add "only selected" option
This commit is contained in:
parent
04f3b0f091
commit
3677565a23
@ -874,8 +874,13 @@ class UI_PT_Panel_Bake(bpy.types.Panel):
|
|||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
|
row = col.row(align=True)
|
||||||
|
row.prop(context.scene.texToolsSettings, "bake_exclude_others", text="Only Selected")
|
||||||
|
|
||||||
|
#row = col.row(align=True)
|
||||||
|
#row.prop(context.scene.texToolsSettings, "bake_merge_object", text="Merge Selected")
|
||||||
|
|
||||||
|
|
||||||
# Collected Related Textures
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
|
@ -79,18 +79,11 @@ def store_bake_settings():
|
|||||||
|
|
||||||
settings.bake_objects_hide_render = []
|
settings.bake_objects_hide_render = []
|
||||||
|
|
||||||
# for obj in bpy.context.view_layer.objects:
|
if bpy.context.scene.texToolsSettings.bake_exclude_others:
|
||||||
# if obj.hide_render == False and obj not in objects_sets:
|
for obj in bpy.context.view_layer.objects:
|
||||||
# Check if layer is active:
|
if obj.hide_render == False and obj not in objects_sets:
|
||||||
# for l in range(0, len(obj.layers)):
|
settings.bake_objects_hide_render.append(obj)
|
||||||
# if obj.layers[l] and bpy.context.scene.layers[l]:
|
obj.hide_render = True;
|
||||||
# settings.bake_objects_hide_render.append(obj)
|
|
||||||
# break #sav
|
|
||||||
|
|
||||||
for obj in settings.bake_objects_hide_render:
|
|
||||||
obj.hide_render = True
|
|
||||||
# obj.cycles_visibility.shadow = False
|
|
||||||
|
|
||||||
|
|
||||||
def restore_bake_settings():
|
def restore_bake_settings():
|
||||||
# Render Settings
|
# Render Settings
|
||||||
@ -103,7 +96,6 @@ def restore_bake_settings():
|
|||||||
for obj in settings.bake_objects_hide_render:
|
for obj in settings.bake_objects_hide_render:
|
||||||
if obj:
|
if obj:
|
||||||
obj.hide_render = False
|
obj.hide_render = False
|
||||||
# obj.cycles_visibility.shadow = True
|
|
||||||
|
|
||||||
|
|
||||||
stored_materials = {}
|
stored_materials = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user