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-06-30 23:20:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-30 23:20:45 +0400
commit37864a4273a5f9217f9b5995dc70212bb97a6cf6 (patch)
tree7c256bbc29aeda0904a45d06825c1e3f27810b68 /release
parent80ee09bb9a03a58019b2054d7e0d280658858656 (diff)
2.5
Image Window * Unpack operator now works. * Some small layout code tweaks. Info Window Header * Moved to python UI code. * template_running_jobs, template_operator_search added. * Ported external data operators: pack/unpack all, make paths relative/absolute, find/report missing files. Also * Report RPT_INFO too, not only warnings and errors. * Run UI handle functions after RNA and Operators. * Rename particle system add/remove operators, to not include "slot", that's only there for materials because that's what they are called now in RNA.
Diffstat (limited to 'release')
-rw-r--r--release/ui/buttons_particle.py4
-rw-r--r--release/ui/space_buttons.py2
-rw-r--r--release/ui/space_filebrowser.py9
-rw-r--r--release/ui/space_image.py42
-rw-r--r--release/ui/space_info.py119
5 files changed, 142 insertions, 34 deletions
diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py
index e51df6ef7fd..85580c9be69 100644
--- a/release/ui/buttons_particle.py
+++ b/release/ui/buttons_particle.py
@@ -36,8 +36,8 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
row.template_list(ob, "particle_systems", "active_particle_system_index")
col = row.column(align=True)
- col.itemO("OBJECT_OT_particle_system_slot_add", icon="ICON_ZOOMIN", text="")
- col.itemO("OBJECT_OT_particle_system_slot_remove", icon="ICON_ZOOMOUT", text="")
+ col.itemO("OBJECT_OT_particle_system_add", icon="ICON_ZOOMIN", text="")
+ col.itemO("OBJECT_OT_particle_system_remove", icon="ICON_ZOOMOUT", text="")
if psys:
split = layout.split(percentage=0.65)
diff --git a/release/ui/space_buttons.py b/release/ui/space_buttons.py
index a669690b8bc..cae9a813433 100644
--- a/release/ui/space_buttons.py
+++ b/release/ui/space_buttons.py
@@ -11,7 +11,7 @@ class Buttons_HT_header(bpy.types.Header):
so = context.space_data
scene = context.scene
- layout.template_header(context)
+ layout.template_header()
if context.area.show_menus:
row = layout.row(align=True)
diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py
index d23cc0f276c..820134d3e87 100644
--- a/release/ui/space_filebrowser.py
+++ b/release/ui/space_filebrowser.py
@@ -11,7 +11,7 @@ class FILEBROWSER_HT_header(bpy.types.Header):
layout = self.layout
params = st.params
- layout.template_header(context)
+ layout.template_header()
if context.area.show_menus:
row = layout.row()
@@ -38,11 +38,8 @@ class FILEBROWSER_HT_header(bpy.types.Header):
row.itemR(params, "filter_sound", text="");
row.itemR(params, "filter_text", text="");
- if params.do_filter:
- row.active = True
- else:
- row.active = False
-
+ row.active = params.do_filter
+
class FILEBROWSER_MT_directory(bpy.types.Menu):
__space_type__ = "FILE_BROWSER"
__label__ = "Directory"
diff --git a/release/ui/space_image.py b/release/ui/space_image.py
index 63ca316efe7..49ef18705c4 100644
--- a/release/ui/space_image.py
+++ b/release/ui/space_image.py
@@ -96,9 +96,9 @@ class IMAGE_MT_image(bpy.types.Menu):
else:
layout.itemO("IMAGE_OT_pack")
- # only for dirty && specific image types : XXX poll?
- #if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
- if False:
+ # only for dirty && specific image types, perhaps
+ # this could be done in operator poll too
+ if ima.dirty:
if ima.source in ("FILE", "GENERATED") and ima.type != "MULTILAYER":
layout.item_booleanO("IMAGE_OT_pack", "as_png", True, text="Pack As PNG")
@@ -215,8 +215,10 @@ class IMAGE_HT_header(bpy.types.Header):
if show_uvedit:
row.itemM("IMAGE_MT_select")
- # XXX menuname= (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))? "Image*": "Image";
- row.itemM("IMAGE_MT_image")
+ if ima and ima.dirty:
+ row.itemM("IMAGE_MT_image", text="Image*")
+ else:
+ row.itemM("IMAGE_MT_image", text="Image")
if show_uvedit:
row.itemM("IMAGE_MT_uvs")
@@ -344,6 +346,10 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
__region_type__ = "UI"
__label__ = "View Properties"
+ def poll(self, context):
+ sima = context.space_data
+ return (sima and (sima.image or sima.show_uvedit))
+
def draw(self, context):
sima = context.space_data
layout = self.layout
@@ -358,10 +364,12 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
if ima:
col.itemR(ima, "display_aspect")
- col = split.column()
- col.itemR(sima, "draw_repeated", text="Repeat")
- if show_uvedit:
- col.itemR(uvedit, "normalized_coordinates")
+ col = split.column()
+ col.itemR(sima, "draw_repeated", text="Repeat")
+ if show_uvedit:
+ col.itemR(uvedit, "normalized_coordinates", text="Normalized")
+ elif show_uvedit:
+ col.itemR(uvedit, "normalized_coordinates", text="Normalized")
if show_uvedit:
col = layout.column()
@@ -377,21 +385,6 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
#col.itemR(uvedit, "draw_edges")
#col.itemR(uvedit, "draw_faces")
-class IMAGE_PT_curves(bpy.types.Panel):
- __space_type__ = "IMAGE_EDITOR"
- __region_type__ = "UI"
- __label__ = "Curves"
-
- def poll(self, context):
- sima = context.space_data
- return (sima and sima.image)
-
- def draw(self, context):
- sima = context.space_data
- layout = self.layout
-
- layout.template_curve_mapping(sima.curves)
-
bpy.types.register(IMAGE_MT_view)
bpy.types.register(IMAGE_MT_select)
bpy.types.register(IMAGE_MT_image)
@@ -403,5 +396,4 @@ bpy.types.register(IMAGE_MT_uvs)
bpy.types.register(IMAGE_HT_header)
bpy.types.register(IMAGE_PT_game_properties)
bpy.types.register(IMAGE_PT_view_properties)
-#bpy.types.register(IMAGE_PT_curves)
diff --git a/release/ui/space_info.py b/release/ui/space_info.py
new file mode 100644
index 00000000000..de3346711e9
--- /dev/null
+++ b/release/ui/space_info.py
@@ -0,0 +1,119 @@
+
+import bpy
+
+class INFO_HT_header(bpy.types.Header):
+ __space_type__ = "USER_PREFERENCES"
+ __idname__ = "INFO_HT_header"
+
+ def draw(self, context):
+ st = context.space_data
+ layout = self.layout
+
+ layout.template_header()
+
+ if context.area.show_menus:
+ row = layout.row()
+ row.itemM("INFO_MT_file")
+ row.itemM("INFO_MT_add")
+ row.itemM("INFO_MT_timeline")
+ row.itemM("INFO_MT_game")
+ row.itemM("INFO_MT_render")
+ row.itemM("INFO_MT_help")
+
+ layout.template_ID(context.window, "screen") #, new="SCREEN_OT_new", open="SCREEN_OT_unlink")
+ layout.template_ID(context.screen, "scene") #, new="SCENE_OT_new", unlink="SCENE_OT_unlink")
+
+ layout.itemS()
+
+ layout.template_operator_search()
+ layout.template_running_jobs()
+
+class INFO_MT_file(bpy.types.Menu):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = "File"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator_context = "EXEC_AREA"
+ layout.itemO("WM_OT_read_homefile")
+ layout.operator_context = "INVOKE_AREA"
+ layout.itemO("WM_OT_open_mainfile")
+
+ layout.itemS()
+
+ layout.operator_context = "EXEC_AREA"
+ layout.itemO("WM_OT_save_mainfile")
+ layout.operator_context = "INVOKE_AREA"
+ layout.itemO("WM_OT_save_as_mainfile")
+
+ layout.itemS()
+
+ layout.itemM("INFO_MT_file_external_data")
+
+class INFO_MT_file_external_data(bpy.types.Menu):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = "External Data"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.itemO("FILE_OT_pack_all", text="Pack into .blend file")
+ layout.itemO("FILE_OT_unpack_all", text="Unpack into Files...")
+
+ layout.itemS()
+
+ layout.itemO("FILE_OT_make_paths_relative")
+ layout.itemO("FILE_OT_make_paths_absolute")
+ layout.itemO("FILE_OT_report_missing_files")
+ layout.itemO("FILE_OT_find_missing_files")
+
+class INFO_MT_add(bpy.types.Menu):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = "Add"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.itemL(text="Nothing yet")
+
+class INFO_MT_timeline(bpy.types.Menu):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = "Timeline"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.itemL(text="Nothing yet")
+
+class INFO_MT_game(bpy.types.Menu):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = "Game"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.itemL(text="Nothing yet")
+
+class INFO_MT_render(bpy.types.Menu):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = "Render"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.itemL(text="Nothing yet")
+
+class INFO_MT_help(bpy.types.Menu):
+ __space_type__ = "USER_PREFERENCES"
+ __label__ = "Help"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.itemL(text="Nothing yet")
+
+bpy.types.register(INFO_HT_header)
+bpy.types.register(INFO_MT_file)
+bpy.types.register(INFO_MT_file_external_data)
+bpy.types.register(INFO_MT_add)
+bpy.types.register(INFO_MT_timeline)
+bpy.types.register(INFO_MT_game)
+bpy.types.register(INFO_MT_render)
+bpy.types.register(INFO_MT_help)
+