diff --git a/README.md b/README.md index d8cb2e7..95eff21 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ # 'Object Alignment': -Iterative closest point alignment addon for Blender +Iterative closest point alignment addon for Blender, works for Blender 3.2.2 # Instructions for Use: -* ... +* Download the latest release .zip file +* In Blender go Edit > Preferences > Add-ons +* Click on Install... and select the .zip Add-on, then enable it + +* Manually place the two meshes close together +* Select the base object first then the object to be aligned second and click on ICP Align +* Increase the number of ICP iterations or just ICP Align multiple times until the tow meshes are well aligned diff --git a/__init__.py b/__init__.py index e3cb674..03f56f1 100644 --- a/__init__.py +++ b/__init__.py @@ -18,8 +18,8 @@ bl_info = { "name": "Object Alignment", "author": "Patrick Moore & Christopher Gearhart", - "version": (0, 2, 0), - "blender": (2, 80, 0), + "version": (0, 3, 0), + "blender": (3, 2, 2), "location": "View3D > UI > Alignment", "description": "Help align objects which have overlapping features", "warning": "", @@ -32,7 +32,6 @@ # Blender imports import bpy -from bpy.types import Scene, Object # Addon imports from .operators import * diff --git a/addon_updater_ops.py b/addon_updater_ops.py index 7c021bd..c095987 100644 --- a/addon_updater_ops.py +++ b/addon_updater_ops.py @@ -114,13 +114,13 @@ class addon_updater_install_popup(bpy.types.Operator): # if true, run clean install - ie remove all files before adding new # equivalent to deleting the addon and reinstalling, except the # updater folder/backup folder remains - clean_install = bpy.props.BoolProperty( + clean_install : bpy.props.BoolProperty( name="Clean install", description="If enabled, completely clear the addon's folder before installing new update, creating a fresh install", default=False, options={'HIDDEN'} ) - ignore_enum = bpy.props.EnumProperty( + ignore_enum : bpy.props.EnumProperty( name="Process update", description="Decide to install, ignore, or defer new addon update", items=[ @@ -256,7 +256,7 @@ class addon_updater_update_now(bpy.types.Operator): # if true, run clean install - ie remove all files before adding new # equivalent to deleting the addon and reinstalling, except the # updater folder/backup folder remains - clean_install = bpy.props.BoolProperty( + clean_install : bpy.props.BoolProperty( name="Clean install", description="If enabled, completely clear the addon's folder before installing new update, creating a fresh install", default=False, @@ -321,7 +321,7 @@ def target_version(self, context): i+=1 return ret - target = bpy.props.EnumProperty( + target : bpy.props.EnumProperty( name="Target version to install", description="Select the version to install", items=target_version @@ -330,7 +330,7 @@ def target_version(self, context): # if true, run clean install - ie remove all files before adding new # equivalent to deleting the addon and reinstalling, except the # updater folder/backup folder remains - clean_install = bpy.props.BoolProperty( + clean_install : bpy.props.BoolProperty( name="Clean install", description="If enabled, completely clear the addon's folder before installing new update, creating a fresh install", default=False, @@ -388,7 +388,7 @@ class addon_updater_install_manually(bpy.types.Operator): bl_description = "Proceed to manually install update" bl_options = {'REGISTER', 'INTERNAL'} - error = bpy.props.StringProperty( + error : bpy.props.StringProperty( name="Error Occurred", default="", options={'HIDDEN'} @@ -451,7 +451,7 @@ class addon_updater_updated_successful(bpy.types.Operator): bl_description = "Update installation response" bl_options = {'REGISTER', 'INTERNAL', 'UNDO'} - error = bpy.props.StringProperty( + error : bpy.props.StringProperty( name="Error Occurred", default="", options={'HIDDEN'} diff --git a/functions/common/blender.py b/functions/common/blender.py index c77b5aa..6fa73d2 100644 --- a/functions/common/blender.py +++ b/functions/common/blender.py @@ -23,7 +23,6 @@ # Blender imports import bpy import bmesh -from mathutils import Vector, Euler, Matrix from bpy.types import Object, Scene#, CollectionProperty try: from bpy.types import ViewLayer diff --git a/functions/common/colors.py b/functions/common/colors.py index e6d9181..03abdc8 100644 --- a/functions/common/colors.py +++ b/functions/common/colors.py @@ -19,7 +19,6 @@ import math # Blender imports -import bpy from mathutils import Matrix diff --git a/functions/common/maths.py b/functions/common/maths.py index 1ddebe6..3e7ead5 100644 --- a/functions/common/maths.py +++ b/functions/common/maths.py @@ -19,7 +19,7 @@ # NONE! # Blender imports -from mathutils import Matrix, Vector +from mathutils import Vector # Module imports from .wrappers import blender_version_wrapper diff --git a/lib/preferences.py b/lib/preferences.py index da31bfe..b6d97eb 100644 --- a/lib/preferences.py +++ b/lib/preferences.py @@ -28,40 +28,40 @@ class ObjectAlignmentPreferences(AddonPreferences): bl_idname = __package__[:__package__.index(".lib")] # Addon preferences - icp_iterations = IntProperty( + icp_iterations : IntProperty( name="ICP Iterations", default=50) - redraw_frequency = IntProperty( + redraw_frequency : IntProperty( name="Redraw Iterations", description="Number of iterations between redraw, bigger = less redraw but faster completion", default=10) - use_sample = BoolProperty( + use_sample : BoolProperty( name="Use Sample", description="Use a sample of verts to align", default=False) - sample_fraction = FloatProperty( + sample_fraction : FloatProperty( name="Sample Fraction", description="Only fraction of mesh verts for alignment. Less accurate, faster", default=0.5, min=0, max=1) - min_start = FloatProperty( + min_start : FloatProperty( name="Minimum Starting Dist", description="Only verts closer than this distance will be used in each iteration", default=0.5, min=0, max=20) - target_d = FloatProperty( + target_d : FloatProperty( name="Target Translation", description="If translation of 3 iterations is < target, ICP is considered sucessful", default=0.01, min=0, max=10) - use_target = BoolProperty( + use_target : BoolProperty( name="Use Target", description="Calc alignment stats at each iteration to assess convergence. SLower per step, may result in less steps", default=True) - take_m_with = BoolProperty( + take_m_with : BoolProperty( name="Take m_ Objects with", description="Applies the same Transformation Matrix to all Objects which start with 'm_'", default=False) @@ -69,27 +69,27 @@ class ObjectAlignmentPreferences(AddonPreferences): align_items = [] for index, item in enumerate(align_methods): align_items.append((str(index), align_methods[index], str(index))) - align_meth = EnumProperty(items = align_items, name="Alignment Method", description="Changes how picked points registration aligns object", default='0', options={'ANIMATABLE'}, update=None, get=None, set=None) + align_meth : EnumProperty(items = align_items, name="Alignment Method", description="Changes how picked points registration aligns object", default='0', options={'ANIMATABLE'}, update=None, get=None, set=None) # addon updater preferences - auto_check_update = BoolProperty( + auto_check_update : BoolProperty( name="Auto-check for Update", description="If enabled, auto-check for updates using an interval", default=False) - updater_intrval_months = IntProperty( + updater_intrval_months : IntProperty( name='Months', description="Number of months between checking for updates", default=0, min=0) - updater_intrval_days = IntProperty( + updater_intrval_days : IntProperty( name='Days', description="Number of days between checking for updates", default=7, min=0) - updater_intrval_hours = IntProperty( + updater_intrval_hours : IntProperty( name='Hours', description="Number of hours between checking for updates", min=0, max=23, default=0) - updater_intrval_minutes = IntProperty( + updater_intrval_minutes : IntProperty( name='Minutes', description="Number of minutes between checking for updates", min=0, max=59, diff --git a/lib/reportError.py b/lib/reportError.py index f3f9c18..44a5ae3 100644 --- a/lib/reportError.py +++ b/lib/reportError.py @@ -22,7 +22,6 @@ # Blender imports import bpy import addon_utils -from bpy.props import StringProperty # Addon imports from ..functions import * diff --git a/operators/align_include_clear.py b/operators/align_include_clear.py index 3f4660a..6109ba7 100644 --- a/operators/align_include_clear.py +++ b/operators/align_include_clear.py @@ -19,7 +19,6 @@ # NONE! # Blender imports -import bpy from bpy.types import Operator # Addon imports diff --git a/ui/app_handlers.py b/ui/app_handlers.py index e562a0e..f4c44ad 100644 --- a/ui/app_handlers.py +++ b/ui/app_handlers.py @@ -19,8 +19,6 @@ import math # Blender imports -import bpy -from bpy.app.handlers import persistent # Addon imports from ..functions import *