Changeset View
Changeset View
Standalone View
Standalone View
materials_utils/materials_cycles_converter.py
| Context not available. | |||||
| # switch temporarily to 'IMAGE EDITOR', other approaches are not reliable | # switch temporarily to 'IMAGE EDITOR', other approaches are not reliable | ||||
| check_area = False | check_area = False | ||||
| store_area = bpy.context.area.type | store_area = bpy.context.area.type | ||||
| collect_report("INFO: Temporarly switching context to Image Editor") | collect_report("INFO: Temporarily switching context to Image Editor") | ||||
| try: | try: | ||||
| bpy.context.area.type = 'IMAGE_EDITOR' | bpy.context.area.type = 'IMAGE_EDITOR' | ||||
| bpy.context.area.spaces[0].image = bpy.data.images["TMP_BAKING"] | bpy.context.area.spaces[0].image = bpy.data.images["TMP_BAKING"] | ||||
| Context not available. | |||||
| def AutoNodeInitiate(active=False, operator=None): | def AutoNodeInitiate(active=False, operator=None): | ||||
| # Checks with bpy.ops.material.check_converter_path | # Checks with bpy.ops.material.check_converter_path | ||||
| # if it's possible to write in the output path | # if it's possible to write in the output path | ||||
| # if it passes procedes with calling AutoNode | # if it passes proceeds with calling AutoNode | ||||
| # if CheckImagePath(operator): | # if CheckImagePath(operator): | ||||
| check_path = bpy.ops.material.check_converter_path() | check_path = bpy.ops.material.check_converter_path() | ||||
| Context not available. | |||||
| tex_node_collect.append(shtext) | tex_node_collect.append(shtext) | ||||
| sT = True | sT = True | ||||
| else: | else: | ||||
| collect_report("ERROR: A problem occured with loading an image for {} " | collect_report("ERROR: A problem occurred with loading an image for {} " | ||||
| "(possibly missing)".format(tex.texture.name)) | "(possibly missing)".format(tex.texture.name)) | ||||
| else: | else: | ||||
| if sc.mat_specials.EXTRACT_PTEX or (sc.mat_specials.EXTRACT_ALPHA and ma_alpha): | if sc.mat_specials.EXTRACT_PTEX or (sc.mat_specials.EXTRACT_ALPHA and ma_alpha): | ||||
| Context not available. | |||||