Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-03-09 18:27:24 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-03-09 18:27:24 +0300
commit29f3af95272590d26f610ae828b2eeee89c82a00 (patch)
treea696a58a2561c48f7ec6166e369e22081e0a64d8 /source/blender/blenkernel/intern/object.c
parentdcb93126876879d969a30a7865700abd072066f8 (diff)
GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes. Also, a huge code cleanup has been done at all levels. Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development. Differential Revision: https://developer.blender.org/D6293
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index e4a3174c908..211cb633881 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -729,8 +729,11 @@ void BKE_object_free_derived_caches(Object *ob)
BKE_object_to_mesh_clear(ob);
BKE_object_free_curve_cache(ob);
- /* clear grease pencil data */
- DRW_gpencil_freecache(ob);
+ /* Clear grease pencil data. */
+ if (ob->runtime.gpd_eval != NULL) {
+ BKE_gpencil_eval_delete(ob->runtime.gpd_eval);
+ ob->runtime.gpd_eval = NULL;
+ }
}
void BKE_object_free_caches(Object *object)
@@ -803,6 +806,9 @@ bool BKE_object_is_in_editmode(const Object *ob)
case OB_SURF:
case OB_CURVE:
return ((Curve *)ob->data)->editnurb != NULL;
+ case OB_GPENCIL:
+ /* Grease Pencil object has no edit mode data. */
+ return GPENCIL_EDIT_MODE((bGPdata *)ob->data);
default:
return false;
}
@@ -1034,6 +1040,10 @@ static void object_init(Object *ob, const short ob_type)
ob->trackflag = OB_NEGZ;
ob->upflag = OB_POSY;
}
+
+ if (ob->type == OB_GPENCIL) {
+ ob->dtx |= OB_USE_GPENCIL_LIGHTS;
+ }
}
void *BKE_object_obdata_add_from_type(Main *bmain, int type, const char *name)
@@ -3963,7 +3973,6 @@ void BKE_object_runtime_reset_on_copy(Object *object, const int UNUSED(flag))
runtime->data_eval = NULL;
runtime->mesh_deform_eval = NULL;
runtime->curve_cache = NULL;
- runtime->gpencil_cache = NULL;
}
/*