Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/scene.c3
-rw-r--r--source/blender/blenloader/intern/versioning_250.c2
-rw-r--r--source/blender/blenloader/intern/versioning_270.c4
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c2
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c2
-rw-r--r--source/blender/bmesh/operators/bmo_dupe.c15
-rw-r--r--source/blender/editors/screen/screen_ops.c157
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h164
9 files changed, 199 insertions, 152 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 91e03337397..a47ff451a6b 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -756,7 +756,8 @@ void BKE_scene_init(Scene *sce)
pset->draw_step = 2;
pset->fade_frames = 2;
pset->selectmode = SCE_SELECT_PATH;
- for (a = 0; a < PE_TOT_BRUSH; a++) {
+
+ for (a = 0; a < ARRAY_SIZE(pset->brush); a++) {
pset->brush[a].strength = 0.5f;
pset->brush[a].size = 50;
pset->brush[a].step = 10;
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index a2eea6cbe7a..7036470c8e4 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -1783,7 +1783,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
ParticleEditSettings *pset = &sce->toolsettings->particle;
int a;
- for (a = 0; a < PE_TOT_BRUSH; a++)
+ for (a = 0; a < ARRAY_SIZE(pset->brush); a++)
pset->brush[a].strength /= 100.0f;
}
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 00b9f304570..0800437c3d2 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1243,7 +1243,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!MAIN_VERSION_ATLEAST(main, 277, 1)) {
for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
ParticleEditSettings *pset = &scene->toolsettings->particle;
- for (int a = 0; a < PE_TOT_BRUSH; a++) {
+ for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) {
if (pset->brush[a].strength > 1.0f) {
pset->brush[a].strength *= 0.01f;
}
@@ -1593,7 +1593,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (scene->toolsettings != NULL) {
ToolSettings *ts = scene->toolsettings;
ParticleEditSettings *pset = &ts->particle;
- for (int a = 0; a < PE_TOT_BRUSH; a++) {
+ for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) {
if (pset->brush[a].count == 0) {
pset->brush[a].count = 10;
}
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index b1113c7ac69..f5f6531754a 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -203,7 +203,7 @@ void BLO_update_defaults_startup_blend(Main *bmain)
ts->gpencil_ima_align = GP_PROJECT_VIEWSPACE;
ParticleEditSettings *pset = &ts->particle;
- for (int a = 0; a < PE_TOT_BRUSH; a++) {
+ for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) {
pset->brush[a].strength = 0.5f;
pset->brush[a].count = 10;
}
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index b263ab15853..0af1c3951ad 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -3068,7 +3068,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
pset->totaddkey = 5;
pset->brushtype = PE_BRUSH_NONE;
- for (a = 0; a < PE_TOT_BRUSH; a++) {
+ for (a = 0; a < ARRAY_SIZE(pset->brush); a++) {
pset->brush[a].strength = 50;
pset->brush[a].size = 50;
pset->brush[a].step = 10;
diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c
index e35c1f3b66c..394faabbd25 100644
--- a/source/blender/bmesh/operators/bmo_dupe.c
+++ b/source/blender/bmesh/operators/bmo_dupe.c
@@ -389,12 +389,10 @@ void bmo_split_exec(BMesh *bm, BMOperator *op)
BMOperator *splitop = op;
BMOperator dupeop;
- BMOperator delop;
const bool use_only_faces = BMO_slot_bool_get(op->slots_in, "use_only_faces");
/* initialize our sub-operator */
BMO_op_init(bm, &dupeop, op->flag, "duplicate");
- BMO_op_init(bm, &delop, op->flag, "delete");
BMO_slot_copy(splitop, slots_in, "geom",
&dupeop, slots_in, "geom");
@@ -437,24 +435,13 @@ void bmo_split_exec(BMesh *bm, BMOperator *op)
}
/* connect outputs of dupe to delete, exluding keep geometry */
- BMO_slot_int_set(delop.slots_in, "context", DEL_FACES);
- BMO_slot_buffer_from_enabled_flag(bm, &delop, delop.slots_in, "geom", BM_ALL_NOLOOP, SPLIT_INPUT);
-
- BMO_op_exec(bm, &delop);
+ BMO_mesh_delete_oflag_context(bm, SPLIT_INPUT, DEL_FACES);
/* now we make our outputs by copying the dupe output */
BMO_slot_copy(&dupeop, slots_out, "geom.out",
splitop, slots_out, "geom.out");
- BMO_slot_copy(&dupeop, slots_out, "boundary_map.out",
- splitop, slots_out, "boundary_map.out");
-
- BMO_slot_copy(&dupeop, slots_out, "isovert_map.out",
- splitop, slots_out, "isovert_map.out");
-
-
/* cleanup */
- BMO_op_finish(bm, &delop);
BMO_op_finish(bm, &dupeop);
#undef SPLIT_INPUT
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 4460ac7d1a7..39b1f5ff5dd 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -90,8 +90,8 @@
#define KM_MODAL_CANCEL 1
#define KM_MODAL_APPLY 2
-#define KM_MODAL_STEP10 3
-#define KM_MODAL_STEP10_OFF 4
+#define KM_MODAL_SNAP_ON 3
+#define KM_MODAL_SNAP_OFF 4
/* ************** Exported Poll tests ********************** */
@@ -1094,8 +1094,9 @@ static void SCREEN_OT_area_dupli(wmOperatorType *ot)
*/
typedef struct sAreaMoveData {
- int bigger, smaller, origval, step;
+ int bigger, smaller, origval;
char dir;
+ bool do_snap;
} sAreaMoveData;
/* helper call to move area-edge, sets limits
@@ -1187,55 +1188,101 @@ static int area_move_init(bContext *C, wmOperator *op)
return 1;
}
+static int area_snap_calc_location(
+ const bScreen *sc, const int delta,
+ const int origval, const int dir,
+ const int bigger, const int smaller)
+{
+ int final_loc = -1;
+
+ const int m_loc = origval + delta;
+ const int axis = (dir == 'v') ? 0 : 1;
+ int snap_dist = INT_MAX;
+ int dist;
+ {
+ /* Test the snap to middle. */
+ int middle = origval + (bigger - smaller) / 2;
+ middle -= (middle % AREAGRID);
+
+ dist = abs(m_loc - middle);
+ if (dist <= snap_dist) {
+ snap_dist = dist;
+ final_loc = middle;
+ }
+ }
+
+ for (const ScrVert *v1 = sc->vertbase.first; v1; v1 = v1->next) {
+ if (v1->editflag) {
+ const int v_loc = (&v1->vec.x)[!axis];
+
+ for (const ScrVert *v2 = sc->vertbase.first; v2; v2 = v2->next) {
+ if (!v2->editflag) {
+ if (v_loc == (&v2->vec.x)[!axis]) {
+ const int v_loc2 = (&v2->vec.x)[axis];
+ /* Do not snap to the vertices at the ends. */
+ if ((origval - smaller) < v_loc2 && v_loc2 < (origval + bigger)) {
+ dist = abs(m_loc - v_loc2);
+ if (dist <= snap_dist) {
+ snap_dist = dist;
+ final_loc = v_loc2;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return final_loc;
+}
+
/* moves selected screen edge amount of delta, used by split & move */
-static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int bigger, int smaller)
+static void area_move_apply_do(
+ const bContext *C, int delta,
+ const int origval, const int dir,
+ const int bigger, const int smaller,
+ const bool do_snap)
{
- wmWindow *win = CTX_wm_window(C);
- const int winsize_x = WM_window_pixels_x(win);
- const int winsize_y = WM_window_pixels_y(win);
bScreen *sc = CTX_wm_screen(C);
ScrVert *v1;
- ScrArea *sa;
- int doredraw = 0;
- int oldval;
-
- delta = CLAMPIS(delta, -smaller, bigger);
-
+ bool doredraw = false;
+ CLAMP(delta, -smaller, bigger);
+
+ short final_loc = -1;
+
+ if (do_snap) {
+ final_loc = area_snap_calc_location(sc, delta, origval, dir, bigger, smaller);
+ }
+ else {
+ final_loc = origval + delta;
+ if (delta != bigger && delta != -smaller) {
+ final_loc -= (final_loc % AREAGRID);
+ }
+ }
+
+ BLI_assert(final_loc != -1);
+ short axis = (dir == 'v') ? 0 : 1;
+
for (v1 = sc->vertbase.first; v1; v1 = v1->next) {
if (v1->editflag) {
- /* that way a nice AREAGRID */
- if ((dir == 'v') && v1->vec.x > 0 && v1->vec.x < winsize_x - 1) {
- oldval = v1->vec.x;
- v1->vec.x = origval + delta;
-
- if (delta != bigger && delta != -smaller) {
- v1->vec.x -= (v1->vec.x % AREAGRID);
- v1->vec.x = CLAMPIS(v1->vec.x, origval - smaller, origval + bigger);
- }
- if (oldval != v1->vec.x)
- doredraw = 1;
- }
- if ((dir == 'h') && v1->vec.y > 0 && v1->vec.y < winsize_y - 1) {
- oldval = v1->vec.y;
- v1->vec.y = origval + delta;
-
- if (delta != bigger && delta != smaller) {
- v1->vec.y -= (v1->vec.y % AREAGRID);
- v1->vec.y = CLAMPIS(v1->vec.y, origval - smaller, origval + bigger);
- }
- if (oldval != v1->vec.y)
- doredraw = 1;
+ short oldval = (&v1->vec.x)[axis];
+ (&v1->vec.x)[axis] = final_loc;
+
+ if (oldval == final_loc) {
+ /* nothing will change to the other vertices either. */
+ break;
}
+ doredraw = true;
}
}
/* only redraw if we actually moved a screen vert, for AREAGRID */
if (doredraw) {
- for (sa = sc->areabase.first; sa; sa = sa->next) {
- if (sa->v1->editflag || sa->v2->editflag || sa->v3->editflag || sa->v4->editflag)
+ for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
+ if (sa->v1->editflag || sa->v2->editflag || sa->v3->editflag || sa->v4->editflag) {
ED_area_tag_redraw(sa);
+ }
}
-
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); /* redraw everything */
/* Update preview thumbnail */
BKE_icon_changed(sc->id.icon_id);
@@ -1245,10 +1292,9 @@ static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int
static void area_move_apply(bContext *C, wmOperator *op)
{
sAreaMoveData *md = op->customdata;
- int delta;
-
- delta = RNA_int_get(op->ptr, "delta");
- area_move_apply_do(C, md->origval, delta, md->dir, md->bigger, md->smaller);
+ int delta = RNA_int_get(op->ptr, "delta");
+
+ area_move_apply_do(C, delta, md->origval, md->dir, md->bigger, md->smaller, md->do_snap);
}
static void area_move_exit(bContext *C, wmOperator *op)
@@ -1310,7 +1356,6 @@ static int area_move_modal(bContext *C, wmOperator *op, const wmEvent *event)
y = RNA_int_get(op->ptr, "y");
delta = (md->dir == 'v') ? event->x - x : event->y - y;
- if (md->step) delta = delta - (delta % md->step);
RNA_int_set(op->ptr, "delta", delta);
area_move_apply(C, op);
@@ -1326,12 +1371,12 @@ static int area_move_modal(bContext *C, wmOperator *op, const wmEvent *event)
case KM_MODAL_CANCEL:
area_move_cancel(C, op);
return OPERATOR_CANCELLED;
-
- case KM_MODAL_STEP10:
- md->step = 10;
+
+ case KM_MODAL_SNAP_ON:
+ md->do_snap = true;
break;
- case KM_MODAL_STEP10_OFF:
- md->step = 0;
+ case KM_MODAL_SNAP_OFF:
+ md->do_snap = false;
break;
}
break;
@@ -1407,6 +1452,7 @@ typedef struct sAreaSplitData {
int delta; /* delta move edge */
int origmin, origsize; /* to calculate fac, for property storage */
int previewmode; /* draw previewline, then split */
+ bool do_snap;
ScrEdge *nedge; /* new edge */
ScrArea *sarea; /* start area */
@@ -1707,8 +1753,9 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event)
sd->delta = (dir == 'v') ? event->x - sd->origval : event->y - sd->origval;
if (sd->previewmode == 0)
- area_move_apply_do(C, sd->origval, sd->delta, dir, sd->bigger, sd->smaller);
+ area_move_apply_do(C, sd->delta, sd->origval, dir, sd->bigger, sd->smaller, sd->do_snap);
else {
+ /* TODO: Snap in preview mode too. */
if (sd->sarea) {
sd->sarea->flag &= ~(AREA_FLAG_DRAWSPLIT_H | AREA_FLAG_DRAWSPLIT_V);
ED_area_tag_redraw(sd->sarea);
@@ -1787,6 +1834,10 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event)
case ESCKEY:
area_split_cancel(C, op);
return OPERATOR_CANCELLED;
+
+ case LEFTCTRLKEY:
+ sd->do_snap = event->val == KM_PRESS;
+ break;
}
return OPERATOR_RUNNING_MODAL;
@@ -4187,8 +4238,8 @@ static void keymap_modal_set(wmKeyConfig *keyconf)
static const EnumPropertyItem modal_items[] = {
{KM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
{KM_MODAL_APPLY, "APPLY", 0, "Apply", ""},
- {KM_MODAL_STEP10, "STEP10", 0, "Steps on", ""},
- {KM_MODAL_STEP10_OFF, "STEP10_OFF", 0, "Steps off", ""},
+ {KM_MODAL_SNAP_ON, "SNAP", 0, "Snap on", ""},
+ {KM_MODAL_SNAP_OFF, "SNAP_OFF", 0, "Snap off", ""},
{0, NULL, 0, NULL, NULL}};
wmKeyMap *keymap;
@@ -4200,8 +4251,8 @@ static void keymap_modal_set(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, KM_MODAL_APPLY);
WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, KM_MODAL_APPLY);
- WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, KM_MODAL_STEP10);
- WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_RELEASE, KM_ANY, 0, KM_MODAL_STEP10_OFF);
+ WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, KM_MODAL_SNAP_ON);
+ WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_RELEASE, KM_ANY, 0, KM_MODAL_SNAP_OFF);
WM_modalkeymap_assign(keymap, "SCREEN_OT_area_move");
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 57a3044cc2b..1ec1e052d43 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -282,7 +282,7 @@ static void imapaint_pick_uv(EvaluationContext *eval_ctx, Scene *scene, Object *
float p[2], w[3], absw, minabsw;
float matrix[4][4], proj[4][4];
GLint view[4];
- const eImageePaintMode mode = scene->toolsettings->imapaint.mode;
+ const eImagePaintMode mode = scene->toolsettings->imapaint.mode;
const MLoopTri *lt = dm->getLoopTriArray(dm);
const MPoly *mpoly = dm->getPolyArray(dm);
const MLoop *mloop = dm->getLoopArray(dm);
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 0dc640adb29..4d910588975 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -180,7 +180,8 @@ typedef struct SceneRenderLayer {
unsigned int lay_zmask DNA_DEPRECATED; /* Converted to LayerCollection cycles holdout override. */
unsigned int lay_exclude DNA_DEPRECATED;
int layflag DNA_DEPRECATED; /* Converted to ViewLayer layflag and flag. */
-
+
+ /* pass_xor has to be after passflag */
int passflag DNA_DEPRECATED; /* pass_xor has to be after passflag */
int pass_xor DNA_DEPRECATED; /* Converted to ViewLayer passflag and flag. */
@@ -192,7 +193,7 @@ typedef struct SceneRenderLayer {
struct FreestyleConfig freestyleConfig DNA_DEPRECATED; /* Converted to ViewLayer freestyleConfig. */
} SceneRenderLayer;
-/* srl->layflag */
+/* SceneRenderLayer.layflag */
#define SCE_LAY_SOLID 1
#define SCE_LAY_ZTRA 2
#define SCE_LAY_HALO 4
@@ -209,7 +210,7 @@ typedef struct SceneRenderLayer {
#define SCE_LAY_ZMASK 0x40000
#define SCE_LAY_NEG_ZMASK 0x80000
-/* srl->passflag */
+/* SceneRenderLayer.passflag */
typedef enum eScenePassType {
SCE_PASS_COMBINED = (1 << 0),
SCE_PASS_Z = (1 << 1),
@@ -279,7 +280,6 @@ typedef enum eScenePassType {
#define RE_PASSNAME_SUBSURFACE_INDIRECT "SubsurfaceInd"
#define RE_PASSNAME_SUBSURFACE_COLOR "SubsurfaceCol"
-/* note, srl->passflag is treestore element 'nr' in outliner, short still... */
/* View - MultiView */
typedef struct SceneRenderView {
@@ -294,16 +294,16 @@ typedef struct SceneRenderView {
} SceneRenderView;
-/* srv->viewflag */
+/* SceneRenderView.viewflag */
#define SCE_VIEW_DISABLE (1<<0)
-/* scene.render.views_format */
+/* RenderData.views_format */
enum {
SCE_VIEWS_FORMAT_STEREO_3D = 0,
SCE_VIEWS_FORMAT_MULTIVIEW = 1,
};
-/* ImageFormatData.views_output */
+/* ImageFormatData.views_format (also used for Sequence.views_format) */
enum {
R_IMF_VIEWS_INDIVIDUAL = 0,
R_IMF_VIEWS_STEREO_3D = 1,
@@ -503,7 +503,7 @@ typedef struct BakeData {
char cage[64]; /* MAX_NAME */
} BakeData;
-/* (char) normal_swizzle */
+/* BakeData.normal_swizzle (char) */
typedef enum eBakeNormalSwizzle {
R_BAKE_POSX = 0,
R_BAKE_POSY = 1,
@@ -513,13 +513,13 @@ typedef enum eBakeNormalSwizzle {
R_BAKE_NEGZ = 5,
} eBakeNormalSwizzle;
-/* (char) save_mode */
+/* BakeData.save_mode (char) */
typedef enum eBakeSaveMode {
R_BAKE_SAVE_INTERNAL = 0,
R_BAKE_SAVE_EXTERNAL = 1,
} eBakeSaveMode;
-/* bake->pass_filter */
+/* BakeData.pass_filter */
typedef enum eBakePassFilter {
R_BAKE_PASS_FILTER_NONE = 0,
R_BAKE_PASS_FILTER_AO = (1 << 0),
@@ -801,6 +801,7 @@ typedef struct GameDome {
struct Text *warptext;
} GameDome;
+/* GameDome.mode */
#define DOME_FISHEYE 1
#define DOME_TRUNCATED_FRONT 2
#define DOME_TRUNCATED_REAR 3
@@ -816,6 +817,7 @@ typedef struct GameFraming {
char type, pad1, pad2, pad3;
} GameFraming;
+/* GameFraming.type */
#define SCE_GAMEFRAMING_BARS 0
#define SCE_GAMEFRAMING_EXTEND 1
#define SCE_GAMEFRAMING_SCALE 2
@@ -839,6 +841,7 @@ typedef struct RecastData {
short pad2;
} RecastData;
+/* RecastData.partitioning */
#define RC_PARTITION_WATERSHED 0
#define RC_PARTITION_MONOTONE 1
#define RC_PARTITION_LAYERS 2
@@ -885,12 +888,15 @@ typedef struct GameData {
/* Scene LoD */
short lodflag, pad2;
int scehysteresis, pad5;
+
} GameData;
+/* GameData.stereoflag */
#define STEREO_NOSTEREO 1
#define STEREO_ENABLED 2
#define STEREO_DOME 3
+/* GameData.stereomode */
//#define STEREO_NOSTEREO 1
#define STEREO_QUADBUFFERED 2
#define STEREO_ABOVEBELOW 3
@@ -901,7 +907,7 @@ typedef struct GameData {
//#define STEREO_DOME 8
#define STEREO_3DTVTOPBOTTOM 9
-/* physicsEngine */
+/* GameData.physicsEngine */
#define WOPHY_NONE 0
#define WOPHY_BULLET 5
@@ -910,13 +916,13 @@ typedef struct GameData {
#define OBSTSIMULATION_TOI_rays 1
#define OBSTSIMULATION_TOI_cells 2
-/* Raster storage */
+/* GameData.raster_storage */
#define RAS_STORE_AUTO 0
-#define RAS_STORE_IMMEDIATE 1
+/* #define RAS_STORE_IMMEDIATE 1 */ /* DEPRECATED */
#define RAS_STORE_VA 2
#define RAS_STORE_VBO 3
-/* vsync */
+/* GameData.vsync */
#define VSYNC_ON 0
#define VSYNC_OFF 1
#define VSYNC_ADAPTIVE 2
@@ -960,13 +966,16 @@ enum {
#define SCE_LOD_USE_HYST (1 << 0)
/* UV Paint */
+/* ToolSettings.uv_sculpt_settings */
#define UV_SCULPT_LOCK_BORDERS 1
#define UV_SCULPT_ALL_ISLANDS 2
+/* ToolSettings.uv_sculpt_tool */
#define UV_SCULPT_TOOL_PINCH 1
#define UV_SCULPT_TOOL_RELAX 2
#define UV_SCULPT_TOOL_GRAB 3
+/* ToolSettings.uv_relax_method */
#define UV_SCULPT_TOOL_RELAX_LAPLACIAN 1
#define UV_SCULPT_TOOL_RELAX_HC 2
@@ -976,6 +985,7 @@ enum {
#define STEREO_RIGHT_SUFFIX "_R"
#define STEREO_LEFT_SUFFIX "_L"
+/* View3D.stereo3d_camera / View3D.multiview_eye / ImageUser.multiview_eye */
typedef enum eStereoViews {
STEREO_LEFT_ID = 0,
STEREO_RIGHT_ID = 1,
@@ -986,7 +996,7 @@ typedef enum eStereoViews {
/* *************************************************************** */
/* Markers */
-typedef struct TimeMarker {
+typedef struct TimeMarker {
struct TimeMarker *next, *prev;
int frame;
char name[64];
@@ -1064,7 +1074,7 @@ typedef struct ParticleEditSettings {
short totaddkey;
short brushtype;
- ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
+ ParticleBrushData brush[7];
void *paintcursor; /* runtime */
float emitterdist, rt;
@@ -1136,7 +1146,7 @@ enum {
/* ------------------------------------------- */
/* GPencil Stroke Sculpting */
-/* Brush types */
+/* GP_BrushEdit_Settings.brushtype */
typedef enum eGP_EditBrush_Types {
GP_EDITBRUSH_TYPE_SMOOTH = 0,
GP_EDITBRUSH_TYPE_THICKNESS = 1,
@@ -1154,7 +1164,7 @@ typedef enum eGP_EditBrush_Types {
TOT_GP_EDITBRUSH_TYPES
} eGP_EditBrush_Types;
-/* Lock axis options */
+/* GP_BrushEdit_Settings.lock_axis */
typedef enum eGP_Lockaxis_Types {
GP_LOCKAXIS_NONE = 0,
GP_LOCKAXIS_X = 1,
@@ -1192,7 +1202,7 @@ typedef struct GP_BrushEdit_Settings {
int brushtype; /* eGP_EditBrush_Types */
int flag; /* eGP_BrushEdit_SettingsFlag */
- int lock_axis; /* lock drawing to one axis */
+ int lock_axis; /* eGP_Lockaxis_Types lock drawing to one axis */
float alpha; /* alpha factor for selection color */
} GP_BrushEdit_Settings;
@@ -1331,6 +1341,7 @@ typedef struct UnifiedPaintSettings {
struct ColorSpace *colorspace;
} UnifiedPaintSettings;
+/* UnifiedPaintSettings.flag */
typedef enum {
UNIFIED_PAINT_SIZE = (1 << 0),
UNIFIED_PAINT_ALPHA = (1 << 1),
@@ -1676,7 +1687,6 @@ typedef struct Scene {
uint64_t customdata_mask; /* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */
uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */
-
/* Color Management */
ColorManagedViewSettings view_settings;
ColorManagedDisplaySettings display_settings;
@@ -1702,14 +1712,14 @@ typedef struct Scene {
/* **************** RENDERDATA ********************* */
-/* flag */
+/* RenderData.flag */
/* use preview range */
#define SCER_PRV_RANGE (1<<0)
#define SCER_LOCK_FRAME_SELECTION (1<<1)
/* show/use subframes (for checking motion blur) */
#define SCER_SHOW_SUBFRAME (1<<3)
-/* mode (int now) */
+/* RenderData.mode */
#define R_OSA 0x0001
#define R_SHADOW 0x0002
#define R_GAMMA 0x0004
@@ -1745,7 +1755,7 @@ typedef struct Scene {
#define R_PERSISTENT_DATA 0x4000000 /* keep data around for re-render */
#define R_USE_WS_SHADING 0x8000000 /* use world space interpretation of lighting data */
-/* seq_flag */
+/* RenderData.seq_flag */
enum {
// R_SEQ_GL_PREV = (1 << 1), // UNUSED, we just use setting from seq_prev_type now.
// R_SEQ_GL_REND = (1 << 2), // UNUSED, opengl render has its own operator now.
@@ -1753,15 +1763,14 @@ enum {
R_SEQ_CAMERA_DOF = (1 << 4),
};
-/* displaymode */
-
+/* RenderData.displaymode */
#define R_OUTPUT_SCREEN 0
#define R_OUTPUT_AREA 1
#define R_OUTPUT_WINDOW 2
#define R_OUTPUT_NONE 3
/*#define R_OUTPUT_FORKED 4*/
-/* filtertype */
+/* RenderData.filtertype */
#define R_FILTER_BOX 0
#define R_FILTER_TENT 1
#define R_FILTER_QUAD 2
@@ -1771,7 +1780,7 @@ enum {
#define R_FILTER_MITCH 6
#define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
-/* raytrace structure */
+/* RenderData.raytrace_structure */
#define R_RAYSTRUCTURE_AUTO 0
#define R_RAYSTRUCTURE_OCTREE 1
#define R_RAYSTRUCTURE_BLIBVH 2 /* removed */
@@ -1779,11 +1788,11 @@ enum {
#define R_RAYSTRUCTURE_SIMD_SVBVH 4 /* needs SIMD */
#define R_RAYSTRUCTURE_SIMD_QBVH 5 /* needs SIMD */
-/* raytrace_options */
+/* RenderData.raytrace_options */
#define R_RAYTRACE_USE_LOCAL_COORDS 0x0001
#define R_RAYTRACE_USE_INSTANCES 0x0002
-/* scemode (int now) */
+/* RenderData.scemode (int now) */
#define R_DOSEQ 0x0001
#define R_BG_RENDER 0x0002
/* passepartout is camera option now, keep this for backward compatibility */
@@ -1808,7 +1817,7 @@ enum {
#define R_EXR_CACHE_FILE 0x100000
#define R_MULTIVIEW 0x200000
-/* r->stamp */
+/* RenderData.stamp */
#define R_STAMP_TIME 0x0001
#define R_STAMP_FRAME 0x0002
#define R_STAMP_DATE 0x0004
@@ -1829,19 +1838,19 @@ enum {
R_STAMP_RENDERTIME|R_STAMP_CAMERALENS|R_STAMP_MEMORY| \
R_STAMP_HIDE_LABELS)
-/* alphamode */
+/* RenderData.alphamode */
#define R_ADDSKY 0
#define R_ALPHAPREMUL 1
/*#define R_ALPHAKEY 2*/ /* deprecated, shouldn't be used */
-/* color_mgt_flag */
+/* RenderData.color_mgt_flag */
enum {
R_COLOR_MANAGEMENT = (1 << 0), /* deprecated, should only be used in versioning code only */
/*R_COLOR_MANAGEMENT_PREDIVIDE = (1 << 1)*/ /* deprecated, shouldn't be used */
};
#ifdef DNA_DEPRECATED
-/* subimtype, flag options for imtype */
+/* RenderData.subimtype flag options for imtype */
enum {
R_OPENEXR_HALF = 1, /*deprecated*/
R_OPENEXR_ZBUF = 2, /*deprecated*/
@@ -1858,7 +1867,7 @@ enum {
#endif
/* bake_mode: same as RE_BAKE_xxx defines */
-/* bake_flag: */
+/* RenderData.bake_flag */
#define R_BAKE_CLEAR 1
#define R_BAKE_OSA 2
#define R_BAKE_TO_ACTIVE 4
@@ -1871,22 +1880,22 @@ enum {
#define R_BAKE_SPLIT_MAT 512
#define R_BAKE_AUTO_NAME 1024
-/* bake_normal_space */
+/* RenderData.bake_normal_space */
#define R_BAKE_SPACE_CAMERA 0
#define R_BAKE_SPACE_WORLD 1
#define R_BAKE_SPACE_OBJECT 2
#define R_BAKE_SPACE_TANGENT 3
-/* simplify_flag */
+/* RenderData.simplify_flag */
#define R_SIMPLE_NO_TRIANGULATE 1
-/* line_thickness_mode */
+/* RenderData.line_thickness_mode */
#define R_LINE_THICKNESS_ABSOLUTE 1
#define R_LINE_THICKNESS_RELATIVE 2
/* sequencer seq_prev_type seq_rend_type */
-/* scene->r.engine (scene.c) */
+/* RenderData.engine (scene.c) */
extern const char *RE_engine_id_BLENDER_RENDER;
extern const char *RE_engine_id_BLENDER_GAME;
extern const char *RE_engine_id_BLENDER_CLAY;
@@ -1948,9 +1957,9 @@ extern const char *RE_engine_id_CYCLES;
#define TIME2FRA(a) ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
#define FPS (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base)
-/* base->legacy_flag is in DNA_object_types.h */
+/* Base.flag is in DNA_object_types.h */
-/* toolsettings->snap_flag */
+/* ToolSettings.snap_flag */
#define SCE_SNAP 1
#define SCE_SNAP_ROTATE 2
#define SCE_SNAP_PEEL_OBJECT 4
@@ -1958,12 +1967,12 @@ extern const char *RE_engine_id_CYCLES;
#define SCE_SNAP_NO_SELF 16
#define SCE_SNAP_ABS_GRID 32
-/* toolsettings->snap_target */
+/* ToolSettings.snap_target */
#define SCE_SNAP_TARGET_CLOSEST 0
#define SCE_SNAP_TARGET_CENTER 1
#define SCE_SNAP_TARGET_MEDIAN 2
#define SCE_SNAP_TARGET_ACTIVE 3
-/* toolsettings->snap_mode */
+/* ToolSettings.snap_mode */
#define SCE_SNAP_MODE_INCREMENT 0
#define SCE_SNAP_MODE_VERTEX 1
#define SCE_SNAP_MODE_EDGE 2
@@ -1974,24 +1983,24 @@ extern const char *RE_engine_id_CYCLES;
#define SCE_SNAP_MODE_NODE_XY 7
#define SCE_SNAP_MODE_GRID 8
-/* toolsettings->selectmode */
+/* ToolSettings.selectmode */
#define SCE_SELECT_VERTEX 1 /* for mesh */
#define SCE_SELECT_EDGE 2
#define SCE_SELECT_FACE 4
-/* toolsettings->statvis->type */
+/* MeshStatVis.type */
#define SCE_STATVIS_OVERHANG 0
#define SCE_STATVIS_THICKNESS 1
#define SCE_STATVIS_INTERSECT 2
#define SCE_STATVIS_DISTORT 3
#define SCE_STATVIS_SHARP 4
-/* toolsettings->particle.selectmode for particles */
+/* ParticleEditSettings.selectmode for particles */
#define SCE_SELECT_PATH 1
#define SCE_SELECT_POINT 2
#define SCE_SELECT_END 4
-/* toolsettings->prop_mode (proportional falloff) */
+/* ToolSettings.prop_mode (proportional falloff) */
#define PROP_SMOOTH 0
#define PROP_SPHERE 1
#define PROP_ROOT 2
@@ -2002,21 +2011,21 @@ extern const char *RE_engine_id_CYCLES;
#define PROP_INVSQUARE 7
#define PROP_MODE_MAX 8
-/* toolsettings->proportional */
+/* ToolSettings.proportional */
#define PROP_EDIT_OFF 0
#define PROP_EDIT_ON 1
#define PROP_EDIT_CONNECTED 2
#define PROP_EDIT_PROJECTED 3
-/* toolsettings->weightuser */
+/* ToolSettings.weightuser */
enum {
OB_DRAW_GROUPUSER_NONE = 0,
OB_DRAW_GROUPUSER_ACTIVE = 1,
OB_DRAW_GROUPUSER_ALL = 2
};
-/* toolsettings->vgroupsubset */
/* object_vgroup.c */
+/* ToolSettings.vgroupsubset */
typedef enum eVGroupSelect {
WT_VGROUP_ALL = 0,
WT_VGROUP_ACTIVE = 1,
@@ -2033,26 +2042,26 @@ typedef enum eVGroupSelect {
(1 << WT_VGROUP_ALL))
-/* sce->flag */
+/* Scene.flag */
#define SCE_DS_SELECTED (1<<0)
#define SCE_DS_COLLAPSED (1<<1)
#define SCE_NLA_EDIT_ON (1<<2)
#define SCE_FRAME_DROP (1<<3)
#define SCE_KEYS_NO_SELONLY (1<<4)
-
/* return flag BKE_scene_base_iter_next functions */
/* #define F_ERROR -1 */ /* UNUSED */
#define F_START 0
#define F_SCENE 1
#define F_DUPLI 3
-/* audio->flag */
+/* AudioData.flag */
#define AUDIO_MUTE (1<<0)
#define AUDIO_SYNC (1<<1)
#define AUDIO_SCRUB (1<<2)
#define AUDIO_VOLUME_ANIMATED (1<<3)
+/* FFMpegCodecData.flags */
enum {
#ifdef DNA_DEPRECATED
FFMPEG_MULTIPLEX_AUDIO = 1, /* deprecated, you can choose none as audiocodec now */
@@ -2121,10 +2130,11 @@ typedef enum eSculptFlags {
SCULPT_HIDE_MASK = (1 << 15),
} eSculptFlags;
-typedef enum eImageePaintMode {
+/* ImagePaintSettings.mode */
+typedef enum eImagePaintMode {
IMAGEPAINT_MODE_MATERIAL, /* detect texture paint slots from the material */
IMAGEPAINT_MODE_IMAGE, /* select texture paint image directly */
-} eImageePaintMode;
+} eImagePaintMode;
/* ImagePaintSettings.flag */
#define IMAGEPAINT_DRAWING 1
@@ -2132,6 +2142,7 @@ typedef enum eImageePaintMode {
// #define IMAGEPAINT_DRAW_TOOL_DRAWING 4 // deprecated
/* projection painting only */
+/* ImagePaintSettings.flag */
#define IMAGEPAINT_PROJECT_XRAY (1 << 4)
#define IMAGEPAINT_PROJECT_BACKFACE (1 << 5)
#define IMAGEPAINT_PROJECT_FLAT (1 << 6)
@@ -2139,29 +2150,29 @@ typedef enum eImageePaintMode {
#define IMAGEPAINT_PROJECT_LAYER_STENCIL (1 << 8)
#define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV (1 << 9)
-
+/* ImagePaintSettings.missing_data */
#define IMAGEPAINT_MISSING_UVS (1 << 0)
#define IMAGEPAINT_MISSING_MATERIAL (1 << 1)
#define IMAGEPAINT_MISSING_TEX (1 << 2)
#define IMAGEPAINT_MISSING_STENCIL (1 << 3)
-/* toolsettings->uvcalc_flag */
+/* ToolSettings.uvcalc_flag */
#define UVCALC_FILLHOLES 1
#define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
#define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
#define UVCALC_USESUBSURF 8 /* Use mesh data after subsurf to compute UVs*/
-/* toolsettings->uv_flag */
+/* ToolSettings.uv_flag */
#define UV_SYNC_SELECTION 1
#define UV_SHOW_SAME_IMAGE 2
-/* toolsettings->uv_selectmode */
+/* ToolSettings.uv_selectmode */
#define UV_SELECT_VERTEX 1
#define UV_SELECT_EDGE 2
#define UV_SELECT_FACE 4
#define UV_SELECT_ISLAND 8
-/* toolsettings->edge_mode */
+/* ToolSettings.edge_mode */
#define EDGE_MODE_SELECT 0
#define EDGE_MODE_TAG_SEAM 1
#define EDGE_MODE_TAG_SHARP 2
@@ -2169,7 +2180,7 @@ typedef enum eImageePaintMode {
#define EDGE_MODE_TAG_BEVEL 4
#define EDGE_MODE_TAG_FREESTYLE 5
-/* toolsettings->gpencil_flags */
+/* ToolSettings.gpencil_flags */
typedef enum eGPencil_Flags {
/* "Continuous Drawing" - The drawing operator enters a mode where multiple strokes can be drawn */
GP_TOOL_FLAG_PAINTSESSIONS_ON = (1 << 0),
@@ -2179,13 +2190,13 @@ typedef enum eGPencil_Flags {
GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2)
} eGPencil_Flags;
-/* toolsettings->gpencil_src */
+/* ToolSettings.gpencil_src */
typedef enum eGPencil_Source_3D {
GP_TOOL_SOURCE_SCENE = 0,
GP_TOOL_SOURCE_OBJECT = 1
} eGPencil_Source_3d;
-/* toolsettings->gpencil_*_align - Stroke Placement mode flags */
+/* ToolSettings.gpencil_*_align - Stroke Placement mode flags */
typedef enum eGPencil_Placement_Flags {
/* New strokes are added in viewport/data space (i.e. not screen space) */
GP_PROJECT_VIEWSPACE = (1 << 0),
@@ -2201,7 +2212,7 @@ typedef enum eGPencil_Placement_Flags {
GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4),
} eGPencil_Placement_Flags;
-/* toolsettings->particle flag */
+/* ToolSettings.particle flag */
#define PE_KEEP_LENGTHS 1
#define PE_LOCK_FIRST 2
#define PE_DEFLECT_EMITTER 4
@@ -2211,7 +2222,7 @@ typedef enum eGPencil_Placement_Flags {
#define PE_FADE_TIME 128
#define PE_AUTO_VELOCITY 256
-/* toolsetting->particle brushtype */
+/* ParticleEditSettings.brushtype */
#define PE_BRUSH_NONE -1
#define PE_BRUSH_COMB 0
#define PE_BRUSH_CUT 1
@@ -2221,18 +2232,15 @@ typedef enum eGPencil_Placement_Flags {
#define PE_BRUSH_SMOOTH 5
#define PE_BRUSH_WEIGHT 6
-/* this must equal ParticleEditSettings.brush array size */
-#define PE_TOT_BRUSH 6
-
-/* ParticleBrushData->flag */
+/* ParticleBrushData.flag */
#define PE_BRUSH_DATA_PUFF_VOLUME 1
-/* tooksettings->particle edittype */
+/* ParticleBrushData.edittype */
#define PE_TYPE_PARTICLES 0
#define PE_TYPE_SOFTBODY 1
#define PE_TYPE_CLOTH 2
-/* toolsettings->skgen_options */
+/* ToolSettings.skgen_options */
#define SKGEN_FILTER_INTERNAL (1 << 0)
#define SKGEN_FILTER_EXTERNAL (1 << 1)
#define SKGEN_SYMMETRY (1 << 2)
@@ -2254,40 +2262,40 @@ typedef enum eGPencil_Placement_Flags {
#define SKGEN_SUB_CORRELATION 2
#define SKGEN_SUB_TOTAL 3
-/* toolsettings->skgen_postpro */
+/* ToolSettings.skgen_postpro */
#define SKGEN_SMOOTH 0
#define SKGEN_AVERAGE 1
#define SKGEN_SHARPEN 2
-/* toolsettings->bone_sketching */
+/* ToolSettings.bone_sketching */
#define BONE_SKETCHING 1
#define BONE_SKETCHING_QUICK 2
#define BONE_SKETCHING_ADJUST 4
-/* toolsettings->bone_sketching_convert */
+/* ToolSettings.bone_sketching_convert */
#define SK_CONVERT_CUT_FIXED 0
#define SK_CONVERT_CUT_LENGTH 1
#define SK_CONVERT_CUT_ADAPTATIVE 2
#define SK_CONVERT_RETARGET 3
-/* toolsettings->skgen_retarget_options */
+/* ToolSettings.skgen_retarget_options */
#define SK_RETARGET_AUTONAME 1
-/* toolsettings->skgen_retarget_roll */
+/* ToolSettings.skgen_retarget_roll */
#define SK_RETARGET_ROLL_NONE 0
#define SK_RETARGET_ROLL_VIEW 1
#define SK_RETARGET_ROLL_JOINT 2
-/* physics_settings->flag */
+/* PhysicsSettings.flag */
#define PHYS_GLOBAL_GRAVITY 1
/* UnitSettings */
-/* UnitSettings->system */
+/* UnitSettings.system */
#define USER_UNIT_NONE 0
#define USER_UNIT_METRIC 1
#define USER_UNIT_IMPERIAL 2
-/* UnitSettings->flag */
+/* UnitSettings.flag */
#define USER_UNIT_OPT_SPLIT 1
#define USER_UNIT_ROT_RADIANS 2