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:
authorAntonioya <blendergit@gmail.com>2019-03-11 19:13:30 +0300
committerAntonioya <blendergit@gmail.com>2019-03-11 19:13:51 +0300
commit958f34dd030d9a0ba7fee9534a0791141f361799 (patch)
treef6b2e7ce329e443586d03ecd4f65e981c02eeff7
parent93633efe69ca4e610304b34268e523f54f9d7d57 (diff)
GPencil: Add support for Bound Box
The bound box was not calculated for grease pencil objects.
-rw-r--r--source/blender/blenkernel/intern/gpencil.c7
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c5
-rw-r--r--source/blender/draw/modes/object_mode.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index c9cb38fcc4e..88c4e1249e3 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1127,14 +1127,11 @@ static void boundbox_gpencil(Object *ob)
/* get bounding box */
BoundBox *BKE_gpencil_boundbox_get(Object *ob)
{
- bGPdata *gpd;
-
if (ELEM(NULL, ob, ob->data))
return NULL;
- gpd = ob->data;
- if ((ob->runtime.bb) && ((ob->runtime.bb->flag & BOUNDBOX_DIRTY) == 0) &&
- ((gpd->flag & GP_DATA_CACHE_IS_DIRTY) == 0))
+ bGPdata *gpd = (bGPdata *)ob->data;
+ if ((ob->runtime.bb) && ((gpd->flag & GP_DATA_CACHE_IS_DIRTY) == 0))
{
return ob->runtime.bb;
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 97b81e3ba1f..957be9ef1cd 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -583,7 +583,12 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
ToolSettings *ts = scene->toolsettings;
View3D *v3d = draw_ctx->v3d;
+ /* bound box object are not visible, only external box*/
if (ob->type == OB_GPENCIL && ob->data) {
+ if (ob->dt == OB_BOUNDBOX) {
+ return;
+ }
+
bGPdata *gpd = (bGPdata *)ob->data;
/* enable multisample and basic framebuffer creation */
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 63932cd986f..3c64fe14100 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -2732,7 +2732,7 @@ static void DRW_shgroup_bounds(OBJECT_ShadingGroupList *sgl, Object *ob, int the
BoundBox *bb = BKE_object_boundbox_get(ob);
if (!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT,
- OB_MBALL, OB_ARMATURE, OB_LATTICE))
+ OB_MBALL, OB_ARMATURE, OB_LATTICE, OB_GPENCIL))
{
const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f};
bb = &bb_local;