[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43309] trunk/blender/source/blender/ windowmanager/intern/wm_event_system.c: fix for error in last commit - don' t overwrite options in the new operator which have been set before the operator runs .

Campbell Barton ideasman42 at gmail.com
Wed Jan 11 21:03:46 CET 2012


Revision: 43309
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43309
Author:   campbellbarton
Date:     2012-01-11 20:03:41 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
fix for error in last commit - don't overwrite options in the new operator which have been set before the operator runs.

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2012-01-11 19:33:14 UTC (rev 43308)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2012-01-11 20:03:41 UTC (rev 43309)
@@ -747,19 +747,20 @@
 
 		RNA_PROP_BEGIN(op->ptr, itemptr, iterprop) {
 			PropertyRNA *prop= itemptr.data;
-
 			if((RNA_property_flag(prop) & PROP_SKIP_SAVE) == 0) {
-				const char *identifier= RNA_property_identifier(prop);
-				IDProperty *idp_src= IDP_GetPropertyFromGroup(lastop->properties, identifier);
-				if(idp_src) {
-					IDProperty *idp_dst = IDP_CopyProperty(idp_src);
+				if (!RNA_property_is_set(op->ptr, prop)) { /* don't override a setting already set */
+					const char *identifier= RNA_property_identifier(prop);
+					IDProperty *idp_src= IDP_GetPropertyFromGroup(lastop->properties, identifier);
+					if(idp_src) {
+						IDProperty *idp_dst = IDP_CopyProperty(idp_src);
 
-					/* note - in the future this may need to be done recursively,
-					 * but for now RNA doesn't access nested operators */
-					idp_dst->flag |= IDP_FLAG_GHOST;
+						/* note - in the future this may need to be done recursively,
+						 * but for now RNA doesn't access nested operators */
+						idp_dst->flag |= IDP_FLAG_GHOST;
 
-					IDP_ReplaceInGroup(op->properties, idp_dst);
-					change= TRUE;
+						IDP_ReplaceInGroup(op->properties, idp_dst);
+						change= TRUE;
+					}
 				}
 			}
 		}



More information about the Bf-blender-cvs mailing list