Skip to content

Commit

Permalink
Revert "v1.0.3 - Override Edge Flow, Improved Operator Versatility"
Browse files Browse the repository at this point in the history
This reverts commit e45a697.
  • Loading branch information
Neltulz committed Aug 24, 2019
1 parent e45a697 commit 5abcb51
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 167 deletions.
10 changes: 2 additions & 8 deletions README_Neltulz_Edge_Curve_Plus.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</picture>

<h1 class="pageTitle">
Neltulz - Edge Curve Plus<br><span class="versionNum">Version: 1.0.1<br>Last Update: 8/24/2019</span>
Neltulz - Edge Curve Plus<br><span class="versionNum">Version: 1.0.0<!--<br>Last Update: 8/22/2019--></span>
</h1>

<div class="versionAndDownloadBar">
Expand Down Expand Up @@ -241,7 +241,7 @@ <h5>Hotkeys</h5>
<td class="hotkey primary">ALT+SHIFT+E</td>
<td class="result success">Insert Edge Loop(s) with Flow</td>
<td class="command">object.neltulz_edge_curve_plus</td>
<td class="properties">useSidebarPanelOptions = True</td>
<td class="properties">None</td>
</tr>

</tbody>
Expand Down Expand Up @@ -344,12 +344,6 @@ <h1>From the GNU GPL v3.0:</h1>
<h3 id="changelog">Changelog</h3>

<ul>
<li>2019-08-24
<ul>
<li>Added ability to insert edge loops without edge flow</li>
<li>You can now override the side panel, great for using the "Edge Curve Plus" operator in other areas, such as a hotkey, or a pie menu.</li>
</ul>
</li>
<li>2019-08-22 - First release!</li>
</ul>

Expand Down
8 changes: 2 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@
"version" : (1, 0, 1),
"location" : "View3D",
"warning" : "",
"category" : "3D View",
"tracker_url": "https://www.logichaos.com/neltulz_blender_addons/neltulz_contact_page/neltulz_contact_page",
"wiki_url": "https://www.logichaos.com/neltulz_blender_addons/neltulz_edge_curve_plus/README_Neltulz_Edge_Curve_Plus"
"category" : "Generic"
}

# -----------------------------------------------------------------------------
# Import Classes and/or functions
# Import Classes and/or functions
# -----------------------------------------------------------------------------

import bpy

from . properties import NeltulzEdgeCurvePlus_IgnitProperties
from . main_ot import OBJECT_OT_NeltulzEdgeCurvePlus
from . misc_ot import OBJECT_OT_NeltulzEdgeCurvePlus_ResetAllSettings
from . addon_preferences import OBJECT_OT_NeltulzEdgeCurvePlus_Preferences
from . panels import OBJECT_PT_NeltulzEdgeCurvePlus

Expand All @@ -35,7 +32,6 @@
classes = (
NeltulzEdgeCurvePlus_IgnitProperties,
OBJECT_OT_NeltulzEdgeCurvePlus,
OBJECT_OT_NeltulzEdgeCurvePlus_ResetAllSettings,
OBJECT_OT_NeltulzEdgeCurvePlus_Preferences,
OBJECT_PT_NeltulzEdgeCurvePlus,
)
Expand Down
2 changes: 1 addition & 1 deletion keymaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def neltulz_edge_curve_plus_register_keymaps(addon_keymaps):
def createEdgeCurvePlusKeymap():
#create shortcuts for keymap
kmi = km.keymap_items.new("object.neltulz_edge_curve_plus", type = "E", ctrl=False, shift=True, alt=True, value = "PRESS")
kmi.properties.useSidebarPanelOptions = True
#kmi.properties.PROPERTYNAME = 1

#------------------------------Object Mode----------------------------------------------------------------------------

Expand Down
96 changes: 10 additions & 86 deletions main_ot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@
from . import misc_functions
from . import addon_utils

from bpy.props import (StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
EnumProperty,
PointerProperty,
)
from bpy.types import (Panel,
Operator,
AddonPreferences,
PropertyGroup,
)

# -----------------------------------------------------------------------------
# Main Addon Operator
# -----------------------------------------------------------------------------
Expand All @@ -27,51 +13,7 @@ class OBJECT_OT_NeltulzEdgeCurvePlus(bpy.types.Operator):
bl_label = "Neltulz - Edge Curve Plus"
bl_description = "Allows you to quick insert edges with flow"

useSidebarPanelOptions : BoolProperty(
name="Use Sidebar Panel Options",
description='Choose this if you want to use the "Neltulz - Edge Curve Plus" sidebar panel options when running this operator. This will cause the panel to override these properties: "numSegments", "useEdgeFlow", "tension", "numIterations", "minAngle" (Default: True)',
default = True
)

numSegments : IntProperty(
name="Segment Number",
description="Number of segments to add. (Default: 1)",
default = 1,
min = 1,
soft_max = 16
)

useEdgeFlow : BoolProperty(
name="Use Edge Flow",
description='Allows you to use the EdgeFlow options (Tension, Num of iterations, Min Angle). If this is disabled, then edges will be added without edge flow adjustments. (Default: True)',
default = True
)


tension : IntProperty(
name="Tension",
description="Tension (Default: 180)",
default = 180,
max = 500,
min = -500
)

numIterations : IntProperty(
name="Number of Iterations",
description="Number of iterations. (Default: 1)",
default = 1,
min = 1,
soft_max = 128
)


minAngle : IntProperty(
name="Minimum Angle",
description="Minimum Angle (Default: 0)",
default = 0,
max = 180,
min = 0
)


@classmethod
def poll(cls, context):
Expand All @@ -82,27 +24,6 @@ def execute(self, context):
obj = context.object
scene = context.scene

#declare
numSegments_final = None
useEdgeFlow_final = None
tension_final = None
numIterations_final = None
minAngle_final = None

if self.useSidebarPanelOptions:
numSegments_final = scene.neltulzEdgeCurvePlus.numSegmentsSlider
useEdgeFlow_final = scene.neltulzEdgeCurvePlus.useEdgeFlowCheckbox
tension_final = scene.neltulzEdgeCurvePlus.tensionSlider
numIterations_final = scene.neltulzEdgeCurvePlus.numIterationsSlider
minAngle_final = scene.neltulzEdgeCurvePlus.minAngleSlider
else:
numSegments_final = self.numSegments
useEdgeFlow_final = self.useEdgeFlow
tension_final = self.tension
numIterations_final = self.numIterations
minAngle_final = self.minAngle


selectedVerts = misc_functions.getSelectedVerts(self, context, obj)
if len(selectedVerts) > 0:

Expand All @@ -120,7 +41,7 @@ def execute(self, context):

for edgeIndex in set(selectedEdgeIndices):

bpy.ops.mesh.loopcut(number_cuts=numSegments_final, object_index=0, edge_index=edgeIndex, mesh_select_mode_init=(False, True, False))
bpy.ops.mesh.loopcut(number_cuts=scene.neltulzEdgeCurvePlus.numSegments, object_index=0, edge_index=edgeIndex, mesh_select_mode_init=(False, True, False))

newEdges = misc_functions.getSelectedEdges(self, context, obj)
newEdgeIndices = list()
Expand All @@ -142,11 +63,14 @@ def execute(self, context):
#switch to edit mode
bpy.ops.object.mode_set(mode='EDIT')

if useEdgeFlow_final:
if addon_utils.check("EdgeFlow")[1]:
bpy.ops.mesh.set_edge_flow(tension=tension_final, iterations=numIterations_final, min_angle=minAngle_final)
else:
self.report({'ERROR'}, 'The "EdgeFlow" add-on could not be found. Please check to see if the Edge Flow addon is installed and enabled.' )
if addon_utils.check("EdgeFlow")[1]:
print(scene.neltulzEdgeCurvePlus.tension)
print(scene.neltulzEdgeCurvePlus.numIterations)
print(scene.neltulzEdgeCurvePlus.minAngle)

bpy.ops.mesh.set_edge_flow(tension=scene.neltulzEdgeCurvePlus.tension, iterations=scene.neltulzEdgeCurvePlus.numIterations, min_angle=scene.neltulzEdgeCurvePlus.minAngle)
else:
self.report({'ERROR'}, 'The "EdgeFlow" add-on could not be found. Please check to see if the Edge Flow addon is installed and enabled.' )

else:
self.report({'ERROR'}, 'Please select something before running the script.' )
Expand Down
45 changes: 0 additions & 45 deletions misc_ot.py

This file was deleted.

47 changes: 34 additions & 13 deletions panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class OBJECT_PT_NeltulzEdgeCurvePlus(Panel):

bl_idname = "object.neltulz_edge_curve_plus_panel"
bl_label = "Edge Curve Plus v1.0.1"
bl_label = "Edge Curve Plus v1.0.0"
bl_category = "Edge Curve+"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
Expand All @@ -35,25 +35,46 @@ def draw(self, context):
obj = context.object

col = layout.column(align=True)
#col.label(text="Title:")
row = col.row(align=True)

col.prop(context.scene.neltulzEdgeCurvePlus, "numSegmentsSlider", text="Number of segments" )

col.separator()

col = layout.column(align=True)
#op = row.operator('object.neltulz_edge_curve_plus', text="BUTTON TEXT")
#op.PROPERTYNAME=1

col.prop(context.scene.neltulzEdgeCurvePlus, "useEdgeFlowCheckbox", text="Use Edge Flow" )
#END Overlay Options (Wireframe, Edge colors, etc)

if scene.neltulzEdgeCurvePlus.useEdgeFlowCheckbox:
# -----------------------------------------------------------------------------
# Use Advanced Settings Box
# -----------------------------------------------------------------------------

col = layout.column(align=True)
col = layout.column(align=True)
row = col.row(align=True)

col.prop(context.scene.neltulzEdgeCurvePlus, "tensionSlider", text="Tension" )
col.prop(context.scene.neltulzEdgeCurvePlus, "numIterationsSlider", text="Number of iterations" )
col.prop(context.scene.neltulzEdgeCurvePlus, "minAngleSlider", text="Min Angle" )
col.prop(context.scene.neltulzEdgeCurvePlus, "numSegments", text="Number of segments" )
col.prop(context.scene.neltulzEdgeCurvePlus, "tension", text="Tension" )
col.prop(context.scene.neltulzEdgeCurvePlus, "numIterations", text="Number of iterations" )
col.prop(context.scene.neltulzEdgeCurvePlus, "minAngle", text="Min Angle" )

col = layout.column(align=True)
row = col.row(align=True)

op = row.operator('object.neltulz_edge_curve_plus', text="Insert Edge(s)")
op = row.operator('object.neltulz_edge_curve_plus_reset_all', text="Reset All Settings")

col.separator()

col.prop(context.scene.neltulzEdgeCurvePlus, "advancedSettings", text="Use Advanced Settings" )


if scene.neltulzEdgeCurvePlus.advancedSettings:

boxAdvancedOptions = layout.box()
boxAdvancedOptions.label(text="Advanced Settings:")

box = boxAdvancedOptions.column(align=True)

row = box.row(align=True)

#op = row.operator('object.neltulz_edge_curve_plus', text="BUTTON TEXT")
#op.PROPERTYNAME=1

#END Use Advanced Settings Box
27 changes: 19 additions & 8 deletions properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,51 @@

class NeltulzEdgeCurvePlus_IgnitProperties(bpy.types.PropertyGroup):

useEdgeFlowCheckbox : BoolProperty(
name="Use Edge Flow",
description="Applies edge flow to the newly created edge loops. (Default: True)",
default = True
exampleEnumItems = [
("1", "Name1", "NAME1"),
("2", "Name2", "NAME2"),
]

exampleEnum : EnumProperty(
items=exampleEnumItems,
description="Description (Default: 1)",
default="1"
)

numSegmentsSlider : IntProperty(
numSegments : IntProperty(
name="Segment Number",
description="Number of segments to add. (Default: 1)",
default = 1,
min = 1,
soft_max = 16
)

numIterationsSlider : IntProperty(
numIterations : IntProperty(
name="Number of Iterations",
description="Number of iterations. (Default: 1)",
default = 1,
min = 1,
soft_max = 128
)

tensionSlider : IntProperty(
tension : IntProperty(
name="Tension",
description="Tension (Default: 180)",
default = 180,
max = 500,
min = -500
)

minAngleSlider : IntProperty(
minAngle : IntProperty(
name="Minimum Angle",
description="Minimum Angle (Default: 0)",
default = 0,
max = 180,
min = 0
)

advancedSettings : BoolProperty(
name="Checkbox Name",
description="Use advanced settings. (Default: False)",
default = False
)

0 comments on commit 5abcb51

Please sign in to comment.