# 需要導入模塊: from bpy_extras import io_utils [as 別名]

# 或者: from bpy_extras.io_utils import ImportHelper [as 別名]

def execute(self,context):

scn = bpy.context.scene

selected = bpy.context.selected_objects

shippart = selected.pop(0)

bpy.ops.object.select_all(action = 'DESELECT')

shippart.select = True

shipname = shippart["ship"]

mergelist = []

for obj in scn.objects:

if obj.type == 'MESH' and obj["ship"] == shipname and not obj.hide:

mergelist.append(obj)

bpy.ops.object.select_all(action = 'DESELECT')

for obj in mergelist:

obj.select = True

bpy.ops.object.join()

bpy.ops.object.parent_clear(type='CLEAR')

result = bpy.context.active_object

result.name = "RESULT"

#result.scale = (10,10,10)

bpy.ops.object.mode_set(mode='EDIT')

bpy.ops.mesh.remove_doubles(threshold = 0.001)

bpy.ops.mesh.normals_make_consistent(inside = False)

bpy.ops.object.mode_set(mode='OBJECT')

return {'FINISHED'}

##class LoadFlagPartOperator(bpy.types.Operator, ImportHelper):

## bl_idname = "object.loadflag"

## bl_label = "Load Flag"

##

## filename_ext = "Image file"

## filter_glob = StringProperty(default="*.jpg;*.JPG;*.jpeg;*.JPEG;*.png;*.PNG;*.bmp;*.BMP;*.tiff;*.TIFF", options={'HIDDEN'})

## #Add more file types if necessary, I guess

##

## def execute(self, context):

## from . import load_flag

##

##

python helper方法_Python io_utils.ImportHelper方法代碼示例相关推荐

  1. python keyboard backspace_Python curses.KEY_BACKSPACE屬性代碼示例

    本文整理匯總了Python中curses.KEY_BACKSPACE屬性的典型用法代碼示例.如果您正苦於以下問題:Python curses.KEY_BACKSPACE屬性的具體用法?Python c ...

  2. python calendar.isleap_Python calendar isleap()用法及代碼示例

    日曆模塊允許輸出類似於程序的日曆,並提供與日曆相關的其他有用功能. "日曆"模塊中定義的函數和類使用理想化的日曆,當前的公曆日曆在兩個方向上都無限期擴展. 在Python中,cal ...

  3. python中fmod什么意思_Python fmod()用法及代碼示例

    fmod()函數是Python中的標準數學庫函數之一,用於計算指定給定參數的模塊. 用法: math.fmod( x, y ) 參數: x任何有效數字(正數或負數). y任何有效數字(正數或負數). ...

  4. python里turtle.circle什么意思_Python turtle.circle方法代碼示例

    本文整理匯總了Python中turtle.circle方法的典型用法代碼示例.如果您正苦於以下問題:Python turtle.circle方法的具體用法?Python turtle.circle怎麽 ...

  5. python的from_bytes属性_Python parse.quote_from_bytes方法代碼示例

    本文整理匯總了Python中urllib.parse.quote_from_bytes方法的典型用法代碼示例.如果您正苦於以下問題:Python parse.quote_from_bytes方法的具體 ...

  6. python中startout是什么意思_Python socket.timeout方法代碼示例

    本文整理匯總了Python中gevent.socket.timeout方法的典型用法代碼示例.如果您正苦於以下問題:Python socket.timeout方法的具體用法?Python socket ...

  7. python markdown2 样式_Python markdown2.markdown方法代碼示例

    本文整理匯總了Python中markdown2.markdown方法的典型用法代碼示例.如果您正苦於以下問題:Python markdown2.markdown方法的具體用法?Python markd ...

  8. python socketio例子_Python socket.SocketIO方法代碼示例

    本文整理匯總了Python中socket.SocketIO方法的典型用法代碼示例.如果您正苦於以下問題:Python socket.SocketIO方法的具體用法?Python socket.Sock ...

  9. python unescape函数_Python escape.url_unescape方法代碼示例

    本文整理匯總了Python中tornado.escape.url_unescape方法的典型用法代碼示例.如果您正苦於以下問題:Python escape.url_unescape方法的具體用法?Py ...

最新文章

  1. intel服务器修复两个漏洞,游戏厂商:修复Intel处理器漏洞后 服务器超卡
  2. fprintf与fwrite的区别
  3. win8.1计算机开启远程桌面连接不上,启动Win8.1远程桌面不得不知的方案
  4. android socket 服务,android 创建socket 通信型service
  5. 手把手教用XNA开发winphone7游戏(四)
  6. 力扣904-水果成篮(C++,总结别人的思路)
  7. Spring MVC JSON数据交互(附带实例)
  8. MATLAB产生线性等分量函数 linspace
  9. LuckyFrame执行Web自动化用例
  10. 11gpath失败 oracle_win10安装oracle11g提示path长度不够,该怎样解决?
  11. fft与fftshift的维度
  12. 怎样从下载的MP4视频中将音乐提取出来?
  13. 妻子,情人,玫瑰花,刺木花(转载)
  14. 解决高分辨率下远程桌面连接服务器,字体图标太小的问题
  15. Jvectormap中文帮助文档(API)
  16. Tomcat启动内存设置
  17. Vue结合element-ui实现导航菜单展开收缩小功能
  18. Learning a Deep Compact Image Representation for Visual Tracking 学习用于视觉跟踪的深度紧凑图像表示
  19. 离岸公司注册在英国的优势
  20. 安装时提示错误1402的解决办法

热门文章

  1. 教师运用计算机技术的难点,浅谈运用电脑技术进行备课的几点优势
  2. u3d引擎移动都有哪些方法?又都适用于什么场景?
  3. 帆软BI工具Fine BI连接数据库
  4. 农信社计算机类试卷,农信社真题:开封农村信用社计算机考试试题合集
  5. 【剑指offer】BN层详解
  6. App ios 消息推送
  7. 2022-2028全球与中国侧装车载摄像头市场现状及未来发展趋势
  8. 2019春招宇视科技嵌入式面试
  9. 【Docker】如何进入到Docker容器内部
  10. 福大软工1816 · 第五次作业 - 结对作业2