please dont mix tabs and spaces, failed with python 3.1

This commit is contained in:
Campbell Barton 2009-05-20 02:17:53 +00:00
parent 40ae17d2f6
commit 42b5e49589
2 changed files with 70 additions and 79 deletions

@ -1,28 +1,27 @@
import bpy import bpy
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW" __space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW" __region_type__ = "WINDOW"
__context__ = "data" __context__ = "data"
def poll(self, context): def poll(self, context):
ob = context.active_object ob = context.active_object
return (ob and ob.type == 'ARMATURE') return (ob and ob.type == 'ARMATURE')
class DATA_PT_skeleton(DataButtonsPanel): class DATA_PT_skeleton(DataButtonsPanel):
__idname__ = "DATA_PT_skeleton" __idname__ = "DATA_PT_skeleton"
__label__ = "Skeleton" __label__ = "Skeleton"
def draw(self, context): def draw(self, context):
arm = context.main.armatures[0] arm = context.main.armatures[0]
layout = self.layout layout = self.layout
row = layout.row()
row.itemR(arm, "rest_position")
split = layout.split()
row = layout.row()
row.itemR(arm, "rest_position")
split = layout.split()
sub = split.column() sub = split.column()
sub.itemL(text="Deform:") sub.itemL(text="Deform:")
@ -41,15 +40,15 @@ class DATA_PT_skeleton(DataButtonsPanel):
class DATA_PT_display(DataButtonsPanel): class DATA_PT_display(DataButtonsPanel):
__idname__ = "DATA_PT_display" __idname__ = "DATA_PT_display"
__label__ = "Display" __label__ = "Display"
def draw(self, context): def draw(self, context):
arm = context.main.armatures[0] arm = context.main.armatures[0]
layout = self.layout layout = self.layout
split = layout.split() split = layout.split()
sub = split.column() sub = split.column()
sub.itemR(arm, "drawtype", text="Style") sub.itemR(arm, "drawtype", text="Style")
sub.itemR(arm, "delay_deform", text="Delay Refresh") sub.itemR(arm, "delay_deform", text="Delay Refresh")
@ -62,14 +61,14 @@ class DATA_PT_display(DataButtonsPanel):
class DATA_PT_paths(DataButtonsPanel): class DATA_PT_paths(DataButtonsPanel):
__idname__ = "DATA_PT_paths" __idname__ = "DATA_PT_paths"
__label__ = "Paths" __label__ = "Paths"
def draw(self, context): def draw(self, context):
arm = context.main.armatures[0] arm = context.main.armatures[0]
layout = self.layout layout = self.layout
split = layout.split() split = layout.split()
sub = split.column() sub = split.column()
@ -92,15 +91,15 @@ class DATA_PT_paths(DataButtonsPanel):
class DATA_PT_ghost(DataButtonsPanel): class DATA_PT_ghost(DataButtonsPanel):
__idname__ = "DATA_PT_ghost" __idname__ = "DATA_PT_ghost"
__label__ = "Ghost" __label__ = "Ghost"
def draw(self, context): def draw(self, context):
arm = context.main.armatures[0] arm = context.main.armatures[0]
layout = self.layout layout = self.layout
split = layout.split() split = layout.split()
sub = split.column() sub = split.column()
sub.itemR(arm, "ghost_type", text="Scope") sub.itemR(arm, "ghost_type", text="Scope")
@ -119,4 +118,4 @@ class DATA_PT_ghost(DataButtonsPanel):
bpy.types.register(DATA_PT_skeleton) bpy.types.register(DATA_PT_skeleton)
bpy.types.register(DATA_PT_display) bpy.types.register(DATA_PT_display)
bpy.types.register(DATA_PT_paths) bpy.types.register(DATA_PT_paths)
bpy.types.register(DATA_PT_ghost) bpy.types.register(DATA_PT_ghost)

@ -2,24 +2,24 @@
import bpy import bpy
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW" __space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW" __region_type__ = "WINDOW"
__context__ = "bone" __context__ = "bone"
def poll(self, context): def poll(self, context):
ob = context.active_object ob = context.active_object
return (ob and ob.type == 'ARMATURE') return (ob and ob.type == 'ARMATURE')
class DATA_PT_bone(DataButtonsPanel): class DATA_PT_bone(DataButtonsPanel):
__idname__ = "DATA_PT_bone" __idname__ = "DATA_PT_bone"
__label__ = "Bone" __label__ = "Bone"
def draw(self, context): def draw(self, context):
bone = context.main.armatures[0].bones[0] bone = context.main.armatures[0].bones[0]
layout = self.layout layout = self.layout
split = layout.split() split = layout.split()
sub = split.column() sub = split.column()
sub.itemR(bone, "name") sub.itemR(bone, "name")
sub.itemR(bone, "parent") sub.itemR(bone, "parent")
@ -53,23 +53,15 @@ class DATA_PT_bone(DataButtonsPanel):
class DATA_PT_constraints(DataButtonsPanel): class DATA_PT_constraints(DataButtonsPanel):
__idname__ = "DATA_PT_constraints" __idname__ = "DATA_PT_constraints"
__label__ = "Constraints" __label__ = "Constraints"
def draw(self, context): def draw(self, context):
bone = context.main.armatures[0].bones[0] bone = context.main.armatures[0].bones[0]
layout = self.layout layout = self.layout
split = layout.split()
split = layout.split()
sub = split.column() sub = split.column()
bpy.types.register(DATA_PT_bone) bpy.types.register(DATA_PT_bone)
bpy.types.register(DATA_PT_constraints) bpy.types.register(DATA_PT_constraints)