Skip to content

Commit

Permalink
tweak panel UI
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Nov 29, 2023
1 parent 661dc80 commit fc3bfec
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 49 deletions.
16 changes: 6 additions & 10 deletions molecularnodes/io/cellpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
maxlen = 0
)
bpy.types.Scene.mol_import_cell_pack_name = bpy.props.StringProperty(
name = 'cellpack_name',
name = 'Name',
description = 'Name of the created object.',
default = 'NewCellPackModel',
maxlen = 0
Expand Down Expand Up @@ -105,7 +105,7 @@ def starting_node_tree(ensemble, coll_cellpack, name = "CellPackModel", fraction

class MN_OT_Import_Cell_Pack(bpy.types.Operator):
bl_idname = "mol.import_cell_pack"
bl_label = "Import CellPack File"
bl_label = "Load"
bl_description = ""
bl_options = {"REGISTER"}

Expand All @@ -124,13 +124,9 @@ def execute(self, context):
return {"FINISHED"}

def panel(layout, scene):
layout = layout.column(heading = "", align = False)
layout.label(text = "Import CellPack Model")
layout.label(text = "Load CellPack Model", icon='FILE_TICK')
layout.separator()
row_import = layout.row()
row_import.prop(
scene, 'mol_import_cell_pack_name',
text = 'Name',
emboss = True
)
row_import.prop(scene, 'mol_import_cell_pack_name')
layout.prop(scene, 'mol_import_cell_pack_path')
row_import.operator('mol.import_cell_pack', text = 'Load', icon = 'FILE_TICK')
row_import.operator('mol.import_cell_pack')
13 changes: 8 additions & 5 deletions molecularnodes/io/density.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def load(

class MN_OT_Import_Map(bpy.types.Operator):
bl_idname = "mn.import_density"
bl_label = "Load Density"
bl_label = "Load"
bl_description = "Import a EM density map into Blender"
bl_options = {"REGISTER"}

Expand All @@ -257,13 +257,15 @@ def execute(self, context):
return {"FINISHED"}

def panel(layout, scene):
layout.label(text = 'Import EM Maps as Volumes')
row = layout.row()
layout.label(text = 'Load EM Map', icon='FILE_TICK')
layout.separator()

row = layout.row()
row.prop(scene, 'MN_import_density_name')
row.operator('mn.import_density', icon = 'FILE_TICK')
row.operator('mn.import_density')

layout.prop(scene, 'MN_import_density')
layout.separator()
col = layout.column()
col.alignment = "LEFT"
col.scale_y = 0.5
Expand All @@ -275,7 +277,8 @@ def panel(layout, scene):
for line in label.strip().split(' '):
col.label(text=line)

layout.label(text = "Import Options", icon = "MODIFIER")
layout.separator()
layout.label(text = "Options", icon = "MODIFIER")
layout.prop(scene, "MN_import_density_style")

grid = layout.grid_flow()
Expand Down
14 changes: 7 additions & 7 deletions molecularnodes/io/dna.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def load(top, traj, name = 'oxDNA', setup_nodes=True, world_scale = 0.01):

class MN_OT_Import_OxDNA_Trajectory(bpy.types.Operator):
bl_idname = "mn.import_oxdna"
bl_label = "Import oxDNA File"
bl_label = "Load"
bl_description = "Will import the given file and toplogy."
bl_options = {"REGISTER"}

Expand All @@ -306,11 +306,11 @@ def execute(self, context):


def panel(layout, scene):
col = layout.column(heading = "", align = False)
col.label(text = "Import oxDNA File")
row = col.row()
layout.label(text = "Load oxDNA File", icon='FILE_TICK')
layout.separator()
row = layout.row()
row.prop(scene, 'MN_import_oxdna_name')
col = col.column(align=True)
row.operator('mn.import_oxdna')
col = layout.column(align=True)
col.prop(scene, 'MN_import_oxdna_topology')
col.prop(scene, 'MN_import_oxdna_trajectory')
row.operator('mn.import_oxdna', text = 'Load', icon = 'FILE_TICK')
col.prop(scene, 'MN_import_oxdna_trajectory')
21 changes: 9 additions & 12 deletions molecularnodes/io/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def open_structure_local_pdbx(file_path):
# operator that calls the function to import the structure from a local file
class MN_OT_Import_Protein_Local(bpy.types.Operator):
bl_idname = "mn.import_protein_local"
bl_label = "import_protein_local"
bl_label = "Load"
bl_description = "Open a local structure file"
bl_options = {"REGISTER", "UNDO"}

Expand Down Expand Up @@ -150,18 +150,15 @@ def invoke(self, context, event):
return self.execute(context)

def panel(layout, scene):
col_main = layout.column(heading = '', align = False)
col_main.alert = False
col_main.enabled = True
col_main.active = True
col_main.label(text = "Open a Local File")
row_name = col_main.row(align = False)
row_name.prop(scene, 'MN_import_local_name', icon_value = 0)
row_name.operator('mn.import_protein_local', text = "Load", icon='FILE_TICK')
row_import = col_main.row()
layout.label(text = "Load a Local File", icon='FILE_TICK')
layout.separator()
row_name = layout.row(align = False)
row_name.prop(scene, 'MN_import_local_name')
row_name.operator('mn.import_protein_local')
row_import = layout.row()
row_import.prop(scene, 'MN_import_local_path')

layout.label(text = "Import Options", icon = "MODIFIER")
layout.separator()
layout.label(text = "Options", icon = "MODIFIER")
layout.prop(scene, "MN_import_style")
grid = layout.grid_flow()

Expand Down
10 changes: 5 additions & 5 deletions molecularnodes/io/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,18 @@ def custom_selections(layout, scene):
col.prop(item, "selection")

def panel(layout, scene):
layout.label(text = "Import Molecular Dynamics Trajectories")
layout.label(text = "Load MD Trajectories", icon='FILE_TICK')
layout.separator()
col = layout.column(align=True)
row_import = col.row(align=True)
row_import = col.row()
row_import.prop(scene, 'MN_import_md_name')
row_import.operator('mn.import_protein_md', text = "Load", icon='FILE_TICK')
row_import.split(factor=2)
row_import.operator('mn.import_protein_md', text = "Load")
col.separator()
col.prop(scene, 'MN_import_md_topology')
col.prop(scene, 'MN_import_md_trajectory')

layout.separator()
layout.label(text = "Import Options", icon = "MODIFIER")
layout.label(text = "Options", icon = "MODIFIER")
layout.prop(scene, "MN_import_style")
layout.prop(scene, 'MN_md_selection')
row_frame = layout.row(heading = "Frames", align = True)
Expand Down
9 changes: 5 additions & 4 deletions molecularnodes/io/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ def execute(self, context):

def panel(layout, scene):

layout.label(text = "Download from PDB")
layout.label(text = "Download from PDB", icon="IMPORT")
layout.separator()
row_import = layout.row()
row_import.prop(scene, 'MN_pdb_code')
row_import.operator('mn.import_protein_rcsb', text='Download', icon='IMPORT')

layout.label(text = "Import Options", icon = "MODIFIER")
row_import.operator('mn.import_protein_rcsb', text='Download')
layout.separator()
layout.label(text = "Options", icon = "MODIFIER")
options = layout.column(align = True)
options.prop(scene, "MN_import_style")
options.separator()
Expand Down
12 changes: 6 additions & 6 deletions molecularnodes/io/star.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def load(

class MN_OT_Import_Star_File(bpy.types.Operator):
bl_idname = "mn.import_star_file"
bl_label = "Import Star File"
bl_label = "Load"
bl_description = "Will import the given file, setting up the points to instance an object."
bl_options = {"REGISTER"}

Expand All @@ -136,9 +136,9 @@ def execute(self, context):


def panel(layout, scene):
col_main = layout.column(heading = "", align = False)
col_main.label(text = "Import Star File")
row_import = col_main.row()
layout.label(text = "Load Star File", icon='FILE_TICK')
layout.separator()
row_import = layout.row()
row_import.prop(scene, 'MN_import_star_file_name')
col_main.prop(scene, 'MN_import_star_file_path')
row_import.operator('mn.import_star_file', text = 'Load', icon = 'FILE_TICK')
layout.prop(scene, 'MN_import_star_file_path')
row_import.operator('mn.import_star_file')

0 comments on commit fc3bfec

Please sign in to comment.