Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-29 03:45:50 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-29 03:45:50 +0400
commit276a75ae071ac44e813a0b5e499846e752d80b1e (patch)
tree851afc75fdc0f86578e1e487bb8125d4d409c662 /release
parentfacb94461665934e3c1bf32a4cfec0c14892ce53 (diff)
UI:
* Added panels with dummy preview template. * Added constraints panel for bones next to objects, though it doesn't work that well yet, the operators and code need to be changed so they don't assume it is one or the other in/out of posemode. * Added some graying out in the scene and world buttons.
Diffstat (limited to 'release')
-rw-r--r--release/ui/buttons_data_bone.py19
-rw-r--r--release/ui/buttons_material.py14
-rw-r--r--release/ui/buttons_object_constraint.py91
-rw-r--r--release/ui/buttons_objects.py14
-rw-r--r--release/ui/buttons_scene.py13
-rw-r--r--release/ui/buttons_texture.py12
-rw-r--r--release/ui/buttons_world.py19
-rw-r--r--release/ui/space_outliner.py2
8 files changed, 130 insertions, 54 deletions
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py
index ea9fc3639f1..a4e0fe4e2fb 100644
--- a/release/ui/buttons_data_bone.py
+++ b/release/ui/buttons_data_bone.py
@@ -1,7 +1,7 @@
import bpy
-class DataButtonsPanel(bpy.types.Panel):
+class BoneButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "bone"
@@ -10,8 +10,8 @@ class DataButtonsPanel(bpy.types.Panel):
ob = context.active_object
return (ob and ob.type == 'ARMATURE')
-class DATA_PT_bone(DataButtonsPanel):
- __idname__ = "DATA_PT_bone"
+class BONE_PT_bone(BoneButtonsPanel):
+ __idname__ = "BONE_PT_bone"
__label__ = "Bone"
def draw(self, context):
@@ -49,16 +49,5 @@ class DATA_PT_bone(DataButtonsPanel):
sub.itemR(bone, "cyclic_offset")
-class DATA_PT_constraints(DataButtonsPanel):
- __idname__ = "DATA_PT_constraints"
- __label__ = "Constraints"
-
- def draw(self, context):
- bone = context.active_object.data.bones[0]
- layout = self.layout
- split = layout.split()
-
- sub = split.column()
+bpy.types.register(BONE_PT_bone)
-bpy.types.register(DATA_PT_bone)
-#bpy.types.register(DATA_PT_constraints) \ No newline at end of file
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index a468a55efba..7137bccd245 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -9,6 +9,16 @@ class MaterialButtonsPanel(bpy.types.Panel):
def poll(self, context):
ob = context.active_object
return (ob and ob.active_material)
+
+class MATERIAL_PT_preview(MaterialButtonsPanel):
+ __idname__= "MATERIAL_PT_preview"
+ __label__ = "Preview"
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.active_object.active_material
+ layout.template_preview(mat)
class MATERIAL_PT_material(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_material"
@@ -188,8 +198,10 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
sub.itemR(halo, "flare_seed", text="Seed")
sub.itemR(halo, "flares_sub", text="Sub")
+bpy.types.register(MATERIAL_PT_preview)
bpy.types.register(MATERIAL_PT_material)
bpy.types.register(MATERIAL_PT_raymir)
bpy.types.register(MATERIAL_PT_raytransp)
bpy.types.register(MATERIAL_PT_sss)
-bpy.types.register(MATERIAL_PT_halo) \ No newline at end of file
+bpy.types.register(MATERIAL_PT_halo)
+
diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py
index 1ff1bec199d..d44e6fdd10d 100644
--- a/release/ui/buttons_object_constraint.py
+++ b/release/ui/buttons_object_constraint.py
@@ -1,34 +1,39 @@
import bpy
-class DataButtonsPanel(bpy.types.Panel):
+class ConstraintButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "object"
- def poll(self, context):
- ob = context.active_object
- return (ob != None)
-
-class DATA_PT_constraints(DataButtonsPanel):
- __idname__ = "DATA_PT_constraints"
- __label__ = "Constraints"
-
- def draw(self, context):
- ob = context.active_object
+ def draw_constraint(self, con):
layout = self.layout
+ box = layout.template_constraint(con)
- row = layout.row()
- row.item_menu_enumO("OBJECT_OT_constraint_add", "type")
- row.itemL();
+ if box:
+ if con.type == "COPY_LOCATION":
+ self.copy_location(box, con)
- for con in ob.constraints:
- box = layout.template_constraint(con)
+ # show/key buttons here are most likely obsolete now, with
+ # keyframing functionality being part of every button
+ if con.type not in ("RIGID_BODY_JOINT", "NULL"):
+ box.itemR(con, "influence")
+
+ def space_template(self, layout, con, target=True, owner=True):
+ if target or owner:
+ row = layout.row()
+
+ row.itemL(text="Convert:")
+
+ if target:
+ row.itemR(con, "target_space", text="")
- if box:
- if con.type == 'COPY_LOCATION':
- self.copy_location(box, con)
-
+ if target and owner:
+ row.itemL(icon=8) # XXX
+
+ if owner:
+ row.itemR(con, "owner_space", text="")
+
def target_template(self, layout, con, subtargets=True):
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
@@ -55,5 +60,49 @@ class DATA_PT_constraints(DataButtonsPanel):
layout.itemR(con, "offset")
-bpy.types.register(DATA_PT_constraints)
+ self.space_template(layout, con)
+
+class OBJECT_PT_constraints(ConstraintButtonsPanel):
+ __idname__ = "OBJECT_PT_constraints"
+ __label__ = "Constraints"
+ __context__ = "object"
+
+ def poll(self, context):
+ ob = context.active_object
+ return (ob != None)
+
+ def draw(self, context):
+ ob = context.active_object
+ layout = self.layout
+
+ row = layout.row()
+ row.item_menu_enumO("OBJECT_OT_constraint_add", "type")
+ row.itemL();
+
+ for con in ob.constraints:
+ self.draw_constraint(con)
+
+class BONE_PT_constraints(ConstraintButtonsPanel):
+ __idname__ = "BONE_PT_constraints"
+ __label__ = "Constraints"
+ __context__ = "bone"
+
+ def poll(self, context):
+ ob = context.active_object
+ return (ob and ob.type == "ARMATURE")
+
+ def draw(self, context):
+ ob = context.active_object
+ pchan = ob.pose.pose_channels[0]
+ layout = self.layout
+
+ #row = layout.row()
+ #row.item_menu_enumO("BONE_OT_constraint_add", "type")
+ #row.itemL();
+
+ for con in pchan.constraints:
+ self.draw_constraint(con)
+
+bpy.types.register(OBJECT_PT_constraints)
+bpy.types.register(BONE_PT_constraints)
diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py
index 8f02a015eac..a5074614515 100644
--- a/release/ui/buttons_objects.py
+++ b/release/ui/buttons_objects.py
@@ -39,15 +39,15 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
for group in bpy.data.groups:
if ob in group.objects:
- box = layout.box()
+ col = layout.column(align=True)
- row = box.row()
- row.itemR(group, "name")
+ row = col.box().row()
+ row.itemR(group, "name", text="")
#row.itemO("OBJECT_OT_remove_group")
- row = box.row()
- row.column().itemR(group, "layer")
- row.column().itemR(group, "dupli_offset")
+ split = col.box().split()
+ split.column().itemR(group, "layer")
+ split.column().itemR(group, "dupli_offset")
class OBJECT_PT_display(ObjectButtonsPanel):
__idname__ = "OBJECT_PT_display"
@@ -131,4 +131,4 @@ bpy.types.register(OBJECT_PT_transform)
bpy.types.register(OBJECT_PT_groups)
bpy.types.register(OBJECT_PT_display)
bpy.types.register(OBJECT_PT_duplication)
-bpy.types.register(OBJECT_PT_animation) \ No newline at end of file
+bpy.types.register(OBJECT_PT_animation)
diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py
index 7b23ae03088..1b892a5b2fb 100644
--- a/release/ui/buttons_scene.py
+++ b/release/ui/buttons_scene.py
@@ -77,10 +77,11 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
def draw(self, context):
scene = context.scene
- layout = self.layout
-
rd = scene.render_data
+ layout = self.layout
+ layout.active = rd.antialiasing
+
split = layout.split()
sub = split.column()
@@ -182,10 +183,11 @@ class RENDER_PT_stamp(RenderButtonsPanel):
def draw(self, context):
scene = context.scene
- layout = self.layout
-
rd = scene.render_data
+ layout = self.layout
+ layout.active = rd.stamp
+
split = layout.split()
sub = split.column()
@@ -211,4 +213,5 @@ bpy.types.register(RENDER_PT_dimensions)
bpy.types.register(RENDER_PT_antialiasing)
bpy.types.register(RENDER_PT_shading)
bpy.types.register(RENDER_PT_output)
-bpy.types.register(RENDER_PT_stamp) \ No newline at end of file
+bpy.types.register(RENDER_PT_stamp)
+
diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py
index 99b9295a6a6..ccdbda5d54d 100644
--- a/release/ui/buttons_texture.py
+++ b/release/ui/buttons_texture.py
@@ -10,6 +10,16 @@ class TextureButtonsPanel(bpy.types.Panel):
try: return (context.active_object.active_material.active_texture.texture != None)
except:return False
+class TEXTURE_PT_preview(TextureButtonsPanel):
+ __idname__= "TEXTURE_PT_preview"
+ __label__ = "Preview"
+
+ def draw(self, context):
+ layout = self.layout
+
+ tex = context.active_object.active_material.active_texture.texture
+ layout.template_preview(tex)
+
class TEXTURE_PT_texture(TextureButtonsPanel):
__idname__= "TEXTURE_PT_texture"
__label__ = "Texture"
@@ -330,6 +340,7 @@ class TEXTURE_PT_distortednoise(TextureButtonsPanel):
sub = split.column()
sub.itemR(tex, "nabla")
+bpy.types.register(TEXTURE_PT_preview)
bpy.types.register(TEXTURE_PT_texture)
bpy.types.register(TEXTURE_PT_clouds)
bpy.types.register(TEXTURE_PT_wood)
@@ -344,3 +355,4 @@ bpy.types.register(TEXTURE_PT_envmap)
bpy.types.register(TEXTURE_PT_musgrave)
bpy.types.register(TEXTURE_PT_voronoi)
bpy.types.register(TEXTURE_PT_distortednoise)
+
diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py
index 401fbcb0c22..c38e791d92a 100644
--- a/release/ui/buttons_world.py
+++ b/release/ui/buttons_world.py
@@ -8,6 +8,15 @@ class WorldButtonsPanel(bpy.types.Panel):
def poll(self, context):
return (context.scene.world != None)
+
+class WORLD_PT_preview(WorldButtonsPanel):
+ __label__ = "Preview"
+
+ def draw(self, context):
+ layout = self.layout
+
+ world = context.scene.world
+ layout.template_preview(world)
class WORLD_PT_world(WorldButtonsPanel):
__label__ = "World"
@@ -49,6 +58,7 @@ class WORLD_PT_mist(WorldButtonsPanel):
def draw(self, context):
world = context.scene.world
layout = self.layout
+ layout.active = world.mist.enabled
flow = layout.column_flow()
flow.itemR(world.mist, "start")
@@ -71,6 +81,7 @@ class WORLD_PT_stars(WorldButtonsPanel):
def draw(self, context):
world = context.scene.world
layout = self.layout
+ layout.active = world.stars.enabled
flow = layout.column_flow()
flow.itemR(world.stars, "size")
@@ -89,9 +100,9 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
def draw(self, context):
world = context.scene.world
- layout = self.layout
-
ao = world.ambient_occlusion
+ layout = self.layout
+ layout.active = ao.enabled
layout.itemR(ao, "gather_method", expand=True)
@@ -126,8 +137,10 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
col.row().itemR(ao, "color", expand=True)
col.itemR(ao, "energy")
+bpy.types.register(WORLD_PT_preview)
bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion)
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)
-bpy.types.register(WORLD_PT_color_correction) \ No newline at end of file
+bpy.types.register(WORLD_PT_color_correction)
+
diff --git a/release/ui/space_outliner.py b/release/ui/space_outliner.py
index 12690ff819f..a87b1e21a0f 100644
--- a/release/ui/space_outliner.py
+++ b/release/ui/space_outliner.py
@@ -18,7 +18,6 @@ class OUTLINER_HT_header(bpy.types.Header):
row = layout.row(align=True)
row.itemR(so, "display_mode")
-
class OUTLINER_MT_view(bpy.types.Menu):
__space_type__ = "OUTLINER"
__label__ = "View"
@@ -30,7 +29,6 @@ class OUTLINER_MT_view(bpy.types.Menu):
layout.column()
row.itemR(so, "show_restriction_columns")
#layout.itemO("TEXT_OT_new")
-
bpy.types.register(OUTLINER_HT_header)
bpy.types.register(OUTLINER_MT_view)