Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'archimesh')
-rw-r--r--archimesh/__init__.py4
-rw-r--r--archimesh/achm_gltools.py24
-rw-r--r--archimesh/achm_main_panel.py3
3 files changed, 16 insertions, 15 deletions
diff --git a/archimesh/__init__.py b/archimesh/__init__.py
index 261397f1..d79e02f7 100644
--- a/archimesh/__init__.py
+++ b/archimesh/__init__.py
@@ -11,8 +11,8 @@ bl_info = {
"name": "Archimesh",
"author": "Antonio Vazquez (antonioya)",
"location": "View3D > Add Mesh / Sidebar > Create Tab",
- "version": (1, 2, 2),
- "blender": (2, 80, 0),
+ "version": (1, 2, 3),
+ "blender": (3, 0, 0),
"description": "Generate rooms, doors, windows, and other architecture objects",
"doc_url": "{BLENDER_MANUAL_URL}/addons/add_mesh/archimesh.html",
"category": "Add Mesh"
diff --git a/archimesh/achm_gltools.py b/archimesh/achm_gltools.py
index de11226d..00160989 100644
--- a/archimesh/achm_gltools.py
+++ b/archimesh/achm_gltools.py
@@ -16,7 +16,6 @@ from mathutils import Vector
from bpy_extras import view3d_utils
from .achm_room_maker import get_wall_points
# GPU
-import bgl
import gpu
from gpu_extras.batch import batch_for_shader
@@ -39,7 +38,7 @@ def draw_main(context):
measure = scene.archimesh_gl_measure
dspname = scene.archimesh_gl_name
- bgl.glEnable(bgl.GL_BLEND)
+ gpu.state.blend_set('ALPHA')
# Display selected or all
if scene.archimesh_gl_ghost is False:
objlist = context.selected_objects
@@ -81,8 +80,8 @@ def draw_main(context):
# -----------------------
# restore opengl defaults
# -----------------------
- bgl.glLineWidth(1)
- bgl.glDisable(bgl.GL_BLEND)
+ gpu.state.line_width_set(1.0)
+ gpu.state.blend_set('NONE')
# -------------------------------------------------------------
@@ -175,8 +174,8 @@ def draw_room_data(myobj, op, region, rv3d, rgba, rgbaw, fsize, wfsize, space, m
screen_point_b2 = view3d_utils.location_3d_to_region_2d(region, rv3d, b2_s2)
# colour + line setup
- bgl.glEnable(bgl.GL_BLEND)
- bgl.glLineWidth(1)
+ gpu.state.blend_set('ALPHA')
+ gpu.state.line_width_set(1.0)
# --------------------------------
# Measures
# --------------------------------
@@ -284,8 +283,8 @@ def draw_door_data(myobj, op, region, rv3d, rgba, fsize, space, measure):
screen_point_ep3 = view3d_utils.location_3d_to_region_2d(region, rv3d, e_p3)
# colour + line setup
- bgl.glEnable(bgl.GL_BLEND)
- bgl.glLineWidth(1)
+ gpu.state.blend_set('ALPHA')
+ gpu.state.line_width_set(1.0)
# --------------------------------
# Measures
@@ -368,8 +367,8 @@ def draw_window_rail_data(myobj, op, region, rv3d, rgba, fsize, space, measure):
screen_point_tp3 = view3d_utils.location_3d_to_region_2d(region, rv3d, t_p3)
# colour + line setup
- bgl.glEnable(bgl.GL_BLEND)
- bgl.glLineWidth(1)
+ gpu.state.blend_set('ALPHA')
+ gpu.state.line_width_set(1.0)
# --------------------------------
# Measures
@@ -473,9 +472,10 @@ def draw_window_panel_data(myobj, op, region, rv3d, rgba, fsize, space, measure)
screen_point_gp3 = view3d_utils.location_3d_to_region_2d(region, rv3d, g_p3)
screen_point_gp4 = view3d_utils.location_3d_to_region_2d(region, rv3d, g_p4)
screen_point_gp5 = view3d_utils.location_3d_to_region_2d(region, rv3d, g_p5)
+
# colour + line setup
- bgl.glEnable(bgl.GL_BLEND)
- bgl.glLineWidth(1)
+ gpu.state.blend_set('ALPHA')
+ gpu.state.line_width_set(1.0)
# --------------------------------
# Measures
diff --git a/archimesh/achm_main_panel.py b/archimesh/achm_main_panel.py
index 97c7d19d..482e26fd 100644
--- a/archimesh/achm_main_panel.py
+++ b/archimesh/achm_main_panel.py
@@ -8,7 +8,6 @@
# noinspection PyUnresolvedReferences
import bpy
# noinspection PyUnresolvedReferences
-import bgl
from bpy.types import Operator, Panel, SpaceView3D
from math import sqrt, fabs, pi, asin
from .achm_tools import *
@@ -36,6 +35,7 @@ class ARCHIMESH_OT_Hole(Operator):
bl_label = "Auto Holes"
bl_description = "Enable windows and doors holes for any selected object (needs wall thickness)"
bl_category = 'View'
+ bl_options = {'UNDO', 'REGISTER'}
# ------------------------------
# Execute
@@ -170,6 +170,7 @@ class ARCHIMESH_OT_Pencil(Operator):
bl_label = "Room from Draw"
bl_description = "Create a room base on grease pencil strokes (draw from top view (7 key))"
bl_category = 'View'
+ bl_options = {'UNDO', 'REGISTER'}
# ------------------------------
# Execute