bugfix: [#28026] Copy Game Property broken
authorDalai Felinto <dfelinto@gmail.com>
Sat, 23 Jul 2011 18:03:01 +0000 (18:03 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Sat, 23 Jul 2011 18:03:01 +0000 (18:03 +0000)
not exactly a bug, but the option to copy individual properties was not working from the SPACE menu.
I believe this was happening because we are using dynamic enums.

This commit makes the "merge" option to be the default one. So if you call it from the SPACE menu it will be the one used.

source/blender/editors/object/object_edit.c

index 29a740affc534051240f5303cda2208fd106211c..395705dc029c8b501d156d2cfaf79438cc16a707 100644 (file)
@@ -2162,16 +2162,20 @@ static int game_property_copy_exec(bContext *C, wmOperator *op)
                        } CTX_DATA_END;
                }
        }
-       else if (ELEM(type, COPY_PROPERTIES_REPLACE, COPY_PROPERTIES_MERGE)) {
+
+       else {
                CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
                        if (ob != ob_iter) {
                                if (ob->data != ob_iter->data){
-                                       if (type == 2) {/* merge */
+                                       if (type == COPY_PROPERTIES_REPLACE)
+                                               copy_properties( &ob_iter->prop, &ob->prop );
+
+                                       /* merge - the default when calling with no argument */
+                                       else {
                                                for(prop = ob->prop.first; prop; prop= prop->next ) {
                                                        set_ob_property(ob_iter, prop);
                                                }
-                                       } else /* replace */
-                                               copy_properties( &ob_iter->prop, &ob->prop );
+                                       }
                                }
                        }
                }