Skip to content

Commit

Permalink
Merge pull request #143 from SpectralVectors/property-format
Browse files Browse the repository at this point in the history
Property format
  • Loading branch information
pppalain authored Mar 22, 2024
2 parents 0ad061a + 4fea2d2 commit 32d6d54
Show file tree
Hide file tree
Showing 12 changed files with 3,329 additions and 1,232 deletions.
2,031 changes: 1,447 additions & 584 deletions scripts/addons/cam/__init__.py

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions scripts/addons/cam/autoupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import pathlib
import zipfile
import bpy
from bpy.props import StringProperty

import re
import io
import os
Expand Down Expand Up @@ -114,7 +116,8 @@ def execute(self, context):
commit_sha = commit_list[0]['sha']
if bpy.context.preferences.addons['cam'].preferences.last_commit_hash != commit_sha:
# get zipball from this commit
zip_url = update_source.replace("/commits", f"/zipball/{commit_sha}")
zip_url = update_source.replace(
"/commits", f"/zipball/{commit_sha}")
self.install_zip_from_url(zip_url)
bpy.context.preferences.addons['cam'].preferences.last_commit_hash = commit_sha
bpy.ops.wm.save_userpref()
Expand All @@ -130,9 +133,11 @@ def install_zip_from_url(self, zip_url):
for fileinfo in files:
filename = fileinfo.filename
if fileinfo.is_dir() == False:
path_pos = filename.replace("\\", "/").find("/scripts/addons/cam/")
path_pos = filename.replace(
"\\", "/").find("/scripts/addons/cam/")
if path_pos != -1:
relative_path = filename[path_pos+len("/scripts/addons/cam/"):]
relative_path = filename[path_pos +
len("/scripts/addons/cam/"):]
out_path = cam_addon_path / relative_path
print(out_path)
# check folder exists
Expand Down Expand Up @@ -162,7 +167,9 @@ class UpdateSourceOperator(bpy.types.Operator):
bl_idname = "render.cam_set_update_source"
bl_label = "Set blendercam update source"

new_source: bpy.props.StringProperty(default='')
new_source: StringProperty(
default='',
)

def execute(self, context):
bpy.context.preferences.addons['cam'].preferences.update_source = self.new_source
Expand Down
Loading

0 comments on commit 32d6d54

Please sign in to comment.