|
|
@ -14,6 +14,25 @@ |
|
|
|
# along with Korman. If not, see <http://www.gnu.org/licenses/>. |
|
|
|
# along with Korman. If not, see <http://www.gnu.org/licenses/>. |
|
|
|
|
|
|
|
|
|
|
|
import bpy |
|
|
|
import bpy |
|
|
|
|
|
|
|
from pathlib import Path |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from . import ui_list |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ImageListUI(bpy.types.UIList): |
|
|
|
|
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_property, index=0, flt_flag=0): |
|
|
|
|
|
|
|
if item.image is None: |
|
|
|
|
|
|
|
layout.label("[No Image Specified]", icon="ERROR") |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
layout.label(str(Path(item.image.name).with_suffix(".hsm")), icon_value=item.image.preview.icon_id) |
|
|
|
|
|
|
|
layout.prop(item, "enabled", text="") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def imagelibmod(modifier, layout, context): |
|
|
|
|
|
|
|
ui_list.draw_modifier_list(layout, "ImageListUI", modifier, "images", "active_image_index", rows=3, maxrows=6) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if modifier.images: |
|
|
|
|
|
|
|
row = layout.row(align=True) |
|
|
|
|
|
|
|
row.template_ID(modifier.images[modifier.active_image_index], "image", open="image.open") |
|
|
|
|
|
|
|
|
|
|
|
def journalbookmod(modifier, layout, context): |
|
|
|
def journalbookmod(modifier, layout, context): |
|
|
|
layout.prop_menu_enum(modifier, "versions") |
|
|
|
layout.prop_menu_enum(modifier, "versions") |
|
|
|