Skip to content

Commit

Permalink
Merge pull request #2 from cavEpfl/blender_3_2_update
Browse files Browse the repository at this point in the history
Blender 3.2.2 update
  • Loading branch information
cavEpfl authored Sep 3, 2022
2 parents 5f7da48 + fd6fa7a commit 674e3da
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 33 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand All @@ -32,7 +32,6 @@

# Blender imports
import bpy
from bpy.types import Scene, Object

# Addon imports
from .operators import *
Expand Down
14 changes: 7 additions & 7 deletions addon_updater_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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'}
Expand Down Expand Up @@ -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'}
Expand Down
1 change: 0 additions & 1 deletion functions/common/blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion functions/common/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import math

# Blender imports
import bpy
from mathutils import Matrix


Expand Down
2 changes: 1 addition & 1 deletion functions/common/maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# NONE!

# Blender imports
from mathutils import Matrix, Vector
from mathutils import Vector

# Module imports
from .wrappers import blender_version_wrapper
Expand Down
28 changes: 14 additions & 14 deletions lib/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,68 +28,68 @@ 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)
align_methods =['RIGID','ROT_LOC_SCALE']#,'AFFINE']
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,
Expand Down
1 change: 0 additions & 1 deletion lib/reportError.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# Blender imports
import bpy
import addon_utils
from bpy.props import StringProperty

# Addon imports
from ..functions import *
Expand Down
1 change: 0 additions & 1 deletion operators/align_include_clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# NONE!

# Blender imports
import bpy
from bpy.types import Operator

# Addon imports
Expand Down
2 changes: 0 additions & 2 deletions ui/app_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import math

# Blender imports
import bpy
from bpy.app.handlers import persistent

# Addon imports
from ..functions import *
Expand Down

0 comments on commit 674e3da

Please sign in to comment.