Skip to content

Commit

Permalink
Only create the addon zip on releases
Browse files Browse the repository at this point in the history
  • Loading branch information
eadf committed Oct 31, 2023
1 parent a62ad68 commit a737ad4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Rust_lib

on:
push:
branches: [ "main" ]
#push:
# branches: [ "main" ]
release:
types:
- created
Expand Down
8 changes: 4 additions & 4 deletions blender_addon/hallr_collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def VIEW3D_MT_collision_menu_item(self, context):

def register():
bpy.utils.register_class(OBJECT_OT_hallr_collision)
bpy.types.VIEW3D_MT_mesh_add.append(VIEW3D_MT_collision_menu_item)
bpy.types.VIEW3D_MT_object_convert.append(VIEW3D_MT_collision_menu_item)


def unregister():
Expand All @@ -214,10 +214,10 @@ def unregister():
except (RuntimeError, NameError):
pass

bpy.types.VIEW3D_MT_mesh_add.remove(VIEW3D_MT_collision_menu_item)
for f in bpy.types.VIEW3D_MT_mesh_add._dyn_ui_initialize():
bpy.types.VIEW3D_MT_object_convert.remove(VIEW3D_MT_collision_menu_item)
for f in bpy.types.VIEW3D_MT_object_convert._dyn_ui_initialize():
if f.__name__ == VIEW3D_MT_collision_menu_item.__name__:
bpy.types.VIEW3D_MT_mesh_add.remove(f)
bpy.types.VIEW3D_MT_object_convert.remove(f)


if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions misc/ffi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class ProcessResult(ctypes.Structure):


system = platform.system()
library_extension = ".dylib" # Default to macOS
library_name = "libhallr.dylib" # Default to macOS
if system == "Linux":
library_extension = ".so"
library_name = "libhallr.so"
elif system == "Windows":
library_extension = ".dll"
library_name = "hallr.dll"

rust_lib = ctypes.cdll.LoadLibrary("./blender_addon_exported/lib/libhallr" + library_extension)
rust_lib = ctypes.cdll.LoadLibrary("./blender_addon_exported/lib/" + library_name)
rust_lib.process_geometry.argtypes = [ctypes.POINTER(Vector3), ctypes.c_size_t,
ctypes.POINTER(ctypes.c_size_t), ctypes.c_size_t,
ctypes.POINTER(StringMap)]
Expand Down

0 comments on commit a737ad4

Please # to comment.