[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23934] trunk/blender/source/blender/ editors: Assorted 3D-View Tweaks:

Joshua Leung aligorith at gmail.com
Mon Oct 19 06:56:21 CEST 2009


Revision: 23934
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23934
Author:   aligorith
Date:     2009-10-19 06:56:19 +0200 (Mon, 19 Oct 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_nla/space_nla.c
    trunk/blender/source/blender/editors/space_view3d/space_view3d.c
    trunk/blender/source/blender/editors/space_view3d/view3d_header.c

Modified: trunk/blender/source/blender/editors/space_nla/space_nla.c
===================================================================
--- trunk/blender/source/blender/editors/space_nla/space_nla.c	2009-10-19 03:54:30 UTC (rev 23933)
+++ trunk/blender/source/blender/editors/space_nla/space_nla.c	2009-10-19 04:56:19 UTC (rev 23934)
@@ -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 @@
 	
 	/* 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 @@
 	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);
 }

Modified: trunk/blender/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2009-10-19 03:54:30 UTC (rev 23933)
+++ trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2009-10-19 04:56:19 UTC (rev 23934)
@@ -123,7 +123,7 @@
 		
 		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 @@
 	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 */

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_header.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_header.c	2009-10-19 03:54:30 UTC (rev 23933)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_header.c	2009-10-19 04:56:19 UTC (rev 23934)
@@ -178,12 +178,12 @@
 	
 	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 @@
 		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 @@
 			
 			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);
 





More information about the Bf-blender-cvs mailing list