Skip to content

Commit

Permalink
Merge pull request #9 from Andrej730/main
Browse files Browse the repository at this point in the history
importing dds without image editor opened
  • Loading branch information
matyalatte committed May 16, 2023
2 parents 6511573 + 5a82b6a commit a78871f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions addons/blender_dds_addon/ui/bpy_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ def get_addon_preferences(context, addon_name):
def get_image_editor_space(context):
area = context.area
if area.type == 'IMAGE_EDITOR':
space = area.spaces.active
else:
raise RuntimeError('Failed to get Image Editor. This is unexpected.')
return space
return area.spaces.active
return None


def get_selected_tex(context):
Expand Down
3 changes: 2 additions & 1 deletion addons/blender_dds_addon/ui/import_dds.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def import_dds(context, file):
dds_options = context.scene.dds_options
tex = load_dds(file, invert_normals=dds_options.invert_normals,
cubemap_layout=dds_options.cubemap_layout)
space.image = tex
if space:
space.image = tex


def import_dds_rec(context, folder, count=0):
Expand Down

0 comments on commit a78871f

Please sign in to comment.