Images as Planes: Improve option panels #104936

Closed
Sun Kim wants to merge 9 commits from persun/blender-addons:iap_options_ui into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 852d7965e6 - Show all commits

View File

@ -804,6 +804,8 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper):
def draw_material_config(self, context): def draw_material_config(self, context):
# --- Material / Rendering Properties --- # # --- Material / Rendering Properties --- #
layout = self.layout layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
box = layout.box() box = layout.box()
box.label(text="Compositing Nodes:", icon='RENDERLAYERS') box.label(text="Compositing Nodes:", icon='RENDERLAYERS')
@ -812,24 +814,19 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper):
box = layout.box() box = layout.box()
box.label(text="Material Settings:", icon='MATERIAL') box.label(text="Material Settings:", icon='MATERIAL')
box.label(text="Material Type")
row = box.row() row = box.row()
row.prop(self, 'shader', expand=True) row.prop(self, 'shader', expand=False)
if self.shader == 'EMISSION': if self.shader == 'EMISSION':
box.prop(self, "emit_strength") box.prop(self, "emit_strength")
box.label(text="Blend Mode")
row = box.row() row = box.row()
row.prop(self, 'blend_method', expand=True) row.prop(self, 'blend_method', expand=False)
if self.use_transparency and self.alpha_mode != "NONE" and self.blend_method == "OPAQUE":
box.label(text="'Opaque' does not support alpha", icon="ERROR")
if self.blend_method == 'BLEND': if self.blend_method == 'BLEND':
row = box.row() row = box.row()
row.prop(self, "show_transparent_back") row.prop(self, "show_transparent_back")
box.label(text="Shadow Mode")
row = box.row() row = box.row()
row.prop(self, 'shadow_method', expand=True) row.prop(self, 'shadow_method', expand=False)
row = box.row() row = box.row()
row.prop(self, "use_backface_culling") row.prop(self, "use_backface_culling")
@ -842,17 +839,15 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper):
layout = self.layout layout = self.layout
box = layout.box() box = layout.box()
box.label(text="Texture Settings:", icon='TEXTURE') box.label(text="Texture Settings:", icon='TEXTURE')
box.label(text="Interpolation")
row = box.row() row = box.row()
row.prop(self, 'interpolation', expand=True) row.prop(self, 'interpolation', expand=False)
box.label(text="Extension")
row = box.row() row = box.row()
row.prop(self, 'extension', expand=True) row.prop(self, 'extension', expand=False)
row = box.row() row = box.row()
row.prop(self, "use_transparency") row.prop(self, "use_transparency")
if self.use_transparency: row = box.row()
sub = row.row() row.enabled = self.use_transparency
sub.prop(self, "alpha_mode", text="") row.prop(self, "alpha_mode")
row = box.row() row = box.row()
row.prop(self, "use_auto_refresh") row.prop(self, "use_auto_refresh")
@ -861,18 +856,18 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper):
layout = self.layout layout = self.layout
box = layout.box() box = layout.box()
box.label(text="Position:", icon='SNAP_GRID') box.label(text="Transform:", icon='SNAP_GRID')
box.prop(self, "offset") box.prop(self, "offset")
col = box.column() col = box.column()
row = col.row() row = col.row()
row.prop(self, "offset_axis", expand=True) row.prop(self, "offset_axis", expand=False)
row = col.row() row = col.row()
row.prop(self, "offset_amount") row.prop(self, "offset_amount")
col.enabled = self.offset col.enabled = self.offset
box.label(text="Plane dimensions:", icon='ARROW_LEFTRIGHT') box.label(text="Plane dimensions:")
row = box.row() row = box.row()
row.prop(self, "size_mode", expand=True) row.prop(self, "size_mode", expand=False)
if self.size_mode == 'ABSOLUTE': if self.size_mode == 'ABSOLUTE':
box.prop(self, "height") box.prop(self, "height")
elif self.size_mode == 'CAMERA': elif self.size_mode == 'CAMERA':
@ -887,7 +882,7 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper):
row.prop(self, "align_axis") row.prop(self, "align_axis")
row = box.row() row = box.row()
row.enabled = 'CAM' in self.align_axis row.enabled = 'CAM' in self.align_axis
row.alignment = 'RIGHT' row = box.row()
row.prop(self, "align_track") row.prop(self, "align_track")
def draw(self, context): def draw(self, context):