From cd26c938e597d7493f3d88dfdf69346c0f8b50ee Mon Sep 17 00:00:00 2001 From: Brendon Murphy <meta.androcto1@gmail.com> Date: Sat, 26 Sep 2015 21:53:10 +1000 Subject: [PATCH] fix for T46265 revert to 3d view operator --- curve_simplify.py | 57 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/curve_simplify.py b/curve_simplify.py index d77c3bd04..4ed3a5b3c 100644 --- a/curve_simplify.py +++ b/curve_simplify.py @@ -19,8 +19,8 @@ bl_info = { "name": "Simplify Curves", "author": "testscreenings", - "version": (1,), - "blender": (2, 59, 0), + "version": (1, 0, 1), + "blender": (2, 75, 0), "location": "Search > Simplify Curves", "description": "Simplifies 3D Curve objects and animation F-Curves", "warning": "", @@ -39,32 +39,9 @@ from bpy.props import * import mathutils import math -from bpy.types import Header, Menu +from bpy.types import Menu -class GraphPanel(Header): - bl_space_type = "GRAPH_EDITOR" - def draw(self, context): - layout = self.layout - - def invoke(self, context, event): - context.window_manager.invoke_props_dialog(self) - return {"RUNNING_MODAL"} - -def menu_func(self, context): - self.layout.operator(GRAPH_OT_simplify.bl_idname) - -class CurveMenu(Menu): - bl_space_type = "3D_VIEW" - bl_label = "Simplify Curves" - def draw(self, context): - layout = self.layout - def invoke(self, context, event): - context.window_manager.invoke_props_dialog(self) - return {"RUNNING_MODAL"} - -def menu(self, context): - self.layout.operator("curve.simplify", text="Curve Simplify", icon="CURVE_DATA") ## Check for curve ############################## @@ -385,6 +362,28 @@ def fcurves_simplify(context, obj, options, fcurves): #fcurve.points.foreach_set('co', newPoints) return +### MENU ### + +class GRAPH_OT_simplifyf(bpy.types.Menu): + bl_space_type = "GRAPH_EDITOR" + bl_label = "Simplify F Curves" + + def draw(self, context): + layout = self.layout + +def menu_func(self, context): + self.layout.operator(GRAPH_OT_simplify.bl_idname) + +class CurveMenu(Menu): + bl_space_type = "3D_VIEW" + bl_label = "Simplify Curves" + + def draw(self, context): + layout = self.layout + +def menu(self, context): + self.layout.operator("curve.simplify", text="Curve Simplify", icon="CURVE_DATA") + ################################################# #### ANIMATION CURVES OPERATOR ################## ################################################# @@ -489,8 +488,7 @@ class GRAPH_OT_simplify(bpy.types.Operator): #print("-------END-------") return {'FINISHED'} - def invoke(self, context, event): - return context.window_manager.invoke_popup(self, width = 100) + ########################### ##### Curves OPERATOR ##### ########################### @@ -626,8 +624,9 @@ def unregister(): bpy.types.GRAPH_MT_channel.remove(menu_func) bpy.types.DOPESHEET_MT_channel.remove(menu_func) bpy.types.INFO_MT_curve_add.remove(menu) - bpy.utils.unregister_module(__name__) + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() + -- GitLab