Cleanup: remove redundant parenthesis (especially with macros)
This commit is contained in:
@@ -2629,7 +2629,7 @@ static int gpencil_material_find_index_by_name(Object *ob, const char *name)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < ob->totcol; i++) {
|
for (int i = 0; i < ob->totcol; i++) {
|
||||||
Material *ma = BKE_object_material_get(ob, i + 1);
|
Material *ma = BKE_object_material_get(ob, i + 1);
|
||||||
if ((ma != nullptr) && (ma->gp_style != nullptr) && (STREQ(ma->id.name + 2, name))) {
|
if ((ma != nullptr) && (ma->gp_style != nullptr) && STREQ(ma->id.name + 2, name)) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2986,7 +2986,7 @@ static void image_free_tile(Image *ima, ImageTile *tile)
|
|||||||
for (int i = 0; i < TEXTARGET_COUNT; i++) {
|
for (int i = 0; i < TEXTARGET_COUNT; i++) {
|
||||||
/* Only two textures depends on all tiles, so if this is a secondary tile we can keep the other
|
/* Only two textures depends on all tiles, so if this is a secondary tile we can keep the other
|
||||||
* two. */
|
* two. */
|
||||||
if (tile != ima->tiles.first && !(ELEM(i, TEXTARGET_2D_ARRAY, TEXTARGET_TILE_MAPPING))) {
|
if (tile != ima->tiles.first && !ELEM(i, TEXTARGET_2D_ARRAY, TEXTARGET_TILE_MAPPING)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -361,10 +361,10 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba
|
|||||||
mloopuv->uv[1] = (v % dl->nr) / float(orco_sizeu);
|
mloopuv->uv[1] = (v % dl->nr) / float(orco_sizeu);
|
||||||
|
|
||||||
/* cyclic correction */
|
/* cyclic correction */
|
||||||
if ((ELEM(i, 1, 2)) && mloopuv->uv[0] == 0.0f) {
|
if (ELEM(i, 1, 2) && mloopuv->uv[0] == 0.0f) {
|
||||||
mloopuv->uv[0] = 1.0f;
|
mloopuv->uv[0] = 1.0f;
|
||||||
}
|
}
|
||||||
if ((ELEM(i, 0, 1)) && mloopuv->uv[1] == 0.0f) {
|
if (ELEM(i, 0, 1) && mloopuv->uv[1] == 0.0f) {
|
||||||
mloopuv->uv[1] = 1.0f;
|
mloopuv->uv[1] = 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -835,7 +835,7 @@ struct LoopSplitTaskDataCommon {
|
|||||||
#define INDEX_UNSET INT_MIN
|
#define INDEX_UNSET INT_MIN
|
||||||
#define INDEX_INVALID -1
|
#define INDEX_INVALID -1
|
||||||
/* See comment about edge_to_loops below. */
|
/* See comment about edge_to_loops below. */
|
||||||
#define IS_EDGE_SHARP(_e2l) (ELEM((_e2l)[1], INDEX_UNSET, INDEX_INVALID))
|
#define IS_EDGE_SHARP(_e2l) ELEM((_e2l)[1], INDEX_UNSET, INDEX_INVALID)
|
||||||
|
|
||||||
static void mesh_edges_sharp_tag(LoopSplitTaskDataCommon *data,
|
static void mesh_edges_sharp_tag(LoopSplitTaskDataCommon *data,
|
||||||
const bool check_angle,
|
const bool check_angle,
|
||||||
|
|||||||
@@ -1417,8 +1417,8 @@ void nodeUnregisterType(bNodeType *nt)
|
|||||||
bool nodeTypeUndefined(const bNode *node)
|
bool nodeTypeUndefined(const bNode *node)
|
||||||
{
|
{
|
||||||
return (node->typeinfo == &NodeTypeUndefined) ||
|
return (node->typeinfo == &NodeTypeUndefined) ||
|
||||||
((ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP)) && node->id &&
|
(ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && node->id && ID_IS_LINKED(node->id) &&
|
||||||
ID_IS_LINKED(node->id) && (node->id->tag & LIB_TAG_MISSING));
|
(node->id->tag & LIB_TAG_MISSING));
|
||||||
}
|
}
|
||||||
|
|
||||||
GHashIterator *nodeTypeGetIterator()
|
GHashIterator *nodeTypeGetIterator()
|
||||||
|
|||||||
@@ -1402,15 +1402,15 @@ ModifierData *BKE_object_active_modifier(const Object *ob)
|
|||||||
|
|
||||||
bool BKE_object_supports_modifiers(const Object *ob)
|
bool BKE_object_supports_modifiers(const Object *ob)
|
||||||
{
|
{
|
||||||
return (ELEM(ob->type,
|
return ELEM(ob->type,
|
||||||
OB_MESH,
|
OB_MESH,
|
||||||
OB_CURVES,
|
OB_CURVES,
|
||||||
OB_CURVES_LEGACY,
|
OB_CURVES_LEGACY,
|
||||||
OB_SURF,
|
OB_SURF,
|
||||||
OB_FONT,
|
OB_FONT,
|
||||||
OB_LATTICE,
|
OB_LATTICE,
|
||||||
OB_POINTCLOUD,
|
OB_POINTCLOUD,
|
||||||
OB_VOLUME));
|
OB_VOLUME);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type)
|
bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type)
|
||||||
@@ -5450,7 +5450,7 @@ bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Skip sub-frame if object is parented to vertex of a dynamic paint canvas. */
|
/* Skip sub-frame if object is parented to vertex of a dynamic paint canvas. */
|
||||||
if (no_update && (ELEM(ob->partype, PARVERT1, PARVERT3))) {
|
if (no_update && ELEM(ob->partype, PARVERT1, PARVERT3)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -126,8 +126,8 @@
|
|||||||
/* ********* my write, buffered writing with minimum size chunks ************ */
|
/* ********* my write, buffered writing with minimum size chunks ************ */
|
||||||
|
|
||||||
/* Use optimal allocation since blocks of this size are kept in memory for undo. */
|
/* Use optimal allocation since blocks of this size are kept in memory for undo. */
|
||||||
#define MEM_BUFFER_SIZE (MEM_SIZE_OPTIMAL(1 << 17)) /* 128kb */
|
#define MEM_BUFFER_SIZE MEM_SIZE_OPTIMAL(1 << 17) /* 128kb */
|
||||||
#define MEM_CHUNK_SIZE (MEM_SIZE_OPTIMAL(1 << 15)) /* ~32kb */
|
#define MEM_CHUNK_SIZE MEM_SIZE_OPTIMAL(1 << 15) /* ~32kb */
|
||||||
|
|
||||||
#define ZSTD_BUFFER_SIZE (1 << 21) /* 2mb */
|
#define ZSTD_BUFFER_SIZE (1 << 21) /* 2mb */
|
||||||
#define ZSTD_CHUNK_SIZE (1 << 20) /* 1mb */
|
#define ZSTD_CHUNK_SIZE (1 << 20) /* 1mb */
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ static int extrapolate9(float *E0,
|
|||||||
do { \
|
do { \
|
||||||
*DST = *SRC; \
|
*DST = *SRC; \
|
||||||
} while (0)
|
} while (0)
|
||||||
if ((!PEQ(B, H)) && (!PEQ(D, F))) {
|
if (!PEQ(B, H) && !PEQ(D, F)) {
|
||||||
if (PEQ(D, B)) {
|
if (PEQ(D, B)) {
|
||||||
PCPY(E0, D);
|
PCPY(E0, D);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ string ComponentNode::OperationIDKey::identifier() const
|
|||||||
|
|
||||||
bool ComponentNode::OperationIDKey::operator==(const OperationIDKey &other) const
|
bool ComponentNode::OperationIDKey::operator==(const OperationIDKey &other) const
|
||||||
{
|
{
|
||||||
return (opcode == other.opcode) && (STREQ(name, other.name)) && (name_tag == other.name_tag);
|
return (opcode == other.opcode) && STREQ(name, other.name) && (name_tag == other.name_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t ComponentNode::OperationIDKey::hash() const
|
uint64_t ComponentNode::OperationIDKey::hash() const
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ float Light::attenuation_radius_get(const ::Light *la, float light_threshold, fl
|
|||||||
void Light::shape_parameters_set(const ::Light *la, const float scale[3])
|
void Light::shape_parameters_set(const ::Light *la, const float scale[3])
|
||||||
{
|
{
|
||||||
if (la->type == LA_AREA) {
|
if (la->type == LA_AREA) {
|
||||||
float area_size_y = (ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE)) ? la->area_sizey :
|
float area_size_y = ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE) ? la->area_sizey :
|
||||||
la->area_size;
|
la->area_size;
|
||||||
_area_size_x = max_ff(0.003f, la->area_size * scale[0] * 0.5f);
|
_area_size_x = max_ff(0.003f, la->area_size * scale[0] * 0.5f);
|
||||||
_area_size_y = max_ff(0.003f, area_size_y * scale[1] * 0.5f);
|
_area_size_y = max_ff(0.003f, area_size_y * scale[1] * 0.5f);
|
||||||
/* For volume point lighting. */
|
/* For volume point lighting. */
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata)
|
|||||||
(GPENCIL_EDIT_MODE(gpd) &&
|
(GPENCIL_EDIT_MODE(gpd) &&
|
||||||
(ts->gpencil_selectmode_edit != GP_SELECTMODE_STROKE));
|
(ts->gpencil_selectmode_edit != GP_SELECTMODE_STROKE));
|
||||||
|
|
||||||
if ((!GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)) &&
|
if (!GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd) &&
|
||||||
((!GPENCIL_VERTEX_MODE(gpd) && !GPENCIL_PAINT_MODE(gpd)) || use_vertex_mask)) {
|
((!GPENCIL_VERTEX_MODE(gpd) && !GPENCIL_PAINT_MODE(gpd)) || use_vertex_mask)) {
|
||||||
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
|
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
|
||||||
DRW_STATE_BLEND_ALPHA;
|
DRW_STATE_BLEND_ALPHA;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ static bool gpencil_bake_grease_pencil_animation_poll(bContext *C)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if grease pencil or empty for dupli groups. */
|
/* Check if grease pencil or empty for dupli groups. */
|
||||||
if ((obact == nullptr) || (!ELEM(obact->type, OB_GPENCIL, OB_EMPTY))) {
|
if ((obact == nullptr) || !ELEM(obact->type, OB_GPENCIL, OB_EMPTY)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ bool ui_but_is_interactive_ex(const uiBut *but, const bool labeledit, const bool
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((but->type == UI_BTYPE_TEXT) &&
|
if ((but->type == UI_BTYPE_TEXT) &&
|
||||||
(ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS)) && !labeledit) {
|
ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS) && !labeledit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((but->type == UI_BTYPE_LISTROW) && labeledit) {
|
if ((but->type == UI_BTYPE_LISTROW) && labeledit) {
|
||||||
@@ -103,7 +103,7 @@ bool UI_but_is_utf8(const uiBut *but)
|
|||||||
{
|
{
|
||||||
if (but->rnaprop) {
|
if (but->rnaprop) {
|
||||||
const int subtype = RNA_property_subtype(but->rnaprop);
|
const int subtype = RNA_property_subtype(but->rnaprop);
|
||||||
return !(ELEM(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME, PROP_BYTESTRING));
|
return !ELEM(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME, PROP_BYTESTRING);
|
||||||
}
|
}
|
||||||
return !(but->flag & UI_BUT_NO_UTF8);
|
return !(but->flag & UI_BUT_NO_UTF8);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,10 +165,10 @@ static void ui_popup_block_position(wmWindow *window,
|
|||||||
dir1 &= (UI_DIR_UP | UI_DIR_DOWN);
|
dir1 &= (UI_DIR_UP | UI_DIR_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dir2 == 0) && (ELEM(dir1, UI_DIR_LEFT, UI_DIR_RIGHT))) {
|
if ((dir2 == 0) && ELEM(dir1, UI_DIR_LEFT, UI_DIR_RIGHT)) {
|
||||||
dir2 = UI_DIR_DOWN;
|
dir2 = UI_DIR_DOWN;
|
||||||
}
|
}
|
||||||
if ((dir2 == 0) && (ELEM(dir1, UI_DIR_UP, UI_DIR_DOWN))) {
|
if ((dir2 == 0) && ELEM(dir1, UI_DIR_UP, UI_DIR_DOWN)) {
|
||||||
dir2 = UI_DIR_LEFT;
|
dir2 = UI_DIR_LEFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout,
|
|||||||
|
|
||||||
/* Only buttons that can be edited as text. */
|
/* Only buttons that can be edited as text. */
|
||||||
const bool use_activate_init = ((prop == prop_activate_init) &&
|
const bool use_activate_init = ((prop == prop_activate_init) &&
|
||||||
(ELEM(type, PROP_STRING, PROP_INT, PROP_FLOAT)));
|
ELEM(type, PROP_STRING, PROP_INT, PROP_FLOAT));
|
||||||
|
|
||||||
if (use_activate_init) {
|
if (use_activate_init) {
|
||||||
uiLayoutSetActivateInit(col, true);
|
uiLayoutSetActivateInit(col, true);
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ bool paint_use_opacity_masking(Brush *brush)
|
|||||||
{
|
{
|
||||||
return ((brush->flag & BRUSH_AIRBRUSH) || (brush->flag & BRUSH_DRAG_DOT) ||
|
return ((brush->flag & BRUSH_AIRBRUSH) || (brush->flag & BRUSH_DRAG_DOT) ||
|
||||||
(brush->flag & BRUSH_ANCHORED) ||
|
(brush->flag & BRUSH_ANCHORED) ||
|
||||||
(ELEM(brush->imagepaint_tool, PAINT_TOOL_SMEAR, PAINT_TOOL_SOFTEN)) ||
|
ELEM(brush->imagepaint_tool, PAINT_TOOL_SMEAR, PAINT_TOOL_SOFTEN) ||
|
||||||
(brush->imagepaint_tool == PAINT_TOOL_FILL) ||
|
(brush->imagepaint_tool == PAINT_TOOL_FILL) ||
|
||||||
(brush->flag & BRUSH_USE_GRADIENT) ||
|
(brush->flag & BRUSH_USE_GRADIENT) ||
|
||||||
(brush->mtex.tex && !ELEM(brush->mtex.brush_map_mode,
|
(brush->mtex.tex && !ELEM(brush->mtex.brush_map_mode,
|
||||||
|
|||||||
@@ -2459,7 +2459,7 @@ static void wpaint_do_symmetrical_brush_actions(
|
|||||||
/* symm is a bit combination of XYZ - 1 is mirror
|
/* symm is a bit combination of XYZ - 1 is mirror
|
||||||
* X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
|
* X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
|
||||||
for (i = 1; i <= symm; i++) {
|
for (i = 1; i <= symm; i++) {
|
||||||
if (symm & i && (symm != 5 || i != 3) && (symm != 6 || (!ELEM(i, 3, 5)))) {
|
if (symm & i && (symm != 5 || i != 3) && (symm != 6 || !ELEM(i, 3, 5))) {
|
||||||
cache->mirror_symmetry_pass = i;
|
cache->mirror_symmetry_pass = i;
|
||||||
cache->radial_symmetry_pass = 0;
|
cache->radial_symmetry_pass = 0;
|
||||||
SCULPT_cache_calc_brushdata_symm(cache, i, 0, 0);
|
SCULPT_cache_calc_brushdata_symm(cache, i, 0, 0);
|
||||||
@@ -3807,7 +3807,7 @@ static void vpaint_do_symmetrical_brush_actions(
|
|||||||
/* symm is a bit combination of XYZ - 1 is mirror
|
/* symm is a bit combination of XYZ - 1 is mirror
|
||||||
* X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
|
* X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
|
||||||
for (i = 1; i <= symm; i++) {
|
for (i = 1; i <= symm; i++) {
|
||||||
if (symm & i && (symm != 5 || i != 3) && (symm != 6 || (!ELEM(i, 3, 5)))) {
|
if (symm & i && (symm != 5 || i != 3) && (symm != 6 || !ELEM(i, 3, 5))) {
|
||||||
cache->mirror_symmetry_pass = i;
|
cache->mirror_symmetry_pass = i;
|
||||||
cache->radial_symmetry_pass = 0;
|
cache->radial_symmetry_pass = 0;
|
||||||
SCULPT_cache_calc_brushdata_symm(cache, i, 0, 0);
|
SCULPT_cache_calc_brushdata_symm(cache, i, 0, 0);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ static bool vertex_weight_paint_mode_poll(bContext *C)
|
|||||||
{
|
{
|
||||||
Object *ob = CTX_data_active_object(C);
|
Object *ob = CTX_data_active_object(C);
|
||||||
Mesh *me = BKE_mesh_from_object(ob);
|
Mesh *me = BKE_mesh_from_object(ob);
|
||||||
return (ob && (ELEM(ob->mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT))) &&
|
return (ob && ELEM(ob->mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT)) &&
|
||||||
(me && me->totpoly && !me->deform_verts().is_empty());
|
(me && me->totpoly && !me->deform_verts().is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -938,7 +938,7 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), Pointe
|
|||||||
uiItemR(
|
uiItemR(
|
||||||
row, &tex_ptr, "noise_basis_2", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
|
row, &tex_ptr, "noise_basis_2", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
|
||||||
row = uiLayoutRow(col, false);
|
row = uiLayoutRow(col, false);
|
||||||
uiLayoutSetActive(row, !(ELEM(tex->stype, TEX_BAND, TEX_RING)));
|
uiLayoutSetActive(row, !ELEM(tex->stype, TEX_BAND, TEX_RING));
|
||||||
uiItemR(row, &tex_ptr, "noise_type", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
|
uiItemR(row, &tex_ptr, "noise_type", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ static bool node_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent
|
|||||||
{
|
{
|
||||||
if (drag->type == WM_DRAG_PATH) {
|
if (drag->type == WM_DRAG_PATH) {
|
||||||
/* rule might not work? */
|
/* rule might not work? */
|
||||||
return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE));
|
return ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE);
|
||||||
}
|
}
|
||||||
return WM_drag_is_ID_type(drag, ID_IM);
|
return WM_drag_is_ID_type(drag, ID_IM);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ static void outliner_context_selected_ids_recursive(const SpaceOutliner &space_o
|
|||||||
{
|
{
|
||||||
tree_iterator::all(space_outliner, [&](const TreeElement *te) {
|
tree_iterator::all(space_outliner, [&](const TreeElement *te) {
|
||||||
const TreeStoreElem *tse = TREESTORE(te);
|
const TreeStoreElem *tse = TREESTORE(te);
|
||||||
if ((tse->flag & TSE_SELECTED) && (ELEM(tse->type, TSE_SOME_ID, TSE_LAYER_COLLECTION))) {
|
if ((tse->flag & TSE_SELECTED) && ELEM(tse->type, TSE_SOME_ID, TSE_LAYER_COLLECTION)) {
|
||||||
CTX_data_id_list_add(result, tse->id);
|
CTX_data_id_list_add(result, tse->id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -632,7 +632,7 @@ static bool view3d_ima_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event
|
|||||||
}
|
}
|
||||||
if (drag->type == WM_DRAG_PATH) {
|
if (drag->type == WM_DRAG_PATH) {
|
||||||
/* rule might not work? */
|
/* rule might not work? */
|
||||||
return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE));
|
return ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return WM_drag_is_ID_type(drag, ID_IM);
|
return WM_drag_is_ID_type(drag, ID_IM);
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ static int lib_id_fake_user_toggle_exec(bContext *C, wmOperator *op)
|
|||||||
ID *id = (ID *)idptr.data;
|
ID *id = (ID *)idptr.data;
|
||||||
|
|
||||||
if (!BKE_id_is_editable(CTX_data_main(C), id) ||
|
if (!BKE_id_is_editable(CTX_data_main(C), id) ||
|
||||||
(ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB, ID_WS))) {
|
ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB, ID_WS)) {
|
||||||
BKE_report(op->reports, RPT_ERROR, "Data-block type does not support fake user");
|
BKE_report(op->reports, RPT_ERROR, "Data-block type does not support fake user");
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -593,14 +593,14 @@ int Stroke::Resample(int iNPoints)
|
|||||||
for (vector<StrokeSegment>::iterator s = strokeSegments.begin(), send = strokeSegments.end();
|
for (vector<StrokeSegment>::iterator s = strokeSegments.begin(), send = strokeSegments.end();
|
||||||
s != send;
|
s != send;
|
||||||
++s) {
|
++s) {
|
||||||
newVertices.push_back(&(*(s->_begin)));
|
newVertices.push_back(&*(s->_begin));
|
||||||
if (s->_sampling < _sampling) {
|
if (s->_sampling < _sampling) {
|
||||||
_sampling = s->_sampling;
|
_sampling = s->_sampling;
|
||||||
}
|
}
|
||||||
|
|
||||||
t = s->_sampling / s->_length;
|
t = s->_sampling / s->_length;
|
||||||
for (int i = 0; i < s->_n; ++i) {
|
for (int i = 0; i < s->_n; ++i) {
|
||||||
newVertex = new StrokeVertex(&(*(s->_begin)), &(*(s->_end)), t);
|
newVertex = new StrokeVertex(&*(s->_begin), &*(s->_end), t);
|
||||||
newVertices.push_back(newVertex);
|
newVertices.push_back(newVertex);
|
||||||
t += s->_sampling / s->_length;
|
t += s->_sampling / s->_length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1289,7 +1289,7 @@ void ViewMapBuilder::computeCusps(ViewMap *ioViewMap)
|
|||||||
if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
|
if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((!((*ve)->getNature() & Nature::SILHOUETTE)) || (!((*ve)->fedgeA()->isSmooth()))) {
|
if (!((*ve)->getNature() & Nature::SILHOUETTE) || !((*ve)->fedgeA()->isSmooth())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
FEdge *fe = (*ve)->fedgeA();
|
FEdge *fe = (*ve)->fedgeA();
|
||||||
@@ -2313,8 +2313,8 @@ struct silhouette_binary_rule : public binary_rule<segment, segment> {
|
|||||||
FEdge *f1 = s1.edge();
|
FEdge *f1 = s1.edge();
|
||||||
FEdge *f2 = s2.edge();
|
FEdge *f2 = s2.edge();
|
||||||
|
|
||||||
if ((!(((f1)->getNature() & Nature::SILHOUETTE) || ((f1)->getNature() & Nature::BORDER))) &&
|
if (!(((f1)->getNature() & Nature::SILHOUETTE) || ((f1)->getNature() & Nature::BORDER)) &&
|
||||||
(!(((f2)->getNature() & Nature::SILHOUETTE) || ((f2)->getNature() & Nature::BORDER)))) {
|
!(((f2)->getNature() & Nature::SILHOUETTE) || ((f2)->getNature() & Nature::BORDER))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ struct GPUSource {
|
|||||||
}
|
}
|
||||||
if ((source.find("drw_debug_") != StringRef::not_found) &&
|
if ((source.find("drw_debug_") != StringRef::not_found) &&
|
||||||
/* Avoid these two files where it makes no sense to add the dependency. */
|
/* Avoid these two files where it makes no sense to add the dependency. */
|
||||||
(!ELEM(filename, "common_debug_draw_lib.glsl", "draw_debug_draw_display_vert.glsl"))) {
|
!ELEM(filename, "common_debug_draw_lib.glsl", "draw_debug_draw_display_vert.glsl")) {
|
||||||
builtins |= shader::BuiltinBits::USE_DEBUG_DRAW;
|
builtins |= shader::BuiltinBits::USE_DEBUG_DRAW;
|
||||||
}
|
}
|
||||||
check_no_quotes();
|
check_no_quotes();
|
||||||
@@ -140,7 +140,7 @@ struct GPUSource {
|
|||||||
if constexpr (check_whole_word) {
|
if constexpr (check_whole_word) {
|
||||||
/* Fix false positive if something has "enum" as suffix. */
|
/* Fix false positive if something has "enum" as suffix. */
|
||||||
char previous_char = input[offset - 1];
|
char previous_char = input[offset - 1];
|
||||||
if (!(ELEM(previous_char, '\n', '\t', ' ', ':', '(', ','))) {
|
if (!ELEM(previous_char, '\n', '\t', ' ', ':', '(', ',')) {
|
||||||
offset += (reversed) ? -1 : 1;
|
offset += (reversed) ? -1 : 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -422,9 +422,9 @@ void USDMeshReader::read_uvs(Mesh *mesh, const double motionSampleTime, const bo
|
|||||||
|
|
||||||
const UVSample &sample = uv_primvars[layer_idx];
|
const UVSample &sample = uv_primvars[layer_idx];
|
||||||
|
|
||||||
if (!(ELEM(sample.interpolation,
|
if (!ELEM(sample.interpolation,
|
||||||
pxr::UsdGeomTokens->faceVarying,
|
pxr::UsdGeomTokens->faceVarying,
|
||||||
pxr::UsdGeomTokens->vertex))) {
|
pxr::UsdGeomTokens->vertex)) {
|
||||||
std::cerr << "WARNING: unexpected interpolation type " << sample.interpolation
|
std::cerr << "WARNING: unexpected interpolation type " << sample.interpolation
|
||||||
<< " for uv " << layer->name << std::endl;
|
<< " for uv " << layer->name << std::endl;
|
||||||
continue;
|
continue;
|
||||||
@@ -865,7 +865,7 @@ Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh,
|
|||||||
|
|
||||||
pxr::TfToken interp = p.GetInterpolation();
|
pxr::TfToken interp = p.GetInterpolation();
|
||||||
|
|
||||||
if (!(ELEM(interp, pxr::UsdGeomTokens->faceVarying, pxr::UsdGeomTokens->vertex))) {
|
if (!ELEM(interp, pxr::UsdGeomTokens->faceVarying, pxr::UsdGeomTokens->vertex)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Quick test to see if we can return early. */
|
/* Quick test to see if we can return early. */
|
||||||
if (!(ELEM(mmd->mode, MOD_MASK_MODE_ARM, MOD_MASK_MODE_VGROUP)) || (mesh->totvert == 0) ||
|
if (!ELEM(mmd->mode, MOD_MASK_MODE_ARM, MOD_MASK_MODE_VGROUP) || (mesh->totvert == 0) ||
|
||||||
BLI_listbase_is_empty(&mesh->vertex_group_names)) {
|
BLI_listbase_is_empty(&mesh->vertex_group_names)) {
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -685,7 +685,7 @@ const char *node_cmp_rlayers_sock_to_pass(int sock_index)
|
|||||||
}
|
}
|
||||||
const char *name = cmp_node_rlayers_out[sock_index].name;
|
const char *name = cmp_node_rlayers_out[sock_index].name;
|
||||||
/* Exception for alpha, which is derived from Combined. */
|
/* Exception for alpha, which is derived from Combined. */
|
||||||
return (STREQ(name, "Alpha")) ? RE_PASSNAME_COMBINED : name;
|
return STREQ(name, "Alpha") ? RE_PASSNAME_COMBINED : name;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace blender::nodes::node_composite_render_layer_cc {
|
namespace blender::nodes::node_composite_render_layer_cc {
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ static bool colinear_f3_f3_f3(const float3 p1, const float3 p2, const float3 p3)
|
|||||||
{
|
{
|
||||||
const float3 a = math::normalize(p2 - p1);
|
const float3 a = math::normalize(p2 - p1);
|
||||||
const float3 b = math::normalize(p3 - p1);
|
const float3 b = math::normalize(p3 - p1);
|
||||||
return (ELEM(a, b, b * -1.0f));
|
return ELEM(a, b, b * -1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Curves *create_arc_curve_from_points(const int resolution,
|
static Curves *create_arc_curve_from_points(const int resolution,
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ static bool colinear_f3_f3_f3(const float3 p1, const float3 p2, const float3 p3)
|
|||||||
{
|
{
|
||||||
const float3 a = math::normalize(p2 - p1);
|
const float3 a = math::normalize(p2 - p1);
|
||||||
const float3 b = math::normalize(p3 - p1);
|
const float3 b = math::normalize(p3 - p1);
|
||||||
return (ELEM(a, b, b * -1.0f));
|
return ELEM(a, b, b * -1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Curves *create_point_circle_curve(
|
static Curves *create_point_circle_curve(
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ static void node_shader_update_tex_voronoi(bNodeTree *ntree, bNode *node)
|
|||||||
outWSock,
|
outWSock,
|
||||||
storage.feature != SHD_VORONOI_DISTANCE_TO_EDGE &&
|
storage.feature != SHD_VORONOI_DISTANCE_TO_EDGE &&
|
||||||
storage.feature != SHD_VORONOI_N_SPHERE_RADIUS &&
|
storage.feature != SHD_VORONOI_N_SPHERE_RADIUS &&
|
||||||
(ELEM(storage.dimensions, 1, 4)));
|
ELEM(storage.dimensions, 1, 4));
|
||||||
nodeSetSocketAvailability(ntree, outRadiusSock, storage.feature == SHD_VORONOI_N_SPHERE_RADIUS);
|
nodeSetSocketAvailability(ntree, outRadiusSock, storage.feature == SHD_VORONOI_N_SPHERE_RADIUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -585,7 +585,7 @@ wmDragAsset *WM_drag_get_asset_data(const wmDrag *drag, int idcode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wmDragAsset *asset_drag = static_cast<wmDragAsset *>(drag->poin);
|
wmDragAsset *asset_drag = static_cast<wmDragAsset *>(drag->poin);
|
||||||
return (ELEM(idcode, 0, asset_drag->id_type)) ? asset_drag : nullptr;
|
return ELEM(idcode, 0, asset_drag->id_type) ? asset_drag : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetMetaData *WM_drag_get_asset_meta_data(const wmDrag *drag, int idcode)
|
AssetMetaData *WM_drag_get_asset_meta_data(const wmDrag *drag, int idcode)
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ void wm_event_do_notifiers(bContext *C)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (note->window == win ||
|
if (note->window == win ||
|
||||||
(note->window == nullptr && (ELEM(note->reference, nullptr, scene)))) {
|
(note->window == nullptr && ELEM(note->reference, nullptr, scene))) {
|
||||||
if (note->category == NC_SCENE) {
|
if (note->category == NC_SCENE) {
|
||||||
if (note->data == ND_FRAME) {
|
if (note->data == ND_FRAME) {
|
||||||
do_anim = true;
|
do_anim = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user