Skip to content

Commit

Permalink
v1.0.6 - Compact Panel, Bug Fixes
Browse files Browse the repository at this point in the history
- New Compact Popup & Pie Panel

- Ability to add edges with flow to multiple selected objects

- Bug Fix: Unable to perform edge flow if there was no active object when objects were selected
  • Loading branch information
Neltulz committed Jan 14, 2020
1 parent dd27b1f commit efb1f34
Show file tree
Hide file tree
Showing 9 changed files with 450 additions and 205 deletions.
25 changes: 16 additions & 9 deletions README_Neltulz_Edge_Curve_Plus.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Neltulz - Edge Curve Plus - ReadMe</title>
<title>Neltulz - Edge Curve - ReadMe</title>

<!-- Twitter Card data -->
<meta name="twitter:card" value="summary">

<!-- Open Graph data -->
<meta property="og:title" content="Neltulz - Edge Curve Plus v1.0.5" />
<meta property="og:title" content="Neltulz - Edge Curve v1.0.6" />
<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: 12/23/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: 01/14/2020 - 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.5<br>Last Update: 12/23/2019</span>
Neltulz - Edge Curve<br><span class="versionNum">Version: 1.0.6<br>Last Update: 01/14/2020</span>
</h1>

<div class="versionAndDownloadBar">
Expand Down Expand Up @@ -180,7 +180,7 @@ <h3 id="keyFeatures">Key Features</h3>
<h3 id="dependencies">Dependencies</h3>

<div class="indentSection">
<p><mark>Neltulz - Edge Curve Plus</mark> requires the <mark>EdgeFlow</mark> addon for blender to be installed prior to using.
<p><mark>Neltulz - Edge Curve</mark> requires the <mark>EdgeFlow</mark> addon for blender to be installed prior to using.
Download the latest version here: <a href="https://github.com/BenjaminSauder/EdgeFlow/releases" target="_blank">EdgeFlow
Addon for Blender</a></p>

Expand All @@ -197,7 +197,7 @@ <h3 id="github">Github</h3>
<h3 id="installation">Installation</h3>

<ol>
<li>Download the <mark>Neltulz - Edge Curve Plus</mark> zip file anywhere on your
<li>Download the <mark>Neltulz - Edge Curve</mark> zip file anywhere on your
computer.</li>

<li>Run Blender.</li>
Expand All @@ -208,10 +208,10 @@ <h3 id="installation">Installation</h3>

<li>At the top right, click <mark>Install</mark>.</li>

<li>Browse for the <mark>Neltulz - Edge Curve Plus</mark> zip file and click Install Add-on
<li>Browse for the <mark>Neltulz - Edge Curve</mark> zip file and click Install Add-on
from File <br>Alternatively, you may double click the zip file to install it.</li>

<li>Next to <mark>Neltulz - Edge Curve Plus</mark>, enable the checkbox.</li>
<li>Next to <mark>Neltulz - Edge Curve</mark>, enable the checkbox.</li>

<li>(OPTIONAL) If you are manually saving preferences (instead of automatically), at the lower left of the preferences window, click <mark>Save Preferences</mark> and
close the preferences window.</li>
Expand Down Expand Up @@ -249,7 +249,7 @@ <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">ntz_edg_curv.insertedges</td>
<td class="command">ntzedgcrv.insertedges</td>
<td class="properties">numSegments = 1<br>useEdgeFlow = True<br>tension = 180<br>numIterations = 4<br>minAngle = 0</td>
</tr>

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

<ul>
<li>2020-01-14
<ul>
<li>New Compact Popup & Pie Panel</li>
<li>Ability to add edges with flow to multiple selected objects</li>
<li>Bug Fix: Unable to perform edge flow if there was no active object when objects were selected</li>
</ul>
</li>
<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>
Expand Down
46 changes: 31 additions & 15 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
bl_info = {
"name" : "Neltulz - Edge Curve Plus",
"name" : "Neltulz - Edge Curve",
"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, 5),
"version" : (1, 0, 6),
"location" : "View3D",
"warning" : "",
"category" : "3D View",
Expand All @@ -17,27 +17,34 @@

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
from . properties import NTZEDGCRV_ignitproperties
from . main_ot import NTZEDGCRV_OT_insertedges
from . misc_ot import NTZEDGCRV_OT_resetsettings
from . addon_preferences import NTZEDGCRV_OT_addonprefs
from . panels import NTZEDGCRV_PT_options
from . panels import NTZEDGCRV_PT_sidebarpanel

from . import keymaps

PendingDeprecationWarning

bDebugModeActive = False
if bDebugModeActive:
print("##################################################################################################################################################################")
print("REMINDER: DEBUG MODE ACTIVE")
print("##################################################################################################################################################################")

# -----------------------------------------------------------------------------
# Store classes in List so that they can be easily registered/unregistered
# -----------------------------------------------------------------------------

classes = (
NeltulzEdgeCurvePlus_IgnitProperties,
OBJECT_OT_NeltulzEdgeCurvePlus,
OBJECT_OT_NeltulzEdgeCurvePlus_ResetAllSettings,
OBJECT_OT_NeltulzEdgeCurvePlus_Preferences,
OBJECT_PT_NeltulzEdgeCurvePlus,
NTZEDGCRV_ignitproperties,
NTZEDGCRV_OT_insertedges,
NTZEDGCRV_OT_resetsettings,
NTZEDGCRV_OT_addonprefs,
NTZEDGCRV_PT_options,
NTZEDGCRV_PT_sidebarpanel,
)

# -----------------------------------------------------------------------------
Expand All @@ -46,19 +53,28 @@

addon_keymaps = []

#vscode pme workaround from iceythe (part 2 of 2)
def _reg():
pme = bpy.utils._preferences.addons['pie_menu_editor'].preferences
for pm in pme.pie_menus:
if pm.key != 'NONE':
pm.register_hotkey()
#END vscode pme workaround (part 2 of 2)

def register():
from bpy.utils import register_class
for cls in classes:
register_class(cls)

# update panel name
addon_preferences.update_panel(None, bpy.context)
prefs = bpy.context.preferences.addons[__name__].preferences
addon_preferences.update_panel(prefs, bpy.context)

#add keymaps from keymaps.py
keymaps.neltulz_edge_curve_plus_register_keymaps(addon_keymaps)

#add property group to the scene
bpy.types.Scene.neltulzEdgeCurvePlus = bpy.props.PointerProperty(type=NeltulzEdgeCurvePlus_IgnitProperties)
bpy.types.Scene.ntzedgcrv = bpy.props.PointerProperty(type=NTZEDGCRV_ignitproperties)



Expand All @@ -77,4 +93,4 @@ def unregister():
register()

# test call
bpy.ops.ntz_edg_curv.insertedges()
bpy.ops.ntzedgcrv.insertedges()
90 changes: 76 additions & 14 deletions addon_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,113 @@
# recommended by "cytoo"

import bpy
from . panels import OBJECT_PT_NeltulzEdgeCurvePlus
from . panels import NTZEDGCRV_PT_sidebarpanel

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 = (
OBJECT_PT_NeltulzEdgeCurvePlus,
NTZEDGCRV_PT_sidebarpanel,
)



def update_panel(self, context):
message = "Neltulz - Edge Curve Plus: Updating Panel locations has failed"

sidebarPanelSize_PropVal = context.preferences.addons[__package__].preferences.sidebarPanelSize
category_PropVal = context.preferences.addons[__package__].preferences.category
popupAndPiePanelSize_PropVal = context.preferences.addons[__package__].preferences.popupAndPiePanelSize

message = "Neltulz - Edge Curve: Updating Panel locations has failed"
try:
for panel in panels:
if "bl_rna" in panel.__dict__:
bpy.utils.unregister_class(panel)

#Whatever the user typed into the text box in the add-ons settings, set that as the addon's tab category name
for panel in panels:
panel.bl_category = context.preferences.addons[__package__].preferences.category

if sidebarPanelSize_PropVal == "HIDE":
panel.bl_category = ""
panel.bl_region_type = "WINDOW"

else:
if self.sidebarPanelSize == "DEFAULT":
panel.bUseCompactSidebarPanel = False
else:
panel.bUseCompactSidebarPanel = True

panel.bl_category = category_PropVal
panel.bl_region_type = "UI"

if self.popupAndPiePanelSize == "DEFAULT":
panel.bUseCompactPopupAndPiePanel = False
else:
panel.bUseCompactPopupAndPiePanel = True

bpy.utils.register_class(panel)

except Exception as e:
print("\n[{}]\n{}\n\nError:\n{}".format(__package__, message, e))
pass


class OBJECT_OT_NeltulzEdgeCurvePlus_Preferences(AddonPreferences):
class NTZEDGCRV_OT_addonprefs(AddonPreferences):
# this must match the addon name, use '__package__'
# when defining this in a submodule of a python package.
bl_idname = __package__

category: StringProperty(
name="Tab Category",
description="Choose a name for the category of the panel",
default="Neltulz",
update=update_panel
)
name="Tab Category",
description="Choose a name for the category of the panel",
default="Neltulz",
update=update_panel,
)

sidebarpanelSize_List = [
("DEFAULT", "Default", "", "", 0),
("COMPACT", "Compact", "", "", 1),
("HIDE", "Hide", "", "", 2),
]

popupAndPiePanelSize_List = [
("DEFAULT", "Default", "", "", 0),
("COMPACT", "Compact", "", "", 1),
]

sidebarPanelSize : EnumProperty (
items = sidebarpanelSize_List,
name = "Sidebar Panel Size",
description = "Sidebar Panel Size",
default = "DEFAULT",
update=update_panel,
)

popupAndPiePanelSize : EnumProperty (
items = popupAndPiePanelSize_List,
name = "Popup & Pie Panel Size",
description = "Popup & Pie Panel Size",
default = "COMPACT",
update=update_panel,
)

def draw(self, context):

from . misc_layout import createProp
layout = self.layout

row = layout.row()
col = row.column()
col.label(text="Tab Category:")
col.prop(self, "category", text="")
labelWidth = 7
labelJustify = "RIGHT"
propJustify = "LEFT"
propWidth = 15
propHeight = 1.25

if self.sidebarPanelSize == "HIDE":
bTabCatEnabled = False
else:
bTabCatEnabled = True

createProp(self, context, None, True, "Sidebar Panel", self, "sidebarPanelSize", propHeight, labelWidth, propWidth, labelJustify, propJustify, None, True, False, layout)
createProp(self, context, None, bTabCatEnabled, "Tab Category", self, "category", propHeight, labelWidth, propWidth, labelJustify, propJustify, "", True, False, layout)
createProp(self, context, None, True, "Popup & Pie Panel", self, "popupAndPiePanelSize", propHeight, labelWidth, propWidth, labelJustify, propJustify, None, True, False, layout)
4 changes: 2 additions & 2 deletions keymaps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bpy
from . properties import NeltulzEdgeCurvePlus_IgnitProperties
from . properties import NTZEDGCRV_ignitproperties

# -----------------------------------------------------------------------------
# Keymaps (For Register)
Expand All @@ -11,7 +11,7 @@ def neltulz_edge_curve_plus_register_keymaps(addon_keymaps):

def createEdgeCurvePlusKeymap():
#create shortcuts for keymap
kmi = km.keymap_items.new("ntz_edg_curv.insertedges", type = "E", ctrl=False, shift=True, alt=True, value = "PRESS")
kmi = km.keymap_items.new("ntzedgcrv.insertedges", type = "E", ctrl=False, shift=True, alt=True, value = "PRESS")
kmi.properties.numSegments = 1
kmi.properties.useEdgeFlow = True
kmi.properties.tension = 180
Expand Down
Loading

0 comments on commit efb1f34

Please sign in to comment.