mirror of
https://github.com/drewcassidy/TexTools-Blender
synced 2024-09-01 14:54:44 +00:00
Fix texture preview in Workbench
This commit is contained in:
parent
204f5991a0
commit
22e7aa72b7
@ -65,6 +65,7 @@ def preview_texture(self, context):
|
||||
break
|
||||
|
||||
if image:
|
||||
material = utilities_bake.get_image_material(image)
|
||||
for obj in objects:
|
||||
print("Map {}".format(obj.name))
|
||||
|
||||
@ -78,8 +79,7 @@ def preview_texture(self, context):
|
||||
|
||||
# Create material with image
|
||||
bpy.ops.object.material_slot_add()
|
||||
obj.material_slots[0].material = utilities_bake.get_image_material(
|
||||
image)
|
||||
obj.material_slots[0].material = material
|
||||
obj.display_type = 'TEXTURED'
|
||||
|
||||
# Re-Select objects
|
||||
@ -91,6 +91,10 @@ def preview_texture(self, context):
|
||||
# Change View mode to TEXTURED
|
||||
for space in view_area.spaces:
|
||||
if space.type == 'VIEW_3D':
|
||||
if bpy.context.scene.render.engine == 'BLENDER_WORKBENCH':
|
||||
space.shading.type = 'SOLID'
|
||||
space.shading.color_type = 'TEXTURE'
|
||||
else:
|
||||
space.shading.type = 'MATERIAL'
|
||||
|
||||
# Enter local view
|
||||
|
Loading…
Reference in New Issue
Block a user