Changeset View
Changeset View
Standalone View
Standalone View
materials_utils/warning_messages_utils.py
| Context not available. | |||||
| gramma_s, gramma_p = " - has ", " - have " | gramma_s, gramma_p = " - has ", " - have " | ||||
| if is_mat: | if is_mat: | ||||
| if is_mat in ('MAT'): | if is_mat in 'MAT': | ||||
| gramma_s, gramma_p = " - Material has ", " - Materials have " | gramma_s, gramma_p = " - Material has ", " - Materials have " | ||||
| elif is_mat in ('TEX'): | elif is_mat in 'TEX': | ||||
| gramma_s, gramma_p = " - Texture has ", " - Textures have " | gramma_s, gramma_p = " - Texture has ", " - Textures have " | ||||
| elif is_mat in ('FILE'): | elif is_mat in 'FILE': | ||||
| gramma_s, gramma_p = " - File ", " - Files " | gramma_s, gramma_p = " - File ", " - Files " | ||||
| # print the whole list in the console if abbreviated | # print the whole list in the console if abbreviated | ||||
| Context not available. | |||||
| obj_size = len(object_name) | obj_size = len(object_name) | ||||
| # compare string list size | # compare string list size | ||||
| if (1 < obj_size <= MAX_COUNT): | if 1 < obj_size <= MAX_COUNT: | ||||
| obj_name = "{}{}".format(obj_name, gramma_p) | obj_name = "{}{}".format(obj_name, gramma_p) | ||||
| elif (obj_size > MAX_COUNT): | elif obj_size > MAX_COUNT: | ||||
| abbrevation = ("(Multiple)" if is_mat else "(Multiple Objects)") | abbrevation = ("(Multiple)" if is_mat else "(Multiple Objects)") | ||||
| obj_size_big = True | obj_size_big = True | ||||
| obj_name = "{}{}".format(abbrevation, gramma_p) | obj_name = "{}{}".format(abbrevation, gramma_p) | ||||
| elif (obj_size == 1): | elif obj_size == 1: | ||||
| obj_name = "{}{}".format(obj_name, gramma_s) | obj_name = "{}{}".format(obj_name, gramma_s) | ||||
| else: | else: | ||||
| obj_name = "{}{}".format(object_name, gramma_s) | obj_name = "{}{}".format(object_name, gramma_s) | ||||
| Context not available. | |||||
| def c_is_cycles_addon_enabled(): | def c_is_cycles_addon_enabled(): | ||||
| # checks if Cycles is enabled | # checks if Cycles is enabled | ||||
| # thanks to ideasman42 | # thanks to ideasman42 | ||||
| return ('cycles' in bpy.context.user_preferences.addons.keys()) | return 'cycles' in bpy.context.user_preferences.addons.keys() | ||||
| def c_data_has_materials(): | def c_data_has_materials(): | ||||
| # check for material presence in data | # check for material presence in data | ||||
| return (len(bpy.data.materials) > 0) | return len(bpy.data.materials) > 0 | ||||
| def c_data_has_images(): | def c_data_has_images(): | ||||
| # check for image presence in data | # check for image presence in data | ||||
| return (len(bpy.data.images) > 0) | return len(bpy.data.images) > 0 | ||||
| def register(): | def register(): | ||||
| Context not available. | |||||