Commit: 2d90ef872abb9ea1140d74c171a3a10c37d8625c
Author: Antonio Vazquez
Date:   Sat Jul 14 10:05:31 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2d90ef872abb9ea1140d74c171a3a10c37d8625c

Fix merge error and remove old code

This file was wrong from a previous merge and still had code about grease 
pencil modifiers that was not deleted when the GP modifiers were splitted.

===================================================================

M       source/blender/editors/object/object_modifier.c

===================================================================

diff --git a/source/blender/editors/object/object_modifier.c 
b/source/blender/editors/object/object_modifier.c
index 641d8bfc90d..f83c6af08ee 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1,31 +1,31 @@
 /*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Blender Foundation, 2009
- *
- * ***** END GPL LICENSE BLOCK *****
- */
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+* All rights reserved.
+*
+* Contributor(s): Blender Foundation, 2009
+*
+* ***** END GPL LICENSE BLOCK *****
+*/
 
 /** \file blender/editors/object/object_modifier.c
- *  \ingroup edobj
- */
+*  \ingroup edobj
+*/
 
 
 #include <math.h>
@@ -38,7 +38,6 @@
 #include "DNA_armature_types.h"
 #include "DNA_curve_types.h"
 #include "DNA_key_types.h"
-#include "DNA_gpencil_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_object_force_types.h"
@@ -75,7 +74,6 @@
 #include "BKE_particle.h"
 #include "BKE_softbody.h"
 #include "BKE_editmesh.h"
-#include "BKE_gpencil.h"
 
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
@@ -119,8 +117,8 @@ ModifierData *ED_object_modifier_add(ReportList *reports, 
Main *bmain, Scene *sc
 
        if (type == eModifierType_ParticleSystem) {
                /* don't need to worry about the new modifier's name, since 
that is set to the number
-                * of particle systems which shouldn't have too many duplicates
-                */
+               * of particle systems which shouldn't have too many duplicates
+               */
                new_md = object_add_particle_system(bmain, scene, ob, name);
        }
        else {
@@ -177,11 +175,6 @@ ModifierData *ED_object_modifier_add(ReportList *reports, 
Main *bmain, Scene *sc
                }
        }
 
-       if (ob->type == OB_GPENCIL) {
-               bGPdata *gpd = ob->data;
-               DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA);
-       }
-
        DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
        DEG_relations_tag_update(bmain);
 
@@ -189,9 +182,9 @@ ModifierData *ED_object_modifier_add(ReportList *reports, 
Main *bmain, Scene *sc
 }
 
 /* Return true if the object has a modifier of type 'type' other than
- * the modifier pointed to be 'exclude', otherwise returns false. */
+* the modifier pointed to be 'exclude', otherwise returns false. */
 static bool object_has_modifier(const Object *ob, const ModifierData *exclude,
-                                ModifierType type)
+       ModifierType type)
 {
        ModifierData *md;
 
@@ -204,16 +197,16 @@ static bool object_has_modifier(const Object *ob, const 
ModifierData *exclude,
 }
 
 /* If the object data of 'orig_ob' has other users, run 'callback' on
- * each of them.
- *
- * If include_orig is true, the callback will run on 'orig_ob' too.
- *
- * If the callback ever returns true, iteration will stop and the
- * function value will be true. Otherwise the function returns false.
- */
+* each of them.
+*
+* If include_orig is true, the callback will run on 'orig_ob' too.
+*
+* If the callback ever returns true, iteration will stop and the
+* function value will be true. Otherwise the function returns false.
+*/
 bool ED_object_iter_other(Main *bmain, Object *orig_ob, const bool 
include_orig,
-                          bool (*callback)(Object *ob, void *callback_data),
-                          void *callback_data)
+                                                 bool (*callback)(Object *ob, 
void *callback_data),
+                                                 void *callback_data)
 {
        ID *ob_data_id = orig_ob->data;
        int users = ob_data_id->us;
@@ -227,10 +220,10 @@ bool ED_object_iter_other(Main *bmain, Object *orig_ob, 
const bool include_orig,
                int totfound = include_orig ? 0 : 1;
 
                for (ob = bmain->object.first; ob && totfound < users;
-                    ob = ob->id.next)
+                       ob = ob->id.next)
                {
                        if (((ob != orig_ob) || include_orig) &&
-                           (ob->data == orig_ob->data))
+                               (ob->data == orig_ob->data))
                        {
                                if (callback(ob, callback_data))
                                        return true;
@@ -254,8 +247,8 @@ static bool object_has_modifier_cb(Object *ob, void *data)
 }
 
 /* Use with ED_object_iter_other(). Sets the total number of levels
- * for any multires modifiers on the object to the int pointed to by
- * callback_data. */
+* for any multires modifiers on the object to the int pointed to by
+* callback_data. */
 bool ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v)
 {
        ModifierData *md;
@@ -272,20 +265,20 @@ bool ED_object_multires_update_totlevels_cb(Object *ob, 
void *totlevel_v)
 
 /* Return true if no modifier of type 'type' other than 'exclude' */
 static bool object_modifier_safe_to_delete(Main *bmain, Object *ob,
-                                           ModifierData *exclude,
-                                           ModifierType type)
+       ModifierData *exclude,
+       ModifierType type)
 {
        return (!object_has_modifier(ob, exclude, type) &&
-               !ED_object_iter_other(bmain, ob, false,
-                                     object_has_modifier_cb, &type));
+               !ED_object_iter_other(bmain, ob, false,
+                       object_has_modifier_cb, &type));
 }
 
 static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
-                                   bool *r_sort_depsgraph)
+       bool *r_sort_depsgraph)
 {
        /* It seems on rapid delete it is possible to
-        * get called twice on same modifier, so make
-        * sure it is in list. */
+       * get called twice on same modifier, so make
+       * sure it is in list. */
        if (BLI_findindex(&ob->modifiers, md) == -1) {
                return 0;
        }
@@ -325,7 +318,7 @@ static bool object_modifier_remove(Main *bmain, Object *ob, 
ModifierData *md,
        }
 
        if (ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) &&
-           BLI_listbase_is_empty(&ob->particlesystem))
+               BLI_listbase_is_empty(&ob->particlesystem))
        {
                ob->mode &= ~OB_MODE_PARTICLE_EDIT;
        }
@@ -529,7 +522,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), 
Main *bmain, Scene *
 }
 
 static int modifier_apply_shape(
-        Main *bmain, ReportList *reports, Depsgraph *depsgraph, Scene *scene, 
Object *ob, ModifierData *md)
+       Main *bmain, ReportList *reports, Depsgraph *depsgraph, Scene *scene, 
Object *ob, ModifierData *md)
 {
        const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
 
@@ -539,15 +532,15 @@ static int modifier_apply_shape(
        }
 
        /*
-        * It should be ridiculously easy to extract the original verts that we 
want
-        * and form the shape data.  We can probably use the CD KEYINDEX layer 
(or
-        * whatever I ended up calling it, too tired to check now), though this 
would
-        * by necessity have to make some potentially ugly assumptions about 
the order
-        * of the mesh data :-/  you can probably assume in 99% of cases that 
the first
-        * element of a given index is the original, and any subsequent 
duplicates are
-        * copies/interpolates, but that's an assumption that would need to be 
tested
-        * and then predominantly stated in comments in a half dozen headers.
-        */
+       * It should be ridiculously easy to extract the original verts that we 
want
+       * and form the shape data.  We can probably use the CD KEYINDEX layer 
(or
+       * whatever I ended up calling it, too tired to check now), though this 
would
+       * by necessity have to make some potentially ugly assumptions about the 
order
+       * of the mesh data :-/  you can probably assume in 99% of cases that 
the first
+       * element of a given index is the original, and any subsequent 
duplicates are
+       * copies/interpolates, but that's an assumption that would need to be 
tested
+       * and then predominantly stated in comments in a half dozen headers.
+       */
 
        if (ob->type == OB_MESH) {
                Mesh *mesh_applied;
@@ -570,7 +563,7 @@ static int modifier_apply_shape(
                        key = me->key = BKE_key_add(bmain, (ID *)me);
                        key->type = KEY_RELATIVE;
                        /* if that was the first key block added, then it was 
the basis.
-                        * Initialize it with the mesh, and add another for the 
modifier */
+                       * Initialize it with the mesh, and add another for the 
modifier */
                        kb = BKE_keyblock_add(key, NULL);
                        BKE_keyblock_convert_from_mesh(me, key, kb);
                }
@@ -587,7 +580,7 @@ static int modifier_apply_shape(
        return 1;
 }
 
-static int modifier_apply_obdata(ReportList *reports, Main *bmain, Depsgraph 
*depsgraph, Scene *scene, Object *ob, ModifierData *md)
+static int modifier_apply_obdata(ReportList *reports, Depsgraph *depsgraph, 
Scene *scene, Object *ob, ModifierData *md)
 {
        const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
 
@@ -674,8 +667,8 @@ static int modifier_apply_obdata(ReportList *reports, Main 
*bmain, Depsgraph *de
 }
 
 int ED_object_modifier_apply(
-        Main *bmain, ReportList *reports, Depsgraph *depsgraph,
-        Scene *scene, Object *ob, ModifierData *md, int mode)
+       Main *bmain,

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to