Changeset View
Changeset View
Standalone View
Standalone View
space_view3d_display_tools/useless_tools.py
| Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | selected = BoolProperty( | ||||
| default=False | default=False | ||||
| ) | ) | ||||
| def execute(self, context): | def execute(self, context): | ||||
| errors = [] | errors = [] | ||||
| objects = bpy.context.selected_objects if self.selected else bpy.data.objects | objects = bpy.context.selected_objects if self.selected else bpy.data.objects | ||||
| for e in objects: | for e in objects: | ||||
| try: | try: | ||||
| if e.type not in {"LAMP", "CAMERA", "EMPTY"}: | if e.type not in {"LIGHT", "CAMERA", "EMPTY"}: | ||||
| e.modifiers['Subsurf'].show_viewport = self.show | e.modifiers['Subsurf'].show_viewport = self.show | ||||
| except Exception as k: | except Exception as k: | ||||
| name = getattr(e, "name", "Nameless") | name = getattr(e, "name", "Nameless") | ||||
| errors.append( | errors.append( | ||||
| "No subsurf on {} or it is not named Subsurf\nError: {}".format(name, k)) | "No subsurf on {} or it is not named Subsurf\nError: {}".format(name, k)) | ||||
| if errors: | if errors: | ||||
| error_handlers(self, "ut.subsurf_show_hide", errors, "Subsurf Show/Hide") | error_handlers(self, "ut.subsurf_show_hide", errors, "Subsurf Show/Hide") | ||||
| Show All 12 Lines | selected = BoolProperty( | ||||
| default=False | default=False | ||||
| ) | ) | ||||
| def execute(self, context): | def execute(self, context): | ||||
| errors = [] | errors = [] | ||||
| objects = bpy.context.selected_objects if self.selected else bpy.data.objects | objects = bpy.context.selected_objects if self.selected else bpy.data.objects | ||||
| for e in objects: | for e in objects: | ||||
| try: | try: | ||||
| if e.type not in {"LAMP", "CAMERA", "EMPTY"}: | if e.type not in {"LIGHT", "CAMERA", "EMPTY"}: | ||||
| e.modifiers['Subsurf'].show_only_control_edges = self.on | e.modifiers['Subsurf'].show_only_control_edges = self.on | ||||
| except Exception as k: | except Exception as k: | ||||
| name = getattr(e, "name", "Nameless") | name = getattr(e, "name", "Nameless") | ||||
| errors.append( | errors.append( | ||||
| "No subsurf on {} or it is not named Subsurf\nError: {}".format(name, k)) | "No subsurf on {} or it is not named Subsurf\nError: {}".format(name, k)) | ||||
| if errors: | if errors: | ||||
| error_handlers(self, "ut.optimaldisplay", errors, "Optimal Display") | error_handlers(self, "ut.optimaldisplay", errors, "Optimal Display") | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||