Changeset View
Changeset View
Standalone View
Standalone View
mesh_custom_normals_tools.py
| Show All 15 Lines | |||||
| # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| # | # | ||||
| # ***** END GPL LICENCE BLOCK ***** | # ***** END GPL LICENCE BLOCK ***** | ||||
| bl_info = { | bl_info = { | ||||
| "name": "Custom Normals Tools", | "name": "Custom Normals Tools", | ||||
| "author": "Bastien Montagne (mont29)", | "author": "Bastien Montagne (mont29)", | ||||
| "version": (0, 0, 1), | "version": (0, 0, 1), | ||||
| "blender": (2, 75, 0), | "blender": (2, 80, 0), | ||||
| "location": "3DView > Tools", | "location": "3DView > Tools", | ||||
| "description": "Various tools/helpers for custom normals", | "description": "Various tools/helpers for custom normals", | ||||
| "warning": "", | "warning": "", | ||||
| "support": 'OFFICIAL', | "support": 'OFFICIAL', | ||||
| "category": "Mesh", | "category": "Mesh", | ||||
| } | } | ||||
| Show All 33 Lines | def execute(self, context): | ||||
| clnors[ls:le] = reversed(clnors[ls:le]) | clnors[ls:le] = reversed(clnors[ls:le]) | ||||
| me.normals_split_custom_set(clnors) | me.normals_split_custom_set(clnors) | ||||
| context.scene.update() | context.scene.update() | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| def flip_custom_normals_draw_func(self, context): | def flip_custom_normals_draw_func(self, context): | ||||
| if isinstance(self, bpy.types.Panel): | |||||
| self.layout.label("Custom Normal Tools:") | |||||
| self.layout.operator(MESH_OT_flip_custom_normals.bl_idname) | self.layout.operator(MESH_OT_flip_custom_normals.bl_idname) | ||||
| def register(): | def register(): | ||||
| bpy.utils.register_module(__name__) | bpy.utils.register_class(MESH_OT_flip_custom_normals) | ||||
| bpy.types.VIEW3D_PT_tools_object.append(flip_custom_normals_draw_func) | bpy.types.VIEW3D_MT_object.append(flip_custom_normals_draw_func) | ||||
| def unregister(): | def unregister(): | ||||
| bpy.types.VIEW3D_PT_tools_object.remove(flip_custom_normals_draw_func) | bpy.types.VIEW3D_MT_object.remove(flip_custom_normals_draw_func) | ||||
| bpy.utils.unregister_module(__name__) | bpy.utils.unregister_class(MESH_OT_flip_custom_normals) | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| register() | register() | ||||