2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2016 Blender Foundation. */
|
2017-04-21 21:14:11 +10:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup draw
|
2017-04-21 21:14:11 +10:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch;
|
|
|
|
|
struct GPUIndexBuf;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct GPUMaterial;
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUVertBuf;
|
2017-04-21 21:14:11 +10:00
|
|
|
struct ListBase;
|
2017-06-22 19:19:55 +02:00
|
|
|
struct ModifierData;
|
2018-05-09 11:14:27 +02:00
|
|
|
struct PTCacheEdit;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ParticleSystem;
|
2020-06-02 15:07:17 +02:00
|
|
|
struct TaskGraph;
|
2017-04-21 21:14:11 +10:00
|
|
|
|
|
|
|
|
struct Curve;
|
Curves: Rename "Hair" types, variables, and functions to "Curves"
Based on discussions from T95355 and T94193, the plan is to use
the name "Curves" to describe the data-block container for multiple
curves. Eventually this will replace the existing "Curve" data-block.
However, it will be a while before the curve data-block can be replaced
so in order to distinguish the two curve types in the UI, "Hair Curves"
will be used, but eventually changed back to "Curves".
This patch renames "hair-related" files, functions, types, and variable
names to this convention. A deep rename is preferred to keep code
consistent and to avoid any "hair" terminology from leaking, since the
new data-block is meant for all curve types, not just hair use cases.
The downside of this naming is that the difference between "Curve"
and "Curves" has become important. That was considered during
design discussons and deemed acceptable, especially given the
non-permanent nature of the somewhat common conflict.
Some points of interest:
- All DNA compatibility is lost, just like rBf59767ff9729.
- I renamed `ID_HA` to `ID_CV` so there is no complete mismatch.
- `hair_curves` is used where necessary to distinguish from the
existing "curves" plural.
- I didn't rename any of the cycles/rendering code function names,
since that is also used by the old hair particle system.
Differential Revision: https://developer.blender.org/D14007
2022-02-07 11:55:54 -06:00
|
|
|
struct Curves;
|
2017-04-21 21:14:11 +10:00
|
|
|
struct Lattice;
|
|
|
|
|
struct Mesh;
|
2017-12-14 12:21:38 -02:00
|
|
|
struct MetaBall;
|
2020-03-17 16:27:08 +01:00
|
|
|
struct PointCloud;
|
|
|
|
|
struct Volume;
|
2020-03-20 12:19:44 +11:00
|
|
|
struct bGPdata;
|
2017-04-21 21:14:11 +10:00
|
|
|
|
2020-10-09 07:27:18 +02:00
|
|
|
#include "BKE_mesh_types.h"
|
|
|
|
|
|
2021-05-21 17:28:19 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Expose via BKE callbacks
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2020-10-09 07:25:43 +02:00
|
|
|
void DRW_mball_batch_cache_dirty_tag(struct MetaBall *mb, int mode);
|
2019-05-07 23:21:16 +02:00
|
|
|
void DRW_mball_batch_cache_validate(struct MetaBall *mb);
|
2017-11-16 15:12:32 -02:00
|
|
|
void DRW_mball_batch_cache_free(struct MetaBall *mb);
|
|
|
|
|
|
2020-10-09 07:25:43 +02:00
|
|
|
void DRW_curve_batch_cache_dirty_tag(struct Curve *cu, int mode);
|
2019-05-07 23:21:16 +02:00
|
|
|
void DRW_curve_batch_cache_validate(struct Curve *cu);
|
2017-04-21 21:14:11 +10:00
|
|
|
void DRW_curve_batch_cache_free(struct Curve *cu);
|
|
|
|
|
|
2020-10-09 07:27:18 +02:00
|
|
|
void DRW_mesh_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode);
|
2022-01-11 15:42:07 +01:00
|
|
|
void DRW_mesh_batch_cache_validate(struct Object *object, struct Mesh *me);
|
2017-04-21 21:14:11 +10:00
|
|
|
void DRW_mesh_batch_cache_free(struct Mesh *me);
|
|
|
|
|
|
2020-10-09 07:25:43 +02:00
|
|
|
void DRW_lattice_batch_cache_dirty_tag(struct Lattice *lt, int mode);
|
2019-05-07 23:21:16 +02:00
|
|
|
void DRW_lattice_batch_cache_validate(struct Lattice *lt);
|
2017-04-21 21:14:11 +10:00
|
|
|
void DRW_lattice_batch_cache_free(struct Lattice *lt);
|
|
|
|
|
|
2020-10-09 07:25:43 +02:00
|
|
|
void DRW_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode);
|
2017-05-09 16:23:47 +02:00
|
|
|
void DRW_particle_batch_cache_free(struct ParticleSystem *psys);
|
|
|
|
|
|
2018-08-23 10:14:29 -03:00
|
|
|
void DRW_gpencil_batch_cache_dirty_tag(struct bGPdata *gpd);
|
2018-07-31 10:22:19 +02:00
|
|
|
void DRW_gpencil_batch_cache_free(struct bGPdata *gpd);
|
|
|
|
|
|
Curves: Rename "Hair" types, variables, and functions to "Curves"
Based on discussions from T95355 and T94193, the plan is to use
the name "Curves" to describe the data-block container for multiple
curves. Eventually this will replace the existing "Curve" data-block.
However, it will be a while before the curve data-block can be replaced
so in order to distinguish the two curve types in the UI, "Hair Curves"
will be used, but eventually changed back to "Curves".
This patch renames "hair-related" files, functions, types, and variable
names to this convention. A deep rename is preferred to keep code
consistent and to avoid any "hair" terminology from leaking, since the
new data-block is meant for all curve types, not just hair use cases.
The downside of this naming is that the difference between "Curve"
and "Curves" has become important. That was considered during
design discussons and deemed acceptable, especially given the
non-permanent nature of the somewhat common conflict.
Some points of interest:
- All DNA compatibility is lost, just like rBf59767ff9729.
- I renamed `ID_HA` to `ID_CV` so there is no complete mismatch.
- `hair_curves` is used where necessary to distinguish from the
existing "curves" plural.
- I didn't rename any of the cycles/rendering code function names,
since that is also used by the old hair particle system.
Differential Revision: https://developer.blender.org/D14007
2022-02-07 11:55:54 -06:00
|
|
|
void DRW_curves_batch_cache_dirty_tag(struct Curves *curves, int mode);
|
|
|
|
|
void DRW_curves_batch_cache_validate(struct Curves *curves);
|
|
|
|
|
void DRW_curves_batch_cache_free(struct Curves *curves);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
2020-10-09 07:25:43 +02:00
|
|
|
void DRW_pointcloud_batch_cache_dirty_tag(struct PointCloud *pointcloud, int mode);
|
2020-03-17 16:27:08 +01:00
|
|
|
void DRW_pointcloud_batch_cache_validate(struct PointCloud *pointcloud);
|
|
|
|
|
void DRW_pointcloud_batch_cache_free(struct PointCloud *pointcloud);
|
|
|
|
|
|
2020-10-09 07:25:43 +02:00
|
|
|
void DRW_volume_batch_cache_dirty_tag(struct Volume *volume, int mode);
|
2020-03-17 16:27:08 +01:00
|
|
|
void DRW_volume_batch_cache_validate(struct Volume *volume);
|
|
|
|
|
void DRW_volume_batch_cache_free(struct Volume *volume);
|
|
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Garbage Collection
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2019-04-19 02:22:22 +02:00
|
|
|
void DRW_batch_cache_free_old(struct Object *ob, int ctime);
|
|
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/**
|
|
|
|
|
* Thread safety need to be assured by caller. Don't call this during drawing.
|
|
|
|
|
* \note For now this only free the shading batches / VBO if any cd layers is not needed anymore.
|
|
|
|
|
*/
|
2019-04-19 02:22:22 +02:00
|
|
|
void DRW_mesh_batch_cache_free_old(struct Mesh *me, int ctime);
|
|
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Generic
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2022-01-07 11:38:08 +11:00
|
|
|
void DRW_vertbuf_create_wiredata(struct GPUVertBuf *vbo, int vert_len);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Curve
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2020-12-18 16:06:26 +01:00
|
|
|
void DRW_curve_batch_cache_create_requested(struct Object *ob, const struct Scene *scene);
|
2018-12-13 01:26:07 +01:00
|
|
|
|
2020-01-28 16:39:33 +01:00
|
|
|
int DRW_curve_material_count_get(struct Curve *cu);
|
|
|
|
|
|
2018-12-13 01:26:07 +01:00
|
|
|
struct GPUBatch *DRW_curve_batch_cache_get_wire_edge(struct Curve *cu);
|
|
|
|
|
struct GPUBatch *DRW_curve_batch_cache_get_normal_edge(struct Curve *cu);
|
2019-03-28 14:51:29 +01:00
|
|
|
struct GPUBatch *DRW_curve_batch_cache_get_edge_detection(struct Curve *cu, bool *r_is_manifold);
|
2018-12-10 15:29:04 +01:00
|
|
|
struct GPUBatch *DRW_curve_batch_cache_get_edit_edges(struct Curve *cu);
|
2020-05-13 21:20:18 +02:00
|
|
|
struct GPUBatch *DRW_curve_batch_cache_get_edit_verts(struct Curve *cu);
|
2017-04-21 21:14:11 +10:00
|
|
|
|
2018-12-13 01:26:07 +01:00
|
|
|
struct GPUBatch *DRW_curve_batch_cache_get_triangles_with_normals(struct Curve *cu);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct Curve *cu,
|
2018-12-13 01:26:07 +01:00
|
|
|
struct GPUMaterial **gpumat_array,
|
|
|
|
|
uint gpumat_array_len);
|
|
|
|
|
struct GPUBatch *DRW_curve_batch_cache_get_wireframes_face(struct Curve *cu);
|
2020-01-28 16:39:33 +01:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Metaball
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2020-01-28 16:39:33 +01:00
|
|
|
int DRW_metaball_material_count_get(struct MetaBall *mb);
|
|
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_metaball_batch_cache_get_triangles_with_normals(struct Object *ob);
|
2018-12-21 10:46:26 +11:00
|
|
|
struct GPUBatch **DRW_metaball_batch_cache_get_surface_shaded(struct Object *ob,
|
|
|
|
|
struct MetaBall *mb,
|
|
|
|
|
struct GPUMaterial **gpumat_array,
|
|
|
|
|
uint gpumat_array_len);
|
2018-12-07 05:03:01 +01:00
|
|
|
struct GPUBatch *DRW_metaball_batch_cache_get_wireframes_face(struct Object *ob);
|
2019-03-28 14:51:29 +01:00
|
|
|
struct GPUBatch *DRW_metaball_batch_cache_get_edge_detection(struct Object *ob,
|
|
|
|
|
bool *r_is_manifold);
|
2017-11-16 15:12:32 -02:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name DispList
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2020-12-18 16:06:26 +01:00
|
|
|
void DRW_displist_vertbuf_create_pos_and_nor(struct ListBase *lb,
|
|
|
|
|
struct GPUVertBuf *vbo,
|
|
|
|
|
const struct Scene *scene);
|
2019-03-01 12:36:34 -03:00
|
|
|
void DRW_displist_vertbuf_create_wiredata(struct ListBase *lb, struct GPUVertBuf *vbo);
|
2020-01-30 01:07:28 +01:00
|
|
|
void DRW_displist_vertbuf_create_loop_pos_and_nor_and_uv_and_tan(struct ListBase *lb,
|
|
|
|
|
struct GPUVertBuf *vbo_pos_nor,
|
|
|
|
|
struct GPUVertBuf *vbo_uv,
|
2020-12-18 16:06:26 +01:00
|
|
|
struct GPUVertBuf *vbo_tan,
|
|
|
|
|
const struct Scene *scene);
|
2019-02-25 19:37:08 +01:00
|
|
|
void DRW_displist_indexbuf_create_lines_in_order(struct ListBase *lb, struct GPUIndexBuf *ibo);
|
|
|
|
|
void DRW_displist_indexbuf_create_triangles_in_order(struct ListBase *lb, struct GPUIndexBuf *ibo);
|
|
|
|
|
void DRW_displist_indexbuf_create_triangles_loop_split_by_material(struct ListBase *lb,
|
2018-12-14 00:42:16 +01:00
|
|
|
struct GPUIndexBuf **ibo_mat,
|
|
|
|
|
uint mat_len);
|
2019-03-28 14:51:29 +01:00
|
|
|
void DRW_displist_indexbuf_create_edges_adjacency_lines(struct ListBase *lb,
|
|
|
|
|
struct GPUIndexBuf *ibo,
|
|
|
|
|
bool *r_is_manifold);
|
2017-04-21 21:14:11 +10:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Lattice
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_lattice_batch_cache_get_all_edges(struct Lattice *lt,
|
|
|
|
|
bool use_weight,
|
2022-01-07 11:38:08 +11:00
|
|
|
int actdef);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_lattice_batch_cache_get_all_verts(struct Lattice *lt);
|
2018-12-10 15:29:04 +01:00
|
|
|
struct GPUBatch *DRW_lattice_batch_cache_get_edit_verts(struct Lattice *lt);
|
2017-04-21 21:14:11 +10:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Hair
|
|
|
|
|
* \{ */
|
|
|
|
|
|
Curves: Rename "Hair" types, variables, and functions to "Curves"
Based on discussions from T95355 and T94193, the plan is to use
the name "Curves" to describe the data-block container for multiple
curves. Eventually this will replace the existing "Curve" data-block.
However, it will be a while before the curve data-block can be replaced
so in order to distinguish the two curve types in the UI, "Hair Curves"
will be used, but eventually changed back to "Curves".
This patch renames "hair-related" files, functions, types, and variable
names to this convention. A deep rename is preferred to keep code
consistent and to avoid any "hair" terminology from leaking, since the
new data-block is meant for all curve types, not just hair use cases.
The downside of this naming is that the difference between "Curve"
and "Curves" has become important. That was considered during
design discussons and deemed acceptable, especially given the
non-permanent nature of the somewhat common conflict.
Some points of interest:
- All DNA compatibility is lost, just like rBf59767ff9729.
- I renamed `ID_HA` to `ID_CV` so there is no complete mismatch.
- `hair_curves` is used where necessary to distinguish from the
existing "curves" plural.
- I didn't rename any of the cycles/rendering code function names,
since that is also used by the old hair particle system.
Differential Revision: https://developer.blender.org/D14007
2022-02-07 11:55:54 -06:00
|
|
|
int DRW_curves_material_count_get(struct Curves *curves);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name PointCloud
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2020-03-17 16:27:08 +01:00
|
|
|
int DRW_pointcloud_material_count_get(struct PointCloud *pointcloud);
|
|
|
|
|
|
|
|
|
|
struct GPUBatch *DRW_pointcloud_batch_cache_get_dots(struct Object *ob);
|
2020-07-15 20:10:45 +02:00
|
|
|
struct GPUBatch *DRW_pointcloud_batch_cache_get_surface(struct Object *ob);
|
|
|
|
|
struct GPUBatch **DRW_cache_pointcloud_surface_shaded_get(struct Object *ob,
|
|
|
|
|
struct GPUMaterial **gpumat_array,
|
|
|
|
|
uint gpumat_array_len);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Volume
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2020-03-17 16:27:08 +01:00
|
|
|
int DRW_volume_material_count_get(struct Volume *volume);
|
|
|
|
|
|
|
|
|
|
struct GPUBatch *DRW_volume_batch_cache_get_wireframes_face(struct Volume *volume);
|
2020-09-29 12:39:41 +02:00
|
|
|
struct GPUBatch *DRW_volume_batch_cache_get_selection_surface(struct Volume *volume);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Mesh
|
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Can be called for any surface type. Mesh *me is the final mesh.
|
|
|
|
|
*/
|
2020-06-02 15:07:17 +02:00
|
|
|
void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph,
|
|
|
|
|
struct Object *ob,
|
2018-12-22 21:00:23 +01:00
|
|
|
struct Mesh *me,
|
2019-07-14 16:49:44 +02:00
|
|
|
const struct Scene *scene,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool is_paint_mode,
|
|
|
|
|
bool use_hide);
|
2018-12-08 20:10:20 +01:00
|
|
|
|
2018-12-18 17:10:38 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_all_verts(struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_all_edges(struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_loose_edges(struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edge_detection(struct Mesh *me, bool *r_is_manifold);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_surface(struct Mesh *me);
|
2022-01-11 15:42:07 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_surface_edges(struct Object *object, struct Mesh *me);
|
|
|
|
|
struct GPUBatch **DRW_mesh_batch_cache_get_surface_shaded(struct Object *object,
|
|
|
|
|
struct Mesh *me,
|
2018-12-16 15:17:31 +01:00
|
|
|
struct GPUMaterial **gpumat_array,
|
2020-01-17 16:05:19 +01:00
|
|
|
uint gpumat_array_len);
|
2022-01-11 15:42:07 +01:00
|
|
|
struct GPUBatch **DRW_mesh_batch_cache_get_surface_texpaint(struct Object *object,
|
|
|
|
|
struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_surface_texpaint_single(struct Object *object,
|
|
|
|
|
struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_surface_vertpaint(struct Object *object,
|
|
|
|
|
struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_surface_sculpt(struct Object *object, struct Mesh *me);
|
2018-12-18 17:10:38 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_surface_weights(struct Mesh *me);
|
2020-09-18 19:30:02 +02:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_sculpt_overlays(struct Mesh *me);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Edit-Mesh Drawing
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2018-12-10 15:29:04 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_triangles(struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_vertices(struct Mesh *me);
|
2019-02-04 01:13:51 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_edges(struct Mesh *me);
|
2019-07-14 16:49:44 +02:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_vnors(struct Mesh *me);
|
2019-02-04 01:13:51 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_lnors(struct Mesh *me);
|
2018-12-10 15:29:04 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_facedots(struct Mesh *me);
|
2019-10-15 01:49:53 +02:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_skin_roots(struct Mesh *me);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Edit-mesh Selection
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2018-12-22 23:57:12 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_facedots_with_select_id(struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edges_with_select_id(struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Object Mode Wireframe Overlays
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2018-12-07 05:03:01 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_wireframes_face(struct Mesh *me);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Edit-mesh UV Editor
|
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates the #GPUBatch for drawing the UV Stretching Area Overlay.
|
|
|
|
|
* Optional retrieves the total area or total uv area of the mesh.
|
|
|
|
|
*
|
|
|
|
|
* The `cache->tot_area` and cache->tot_uv_area` update are calculation are
|
|
|
|
|
* only valid after calling `DRW_mesh_batch_cache_create_requested`.
|
|
|
|
|
*/
|
2022-01-11 15:42:07 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_faces_stretch_area(struct Object *object,
|
|
|
|
|
struct Mesh *me,
|
2019-09-27 16:40:18 +02:00
|
|
|
float **tot_area,
|
|
|
|
|
float **tot_uv_area);
|
2022-01-11 15:42:07 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(struct Object *object,
|
|
|
|
|
struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_faces(struct Object *object, struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_edges(struct Object *object, struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_verts(struct Object *object, struct Mesh *me);
|
|
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_facedots(struct Object *object, struct Mesh *me);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name For Image UV Editor
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2022-01-11 15:42:07 +01:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_uv_edges(struct Object *object, struct Mesh *me);
|
2019-04-18 08:00:59 +02:00
|
|
|
struct GPUBatch *DRW_mesh_batch_cache_get_edit_mesh_analysis(struct Mesh *me);
|
2017-04-21 21:14:11 +10:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name For Direct Data Access
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2020-06-19 17:02:55 +02:00
|
|
|
struct GPUVertBuf *DRW_mesh_batch_cache_pos_vertbuf_get(struct Mesh *me);
|
|
|
|
|
struct GPUVertBuf *DRW_curve_batch_cache_pos_vertbuf_get(struct Curve *cu);
|
|
|
|
|
struct GPUVertBuf *DRW_mball_batch_cache_pos_vertbuf_get(struct Object *ob);
|
|
|
|
|
|
2022-01-11 15:42:07 +01:00
|
|
|
int DRW_mesh_material_count_get(const struct Object *object, const struct Mesh *me);
|
2020-01-28 16:39:33 +01:00
|
|
|
|
2020-06-15 15:28:51 +10:00
|
|
|
/* See 'common_globals_lib.glsl' for duplicate defines. */
|
|
|
|
|
|
2018-09-05 17:02:00 +02:00
|
|
|
/* Edit mesh bitflags (is this the right place?) */
|
|
|
|
|
enum {
|
2019-02-04 01:13:51 +01:00
|
|
|
VFLAG_VERT_ACTIVE = 1 << 0,
|
|
|
|
|
VFLAG_VERT_SELECTED = 1 << 1,
|
2020-06-15 15:28:51 +10:00
|
|
|
VFLAG_VERT_SELECTED_BEZT_HANDLE = 1 << 2,
|
|
|
|
|
VFLAG_EDGE_ACTIVE = 1 << 3,
|
|
|
|
|
VFLAG_EDGE_SELECTED = 1 << 4,
|
|
|
|
|
VFLAG_EDGE_SEAM = 1 << 5,
|
|
|
|
|
VFLAG_EDGE_SHARP = 1 << 6,
|
|
|
|
|
VFLAG_EDGE_FREESTYLE = 1 << 7,
|
|
|
|
|
/* Beware to not go over 1 << 7 (it's a byte flag). */
|
2021-01-04 15:31:53 +01:00
|
|
|
/* NOTE: Grease pencil edit curve use another type of data format that allows for this value. */
|
|
|
|
|
VFLAG_VERT_GPENCIL_BEZT_HANDLE = 1 << 30,
|
2018-09-05 17:02:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
2019-02-04 01:13:51 +01:00
|
|
|
VFLAG_FACE_ACTIVE = 1 << 0,
|
|
|
|
|
VFLAG_FACE_SELECTED = 1 << 1,
|
|
|
|
|
VFLAG_FACE_FREESTYLE = 1 << 2,
|
|
|
|
|
VFLAG_VERT_UV_SELECT = 1 << 3,
|
|
|
|
|
VFLAG_VERT_UV_PINNED = 1 << 4,
|
|
|
|
|
VFLAG_EDGE_UV_SELECT = 1 << 5,
|
|
|
|
|
VFLAG_FACE_UV_ACTIVE = 1 << 6,
|
|
|
|
|
VFLAG_FACE_UV_SELECT = 1 << 7,
|
2020-06-15 15:28:51 +10:00
|
|
|
/* Beware to not go over 1 << 7 (it's a byte flag). */
|
2018-09-05 17:02:00 +02:00
|
|
|
};
|
|
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Particles
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_particles_batch_cache_get_hair(struct Object *object,
|
2018-05-26 10:41:25 +02:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct ModifierData *md);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_particles_batch_cache_get_dots(struct Object *object,
|
2018-05-26 10:41:25 +02:00
|
|
|
struct ParticleSystem *psys);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_particles_batch_cache_get_edit_strands(struct Object *object,
|
2018-11-27 13:49:00 +01:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct PTCacheEdit *edit,
|
|
|
|
|
bool use_weight);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_particles_batch_cache_get_edit_inner_points(struct Object *object,
|
2018-05-26 10:41:25 +02:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct PTCacheEdit *edit);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_particles_batch_cache_get_edit_tip_points(struct Object *object,
|
2018-05-26 10:41:25 +02:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct PTCacheEdit *edit);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
2021-05-21 17:28:19 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|