Skip to content

Commit

Permalink
fix image name for relative filepaths
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Meech committed Sep 22, 2023
1 parent e7fc808 commit 11a113f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions image.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ def execute(self, context):
self.report({"ERROR"}, "Please input image filepath")
return {"CANCELLED"}

image_filename = os.path.basename(
os.path.normpath(settings.image_filepath)
)
absolute_image_path = os.path.normpath(bpy.path.abspath(settings.image_filepath))
image_filename = os.path.basename(absolute_image_path)

if check_if_image_already_added(context, image_filename):
self.report({"ERROR"}, "Image of same name already loaded")
Expand Down Expand Up @@ -101,10 +100,10 @@ def execute(self, context):
image_match.points_3d_collection = point_collection

# Hide any currently shown 3D points
swap_point_matches(settings.image_matches,
swap_point_matches(settings.image_matches,
settings.current_image_name, image_match.name)
settings.current_image_name = image_match.name

return {"FINISHED"}


Expand All @@ -128,7 +127,7 @@ def execute(self, context):
image_match = settings.image_matches[self.image_name]

open_movie_clip(image_match.movie_clip)
swap_point_matches(settings.image_matches,
swap_point_matches(settings.image_matches,
settings.current_image_name, self.image_name)
settings.current_image_name = self.image_name

Expand Down

0 comments on commit 11a113f

Please sign in to comment.