[Bf-extensions-cvs] [2b6424df] master: xedit: more code updates for 2.80
NBurn
noreply at git.blender.org
Fri Mar 29 02:59:46 CET 2019
Commit: 2b6424df6da80037a277169f4d838ad61d78f3b8
Author: NBurn
Date: Thu Mar 28 21:59:21 2019 -0400
Branches: master
https://developer.blender.org/rBAC2b6424df6da80037a277169f4d838ad61d78f3b8
xedit: more code updates for 2.80
===================================================================
M exact_edit/__init__.py
M exact_edit/xedit_set_meas.py
===================================================================
diff --git a/exact_edit/__init__.py b/exact_edit/__init__.py
index e070b30d..bdde4af9 100644
--- a/exact_edit/__init__.py
+++ b/exact_edit/__init__.py
@@ -41,11 +41,11 @@ import bpy
class XEditPanel(bpy.types.Panel):
- # Creates a panel in the 3d view Toolshelf window
+ # Creates a panel in the 3d view N Panel
bl_label = 'Exact Edit'
bl_idname = 'xedit_base_panel'
bl_space_type = 'VIEW_3D'
- bl_region_type = 'TOOLS'
+ bl_region_type = 'UI'
#bl_context = 'objectmode'
bl_category = 'Tools'
@@ -57,19 +57,38 @@ class XEditPanel(bpy.types.Panel):
col.operator("view3d.xedit_free_rotate_op", text="Free Rotate", icon="FORCE_MAGNETIC")
+classes = (
+ xedit_set_meas.XEditStoreMeasBtn,
+ xedit_set_meas.XEditMeasureInputPanel,
+ xedit_set_meas.XEditSetMeas,
+ xedit_free_rotate.XEditFreeRotate,
+ XEditPanel
+)
+
+
def register():
+ for c in classes:
+ bpy.utils.register_class(c)
+ #
+ '''
bpy.utils.register_class(xedit_set_meas.XEditStoreMeasBtn)
bpy.utils.register_class(xedit_set_meas.XEditMeasureInputPanel)
bpy.utils.register_class(xedit_set_meas.XEditSetMeas)
bpy.utils.register_class(xedit_free_rotate.XEditFreeRotate)
bpy.utils.register_class(XEditPanel)
+ '''
def unregister():
+ for c in reversed(classes):
+ bpy.utils.unregister_class(c)
+ #
+ '''
bpy.utils.unregister_class(xedit_set_meas.XEditStoreMeasBtn)
bpy.utils.unregister_class(xedit_set_meas.XEditMeasureInputPanel)
bpy.utils.unregister_class(xedit_set_meas.XEditSetMeas)
bpy.utils.unregister_class(xedit_free_rotate.XEditFreeRotate)
bpy.utils.unregister_class(XEditPanel)
+ '''
if __name__ == "__main__":
register()
diff --git a/exact_edit/xedit_set_meas.py b/exact_edit/xedit_set_meas.py
index f7cdd20f..46bf8150 100644
--- a/exact_edit/xedit_set_meas.py
+++ b/exact_edit/xedit_set_meas.py
@@ -251,8 +251,9 @@ class MenuHandler:
bgl.glVertex2f(*p)
bgl.glEnd()
'''
+ indices = ((0, 1), (1, 2), (2, 0))
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
- batch = batch_for_shader(shader, 'LINES', {"pos": menu.arrows[menu.active]})
+ batch = batch_for_shader(shader, 'LINES', {"pos": menu.arrows[menu.active]}, indices=indices)
shader.bind()
shader.uniform_float("color", self.act_colr)
batch.draw(shader)
@@ -437,8 +438,9 @@ class ViewButton():
bgl.glVertex2f(self.coords[0][0], self.coords[0][1])
bgl.glEnd()
'''
+ indices = ((0, 1), (1, 2), (2, 3), (3, 0))
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
- batch = batch_for_shader(shader, 'LINES', {"pos": self.coords})
+ batch = batch_for_shader(shader, 'LINES', {"pos": self.coords}, indices=indices)
shader.bind()
shader.uniform_float("color", colr)
batch.draw(shader)
More information about the Bf-extensions-cvs
mailing list