Skip to content

Commit

Permalink
v1.0.5 - Sidebar Panel Improvements
Browse files Browse the repository at this point in the history
- Set default sidebar tab name to "Neltulz" so that all Neltulz related sidebars from various Neltulz add-ons will be organized here.

- Changed operator bl_idnames to improve organization. This may break things if you've added operators to any custom pie menus. Sorry for the inconvenience.

- Improved sidebar panel significantly. Better use of space.

- Set default iteration count to 4 instead of 1. This provides better results most situations.
  • Loading branch information
Neltulz committed Dec 23, 2019
1 parent 7e4361d commit dd27b1f
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 127 deletions.
18 changes: 13 additions & 5 deletions README_Neltulz_Edge_Curve_Plus.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<meta name="twitter:card" value="summary">

<!-- Open Graph data -->
<meta property="og:title" content="Neltulz - Edge Curve Plus v1.0.4" />
<meta property="og:title" content="Neltulz - Edge Curve Plus v1.0.5" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.logichaos.com/neltulz_blender_addons/neltulz_edge_curve_plus/README_Neltulz_Edge_Curve_Plus"/>
<meta property="og:image" content="https://www.logichaos.com/neltulz_blender_addons/neltulz_edge_curve_plus/readme_html_files/img/logo.png" />
<meta property="og:description" content="Updated: 8/27/2019 - Blender Addon that allows you to quickly insert edge loops with flow. (Requires the EdgeFlow addon for Blender)" />
<meta property="og:description" content="Updated: 12/23/2019 - Blender Addon that allows you to quickly insert edge loops with flow. (Requires the EdgeFlow addon for Blender)" />

<link href="readme_html_files/fontawesome-free-5.10.1-web/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="readme_html_files/css/bootstrap-reboot.min.css">
Expand Down Expand Up @@ -79,7 +79,7 @@
</picture>

<h1 class="pageTitle">
Neltulz - Edge Curve Plus<br><span class="versionNum">Version: 1.0.4<br>Last Update: 9/3/2019</span>
Neltulz - Edge Curve Plus<br><span class="versionNum">Version: 1.0.5<br>Last Update: 12/23/2019</span>
</h1>

<div class="versionAndDownloadBar">
Expand Down Expand Up @@ -249,8 +249,8 @@ <h5>Hotkeys</h5>
<tr>
<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">numSegments = 1<br>useEdgeFlow = True<br>tension = 180<br>numIterations = 1<br>minAngle = 0</td>
<td class="command">ntz_edg_curv.insertedges</td>
<td class="properties">numSegments = 1<br>useEdgeFlow = True<br>tension = 180<br>numIterations = 4<br>minAngle = 0</td>
</tr>

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

<ul>
<li>2019-12-23
<ul>
<li>Set default sidebar tab name to "Neltulz" so that all Neltulz related sidebars from various Neltulz add-ons will be organized here.</li>
<li>Changed operator bl_idnames to improve organization. This may break things if you've added operators to any custom pie menus. Sorry for the inconvenience.</li>
<li>Improved sidebar panel significantly. Better use of space.</li>
<li>Set default iteration count to 4 instead of 1. This provides better results most situations.</li>
</ul>
</li>
<li>2019-09-03
<ul>
<li>Removed addon_utils.py</li>
Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author" : "Neil V. Moore",
"description" : "Allows you to quickly insert edge loops with flow (Requires edge flow addon)",
"blender" : (2, 80, 0),
"version" : (1, 0, 4),
"version" : (1, 0, 5),
"location" : "View3D",
"warning" : "",
"category" : "3D View",
Expand Down Expand Up @@ -77,4 +77,4 @@ def unregister():
register()

# test call
bpy.ops.object.neltulz_edge_curve_plus()
bpy.ops.ntz_edg_curv.insertedges()
17 changes: 3 additions & 14 deletions addon_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,8 @@
import bpy
from . panels import OBJECT_PT_NeltulzEdgeCurvePlus

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

# Define Panel classes for updating
panels = (
Expand Down Expand Up @@ -50,7 +39,7 @@ class OBJECT_OT_NeltulzEdgeCurvePlus_Preferences(AddonPreferences):
category: StringProperty(
name="Tab Category",
description="Choose a name for the category of the panel",
default="Edge Curve+",
default="Neltulz",
update=update_panel
)

Expand Down
15 changes: 2 additions & 13 deletions keymaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,13 @@ 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 = km.keymap_items.new("ntz_edg_curv.insertedges", type = "E", ctrl=False, shift=True, alt=True, value = "PRESS")
kmi.properties.numSegments = 1
kmi.properties.useEdgeFlow = True
kmi.properties.tension = 180
kmi.properties.numIterations = 1
kmi.properties.numIterations = 4
kmi.properties.minAngle = 0

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

#create new keymap
km = wm.keyconfigs.addon.keymaps.new(name="Object Mode", space_type="EMPTY")

createEdgeCurvePlusKeymap()


#add list of keymaps
addon_keymaps.append(km)

#------------------------------Mesh Mode----------------------------------------------------------------------------

#create new keymap
Expand Down
20 changes: 4 additions & 16 deletions main_ot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,19 @@
from . properties import NeltulzEdgeCurvePlus_IgnitProperties
from . import misc_functions

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

# -----------------------------------------------------------------------------
# Main Addon Operator
# -----------------------------------------------------------------------------

class OBJECT_OT_NeltulzEdgeCurvePlus(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.neltulz_edge_curve_plus"
bl_idname = "ntz_edg_curv.insertedges"
bl_label = "Neltulz - Edge Curve Plus"
bl_description = "Allows you to quick insert edges with flow"
bl_options = {'REGISTER', 'UNDO'}
bl_options = {'REGISTER', 'UNDO', 'PRESET'}

numSegments : IntProperty(
name="Segment Number",
Expand All @@ -41,7 +30,6 @@ class OBJECT_OT_NeltulzEdgeCurvePlus(bpy.types.Operator):
default = True
)


tension : IntProperty(
name="Tension",
description="Tension (Default: 180)",
Expand Down
68 changes: 68 additions & 0 deletions misc_layout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import bpy

#Show hide section with arrow, optional checkbox, and text
def createShowHide(self, context, scene, properties, showHideBool, optionalCheckboxBool, text, layout):

if scene is not None:
data = eval( f"scene.{properties}" )
boolThing = eval( f"scene.{properties}.{showHideBool}" )
else:
data = self
boolThing = eval( f"self.{showHideBool}")

if boolThing:
showHideIcon = "TRIA_DOWN"
else:
showHideIcon = "TRIA_RIGHT"

row = layout.row(align=True)

downArrow = row.column(align=True)
downArrow.alignment = "LEFT"
downArrow.prop(data, showHideBool, text="", icon=showHideIcon, emboss=False )

if optionalCheckboxBool is not None:
checkbox = row.column(align=True)
checkbox.alignment = "LEFT"
checkbox.prop(data, optionalCheckboxBool, text="" )

textRow = row.column(align=True)
textRow.alignment = "LEFT"
textRow.prop(data, showHideBool, text=text, emboss=False )

emptySpace = row.column(align=True)
emptySpace.alignment = "EXPAND"
emptySpace.prop(data, showHideBool, text=" ", emboss=False)

def createPropWithHideButton(self, context, scene, properties, propName, propNameVisibilityBool, customPropText, layout):

propRow = layout.row(align=True)
propVisible = eval(f"scene.{properties}.{propNameVisibilityBool}")

if propVisible:
propXButtonIcon = "X"
propEditButtonIcon = "BLANK1"
propEnabled = True

else:
propXButtonIcon = "BLANK1"
propEditButtonIcon = "GREASEPENCIL"
propEnabled = False

data = eval( f"scene.{properties}" )

propEditButton = propRow.column(align=True)
propEditButton.prop ( data, propNameVisibilityBool, text="", icon=propEditButtonIcon, emboss=False )
propEditButton.enabled = not(propEnabled)
propEditButton.active = False

propRow.separator()

propCol = propRow.column(align=True)
propCol.prop ( data, propName, text=customPropText)
propCol.enabled = propEnabled
propRow.separator()

propXButton = propRow.column(align=True)
propXButton.prop ( data, propNameVisibilityBool, text="", icon=propXButtonIcon, emboss=False )
propXButton.enabled = propEnabled
42 changes: 19 additions & 23 deletions misc_ot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,17 @@
from . properties import NeltulzEdgeCurvePlus_IgnitProperties
from . import misc_functions

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


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

# -----------------------------------------------------------------------------
# Reset All Settings
# -----------------------------------------------------------------------------

class OBJECT_OT_NeltulzEdgeCurvePlus_ResetAllSettings(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.neltulz_edge_curve_plus_reset_all"
bl_label = "Neltulz - Edge Curve Plus - Reset All Settings"
bl_idname = "ntz_edg_curv.resetallsettings"
bl_label = "Neltulz - Edge Curve Plus : Reset All Settings"
bl_description = "Resets all settings"

@classmethod
Expand All @@ -36,12 +23,21 @@ def execute(self, context):

scene = context.scene

scene.neltulzEdgeCurvePlus.numSegmentsSlider = 1
scene.neltulzEdgeCurvePlus.useEdgeFlowCheckbox = True
scene.neltulzEdgeCurvePlus.tensionSlider = 180
scene.neltulzEdgeCurvePlus.numIterationsSlider = 1
scene.neltulzEdgeCurvePlus.minAngleSlider = 0
scene.neltulzEdgeCurvePlus.numSegmentsSlider_Enable = True
scene.neltulzEdgeCurvePlus.numSegmentsSlider = 1

scene.neltulzEdgeCurvePlus.useEdgeFlowCheckbox_Enable = True
scene.neltulzEdgeCurvePlus.useEdgeFlowCheckbox = True

scene.neltulzEdgeCurvePlus.tensionSlider_Enable = True
scene.neltulzEdgeCurvePlus.tensionSlider = 180

scene.neltulzEdgeCurvePlus.numIterationsSlider_Enable = True
scene.neltulzEdgeCurvePlus.numIterationsSlider = 4

scene.neltulzEdgeCurvePlus.minAngleSlider_Enable = True
scene.neltulzEdgeCurvePlus.minAngleSlider = 0

return {'FINISHED'}
# END execute()
# END Operator()
# END Operator()
Loading

0 comments on commit dd27b1f

Please sign in to comment.