Changeset View
Changeset View
Standalone View
Standalone View
materials_utils/__init__.py
| Show First 20 Lines • Show All 2,500 Lines • ▼ Show 20 Lines | except Exception as e: | ||||
| print("\n[Materials Utils Specials]\nfunction: check_mat_name_unique\nError: %s \n" % e) | print("\n[Materials Utils Specials]\nfunction: check_mat_name_unique\nError: %s \n" % e) | ||||
| pass | pass | ||||
| return name_id | return name_id | ||||
| def included_object_types(objects): | def included_object_types(objects): | ||||
| # Pass the bpy.data.objects.type to avoid needless assigning/removing | # Pass the bpy.data.objects.type to avoid needless assigning/removing | ||||
| # included - type that can have materials | # included - type that can have materials | ||||
| included = ['MESH', 'CURVE', 'SURFACE', 'FONT', 'META'] | included = ['MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'GPENCIL'] | ||||
| obj = objects | obj = objects | ||||
| return bool(obj and obj in included) | return bool(obj and obj in included) | ||||
| def check_is_excluded_obj_types(contxt): | def check_is_excluded_obj_types(contxt): | ||||
| # pass the context to check if selected objects have excluded types | # pass the context to check if selected objects have excluded types | ||||
| if contxt and contxt.selected_editable_objects: | if contxt and contxt.selected_editable_objects: | ||||
| for obj in contxt.selected_editable_objects: | for obj in contxt.selected_editable_objects: | ||||
| ▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines | |||||