minor update to panel templates/examples - the panel examples didnt show an operator and use scene
rather then sc
for the active scene name.
This commit is contained in:
parent
60a5e05a4d
commit
e038d7212a
@ -12,36 +12,36 @@ class LayoutDemoPanel(bpy.types.Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
sc = context.scene
|
||||
|
||||
#Create a simple row.
|
||||
scene = context.scene
|
||||
|
||||
# Create a simple row.
|
||||
layout.label(text=" Simple Row:")
|
||||
|
||||
|
||||
row = layout.row()
|
||||
row.prop(sc, "frame_start")
|
||||
row.prop(sc, "frame_end")
|
||||
|
||||
#Create an row where the buttons are aligned to each other.
|
||||
row.prop(scene, "frame_start")
|
||||
row.prop(scene, "frame_end")
|
||||
|
||||
# Create an row where the buttons are aligned to each other.
|
||||
layout.label(text=" Aligned Row")
|
||||
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(sc, "frame_start")
|
||||
row.prop(sc, "frame_end")
|
||||
|
||||
#Create two columns, by using a split layout.
|
||||
row.prop(scene, "frame_start")
|
||||
row.prop(scene, "frame_end")
|
||||
|
||||
# Create two columns, by using a split layout.
|
||||
split = layout.split()
|
||||
|
||||
|
||||
# First column
|
||||
col = split.column()
|
||||
col.label(text="Column One:")
|
||||
col.prop(sc, "frame_end")
|
||||
col.prop(sc, "frame_start")
|
||||
|
||||
col.prop(scene, "frame_end")
|
||||
col.prop(scene, "frame_start")
|
||||
|
||||
# Second column, aligned
|
||||
col = split.column(align=True)
|
||||
col.label(text="Column Two")
|
||||
col.prop(sc, "frame_start")
|
||||
col.prop(sc, "frame_end")
|
||||
col.prop(scene, "frame_start")
|
||||
col.prop(scene, "frame_end")
|
||||
|
||||
|
||||
def register():
|
||||
|
@ -22,6 +22,9 @@ class HelloWorldPanel(bpy.types.Panel):
|
||||
row = layout.row()
|
||||
row.prop(obj, "name")
|
||||
|
||||
row = layout.row()
|
||||
row.operator("mesh.primitive_cube_add")
|
||||
|
||||
|
||||
def register():
|
||||
bpy.utils.register_class(HelloWorldPanel)
|
||||
|
Loading…
x
Reference in New Issue
Block a user