Skip to content

Commit

Permalink
修复blender3.1.2无法开启插件的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zk-wz committed Apr 13, 2022
1 parent 77cce94 commit b078b43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .utils import *
from .bangumi_spider import *
from .bilibili_spider import *
# import bpy.utils.previews
import bpy.utils.previews


classes = [bangumi_props,
Expand Down
9 changes: 8 additions & 1 deletion operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ def poll(cls, context):
return True

def execute(self, context):
subprocess.run("clip", universal_newlines=True, input=context.scene.bangumi_property.yiyan,encoding="gbk")
try:
subprocess.run("clip", universal_newlines=True, input=context.scene.bangumi_property.yiyan,encoding="gbk")
except:
subprocess.run("pbcopy", universal_newlines=True, input=context.scene.bangumi_property.yiyan,encoding="gbk")
try:
subprocess.run("xclip", universal_newlines=True, input=context.scene.bangumi_property.yiyan,encoding="gbk")
except:
pass
self.report({'INFO'}, "文本已复制")
return {"FINISHED"}

Expand Down

0 comments on commit b078b43

Please sign in to comment.