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:
authorElia Sarti <vekoon@gmail.com>2009-12-07 14:50:05 +0300
committerElia Sarti <vekoon@gmail.com>2009-12-07 14:50:05 +0300
commitc1c5acae14517fa2e365816caf9041dbeb956ac0 (patch)
treec427655c924c2f675e69a41c6e27cb3bd3e04269 /source/blender/editors/interface/interface_templates.c
parentcc166a8b50dad33522463e663df53a99db867ba4 (diff)
Porting of Graph Editor's UI to python, just header done for now.
Brecht, I added a Layout template function, template_dopesheet_filter -> uiTemplateDopeSheetFilter, this creates the group of buttons for filtering ID type (and some other options) for animation editors (Graph, NLA and Dopesheet). I hope this is all right, if not, we can move this maybe to a .py file as a function for reuse.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 9402da2f2c6..bb893294910 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -60,12 +60,58 @@ void ui_template_fix_linking()
void uiTemplateHeader(uiLayout *layout, bContext *C, int menus)
{
uiBlock *block;
-
+
block= uiLayoutAbsoluteBlock(layout);
if(menus) ED_area_header_standardbuttons(C, block, 0);
else ED_area_header_switchbutton(C, block, 0);
}
+/********************** DopeSheet Filter Template *************************/
+
+void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr)
+{
+ Main *mainptr= CTX_data_main(C);
+ ScrArea *sa= CTX_wm_area(C);
+ uiLayout *row= layout;
+ short nlaActive= ((sa) && (sa->spacetype==SPACE_NLA));
+
+ /* more 'generic' filtering options */
+ if (nlaActive)
+ row= uiLayoutRow(layout, 1);
+
+ uiItemR(row, "", 0, ptr, "only_selected", 0);
+
+ if (nlaActive)
+ uiItemR(row, "", 0, ptr, "include_missing_nla", 0);
+
+ if (nlaActive)
+ row= layout;
+
+ /* datatype based - only available datatypes are shown */
+ row= uiLayoutRow(layout, 1);
+
+ uiItemR(row, "", 0, ptr, "display_scene", 0);
+ uiItemR(row, "", 0, ptr, "display_world", 0);
+ uiItemR(row, "", 0, ptr, "display_node", 0);
+
+ if (mainptr && mainptr->key.first)
+ uiItemR(row, "", 0, ptr, "display_shapekeys", 0);
+ if (mainptr && mainptr->mat.first)
+ uiItemR(row, "", 0, ptr, "display_material", 0);
+ if (mainptr && mainptr->lamp.first)
+ uiItemR(row, "", 0, ptr, "display_lamp", 0);
+ if (mainptr && mainptr->camera.first)
+ uiItemR(row, "", 0, ptr, "display_camera", 0);
+ if (mainptr && mainptr->curve.first)
+ uiItemR(row, "", 0, ptr, "display_curve", 0);
+ if (mainptr && mainptr->mball.first)
+ uiItemR(row, "", 0, ptr, "display_metaball", 0);
+ if (mainptr && mainptr->armature.first)
+ uiItemR(row, "", 0, ptr, "display_armature", 0);
+ if (mainptr && mainptr->particle.first)
+ uiItemR(row, "", 0, ptr, "display_particle", 0);
+}
+
/********************** Search Callbacks *************************/
typedef struct TemplateID {