def draw_socket_layout_split(socket: bpy.types.NodeSocket, layout: bpy.types.UILayout, prop_name='default_value_raw'): if not socket.is_output and not socket.is_linked: # Blender layouts use 0.4 splits layout = layout.split(factor=0.4, align=True) layout.label(text=socket.name) if not socket.is_output and not socket.is_linked: layout.prop(socket, prop_name, text='')
def draw_item(self, _context: bpy.types.Context, layout: bpy.types.UILayout, _data: AnyType, item: LS3DLensProperty, icon: int, _active_data: AnyType, _active_propname: str, _index: int) -> None: lens = item if self.layout_type in {'DEFAULT', 'COMPACT'}: if lens: split = layout.split() col = split.column() col.prop(lens, "material", text="", emboss=True, icon_only=True) col = split.column() row = col.row() row.prop(lens, "unknown_a", text="", emboss=False, icon_value=icon) row.prop(lens, "unknown_b", text="", emboss=False, icon_value=icon) else: layout.label(text="", icon_value=icon) elif self.layout_type == 'GRID': layout.alignment = 'CENTER' layout.label(text="", icon_value=icon)
def __draw_location_properties(position_box: bpy.types.UILayout, position_properties: WorkpiecePosition): position_box.label(text="Origin type") position_box.prop(position_properties, "origin_type", text="") if position_properties.origin_type == "corner": position_box.label(text="Selected corner (local)") position_box.prop(position_properties, "origin_corner", text="") elif position_properties.origin_type == "edge-centered": position_box.label(text="Selected edge") position_box.prop(position_properties, "origin_edge", text="") elif position_properties.origin_type == "face-centered": position_box.label(text="Selected face") position_box.prop(position_properties, "origin_face", text="") position_box.label(text="Origin location") position_box.prop(position_properties, "origin_location", text="") if position_properties.origin_location == "position": position_box.label(text="Coordinates") position_box.prop(position_properties, "location_coordinates", text="") elif position_properties.origin_location == "selected": position_box.label(text="Distance", icon='ARROW_LEFTRIGHT') position_box.prop(position_properties, "distance", text="")