2012-02-19 18:31:04 +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
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup bmesh
|
2012-02-19 18:31:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*see comments in intern/bmesh_opdefines.c for documentation of specific operators*/
|
|
|
|
|
|
|
|
/*--------defines/enumerations for specific operators-------*/
|
|
|
|
|
2021-02-05 16:23:34 +11:00
|
|
|
/* Quad `innervert` values. */
|
2012-02-19 18:31:04 +00:00
|
|
|
enum {
|
2014-11-16 15:46:30 +01:00
|
|
|
SUBD_CORNER_INNERVERT,
|
|
|
|
SUBD_CORNER_PATH,
|
|
|
|
SUBD_CORNER_FAN,
|
2019-02-03 14:01:45 +11:00
|
|
|
SUBD_CORNER_STRAIGHT_CUT,
|
2012-02-19 18:31:04 +00:00
|
|
|
};
|
|
|
|
|
2013-05-08 12:58:28 +00:00
|
|
|
/* aligned with PROP_SMOOTH and friends */
|
|
|
|
enum {
|
|
|
|
SUBD_FALLOFF_SMOOTH = 0,
|
|
|
|
SUBD_FALLOFF_SPHERE,
|
|
|
|
SUBD_FALLOFF_ROOT,
|
|
|
|
SUBD_FALLOFF_SHARP,
|
|
|
|
SUBD_FALLOFF_LIN,
|
2015-04-26 18:31:54 +10:00
|
|
|
SUBD_FALLOFF_INVSQUARE = 7, /* matching PROP_INVSQUARE */
|
2013-05-08 12:58:28 +00:00
|
|
|
};
|
|
|
|
|
2012-04-23 04:24:11 +00:00
|
|
|
enum {
|
2013-07-24 19:31:58 +00:00
|
|
|
SUBDIV_SELECT_NONE,
|
2012-04-23 04:24:11 +00:00
|
|
|
SUBDIV_SELECT_ORIG,
|
|
|
|
SUBDIV_SELECT_INNER,
|
2019-02-03 14:01:45 +11:00
|
|
|
SUBDIV_SELECT_LOOPCUT,
|
2012-04-23 04:24:11 +00:00
|
|
|
};
|
|
|
|
|
2013-05-23 06:19:04 +00:00
|
|
|
/* subdivide_edgering */
|
|
|
|
enum {
|
|
|
|
/* just subdiv */
|
|
|
|
SUBD_RING_INTERP_LINEAR,
|
|
|
|
|
|
|
|
/* single bezier spline - curve follows bezier rotation */
|
|
|
|
SUBD_RING_INTERP_PATH,
|
|
|
|
|
|
|
|
/* beziers based on adjacent faces (fallback to tangent) */
|
|
|
|
SUBD_RING_INTERP_SURF,
|
|
|
|
};
|
|
|
|
|
2012-02-19 18:31:04 +00:00
|
|
|
/* similar face selection slot values */
|
|
|
|
enum {
|
|
|
|
SIMFACE_MATERIAL = 201,
|
|
|
|
SIMFACE_AREA,
|
2012-10-30 06:43:30 +00:00
|
|
|
SIMFACE_SIDES,
|
2012-02-19 18:31:04 +00:00
|
|
|
SIMFACE_PERIMETER,
|
|
|
|
SIMFACE_NORMAL,
|
2012-02-21 01:40:04 +00:00
|
|
|
SIMFACE_COPLANAR,
|
2014-12-28 19:08:30 +01:00
|
|
|
SIMFACE_SMOOTH,
|
2017-06-01 16:42:14 +10:00
|
|
|
SIMFACE_FACEMAP,
|
2019-02-03 14:01:45 +11:00
|
|
|
SIMFACE_FREESTYLE,
|
2012-02-19 18:31:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* similar edge selection slot values */
|
|
|
|
enum {
|
|
|
|
SIMEDGE_LENGTH = 101,
|
|
|
|
SIMEDGE_DIR,
|
|
|
|
SIMEDGE_FACE,
|
|
|
|
SIMEDGE_FACE_ANGLE,
|
|
|
|
SIMEDGE_CREASE,
|
2012-05-12 14:06:35 +00:00
|
|
|
SIMEDGE_BEVEL,
|
2012-02-19 18:31:04 +00:00
|
|
|
SIMEDGE_SEAM,
|
2012-02-21 01:40:04 +00:00
|
|
|
SIMEDGE_SHARP,
|
2019-02-03 14:01:45 +11:00
|
|
|
SIMEDGE_FREESTYLE,
|
2012-02-19 18:31:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* similar vertex selection slot values */
|
|
|
|
enum {
|
|
|
|
SIMVERT_NORMAL = 0,
|
|
|
|
SIMVERT_FACE,
|
2012-06-15 01:43:01 +00:00
|
|
|
SIMVERT_VGROUP,
|
2019-02-03 14:01:45 +11:00
|
|
|
SIMVERT_EDGE,
|
2012-02-19 18:31:04 +00:00
|
|
|
};
|
|
|
|
|
2013-04-06 02:45:43 +00:00
|
|
|
/* Poke face center calculation */
|
|
|
|
enum {
|
2018-12-14 11:01:01 +11:00
|
|
|
BMOP_POKE_MEDIAN_WEIGHTED = 0,
|
|
|
|
BMOP_POKE_MEDIAN,
|
2019-02-03 14:01:45 +11:00
|
|
|
BMOP_POKE_BOUNDS,
|
2013-04-06 02:45:43 +00:00
|
|
|
};
|
|
|
|
|
2013-11-10 12:31:57 +00:00
|
|
|
/* Bevel offset_type slot values */
|
|
|
|
enum {
|
|
|
|
BEVEL_AMT_OFFSET,
|
|
|
|
BEVEL_AMT_WIDTH,
|
|
|
|
BEVEL_AMT_DEPTH,
|
2019-02-03 14:01:45 +11:00
|
|
|
BEVEL_AMT_PERCENT,
|
2020-06-19 17:56:01 -04:00
|
|
|
BEVEL_AMT_ABSOLUTE,
|
2013-11-10 12:31:57 +00:00
|
|
|
};
|
|
|
|
|
2020-06-22 22:25:55 -04:00
|
|
|
/* Bevel profile type */
|
|
|
|
enum {
|
|
|
|
BEVEL_PROFILE_SUPERELLIPSE,
|
|
|
|
BEVEL_PROFILE_CUSTOM,
|
|
|
|
};
|
|
|
|
|
2020-06-25 23:13:02 +10:00
|
|
|
/* Bevel face_strength_mode values: should match face_str mode enum in DNA_modifier_types.h */
|
2018-06-11 11:58:26 +05:30
|
|
|
enum {
|
2019-01-03 13:39:52 -05:00
|
|
|
BEVEL_FACE_STRENGTH_NONE,
|
|
|
|
BEVEL_FACE_STRENGTH_NEW,
|
|
|
|
BEVEL_FACE_STRENGTH_AFFECTED,
|
|
|
|
BEVEL_FACE_STRENGTH_ALL,
|
2018-06-11 11:58:26 +05:30
|
|
|
};
|
|
|
|
|
2019-01-18 12:54:10 -05:00
|
|
|
/* Bevel miter slot values */
|
|
|
|
enum {
|
|
|
|
BEVEL_MITER_SHARP,
|
|
|
|
BEVEL_MITER_PATCH,
|
|
|
|
BEVEL_MITER_ARC,
|
|
|
|
};
|
|
|
|
|
2019-11-20 16:12:32 -05:00
|
|
|
/* Bevel vertex mesh creation methods */
|
|
|
|
enum {
|
|
|
|
BEVEL_VMESH_ADJ,
|
|
|
|
BEVEL_VMESH_CUTOFF,
|
|
|
|
};
|
|
|
|
|
2020-07-21 16:32:00 -04:00
|
|
|
/* Bevel affect option. */
|
|
|
|
enum {
|
|
|
|
BEVEL_AFFECT_VERTICES = 0,
|
|
|
|
BEVEL_AFFECT_EDGES = 1,
|
|
|
|
};
|
|
|
|
|
2019-05-20 08:51:18 -04:00
|
|
|
/* Normal Face Strength values */
|
|
|
|
enum {
|
|
|
|
FACE_STRENGTH_WEAK = -16384,
|
|
|
|
FACE_STRENGTH_MEDIUM = 0,
|
|
|
|
FACE_STRENGTH_STRONG = 16384,
|
|
|
|
};
|
|
|
|
|
2012-11-26 02:24:03 +00:00
|
|
|
extern const BMOpDefine *bmo_opdefines[];
|
|
|
|
extern const int bmo_opdefines_total;
|
2012-02-19 18:31:04 +00:00
|
|
|
|
|
|
|
/*------specific operator helper functions-------*/
|
2015-04-25 20:15:20 +10:00
|
|
|
void BM_mesh_esubdivide(BMesh *bm,
|
|
|
|
const char edge_hflag,
|
|
|
|
const float smooth,
|
|
|
|
const short smooth_falloff,
|
|
|
|
const bool use_smooth_even,
|
|
|
|
const float fractal,
|
|
|
|
const float along_normal,
|
|
|
|
const int numcuts,
|
|
|
|
const int seltype,
|
|
|
|
const int cornertype,
|
|
|
|
const short use_single_edge,
|
|
|
|
const short use_grid_fill,
|
|
|
|
const short use_only_quads,
|
|
|
|
const int seed);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-05-15 16:53:57 +10:00
|
|
|
void BM_mesh_calc_uvs_grid(BMesh *bm,
|
|
|
|
const uint x_segments,
|
|
|
|
const uint y_segments,
|
|
|
|
const short oflag,
|
|
|
|
const int cd_loop_uv_offset);
|
|
|
|
void BM_mesh_calc_uvs_sphere(BMesh *bm, const short oflag, const int cd_loop_uv_offset);
|
|
|
|
void BM_mesh_calc_uvs_circle(BMesh *bm,
|
|
|
|
float mat[4][4],
|
|
|
|
const float radius,
|
|
|
|
const short oflag,
|
|
|
|
const int cd_loop_uv_offset);
|
Fix T37879: Default UV generation for mesh primitives.
Adds default-generated UVs to mesh primitives (cone, cylinder, icosphere, uvsphere, cube, circle, grid)
when they are added to the scene, since some of them can be pretty awkward to unwrap manually.
Original patch: Liam Mitchell (CommanderCorianderSalamander).
Main review work: Campbell Barton (campbellbarton).
Finalization, fixes and cleanup: Bastien Montagne (mont29).
Reviewers: mont29, #mesh_modeling, campbellbarton
Reviewed By: mont29, campbellbarton
Subscribers: lkruel, campbellbarton, michaelknubben, kevindietrich
Maniphest Tasks: T37879
Differential Revision: https://developer.blender.org/D481
2015-12-04 23:49:55 +01:00
|
|
|
void BM_mesh_calc_uvs_cone(BMesh *bm,
|
|
|
|
float mat[4][4],
|
2017-05-15 16:53:57 +10:00
|
|
|
const float radius_top,
|
|
|
|
const float radius_bottom,
|
|
|
|
const int segments,
|
|
|
|
const bool cap_ends,
|
|
|
|
const short oflag,
|
|
|
|
const int cd_loop_uv_offset);
|
Fix T37879: Default UV generation for mesh primitives.
Adds default-generated UVs to mesh primitives (cone, cylinder, icosphere, uvsphere, cube, circle, grid)
when they are added to the scene, since some of them can be pretty awkward to unwrap manually.
Original patch: Liam Mitchell (CommanderCorianderSalamander).
Main review work: Campbell Barton (campbellbarton).
Finalization, fixes and cleanup: Bastien Montagne (mont29).
Reviewers: mont29, #mesh_modeling, campbellbarton
Reviewed By: mont29, campbellbarton
Subscribers: lkruel, campbellbarton, michaelknubben, kevindietrich
Maniphest Tasks: T37879
Differential Revision: https://developer.blender.org/D481
2015-12-04 23:49:55 +01:00
|
|
|
void BM_mesh_calc_uvs_cube(BMesh *bm, const short oflag);
|
|
|
|
|
2012-03-24 01:24:58 +00:00
|
|
|
#include "intern/bmesh_operator_api_inline.h"
|