0
以下是攪拌器腳本(VERS 2.77)來讀取SVG文件和記錄材料,MEST等使用攪拌機腳本無法讀取SVG文件導出爲JSON
import bpy
bpy.ops.import_curve.svg (filepath="test.svg")
bpy.ops.object.delete(use_global=False)
bpy.context.space_data.system_bookmarks_active = 1
bpy.ops.transform.resize(value=(5.38055, 5.38055, 5.38055), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
bpy.ops.transform.translate(value=(0, 5.83748, 0), constraint_axis=(False, True, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True)
bpy.ops.transform.resize(value=(1.36144, 1.36144, 1.36144), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
bpy.ops.transform.rotate(value=1.5708, axis=(1, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
bpy.ops.transform.translate(value=(0, 0, 9.82884), constraint_axis=(False, False, True), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True)
bpy.ops.object.join()
bpy.data.materials.new("foo")
bpy.context.object.data.materials.append(mat)
bpy.context.space_data.context = 'DATA'
bpy.context.object.data.dimensions = '3D'
bpy.context.object.data.dimensions = '2D'
bpy.context.space_data.context = 'MODIFIER'
bpy.context.space_data.context = 'DATA'
bpy.context.space_data.context = 'MATERIAL'
bpy.context.object.active_material.diffuse_color = (0.239552, 0.239552, 0.239552)
bpy.context.space_data.viewport_shade = 'WIREFRAME'
bpy.context.space_data.viewport_shade = 'MATERIAL'
bpy.ops.object.convert(target='MESH', keep_original=True)
bpy.data.window_managers["WinMan"] = False
bpy.ops.object.convert(target='MESH', keep_original=False)
bpy.data.window_managers["WinMan"] = False
bpy.ops.object.convert(target='MESH', keep_original=True)
bpy.data.window_managers["WinMan"] = False
bpy.ops.object.modifier_add(type='EDGE_SPLIT')
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="EdgeSplit")
以下是錯誤遇到
AttributeError的: 'SpaceTextEditor' 對象有沒有屬性 'system_bookmarks_action'
PLS提示前進的道路
感謝 ASH