diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-10-19 08:56:19 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-10-19 08:56:19 +0400 |
commit | 1a7ec53dc446f417592d077f3b736ad35f72ae2e (patch) | |
tree | 96837a1edfa75e2eaae876448a82832f64520a93 /source | |
parent | ed032e13f230a156bbe95412036c37f5f4a8d4b5 (diff) |
Assorted 3D-View Tweaks:
* Paste Flipped Pose in PoseMode should now work. The parameters weren't getting set before
* Added a notifier that gets sent when changing layers with scene lock on. For some reason, this doesn't seem to be sending the correct updates though.
* Made the tools region no longer overlap the 3D-View. The default .b.blend file still needs to be updated so that this gets reflected.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_nla/space_nla.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_header.c | 12 |
3 files changed, 32 insertions, 7 deletions
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 32ff7766690..5f2f75b7b6f 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -47,6 +47,8 @@ #include "BKE_nla.h" #include "BKE_colortools.h" #include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_main.h" #include "BKE_screen.h" #include "BKE_utildefines.h" @@ -112,6 +114,7 @@ static SpaceLink *nla_new(const bContext *C) /* allocate DopeSheet data for NLA Editor */ snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet"); + snla->ads->source= (ID *)scene; /* set auto-snapping settings */ snla->autosnap = SACTSNAP_FRAME; @@ -189,8 +192,10 @@ static void nla_init(struct wmWindowManager *wm, ScrArea *sa) SpaceNla *snla= (SpaceNla *)sa->spacedata.first; /* init dopesheet data if non-existant (i.e. for old files) */ - if (snla->ads == NULL) + if (snla->ads == NULL) { snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet"); + snla->ads->source= (ID *)G.main->scene.first; // XXX this is bad, but we need this to be set correct + } ED_area_tag_refresh(sa); } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 2cade9bb685..86e9743d5bb 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -123,7 +123,7 @@ ARegion *view3d_has_tools_region(ScrArea *sa) BLI_insertlinkafter(&sa->regionbase, arhead, artool); artool->regiontype= RGN_TYPE_TOOLS; - artool->alignment= RGN_OVERLAP_LEFT; + artool->alignment= RGN_ALIGN_LEFT; //RGN_OVERLAP_LEFT; artool->flag = RGN_FLAG_HIDDEN; } @@ -218,12 +218,28 @@ static SpaceLink *view3d_new(const bContext *C) ar->regiontype= RGN_TYPE_HEADER; ar->alignment= RGN_ALIGN_BOTTOM; + /* toolbar */ + ar= MEM_callocN(sizeof(ARegion), "toolbar for view3d"); + + BLI_addtail(&v3d->regionbase, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_LEFT; + ar->flag = RGN_FLAG_HIDDEN; + + /* tool properties */ + ar= MEM_callocN(sizeof(ARegion), "tool properties for view3d"); + + BLI_addtail(&v3d->regionbase, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; + ar->flag = RGN_FLAG_HIDDEN; + /* buttons/list view */ ar= MEM_callocN(sizeof(ARegion), "buttons for view3d"); BLI_addtail(&v3d->regionbase, ar); ar->regiontype= RGN_TYPE_UI; - ar->alignment= RGN_ALIGN_LEFT; + ar->alignment= RGN_ALIGN_RIGHT; ar->flag = RGN_FLAG_HIDDEN; /* main area */ diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index c0a0241c74c..e6fe8fabc13 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -178,12 +178,12 @@ static void handle_view3d_lock(bContext *C) if (v3d != NULL && sa != NULL) { if(v3d->localvd==NULL && v3d->scenelock && sa->spacetype==SPACE_VIEW3D) { - /* copy to scene */ scene->lay= v3d->lay; scene->camera= v3d->camera; - //copy_view3d_lock(REDRAW); + /* notifiers for scene update */ + WM_event_add_notifier(C, NC_SCENE, scene); } } } @@ -2204,6 +2204,9 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE, xco,yco,XIC,YIC, NULL, 0, 1.0, 0, 0, "Render this window (Ctrl Click for anim)"); if (ob && (ob->mode & OB_MODE_POSE)) { + PointerRNA *but_ptr; + uiBut *but; + xco+= XIC*2; uiBlockBeginAlign(block); @@ -2213,8 +2216,9 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiDefIconButO(block, BUT, "POSE_OT_paste", WM_OP_INVOKE_REGION_WIN, ICON_PASTEDOWN, xco,yco,XIC,YIC, NULL); xco+= XIC; - // FIXME: this needs an extra arg... - uiDefIconButO(block, BUT, "POSE_OT_paste", WM_OP_INVOKE_REGION_WIN, ICON_PASTEFLIPDOWN, xco,yco,XIC,YIC, NULL); + but=uiDefIconButO(block, BUT, "POSE_OT_paste", WM_OP_INVOKE_REGION_WIN, ICON_PASTEFLIPDOWN, xco,yco,XIC,YIC, NULL); + but_ptr= uiButGetOperatorPtrRNA(but); + RNA_boolean_set(but_ptr, "flipped", 1); uiBlockEndAlign(block); header_xco_step(ar, &xco, &yco, &maxco, XIC); |