Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_cache_utils.c
| Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob) | ||||
| tgp_ob->layers.first = tgp_ob->layers.last = NULL; | tgp_ob->layers.first = tgp_ob->layers.last = NULL; | ||||
| tgp_ob->vfx.first = tgp_ob->vfx.last = NULL; | tgp_ob->vfx.first = tgp_ob->vfx.last = NULL; | ||||
| tgp_ob->camera_z = dot_v3v3(pd->camera_z_axis, ob->obmat[3]); | tgp_ob->camera_z = dot_v3v3(pd->camera_z_axis, ob->obmat[3]); | ||||
| tgp_ob->is_drawmode3d = (gpd->draw_mode == GP_DRAWMODE_3D) || pd->draw_depth_only; | tgp_ob->is_drawmode3d = (gpd->draw_mode == GP_DRAWMODE_3D) || pd->draw_depth_only; | ||||
| tgp_ob->object_scale = mat4_to_scale(ob->obmat); | tgp_ob->object_scale = mat4_to_scale(ob->obmat); | ||||
| /* Check if any material with holdout flag enabled. */ | /* Check if any material with holdout flag enabled. */ | ||||
| tgp_ob->do_mat_holdout = false; | tgp_ob->do_mat_holdout = false; | ||||
| for (int i = 0; i < ob->totcol; i++) { | const int tot_materials = BKE_object_material_count_eval(ob); | ||||
| for (int i = 0; i < tot_materials; i++) { | |||||
| MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, i + 1); | MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, i + 1); | ||||
| if (((gp_style != NULL) && (gp_style->flag & GP_MATERIAL_IS_STROKE_HOLDOUT)) || | if (((gp_style != NULL) && (gp_style->flag & GP_MATERIAL_IS_STROKE_HOLDOUT)) || | ||||
| ((gp_style->flag & GP_MATERIAL_IS_FILL_HOLDOUT))) { | ((gp_style->flag & GP_MATERIAL_IS_FILL_HOLDOUT))) { | ||||
| tgp_ob->do_mat_holdout = true; | tgp_ob->do_mat_holdout = true; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines | |||||