[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23712] trunk/blender: A few fixes:

Joshua Leung aligorith at gmail.com
Thu Oct 8 13:29:28 CEST 2009


Revision: 23712
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23712
Author:   aligorith
Date:     2009-10-08 13:29:27 +0200 (Thu, 08 Oct 2009)

Log Message:
-----------
A few fixes:
* Loading old files didn't initialise the new rotation variables properly
* Fixed some errors with the newly added operator for copying RNA-paths for properties
* Auto-keyframing now correctly refreshes animation editors after adding keyframes. Made the keyingsets code send notifiers again, but now using the newly added WM_main_event_add()  (thanks Brecht)
* A few UI tweaks again for animation stuff (timeline, keyingsets UI)

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/buttons_object.py
    trunk/blender/release/scripts/ui/buttons_scene.py
    trunk/blender/release/scripts/ui/space_time.py
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/animation/drivers.c
    trunk/blender/source/blender/editors/animation/keyingsets.c
    trunk/blender/source/blender/editors/interface/interface_anim.c
    trunk/blender/source/blender/editors/space_outliner/outliner.c
    trunk/blender/source/blender/makesrna/intern/rna_animation_api.c

Modified: trunk/blender/release/scripts/ui/buttons_object.py
===================================================================
--- trunk/blender/release/scripts/ui/buttons_object.py	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/release/scripts/ui/buttons_object.py	2009-10-08 11:29:27 UTC (rev 23712)
@@ -26,8 +26,6 @@
 		
 		ob = context.object
 		
-		
-
 		row = layout.row()
 		
 		row.column().itemR(ob, "location")

Modified: trunk/blender/release/scripts/ui/buttons_scene.py
===================================================================
--- trunk/blender/release/scripts/ui/buttons_scene.py	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/release/scripts/ui/buttons_scene.py	2009-10-08 11:29:27 UTC (rev 23712)
@@ -474,7 +474,7 @@
 		scene = context.scene
 		
 		row = layout.row()
-		row.itemL(text="Keying Sets")
+		row.itemL(text="Keying Sets:")
 		
 		row = layout.row()
 		
@@ -512,7 +512,7 @@
 		ks = scene.active_keying_set
 		
 		row = layout.row()
-		row.itemL(text="Paths")
+		row.itemL(text="Paths:")
 		
 		row = layout.row()
 		

Modified: trunk/blender/release/scripts/ui/space_time.py
===================================================================
--- trunk/blender/release/scripts/ui/space_time.py	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/release/scripts/ui/space_time.py	2009-10-08 11:29:27 UTC (rev 23712)
@@ -100,7 +100,7 @@
 		layout.itemS()
 		
 		sub = layout.row()
-		sub.active = tools.enable_auto_key
+		#sub.active = tools.enable_auto_key
 		sub.itemM("TIME_MT_autokey")
 
 class TIME_MT_playback(bpy.types.Menu):

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2009-10-08 11:29:27 UTC (rev 23712)
@@ -9912,6 +9912,24 @@
 
 	/* put 2.50 compatibility code here until next subversion bump */
 	{
+		Object *ob;
+		
+		/* New variables for axis-angle rotations and/or quaternion rotations were added, and need proper initialisation */
+		for (ob= main->object.first; ob; ob= ob->id.next) {
+			/* new variables for all objects */
+			ob->quat[0]= 1.0f;
+			ob->rotAxis[1]= 1.0f;
+			
+			/* bones */
+			if (ob->pose) {
+				bPoseChannel *pchan;
+				
+				for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+					/* just need to initalise rotation axis properly... */
+					pchan->rotAxis[1]= 1.0f;
+				}
+			}
+		}
 	}
 
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

Modified: trunk/blender/source/blender/editors/animation/drivers.c
===================================================================
--- trunk/blender/source/blender/editors/animation/drivers.c	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/source/blender/editors/animation/drivers.c	2009-10-08 11:29:27 UTC (rev 23712)
@@ -565,7 +565,7 @@
 }
 
 
-/* Paste Driver Button Operator ------------------------ */
+/* Copy to Clipboard Button Operator ------------------------ */
 
 static int copy_clipboard_button_exec(bContext *C, wmOperator *op)
 {
@@ -579,9 +579,9 @@
 	memset(&ptr, 0, sizeof(PointerRNA));
 	uiAnimContextProperty(C, &ptr, &prop, &index);
 
-	if (ptr.data && prop) { // && RNA_property_animateable(ptr.data, prop)
+	if (ptr.data && prop) {
 		path= RNA_path_from_ID_to_property(&ptr, prop);
-
+		
 		if (path) {
 			WM_clipboard_text_set(path, FALSE);
 			MEM_freeN(path);
@@ -597,15 +597,14 @@
 	/* identifiers */
 	ot->name= "Copy Data Path";
 	ot->idname= "ANIM_OT_copy_clipboard_button";
-	ot->description= "Copy the rna data path to the clipboard.";
+	ot->description= "Copy the RNA data path for this property to the clipboard.";
 
 	/* callbacks */
 	ot->exec= copy_clipboard_button_exec;
-	//op->poll= ??? // TODO: need to have some driver to be able to do this...
+	//op->poll= ??? // TODO: need to have some valid property before this can be done
 
 	/* flags */
-	ot->flag= 0;
+	ot->flag= OPTYPE_REGISTER;
 }
 
-
 /* ************************************************** */

Modified: trunk/blender/source/blender/editors/animation/keyingsets.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyingsets.c	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/source/blender/editors/animation/keyingsets.c	2009-10-08 11:29:27 UTC (rev 23712)
@@ -349,6 +349,7 @@
 				
 			/* add path to this setting */
 			BKE_keyingset_add_destination(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME);
+			ks->active_path= BLI_countlist(&ks->paths);
 			success= 1;
 			
 			/* free the temp path created */
@@ -1354,6 +1355,9 @@
 					}
 						break;
 				}
+				
+				/* send notifiers for updates (this doesn't require context to work!) */
+				WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
 			}
 		}
 	}
@@ -1484,6 +1488,9 @@
 					}
 						break;
 				}
+				
+				/* send notifiers for updates (this doesn't require context to work!) */
+				WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
 			}
 		}
 	}

Modified: trunk/blender/source/blender/editors/interface/interface_anim.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_anim.c	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/source/blender/editors/interface/interface_anim.c	2009-10-08 11:29:27 UTC (rev 23712)
@@ -309,10 +309,11 @@
 				uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button");
 			}
 		}
-
+		
 		uiItemS(layout);
-		uiItemBooleanO(layout, "Copy Data Path", 0, "ANIM_OT_copy_clipboard_button", "all", 1);
-
+		
+		uiItemO(layout, "Copy Data Path", 0, "ANIM_OT_copy_clipboard_button");
+		
 		uiPupMenuEnd(C, pup);
 	}
 }

Modified: trunk/blender/source/blender/editors/space_outliner/outliner.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner.c	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/source/blender/editors/space_outliner/outliner.c	2009-10-08 11:29:27 UTC (rev 23712)
@@ -3939,6 +3939,7 @@
 						/* add a new path with the information obtained (only if valid) */
 						// TODO: what do we do with group name? for now, we don't supply one, and just let this use the KeyingSet name
 						BKE_keyingset_add_destination(ks, id, NULL, path, array_index, flag, groupmode);
+						ks->active_path= BLI_countlist(&ks->paths);
 					}
 						break;
 					case KEYINGSET_EDITMODE_REMOVE:
@@ -3950,6 +3951,7 @@
 							/* free path's data */
 							// TODO: we probably need an API method for this 
 							if (ksp->rna_path) MEM_freeN(ksp->rna_path);
+							ks->active_path= 0;
 							
 							/* remove path from set */
 							BLI_freelinkN(&ks->paths, ksp);

Modified: trunk/blender/source/blender/makesrna/intern/rna_animation_api.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_animation_api.c	2009-10-08 11:24:06 UTC (rev 23711)
+++ trunk/blender/source/blender/makesrna/intern/rna_animation_api.c	2009-10-08 11:29:27 UTC (rev 23712)
@@ -54,6 +54,7 @@
 	/* if data is valid, call the API function for this */
 	if (keyingset) {
 		BKE_keyingset_add_destination(keyingset, id, group_name, rna_path, array_index, flag, grouping_method);
+		keyingset->active_path= BLI_countlist(&keyingset->paths); 
 	}
 	else {
 		BKE_report(reports, RPT_ERROR, "Keying Set Destination could not be added.");





More information about the Bf-blender-cvs mailing list