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:
authorSpivak Vladimir (cwolf3d) <cwolf3d@gmail.com>2019-08-22 01:07:37 +0300
committerSpivak Vladimir (cwolf3d) <cwolf3d@gmail.com>2019-08-22 01:08:20 +0300
commit4a66c4e0b80f5483c8434554c615a56fef71d627 (patch)
tree7340fa027e1465976f041f6b4e437e1baa2b5488
parent346320d012f5bd6e3fabd888d0186c417e78b9c0 (diff)
Addon: BSurfaces: Fixed https://developer.blender.org/T68959 Fixed confusion about initial 'setup' window
-rw-r--r--mesh_bsurfaces.py31
1 files changed, 19 insertions, 12 deletions
diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py
index abd8e77e..90caee2c 100644
--- a/mesh_bsurfaces.py
+++ b/mesh_bsurfaces.py
@@ -20,7 +20,7 @@
bl_info = {
"name": "Bsurfaces GPL Edition",
"author": "Eclectiel, Spivak Vladimir(cwolf3d)",
- "version": (1, 6, 0),
+ "version": (1, 6, 1),
"blender": (2, 80, 0),
"location": "View3D EditMode > Sidebar > Edit Tab",
"description": "Modeling and retopology tool",
@@ -50,6 +50,7 @@ from bpy.props import (
IntProperty,
StringProperty,
PointerProperty,
+ EnumProperty,
)
from bpy.types import (
Operator,
@@ -75,16 +76,16 @@ class VIEW3D_PT_tools_SURFSK_mesh(Panel):
row.separator()
col.operator("gpencil.surfsk_init", text="Initialize")
col.prop(scn, "SURFSK_object_with_retopology")
- col.prop(scn, "SURFSK_use_annotation")
- if not scn.SURFSK_use_annotation:
+ col.row().prop(scn, "SURFSK_guide", expand=True)
+ if not scn.SURFSK_guide == 'Annotation':
col.prop(scn, "SURFSK_object_with_strokes")
col.separator()
props = col.operator("gpencil.surfsk_add_surface", text="Add Surface")
col.operator("gpencil.surfsk_edit_surface", text="Edit Surface")
- if not scn.SURFSK_use_annotation:
+ if scn.SURFSK_guide == 'GPencil':
col.operator("gpencil.surfsk_add_strokes", text="Add Strokes")
col.operator("gpencil.surfsk_edit_strokes", text="Edit Strokes")
- else:
+ if scn.SURFSK_guide == 'Annotation':
col.operator("gpencil.surfsk_add_annotation", text="Add Annotation")
col.separator()
col.label(text="Initial settings:")
@@ -124,7 +125,7 @@ def get_strokes_type(context):
strokes_num = 0
# Check if they are grease pencil
- if context.scene.bsurfaces.SURFSK_use_annotation:
+ if context.scene.bsurfaces.SURFSK_guide == 'Annotation':
try:
strokes = bpy.data.grease_pencils[0].layers.active.active_frame.strokes
@@ -3213,6 +3214,7 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
# self.edges_V = 1
#else:
# self.edges_V = bsurfaces_props.SURFSK_edges_V
+ self.edges_U = bsurfaces_props.SURFSK_edges_U
self.edges_V = bsurfaces_props.SURFSK_edges_V
self.is_fill_faces = False
@@ -3509,7 +3511,7 @@ class GPENCIL_OT_SURFSK_init(Operator):
bpy.context.scene.bsurfaces.SURFSK_object_with_retopology = mesh_object
- if not context.scene.bsurfaces.SURFSK_use_annotation and bs.SURFSK_object_with_strokes == None:
+ if context.scene.bsurfaces.SURFSK_guide == 'GPencil' and bs.SURFSK_object_with_strokes == None:
bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
bpy.ops.object.gpencil_add(radius=1.0, align='WORLD', location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0), type='EMPTY')
bpy.context.scene.tool_settings.gpencil_stroke_placement_view3d = 'SURFACE'
@@ -3520,7 +3522,7 @@ class GPENCIL_OT_SURFSK_init(Operator):
bpy.context.scene.bsurfaces.SURFSK_object_with_strokes = gpencil_object
gpencil_object.data.stroke_depth_order = '3D'
- if context.scene.bsurfaces.SURFSK_use_annotation:
+ if context.scene.bsurfaces.SURFSK_guide == 'Annotation':
bpy.ops.wm.tool_set_by_id(name="builtin.annotate")
bpy.context.scene.tool_settings.annotation_stroke_placement_view3d = 'SURFACE'
@@ -4143,10 +4145,15 @@ class BsurfPreferences(AddonPreferences):
# Properties
class BsurfacesProps(PropertyGroup):
- SURFSK_use_annotation: BoolProperty(
- name="Use Annotation",
- default=True
- )
+ SURFSK_guide: EnumProperty(
+ name="Guide:",
+ items=[
+ ('Annotation', 'Annotation', 'Annotation'),
+ ('GPencil', 'GPencil', 'GPencil'),
+ ('Curve', 'Curve', 'Curve')
+ ],
+ default="Annotation"
+ )
SURFSK_edges_U: IntProperty(
name="Cross",
description="Number of face-loops crossing the strokes",