Home > Blender | bpy > Blender2.5から始めるスクリプト05

Blender2.5から始めるスクリプト05

オブジェクトパネル最下部に「Test」欄とボタンを作成し、押したら「clicked」と表示する。

import bpy

class 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.layout

def 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)

Comments:0

Comment Form
Remember personal info

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

Home > Blender | bpy > Blender2.5から始めるスクリプト05

Search
Feeds
Meta

Return to page top