2018-06-17 17:05:51 +02:00
|
|
|
/*
|
2002-10-12 11:37:38 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
2012-04-30 14:24:11 +00:00
|
|
|
*/
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_DISPLIST_H__
|
|
|
|
|
#define __BKE_DISPLIST_H__
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup bke
|
|
|
|
|
* \brief display list (or rather multi purpose list) stuff.
|
2011-02-18 13:05:18 +00:00
|
|
|
*/
|
2006-12-05 17:42:03 +00:00
|
|
|
#include "BKE_customdata.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_customdata_types.h"
|
Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.
Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData
Replaced TFace by MTFace:
This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.
Removed DispListMesh:
This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.
Removed ssDM and meshDM DerivedMesh backends:
The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.
This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-05-29 16:17:46 +00:00
|
|
|
/* dl->type */
|
2019-04-17 06:17:24 +02:00
|
|
|
#define DL_POLY 0
|
|
|
|
|
#define DL_SEGM 1
|
|
|
|
|
#define DL_SURF 2
|
|
|
|
|
#define DL_INDEX3 4
|
|
|
|
|
#define DL_INDEX4 5
|
2013-05-28 01:15:59 +00:00
|
|
|
// #define DL_VERTCOL 6 // UNUSED
|
2019-04-17 06:17:24 +02:00
|
|
|
#define DL_VERTS 7
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-05-29 16:17:46 +00:00
|
|
|
/* dl->flag */
|
2016-06-25 11:24:25 +10:00
|
|
|
enum {
|
2019-04-17 06:17:24 +02:00
|
|
|
/** U/V swapped here compared with #Nurb.flagu, #Nurb.flagv and #CU_NURB_CYCLIC */
|
|
|
|
|
DL_CYCL_U = (1 << 0),
|
|
|
|
|
DL_CYCL_V = (1 << 1),
|
2016-06-25 11:24:25 +10:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
DL_FRONT_CURVE = (1 << 2),
|
|
|
|
|
DL_BACK_CURVE = (1 << 3),
|
2016-06-25 11:24:25 +10:00
|
|
|
};
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* prototypes */
|
|
|
|
|
|
2018-04-06 12:07:27 +02:00
|
|
|
struct Depsgraph;
|
2018-06-11 12:14:18 +02:00
|
|
|
struct ListBase;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Mesh;
|
2018-06-11 12:14:18 +02:00
|
|
|
struct Object;
|
|
|
|
|
struct Scene;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2006-11-20 21:25:02 +00:00
|
|
|
/* used for curves, nurbs, mball, importing */
|
2002-10-12 11:37:38 +00:00
|
|
|
typedef struct DispList {
|
2019-04-17 06:17:24 +02:00
|
|
|
struct DispList *next, *prev;
|
|
|
|
|
short type, flag;
|
|
|
|
|
int parts, nr;
|
|
|
|
|
short col, rt; /* rt used by initrenderNurbs */
|
|
|
|
|
float *verts, *nors;
|
|
|
|
|
int *index;
|
|
|
|
|
int charidx;
|
|
|
|
|
int totindex; /* indexed array drawing surfaces */
|
|
|
|
|
|
|
|
|
|
unsigned int *bevel_split; /* BLI_bitmap */
|
2002-10-12 11:37:38 +00:00
|
|
|
} DispList;
|
|
|
|
|
|
2012-05-07 06:58:03 +00:00
|
|
|
void BKE_displist_copy(struct ListBase *lbn, struct ListBase *lb);
|
|
|
|
|
void BKE_displist_elem_free(DispList *dl);
|
|
|
|
|
DispList *BKE_displist_find_or_create(struct ListBase *lb, int type);
|
|
|
|
|
DispList *BKE_displist_find(struct ListBase *lb, int type);
|
|
|
|
|
void BKE_displist_normals_add(struct ListBase *lb);
|
2012-12-27 03:51:45 +00:00
|
|
|
void BKE_displist_count(struct ListBase *lb, int *totvert, int *totface, int *tottri);
|
2012-05-07 06:58:03 +00:00
|
|
|
void BKE_displist_free(struct ListBase *lb);
|
2013-03-20 23:14:18 +00:00
|
|
|
bool BKE_displist_has_faces(struct ListBase *lb);
|
2012-05-07 06:58:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
void BKE_displist_make_surf(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ListBase *dispbase,
|
|
|
|
|
struct Mesh **r_final,
|
|
|
|
|
const bool for_render,
|
2019-05-13 09:42:32 +02:00
|
|
|
const bool for_orco);
|
2019-04-17 06:17:24 +02:00
|
|
|
void BKE_displist_make_curveTypes(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
const bool for_render,
|
2019-05-21 14:54:08 +02:00
|
|
|
const bool for_orco);
|
2019-04-17 06:17:24 +02:00
|
|
|
void BKE_displist_make_curveTypes_forRender(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ListBase *dispbase,
|
|
|
|
|
struct Mesh **r_final,
|
2019-05-21 14:54:08 +02:00
|
|
|
const bool for_orco);
|
2019-04-17 06:17:24 +02:00
|
|
|
void BKE_displist_make_mball(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
|
|
|
|
|
void BKE_displist_make_mball_forRender(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ListBase *dispbase);
|
2012-05-07 06:58:03 +00:00
|
|
|
|
2013-03-20 23:14:18 +00:00
|
|
|
bool BKE_displist_surfindex_get(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4);
|
2019-04-17 06:17:24 +02:00
|
|
|
void BKE_displist_fill(struct ListBase *dispbase,
|
|
|
|
|
struct ListBase *to,
|
|
|
|
|
const float normal_proj[3],
|
|
|
|
|
const bool flipnormal);
|
2012-05-07 06:58:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
float BKE_displist_calc_taper(
|
|
|
|
|
struct Depsgraph *depsgraph, struct Scene *scene, struct Object *taperobj, int cur, int tot);
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
|
2013-08-21 07:40:19 +00:00
|
|
|
void BKE_displist_minmax(struct ListBase *dispbase, float min[3], float max[3]);
|
|
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#endif
|