Skip to content

Commit

Permalink
v1.0.1 - Colored Icons, Modifer Improvements
Browse files Browse the repository at this point in the history
- Added Colorized icons for X,Y,Z (red, green, blue) buttons

- Added ability to slice, cut and mirror based on user chosen Transform Pivot Location and Orientation

- Added ability to adjust merge threshold when mirroring.

- Added Bisect feature when mirroring for extremely accurate mirroring. Eliminates anomalies such as holes and overlapping geometry. Great for mirroring dense objects with lots of polies.

- Added ability to apply/remove mirror & boolean modifiers and clean up orphaned empties and bisect planes

- Added ability to Fill with N-gon after performing a cut.

- Holding CTRL while clicking a mirror button, will mirror the object and keep the mirror and/or bisect modifier

- Holding CTRL while clicking Apply or Remove will apply or remove the modifiers, but preserve the empties and bisect planes.
  • Loading branch information
Neltulz committed Feb 18, 2020
1 parent 10319af commit 7453ab3
Show file tree
Hide file tree
Showing 35 changed files with 2,291 additions and 1,108 deletions.
674 changes: 0 additions & 674 deletions LICENSE

This file was deleted.

91 changes: 54 additions & 37 deletions README_Neltulz_Symmetry.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 - Symmetry v1.0.0" />
<meta property="og:title" content="Neltulz - Symmetry v1.0.1" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.logichaos.com/neltulz_blender_addons/neltulz_symmetry/README_Neltulz_Symmetry"/>
<meta property="og:image" content="https://www.logichaos.com/neltulz_blender_addons/neltulz_symmetry/readme_html_files/img/logo.png" />
<meta property="og:description" content="Updated: 12/25/2019 - Slice, cut, or mirror a mesh object easily" />
<meta property="og:description" content="Updated: 2/18/2020 - Slice, cut, or mirror a mesh object easily" />

<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 @@ -76,14 +76,13 @@

<div class="main">

<picture class="mainAddonImage">
<source srcset="readme_html_files/img/logo.webp" type="image/webp">
<source srcset="readme_html_files/img/logo.png" type="image/png">
<img src="readme_html_files/img/logo.png" alt="Logo">
<picture class="mainAddonBanner">
<source srcset="readme_html_files/img/banner.jpg" type="image/jpeg">
<img src="readme_html_files/img/banner.jpg" alt="Logo">
</picture>

<h1 class="pageTitle">
Neltulz - Symmetry<br><span class="versionNum">Version: 1.0.0<!--<br>Updated: 12/25/2019--></span>
Neltulz - Symmetry<br><span class="versionNum">Version: 1.0.1<br>Updated: 2/18/2020</span>
</h1>

<div class="versionAndDownloadBar">
Expand Down Expand Up @@ -145,51 +144,58 @@ <h1 class="pageTitle">
insert youtube iframe embed code here
</div>-->

<h3>Table of Contents</h3>

<ul>
<li><a href="#keyFeatures">Key Features</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#howToUse">How to Use</a></li>
<li><a href="#knownIssues">Known Issues & Limitations</a></li>
<li><a href="#license">License</a></li>
<li><a href="#changelog">Changelog</a></li>
<li><a href="#links">Links</a></li>
<li><a href="#specialThanks">Special Thanks</a></li>
<li><a href="#contact">Contact Me, Report a Bug, or Request a thing</a></li>
</ul>
<div class="TOC">
<ul>
<li><a href="#keyFeatures">Features</a></li>
<li><a href="#github">Github</a></li>
<li><a href="#installation">Install</a></li>
<li><a href="#howToUse">How to Use</a></li>
<li><a href="#knownIssues">Known Issues</a></li>
<li><a href="#license">License</a></li>
<li><a href="#changelog">Changelog</a></li>
<li><a href="#links">Links</a></li>
<li><a href="#credits">Credits</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>

<h3 id="keyFeatures">Key Features</h3>

<ul>
<li><span class="focusText">Slice</span> a mesh object along a given axis</li>
<li><span class="focusText">Cut</span> a mesh object in half along a given axis</li>
<li><span class="focusText">Mirror</span> a mesh object in half along a given axis</li>
<li>Can access the addon from either <span class="focusText">Object Mode</span> or <span class="focusText">Edit Mode</span></li>
<li>Supports <span class="focusText">local</span> or <span class="focusText">global</span> object location or rotation</li>
<li>Sidebar panel can be easily added to any pie menu using <span class="focusText">Pie Menu Editor Add-on</span>!</li>
<li><mark>Slice</mark> a mesh object along a given axis</li>
<li><mark>Cut</mark> a mesh object in half along a given axis</li>
<li><mark>Mirror</mark> a mesh object in half along a given axis</li>
<li>Can access the addon from either <mark>Object Mode</mark> or <mark>Edit Mode</mark></li>
<li>Supports <mark>local</mark> or <mark>global</mark> object location or rotation</li>
<li>Sidebar panel can be easily added to any pie menu using <mark>Pie Menu Editor Add-on</mark>!</li>
</ul>

<h3 id="github">Github</h3>

<div class="indentSection">
To see all of the very latest changes, please <a href="https://github.com/Neltulz/Neltulz_Symmetry" target="_blank">visit the github for this addon</a>.
</div>

<h3 id="installation">Installation</h3>

<ol>
<li>Download the <span class="focusText">Neltulz - Symmetry</span> zip file anywhere on your
<li>Download the <mark>Neltulz - Symmetry</mark> zip file anywhere on your
computer.</li>

<li>Run Blender.</li>

<li>Go to <span class="focusText">Edit > Preferences</span>.</li>
<li>Go to <mark>Edit > Preferences</mark>.</li>

<li>In the left sidebar, go to <span class="focusText">Add-ons</span>.</li>
<li>In the left sidebar, go to <mark>Add-ons</mark>.</li>

<li>At the top right, click <span class="focusText">Install</span>.</li>
<li>At the top right, click <mark>Install</mark>.</li>

<li>Browse for the <span class="focusText">Neltulz - Symmetry</span> zip file and click Install Add-on
<li>Browse for the <mark>Neltulz - Symmetry</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 Generic: <span class="focusText">Neltulz - Symmetry</span>, enable the checkbox.</li>
<li>Next to Generic: <mark>Neltulz - Symmetry</mark>, enable the checkbox.</li>

<li>At the lower left of the preferences window, click <span class="focusText">Save Preferences</span> and
<li>At the lower left of the preferences window, click <mark>Save Preferences</mark> and
close the preferences window.</li>
</ol>

Expand Down Expand Up @@ -237,14 +243,13 @@ <h5>Hotkeys</h5>
<h3 id="knownIssues">Known Issues & Limitations</h3>

<ul>
<li>If you isolate while in object mode, then try to isolate again while in edit mode, you'll have to
perform the "isolate" operator twice to get it to work.</li>
<li>Applying/Removing modifiers on an object will only remove 1 mirror modifier at a time. Need to add support for multiple mirror modifiers.</li>
</ul>

<h3 id="license">License</h3>

<p>This addon is using the <span class="focusText"><a href="https://choosealicense.com/licenses/gpl-3.0/"
target="_blank">GNU GPL v3.0</a></span>.</p>
<p>This addon is using the <mark><a href="https://choosealicense.com/licenses/gpl-3.0/"
target="_blank">GNU GPL v3.0</a></mark>.</p>

<div class="alert alert-dark quote">

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

<ul>
<li>2020-02-18
<ul>
<li>Added <mark>Colorized icons</mark> for X,Y,Z (red, green, blue) buttons</li>
<li>Added ability to slice, cut and mirror based on user chosen <mark>Transform Pivot Location</mark> and <mark>Orientation</mark></li>
<li>Added ability to <mark>adjust merge threshold</mark> when mirroring.</li>
<li>Added <mark>Bisect</mark> feature when mirroring for extremely accurate mirroring. Eliminates anomalies such as holes and overlapping geometry. Great for mirroring dense objects with lots of polies.</li>
<li>Added ability to <mark>apply/remove</mark> mirror & boolean modifiers and <mark>clean up</mark> orphaned empties and bisect planes</li>
<li>Added ability to <mark>Fill with N-gon</mark> after performing a cut.</li>
<li>Holding <mark>CTRL</mark> while clicking a <mark>mirror button</mark>, will mirror the object and keep the mirror and/or bisect modifier</li>
<li>Holding <mark>CTRL</mark> while clicking <mark>Apply or Remove</mark> will apply or remove the modifiers, but preserve the empties and bisect planes.</li>
</ul>
</li>
<li>
2019-12-25 - First Release!
</li>
Expand Down
49 changes: 44 additions & 5 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author" : "Neil V. Moore",
"description" : 'Slice, cut, or mirror a mesh object easily',
"blender" : (2, 80, 0),
"version" : (1, 0, 0),
"version" : (1, 0, 1),
"location" : "View3D",
"warning" : "",
"category" : "Generic",
Expand All @@ -17,28 +17,40 @@

import bpy

from . import icons

from . properties import NTZSYM_ignitproperties
from . main_ot import NTZSYM_OT_ntzperformsym
from . misc_ot import NTZSYM_OT_NtzResetAllSettings
from . addon_preferences import NTZSYM_OT_ntzsymprefs
from . addonPrefs import NTZSYM_OT_addonprefs
from . panels import NTZSYM_PT_options
from . panels import NTZSYM_PT_optionscompactpopover
from . panels import NTZSYM_PT_ntzsym
from . misc_ot import NTZSYM_OT_NtzResetAllSettings
from . misc_ot import NTZSYM_OT_applyorremovemodifier

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 = (
NTZSYM_ignitproperties,
NTZSYM_OT_ntzperformsym,
NTZSYM_OT_ntzsymprefs,
NTZSYM_OT_addonprefs,
NTZSYM_PT_options,
NTZSYM_PT_optionscompactpopover,
NTZSYM_PT_ntzsym,
NTZSYM_OT_NtzResetAllSettings,
NTZSYM_OT_applyorremovemodifier,
)

# -----------------------------------------------------------------------------
Expand All @@ -47,20 +59,44 @@

addon_keymaps = []

#vscode pme workaround from iceythe (part 1 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 1 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
addonPrefs.update_panel(prefs, bpy.context)

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


#add property group to the scene
bpy.types.Scene.ntzSym = bpy.props.PointerProperty(type=NTZSYM_ignitproperties)

#add a pointerProperty to all objects in the scene so that the mirrorEmpty can keep track of the object --> mirror modifier it will be parented to
bpy.types.Object.mirrorParent = bpy.props.PointerProperty(type=bpy.types.Object)

if prefs.rememberOrientAndLocOnUndo:
# load undo/redo handlers so that scene properties get restored on undo/redo or when adjusting operator properties
miscFunc.load_handler()

#vscode pme workaround from iceythe (part 2 of 2)
#must be appended to def register() so that it is the last thing that executes
if bDebugModeActive:
if not bpy.app.timers.is_registered(_reg):
bpy.app.timers.register(_reg, first_interval=1)
#END vscode pme workaround (part 2 of 2)

def unregister():
from bpy.utils import unregister_class
for cls in reversed(classes):
Expand All @@ -69,6 +105,9 @@ def unregister():
#remove keymaps
keymaps.ntzSym_unregKMs(addon_keymaps)

# unload the undo/redo handlers for restoring scene properties
miscFunc.unload_handler()

if __name__ == "__main__":
register()

Expand Down
133 changes: 133 additions & 0 deletions addonPrefs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Update "Tab Category Name" inspired by "Meta-Androcto's" "Edit Mesh Tools" Add-on
# recommended by "cytoo"

import bpy
from . panels import NTZSYM_PT_ntzsym
from . miscFunc import load_handler
from . miscFunc import unload_handler

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



def update_panel(self, context):

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 QuickSubD: 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:

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

def addRemoveUndoHandler(self, context):
if context.preferences.addons[__package__].preferences.rememberOrientAndLocOnUndo:
load_handler()
else:
unload_handler()

class NTZSYM_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,
)

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,
)

rememberOrientAndLocOnUndo : BoolProperty (
name="Remember Orientation & Transform Pivot Point on Undo",
description = "Whenever you perform an undo, sometimes blender will change your Orientation and Location , which can be annoying when you're trying to change pivot transform location and orientation before performing symmetry on a mesh object",
default = True,
update = addRemoveUndoHandler,
)

def draw(self, context):

from . miscLay import createProp
layout = self.layout

scale_y = 1.25
labelScale = 7
propScale = 15
propAlignment = "LEFT"
propAlign = True
labelJustify = "RIGHT"

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

#createProp(self, context, scn, bEnabled, bActive, bUseCol, labelText, data, checkboxProp, propItem, scale_y, labelScale, propScale, labelAlign, propAlignment, propAlign, propText, bExpandProp, propColCount, bUseSlider, resetProp, layout )
createProp( self, context, None, True, True, False, "Sidebar Panel", self, None, "sidebarPanelSize", scale_y, labelScale, propScale, labelJustify, propAlignment, propAlign, None, True, 1, False, None, layout )
createProp( self, context, None, bTabCatEnabled, True, False, "Tab Category", self, None, "category", scale_y, labelScale, propScale, labelJustify, propAlignment, propAlign, "", True, 1, False, None, layout )
createProp( self, context, None, True, True, False, "Popup & Pie Panel", self, None, "popupAndPiePanelSize", scale_y, labelScale, propScale, labelJustify, propAlignment, propAlign, None, True, 1, False, None, layout )


createProp( self, context, None, True, True, False, "", self, None, "rememberOrientAndLocOnUndo", 1, labelScale, 30, labelJustify, "EXPAND", propAlign, None, True, 1, False, None, layout )
Loading

0 comments on commit 7453ab3

Please sign in to comment.