Skip to content

Commit

Permalink
Switched to gmsh-api.
Browse files Browse the repository at this point in the history
  • Loading branch information
senthurayyappan committed Jul 29, 2020
1 parent 890e706 commit b95884e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ Report any issues or feedback here: https://github.com/blender-for-science/blend

## References

Gmsh documentation: http://gmsh.info/doc/texinfo/gmsh.html
Gmsh documentation: http://gmsh.info/doc/texinfo/gmsh.html
gmsh-api: https://pypi.org/project/gmsh-api
18 changes: 9 additions & 9 deletions preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ def draw(self, context):

layout = self.layout

if importlib.util.find_spec('gmsh') is not None:
layout.label(text='Gmsh module loaded.', icon='INFO')
if importlib.util.find_spec('gmsh-api') is not None:
layout.label(text='gmsh-api loaded.', icon='INFO')
else:
layout.label(text='Blendmsh requires Gmsh module!', icon='ERROR')
layout.label(text='Blendmsh requires gmsh-api!', icon='ERROR')
row = layout.row()
row.operator('blendmsh.installer')

class BlendmshInstaller(bpy.types.Operator):
bl_idname = "blendmsh.installer"
bl_label = "Install Gmsh"
bl_description = ("Install Gmsh module")
bl_label = "Install gmsh-api"
bl_description = ("Install gmsh-api")

def execute(self, context):
try:
from .utils_pip import Pip
# Pip.upgrade_pip()
Pip.install('gmsh')
Pip.install('gmsh-api')

import gmsh
self.report({'INFO'}, 'Successfully installed Gmsh module.')
import gmsh_api
self.report({'INFO'}, 'Successfully installed gmsh-api.')
except:
self.report({'ERROR'}, 'Could not install Gmsh module, Kindly install it manually.')
self.report({'ERROR'}, 'Could not install gmsh-api, Kindly install it manually.')
return {'FINISHED'}
2 changes: 1 addition & 1 deletion processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def execute(self, context):
scene = context.scene

try:
import gmsh
import gmsh_api.gmsh as gmsh

if scene.blendmsh.initialized:
filename = bpy.context.active_object.name
Expand Down

0 comments on commit b95884e

Please sign in to comment.