オブジェクトパネル最下部に「Test」欄とボタンを作成し、押したら「clicked」と表示する。
import bpyclass ObjectButtonsPanel(bpy.types.Panel):
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"class OBJECT_PT_Test(ObjectButtonsPanel):
bl_label = "Test"
Display = 0
def draw_header(self, context):
layout = self.layoutdef draw(self, context):
layout = self.layout
row = layout.row()
row.operator("exportbutton", text="Exec")class OBJECT_OT_Test(bpy.types.Operator):
bl_label = "Test"
bl_idname = "exportbutton"def invoke(self, context, event):
scene = context.scene
print("clicked");
return('FINISHED')bpy.types.register(OBJECT_OT_Test)
bpy.types.register(OBJECT_PT_Test)

- Newer: Firefox3.6の新規タブを右端に出るように設定
- Older: Blender2.5の日本語化のための調査メモ
Comments:0
Trackbacks:0
- Trackback URL for this entry
- http://www.futuregadget.com/wp-trackback.php?p=212
- Listed below are links to weblogs that reference
- Blender2.5から始めるスクリプト05 from FutureGadget