Browse Source

Add cubemap builder to Plasma Image menu.

pull/176/head
Adam Johnson 5 years ago
parent
commit
b98d315115
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 13
      korman/operators/op_image.py
  2. 1
      korman/ui/ui_menus.py

13
korman/operators/op_image.py

@ -127,15 +127,8 @@ class PlasmaBuildCubeMapOperator(bpy.types.Operator):
default="",
options={"HIDDEN"})
def __init__(self):
self._report = ExportProgressLogger()
self._report.progress_add_step("Finding Face Images")
self._report.progress_add_step("Loading Face Images")
self._report.progress_add_step("Scaling Face Images")
self._report.progress_add_step("Generating Cube Map")
def execute(self, context):
with ConsoleToggler(True) as _:
with ConsoleToggler(True), ExportProgressLogger() as self._report:
try:
self._execute()
except ExportError as error:
@ -145,6 +138,10 @@ class PlasmaBuildCubeMapOperator(bpy.types.Operator):
return {"FINISHED"}
def _execute(self):
self._report.progress_add_step("Finding Face Images")
self._report.progress_add_step("Loading Face Images")
self._report.progress_add_step("Scaling Face Images")
self._report.progress_add_step("Generating Cube Map")
self._report.progress_start("BUILDING CUBE MAP")
if not Path(self.filepath).is_file():
raise ExportError("No cube image found at '{}'".format(self.filepath))

1
korman/ui/ui_menus.py

@ -42,6 +42,7 @@ class PlasmaImageMenu(PlasmaMenu, bpy.types.Menu):
layout = self.layout
layout.operator("image.plasma_bake_image_alpha", icon="IMAGE_RGB_ALPHA")
layout.operator("image.plasma_build_cube_map", icon="MATCUBE")
def _build_plasma_menu(menu_operator, self, context):

Loading…
Cancel
Save