diff --git a/Makefile b/Makefile index a8a06ff..ca84ddf 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,5 @@ -bleMD.zip: - zip bleMD.zip bleMD/* +SRC = $(shell find bleMD) + +bleMD.zip: $(SRC) + zip -r bleMD.zip bleMD/* + diff --git a/bleMD/__init__.py b/bleMD/__init__.py index c9309ec..7828b2a 100644 --- a/bleMD/__init__.py +++ b/bleMD/__init__.py @@ -172,13 +172,29 @@ class WM_OT_bleMDOpenOvitoScript(Operator): def execute(self, context): if "Ovito" not in bpy.data.texts.keys(): bpy.data.texts.new("Ovito") - bpy.data.texts['Ovito'].write("# You can put in your ovito script here!") + bpy.data.texts['Ovito'].write( +""" +# +# You can set up OVITO commands to run here. +# +# You are given a "pipeline" object that has already been loaded. +# All you need to do is set up the modifiers that you want to use. +# For instance, you can use the following lines to unwrap trajectories: +# +# from ovito.modifiers import UnwrapTrajectoriesModifier +# from ovito.modifiers import WrapPeriodicImagesModifier +# pipeline.modifiers.append(WrapPeriodicImagesModifier()) +# pipeline.modifiers.append(UnwrapTrajectoriesModifier()) +# +""") + bpy.context.window.workspace = bpy.data.workspaces['Scripting'] for area in context.screen.areas: if area.type == "TEXT_EDITOR": - break - area.spaces[0].text = bpy.data.texts['Ovito'] + for space in area.spaces: + if type(space) == bpy.types.SpaceTextEditor: + space.text = bpy.data.texts['Ovito'] return {'FINISHED'} diff --git a/scripts/install.py b/scripts/install.py index 5b82ee9..7d02bac 100644 --- a/scripts/install.py +++ b/scripts/install.py @@ -1,3 +1,6 @@ import bpy bpy.ops.preferences.addon_install(filepath="bleMD.zip",overwrite=True) bpy.ops.preferences.addon_enable(module='bleMD') + +#bpy.context.scene.bleMD_props.lammpsfile="/home/brunnels/Downloads/qstruct_S3_fcc_N13_n17_25_Al_M99_201228.389.out" +#bpy.ops.wm.read_lammps_file()