Changeset View
Changeset View
Standalone View
Standalone View
mesh_bsurfaces.py
| # SPDX-License-Identifier: GPL-2.0-or-later | # SPDX-License-Identifier: GPL-2.0-or-later | ||||
| bl_info = { | bl_info = { | ||||
| "name": "Bsurfaces GPL Edition", | "name": "Bsurfaces GPL Edition", | ||||
| "author": "Eclectiel, Vladimir Spivak (cwolf3d)", | "author": "Eclectiel, Vladimir Spivak (cwolf3d)", | ||||
| "version": (1, 8, 0), | "version": (1, 8, 1), | ||||
| "blender": (2, 80, 0), | "blender": (2, 80, 0), | ||||
| "location": "View3D EditMode > Sidebar > Edit Tab", | "location": "View3D EditMode > Sidebar > Edit Tab", | ||||
| "description": "Modeling and retopology tool", | "description": "Modeling and retopology tool", | ||||
| "doc_url": "{BLENDER_MANUAL_URL}/addons/mesh/bsurfaces.html", | "doc_url": "{BLENDER_MANUAL_URL}/addons/mesh/bsurfaces.html", | ||||
| "category": "Mesh", | "category": "Mesh", | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,496 Lines • ▼ Show 20 Lines | def rectangular_surface(self, context): | ||||
| bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN') | bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN') | ||||
| segments = sqrt( | segments = sqrt( | ||||
| (ob_simplified_curve[i].data.splines[0].bezier_points[0].co - | (ob_simplified_curve[i].data.splines[0].bezier_points[0].co - | ||||
| ob_simplified_curve[i].data.splines[0].bezier_points[spline_bp_count - 1].co).length / | ob_simplified_curve[i].data.splines[0].bezier_points[spline_bp_count - 1].co).length / | ||||
| self.average_gp_segment_length | self.average_gp_segment_length | ||||
| ) | ) | ||||
| for t in range(2): | for t in range(2): | ||||
| bpy.ops.curve.subdivide('INVOKE_REGION_WIN', number_cuts=segments) | bpy.ops.curve.subdivide('INVOKE_REGION_WIN', number_cuts=int(segments)) | ||||
| # Delete the other vertices and make it non-cyclic to | # Delete the other vertices and make it non-cyclic to | ||||
| # keep only the needed verts of the "closing segment" | # keep only the needed verts of the "closing segment" | ||||
| bpy.ops.curve.select_all(action='INVERT') | bpy.ops.curve.select_all(action='INVERT') | ||||
| bpy.ops.curve.delete(type='VERT') | bpy.ops.curve.delete(type='VERT') | ||||
| ob_simplified_curve[i].data.splines[0].use_cyclic_u = False | ob_simplified_curve[i].data.splines[0].use_cyclic_u = False | ||||
| bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN') | bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN') | ||||
| ▲ Show 20 Lines • Show All 2,010 Lines • Show Last 20 Lines | |||||