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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user