static BLI_bitmap *get_tface_mesh_marked_edge_info(Mesh *me, bool draw_select_edges)
{
	BLI_bitmap *bitmap_edge_flags = BLI_BITMAP_NEW(me->totedge * 2, __func__);
	MPoly *mp;
	MLoop *ml;
	int i, j;
	bool select_set;
	
	for (i = 0; i < me->totpoly; i++) {
		mp = &me->mpoly[i];

		if (!(mp->flag & ME_HIDE)) {
			select_set = (mp->flag & ME_FACE_SEL) != 0;

			ml = me->mloop + mp->loopstart;
			for (j = 0; j < mp->totloop; j++, ml++) {
				if ((draw_select_edges == false) &&
				    (select_set && BLI_BITMAP_TEST(bitmap_edge_flags, edge_sel_index(ml->e))))
				{
					BLI_BITMAP_DISABLE(bitmap_edge_flags, edge_vis_index(ml->e));
				}
				else {
					BLI_BITMAP_ENABLE(bitmap_edge_flags, edge_vis_index(ml->e));
					if (select_set) {
						BLI_BITMAP_ENABLE(bitmap_edge_flags, edge_sel_index(ml->e));
					}
				}
			}
		}
	}

	return bitmap_edge_flags;
}
Ejemplo n.º 2
0
void BKE_lattice_bitmap_from_flag(
    Lattice *lt, BLI_bitmap *bitmap, const short flag, const bool clear, const bool respecthide)
{
  const unsigned int tot = lt->pntsu * lt->pntsv * lt->pntsw;
  unsigned int i;
  BPoint *bp;

  bp = lt->def;
  for (i = 0; i < tot; i++, bp++) {
    if ((bp->f1 & flag) && (!respecthide || !bp->hide)) {
      BLI_BITMAP_ENABLE(bitmap, i);
    }
    else {
      if (clear) {
        BLI_BITMAP_DISABLE(bitmap, i);
      }
    }
  }
}