Skip to content

Commit

Permalink
Updating so that ALL properties get set, including those resulting fr…
Browse files Browse the repository at this point in the history
…om the ovito script
  • Loading branch information
bsrunnels committed Nov 21, 2023
1 parent d7f3f9c commit 67ca1d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions bleMD/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@
# KEY SUBROUTINE 1/2
# Opens Ovito and does basic communication with dump fil
#
def startOvito():
def startOvito(hardrefresh=False):
filename = bpy.context.scene.bleMD_props.lammpsfile
interp = bpy.context.scene.bleMD_props.lammps_frame_stride
scene = bpy.context.scene
mytool = scene.bleMD_props


#
# Load the file
#
Expand All @@ -70,13 +69,16 @@ def startOvito():
#
data = pipeline.compute()
props = list(data.particles.keys())
scene.datafieldlist.clear()
if hardrefresh:
scene.datafieldlist.clear()

for prop in props:
item = scene.datafieldlist.add()
item.name = prop
if prop == "Position":
item.enable = True
item.editable = False
if prop not in [i.name for i in scene.datafieldlist]:
item = scene.datafieldlist.add()
item.name = prop
if prop == "Position":
item.enable = True
item.editable = False

return pipeline

Expand Down
2 changes: 1 addition & 1 deletion bleMD/bleMDProperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def updateFrameStride(self, context):
)

def openLAMMPSFile(self, context):
startOvito()
startOvito(hardrefresh=True)


lammpsfile: StringProperty(
Expand Down

0 comments on commit 67ca1d3

Please sign in to comment.