Cleanup: Convert several RNA C files to C++

C++ RNA files for object, nodetree, and curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/108934
This commit is contained in:
Lukas Tönne
2023-06-14 15:27:59 +02:00
parent cfede90082
commit f3dd63e25c
8 changed files with 890 additions and 881 deletions

View File

@@ -30,9 +30,9 @@ set(DEFSRC
rna_color.c
rna_constraint.c
rna_context.c
rna_curve.c
rna_curve.cc
rna_curveprofile.c
rna_curves.c
rna_curves.cc
rna_depsgraph.c
rna_dynamicpaint.c
rna_fcurve.c
@@ -54,8 +54,8 @@ set(DEFSRC
rna_modifier.c
rna_movieclip.c
rna_nla.c
rna_nodetree.c
rna_object.c
rna_nodetree.cc
rna_object.cc
rna_object_force.c
rna_packedfile.c
rna_palette.c
@@ -103,7 +103,7 @@ set(APISRC
rna_animation_api.c
rna_armature_api.c
rna_camera_api.c
rna_curve_api.c
rna_curve_api.cc
rna_fcurve_api.c
rna_image_api.c
rna_lattice_api.cc
@@ -111,7 +111,7 @@ set(APISRC
rna_material_api.c
rna_mesh_api.cc
rna_meta_api.c
rna_object_api.c
rna_object_api.cc
rna_pose_api.c
rna_scene_api.c
rna_sequencer_api.c

View File

@@ -4546,12 +4546,12 @@ static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_color.c", NULL, RNA_def_color},
{"rna_constraint.c", NULL, RNA_def_constraint},
{"rna_context.c", NULL, RNA_def_context},
{"rna_curve.c", "rna_curve_api.c", RNA_def_curve},
{"rna_curve.cc", "rna_curve_api.cc", RNA_def_curve},
{"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint},
{"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve},
{"rna_gpencil_legacy.c", NULL, RNA_def_gpencil},
{"rna_grease_pencil.c", NULL, RNA_def_grease_pencil},
{"rna_curves.c", NULL, RNA_def_curves},
{"rna_curves.cc", NULL, RNA_def_curves},
{"rna_image.c", "rna_image_api.c", RNA_def_image},
{"rna_key.c", NULL, RNA_def_key},
{"rna_light.c", NULL, RNA_def_light},
@@ -4567,8 +4567,8 @@ static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_gpencil_legacy_modifier.c", NULL, RNA_def_greasepencil_modifier},
{"rna_shader_fx.c", NULL, RNA_def_shader_fx},
{"rna_nla.c", NULL, RNA_def_nla},
{"rna_nodetree.c", NULL, RNA_def_nodetree},
{"rna_object.c", "rna_object_api.c", RNA_def_object},
{"rna_nodetree.cc", NULL, RNA_def_nodetree},
{"rna_object.cc", "rna_object_api.cc", RNA_def_object},
{"rna_object_force.c", NULL, RNA_def_object_force},
{"rna_depsgraph.c", NULL, RNA_def_depsgraph},
{"rna_packedfile.c", NULL, RNA_def_packedfile},

View File

@@ -10,16 +10,13 @@
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
#include "BLI_math.h"
#include "BLI_math_rotation.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_vfont.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -154,9 +151,12 @@ static const EnumPropertyItem curve2d_fill_mode_items[] = {
# include "DNA_object_types.h"
# include "BLI_math.h"
# include "BKE_curve.h"
# include "BKE_curveprofile.h"
# include "BKE_main.h"
# include "BKE_vfont.h"
# include "DEG_depsgraph.h"
# include "DEG_depsgraph_build.h"
@@ -174,14 +174,17 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
Nurb *nu;
int i = 0;
for (nu = nurbs->first; nu; nu = nu->next, i++) {
for (nu = static_cast<Nurb *>(nurbs->first); nu; nu = nu->next, i++) {
if (nu->type == CU_BEZIER) {
if (point >= (void *)nu->bezt && point < (void *)(nu->bezt + nu->pntsu)) {
if (point >= static_cast<void *>(nu->bezt) &&
point < static_cast<void *>(nu->bezt + nu->pntsu)) {
break;
}
}
else {
if (point >= (void *)nu->bp && point < (void *)(nu->bp + (nu->pntsu * nu->pntsv))) {
if (point >= static_cast<void *>(nu->bp) &&
point < static_cast<void *>(nu->bp + (nu->pntsu * nu->pntsv)))
{
break;
}
}
@@ -194,10 +197,10 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
if (pt_index) {
if (nu->type == CU_BEZIER) {
*pt_index = (int)((BezTriple *)point - nu->bezt);
*pt_index = int(static_cast<const BezTriple *>(point) - nu->bezt);
}
else {
*pt_index = (int)((BPoint *)point - nu->bp);
*pt_index = int(static_cast<const BPoint *>(point) - nu->bp);
}
}
}
@@ -207,7 +210,7 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
static StructRNA *rna_Curve_refine(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
short obtype = BKE_curve_type_get(cu);
if (obtype == OB_FONT) {
@@ -223,58 +226,58 @@ static StructRNA *rna_Curve_refine(PointerRNA *ptr)
static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
{
BezTriple *bezt = (BezTriple *)ptr->data;
BezTriple *bezt = static_cast<BezTriple *>(ptr->data);
copy_v3_v3(values, bezt->vec[0]);
}
static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
{
BezTriple *bezt = (BezTriple *)ptr->data;
BezTriple *bezt = static_cast<BezTriple *>(ptr->data);
copy_v3_v3(bezt->vec[0], values);
}
static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values)
{
BezTriple *bezt = (BezTriple *)ptr->data;
BezTriple *bezt = static_cast<BezTriple *>(ptr->data);
copy_v3_v3(values, bezt->vec[2]);
}
static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
{
BezTriple *bezt = (BezTriple *)ptr->data;
BezTriple *bezt = static_cast<BezTriple *>(ptr->data);
copy_v3_v3(bezt->vec[2], values);
}
static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values)
{
BezTriple *bezt = (BezTriple *)ptr->data;
BezTriple *bezt = static_cast<BezTriple *>(ptr->data);
copy_v3_v3(values, bezt->vec[1]);
}
static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
{
BezTriple *bezt = (BezTriple *)ptr->data;
BezTriple *bezt = static_cast<BezTriple *>(ptr->data);
copy_v3_v3(bezt->vec[1], values);
}
static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_Curve_texspace_set(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
if (cu->texspace_flag & CU_TEXSPACE_FLAG_AUTO) {
BKE_curve_texspace_calc(cu);
}
}
static int rna_Curve_texspace_editable(PointerRNA *ptr, const char **UNUSED(r_info))
static int rna_Curve_texspace_editable(PointerRNA *ptr, const char ** /*r_info*/)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
return (cu->texspace_flag & CU_TEXSPACE_FLAG_AUTO) ? 0 : PROP_EDITABLE;
}
static void rna_Curve_texspace_location_get(PointerRNA *ptr, float *values)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
BKE_curve_texspace_ensure(cu);
@@ -283,14 +286,14 @@ static void rna_Curve_texspace_location_get(PointerRNA *ptr, float *values)
static void rna_Curve_texspace_location_set(PointerRNA *ptr, const float *values)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
copy_v3_v3(cu->texspace_location, values);
}
static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
BKE_curve_texspace_ensure(cu);
@@ -299,15 +302,15 @@ static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
copy_v3_v3(cu->texspace_size, values);
}
static void rna_Curve_material_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
*min = 0;
*max = max_ii(0, cu->totcol - 1);
}
@@ -315,27 +318,27 @@ static void rna_Curve_material_index_range(
/* simply offset by don't expose -1 */
static int rna_ChariInfo_material_index_get(PointerRNA *ptr)
{
CharInfo *info = ptr->data;
CharInfo *info = static_cast<CharInfo *>(ptr->data);
return info->mat_nr ? info->mat_nr - 1 : 0;
}
static void rna_ChariInfo_material_index_set(PointerRNA *ptr, int value)
{
CharInfo *info = ptr->data;
CharInfo *info = static_cast<CharInfo *>(ptr->data);
info->mat_nr = value + 1;
}
static void rna_Curve_active_textbox_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
*min = 0;
*max = max_ii(0, cu->totbox - 1);
}
static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
if (value == CU_3D) {
cu->flag |= CU_3D;
}
@@ -345,21 +348,21 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
}
}
static const EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
bool *UNUSED(r_free))
PropertyRNA * /*prop*/,
bool * /*r_free*/)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
/* cast to quiet warning it IS a const still */
return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items :
curve2d_fill_mode_items);
return static_cast<const EnumPropertyItem *>((cu->flag & CU_3D) ? curve3d_fill_mode_items :
curve2d_fill_mode_items);
}
static int rna_Nurb_length(PointerRNA *ptr)
{
Nurb *nu = (Nurb *)ptr->data;
Nurb *nu = static_cast<Nurb *>(ptr->data);
if (nu->type == CU_BEZIER) {
return 0;
}
@@ -368,8 +371,8 @@ static int rna_Nurb_length(PointerRNA *ptr)
static void rna_Nurb_type_set(PointerRNA *ptr, int value)
{
Curve *cu = (Curve *)ptr->owner_id;
Nurb *nu = (Nurb *)ptr->data;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Nurb *nu = static_cast<Nurb *>(ptr->data);
const int pntsu_prev = nu->pntsu;
if (BKE_nurb_type_convert(nu, value, true, NULL)) {
@@ -381,16 +384,16 @@ static void rna_Nurb_type_set(PointerRNA *ptr, int value)
static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Nurb *nu = (Nurb *)ptr->data;
Nurb *nu = static_cast<Nurb *>(ptr->data);
rna_iterator_array_begin(iter,
(void *)nu->bp,
static_cast<void *>(nu->bp),
sizeof(BPoint),
nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu,
0,
NULL);
}
static void rna_Curve_update_data_id(Main *UNUSED(bmain), Scene *UNUSED(scene), ID *id)
static void rna_Curve_update_data_id(Main * /*bmain*/, Scene * /*scene*/, ID *id)
{
DEG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
@@ -409,7 +412,7 @@ static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL);
if (nu) {
@@ -421,7 +424,7 @@ static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Object *ob = cu->bevobj;
if (ob) {
@@ -433,17 +436,17 @@ static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
static void rna_Curve_bevelObject_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Curve *cu = (Curve *)ptr->owner_id;
Object *ob = (Object *)value.data;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Object *ob = static_cast<Object *>(value.data);
if (ob) {
/* If bevel object has got the save curve, as object, for which it's set as bevobj,
* there could be an infinite loop in curve evaluation. */
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
cu->bevobj = ob;
id_lib_extern((ID *)ob);
id_lib_extern(&ob->id);
}
}
else {
@@ -457,7 +460,7 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr,
*/
static void rna_Curve_bevel_resolution_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
if (cu->bevel_mode == CU_BEV_MODE_CURVE_PROFILE) {
BKE_curveprofile_init(cu->bevel_profile, cu->bevresol + 1);
@@ -468,7 +471,7 @@ static void rna_Curve_bevel_resolution_update(Main *bmain, Scene *scene, Pointer
static void rna_Curve_bevel_mode_set(PointerRNA *ptr, int value)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
if (value == CU_BEV_MODE_CURVE_PROFILE) {
if (cu->bevel_profile == NULL) {
@@ -482,8 +485,8 @@ static void rna_Curve_bevel_mode_set(PointerRNA *ptr, int value)
static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
{
Curve *cu = (Curve *)ptr->owner_id;
Object *ob = (Object *)value.data;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Object *ob = static_cast<Object *>(value.data);
if (ob) {
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
@@ -496,7 +499,7 @@ static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Object *ob = cu->taperobj;
if (ob) {
@@ -508,17 +511,17 @@ static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
static void rna_Curve_taperObject_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Curve *cu = (Curve *)ptr->owner_id;
Object *ob = (Object *)value.data;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Object *ob = static_cast<Object *>(value.data);
if (ob) {
/* If taper object has got the save curve, as object, for which it's set as bevobj,
* there could be an infinite loop in curve evaluation. */
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
cu->taperobj = ob;
id_lib_extern((ID *)ob);
id_lib_extern(&ob->id);
}
}
else {
@@ -528,7 +531,7 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr,
static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
ListBase *nurbs = BKE_curve_nurbs_get(cu);
LISTBASE_FOREACH (Nurb *, nu, nurbs) {
@@ -540,7 +543,7 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe
static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
ListBase *nurbs = BKE_curve_nurbs_get(cu);
LISTBASE_FOREACH (Nurb *, nu, nurbs) {
@@ -552,26 +555,26 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe
static float rna_Curve_offset_get(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
return cu->offset - 1.0f;
}
static void rna_Curve_offset_set(PointerRNA *ptr, float value)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
cu->offset = 1.0f + value;
}
static int rna_Curve_body_length(PointerRNA *ptr);
static void rna_Curve_body_get(PointerRNA *ptr, char *value)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
memcpy(value, cu->str, rna_Curve_body_length(ptr) + 1);
}
static int rna_Curve_body_length(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
return cu->len;
}
@@ -581,7 +584,7 @@ static void rna_Curve_body_set(PointerRNA *ptr, const char *value)
size_t len_bytes;
size_t len_chars = BLI_strlen_utf8_ex(value, &len_bytes);
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
cu->len_char32 = len_chars;
cu->len = len_bytes;
@@ -594,15 +597,16 @@ static void rna_Curve_body_set(PointerRNA *ptr, const char *value)
MEM_freeN(cu->strinfo);
}
cu->str = MEM_mallocN(len_bytes + sizeof(char32_t), "str");
cu->strinfo = MEM_callocN((len_chars + 4) * sizeof(CharInfo), "strinfo");
cu->str = static_cast<char *>(MEM_mallocN(len_bytes + sizeof(char32_t), "str"));
cu->strinfo = static_cast<CharInfo *>(
MEM_callocN((len_chars + 4) * sizeof(CharInfo), "strinfo"));
memcpy(cu->str, value, len_bytes + 1);
}
static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb *)ptr->data;
Nurb *nu = static_cast<Nurb *>(ptr->data);
if (nu->type == CU_BEZIER) {
BKE_nurb_handles_calc(nu);
@@ -616,7 +620,7 @@ static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb *)ptr->data;
Nurb *nu = static_cast<Nurb *>(ptr->data);
BKE_nurb_knot_calc_v(nu);
@@ -625,7 +629,7 @@ static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb *)ptr->data;
Nurb *nu = static_cast<Nurb *>(ptr->data);
BKE_nurb_order_clamp_u(nu);
BKE_nurb_knot_calc_u(nu);
@@ -635,7 +639,7 @@ static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb *)ptr->data;
Nurb *nu = static_cast<Nurb *>(ptr->data);
BKE_nurb_order_clamp_v(nu);
BKE_nurb_knot_calc_v(nu);
@@ -682,15 +686,15 @@ static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports
static Nurb *rna_Curve_spline_new(Curve *cu, int type)
{
Nurb *nu = (Nurb *)MEM_callocN(sizeof(Nurb), "spline.new");
Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), "spline.new"));
if (type == CU_BEZIER) {
BezTriple *bezt = (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt");
BezTriple *bezt = static_cast<BezTriple *>(MEM_callocN(sizeof(BezTriple), "spline.new.bezt"));
bezt->radius = 1.0;
nu->bezt = bezt;
}
else {
BPoint *bp = (BPoint *)MEM_callocN(sizeof(BPoint), "spline.new.bp");
BPoint *bp = static_cast<BPoint *>(MEM_callocN(sizeof(BPoint), "spline.new.bp"));
bp->radius = 1.0f;
nu->bp = bp;
}
@@ -711,7 +715,7 @@ static Nurb *rna_Curve_spline_new(Curve *cu, int type)
static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, PointerRNA *nu_ptr)
{
Nurb *nu = nu_ptr->data;
Nurb *nu = static_cast<Nurb *>(nu_ptr->data);
ListBase *nurbs = BKE_curve_nurbs_get(cu);
if (BLI_remlink_safe(nurbs, nu) == false) {
@@ -738,13 +742,13 @@ static void rna_Curve_spline_clear(Curve *cu)
static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->data;
Curve *cu = static_cast<Curve *>(ptr->data);
Nurb *nu;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
/* For curve outside editmode will set to -1,
* should be changed to be allowed outside of editmode. */
nu = BLI_findlink(nurbs, cu->actnu);
nu = static_cast<Nurb *>(BLI_findlink(nurbs, cu->actnu));
if (nu) {
return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
@@ -755,10 +759,10 @@ static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
static void rna_Curve_active_spline_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Curve *cu = (Curve *)ptr->data;
Nurb *nu = value.data;
Curve *cu = static_cast<Curve *>(ptr->data);
Nurb *nu = static_cast<Nurb *>(value.data);
ListBase *nubase = BKE_curve_nurbs_get(cu);
/* -1 is ok for an unset index */
@@ -772,9 +776,9 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr,
static char *rna_Curve_spline_path(const PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
ListBase *nubase = BKE_curve_nurbs_get(cu);
Nurb *nu = ptr->data;
Nurb *nu = static_cast<Nurb *>(ptr->data);
int index = BLI_findindex(nubase, nu);
if (index >= 0) {
@@ -788,7 +792,7 @@ static char *rna_Curve_spline_path(const PointerRNA *ptr)
/* use for both bezier and nurbs */
static char *rna_Curve_spline_point_path(const PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
Nurb *nu;
void *point = ptr->data;
int nu_index, pt_index;
@@ -810,9 +814,9 @@ static char *rna_Curve_spline_point_path(const PointerRNA *ptr)
static char *rna_TextBox_path(const PointerRNA *ptr)
{
const Curve *cu = (Curve *)ptr->owner_id;
const TextBox *tb = ptr->data;
int index = (int)(tb - cu->tb);
const Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
const TextBox *tb = static_cast<TextBox *>(ptr->data);
int index = int(tb - cu->tb);
if (index >= 0 && index < cu->totbox) {
return BLI_sprintfN("text_boxes[%d]", index);
@@ -824,13 +828,13 @@ static char *rna_TextBox_path(const PointerRNA *ptr)
static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
rna_iterator_listbase_begin(iter, BKE_curve_nurbs_get(cu), NULL);
}
static bool rna_Curve_is_editmode_get(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
const short type = BKE_curve_type_get(cu);
if (type == OB_FONT) {
return (cu->editfont != NULL);
@@ -842,7 +846,7 @@ static bool rna_Curve_is_editmode_get(PointerRNA *ptr)
static bool rna_TextCurve_has_selection_get(PointerRNA *ptr)
{
Curve *cu = (Curve *)ptr->owner_id;
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
if (cu->editfont != NULL)
return (cu->editfont->selboxes != NULL);
else
@@ -998,7 +1002,7 @@ static void rna_def_beztriple(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_Curve_spline_point_path");
}
static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna)
static void rna_def_path(BlenderRNA * /*brna*/, StructRNA *srna)
{
PropertyRNA *prop;
@@ -1057,12 +1061,12 @@ static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_nurbs(BlenderRNA *UNUSED(brna), StructRNA *UNUSED(srna))
static void rna_def_nurbs(BlenderRNA * /*brna*/, StructRNA * /*srna*/)
{
/* Nothing. */
}
static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
static void rna_def_font(BlenderRNA * /*brna*/, StructRNA *srna)
{
PropertyRNA *prop;
@@ -1454,7 +1458,7 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
# if 0
func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
@@ -1484,7 +1488,7 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
# if 0
func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
@@ -1513,7 +1517,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "new", "rna_Curve_spline_new");
RNA_def_function_ui_description(func, "Add a new spline to the curve");
parm = RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
RNA_def_function_return(func, parm);
@@ -1522,7 +1526,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
func = RNA_def_function(srna, "clear", "rna_Curve_spline_clear");
RNA_def_function_ui_description(func, "Remove all splines from a curve");

View File

@@ -77,7 +77,7 @@ void RNA_api_curve(StructRNA *srna)
func = RNA_def_function(srna, "transform", "rna_Curve_transform");
RNA_def_function_ui_description(func, "Transform curve by a matrix");
parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
RNA_def_boolean(func, "shape_keys", 0, "", "Transform Shape Keys");
func = RNA_def_function(srna, "validate_material_indices", "BKE_curve_material_index_validate");
@@ -122,7 +122,7 @@ void RNA_api_curve_nurb(StructRNA *srna)
RNA_def_function_ui_description(func, "Return the message");
parm = RNA_def_int(
func, "direction", 0, 0, 1, "Direction", "The direction where 0-1 maps to U-V", 0, 1);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return value */
parm = RNA_def_string(func,
"result",

View File

@@ -15,9 +15,6 @@
#include "DNA_curves_types.h"
#include "BLI_math_base.h"
#include "BLI_string.h"
#include "WM_types.h"
const EnumPropertyItem rna_enum_curves_types[] = {
@@ -59,7 +56,7 @@ const EnumPropertyItem rna_enum_curve_normal_modes[] = {
static Curves *rna_curves(const PointerRNA *ptr)
{
return (Curves *)ptr->owner_id;
return reinterpret_cast<Curves *>(ptr->owner_id);
}
static int rna_Curves_curve_offset_data_length(PointerRNA *ptr)
@@ -106,9 +103,9 @@ static const float (*get_curves_positions_const(const Curves *curves))[3]
static int rna_CurvePoint_index_get_const(const PointerRNA *ptr)
{
const Curves *curves = rna_curves(ptr);
const float(*co)[3] = ptr->data;
const float(*co)[3] = static_cast<float(*)[3]>(ptr->data);
const float(*positions)[3] = get_curves_positions_const(curves);
return (int)(co - positions);
return int(co - positions);
}
static void rna_Curves_curves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
@@ -176,19 +173,19 @@ static int rna_CurvePoint_index_get(PointerRNA *ptr)
static void rna_CurvePoint_location_get(PointerRNA *ptr, float value[3])
{
copy_v3_v3(value, (const float *)ptr->data);
copy_v3_v3(value, static_cast<const float *>(ptr->data));
}
static void rna_CurvePoint_location_set(PointerRNA *ptr, const float value[3])
{
copy_v3_v3((float *)ptr->data, value);
copy_v3_v3(static_cast<float *>(ptr->data), value);
}
static float rna_CurvePoint_radius_get(PointerRNA *ptr)
{
const Curves *curves = rna_curves(ptr);
const float *radii = (const float *)CustomData_get_layer_named(
&curves->geometry.point_data, CD_PROP_FLOAT, "radius");
const float *radii = static_cast<const float *>(
CustomData_get_layer_named(&curves->geometry.point_data, CD_PROP_FLOAT, "radius"));
if (radii == NULL) {
return 0.0f;
}
@@ -198,8 +195,8 @@ static float rna_CurvePoint_radius_get(PointerRNA *ptr)
static void rna_CurvePoint_radius_set(PointerRNA *ptr, float value)
{
Curves *curves = rna_curves(ptr);
float *radii = (float *)CustomData_get_layer_named_for_write(
&curves->geometry.point_data, CD_PROP_FLOAT, "radius", curves->geometry.point_num);
float *radii = static_cast<float *>(CustomData_get_layer_named_for_write(
&curves->geometry.point_data, CD_PROP_FLOAT, "radius", curves->geometry.point_num));
if (radii == NULL) {
return;
}
@@ -226,7 +223,7 @@ int rna_Curves_points_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr)
static int rna_CurveSlice_index_get_const(const PointerRNA *ptr)
{
Curves *curves = rna_curves(ptr);
return (int)((int *)ptr->data - curves->geometry.curve_offsets);
return int(static_cast<int *>(ptr->data) - curves->geometry.curve_offsets);
}
static int rna_CurveSlice_index_get(PointerRNA *ptr)
@@ -241,13 +238,13 @@ static char *rna_CurveSlice_path(const PointerRNA *ptr)
static int rna_CurveSlice_first_point_index_get(PointerRNA *ptr)
{
const int *offset_ptr = (int *)ptr->data;
const int *offset_ptr = static_cast<int *>(ptr->data);
return *offset_ptr;
}
static int rna_CurveSlice_points_length_get(PointerRNA *ptr)
{
const int *offset_ptr = (int *)ptr->data;
const int *offset_ptr = static_cast<int *>(ptr->data);
const int offset = *offset_ptr;
return *(offset_ptr + 1) - offset;
}
@@ -270,8 +267,8 @@ static void rna_Curves_normals_begin(CollectionPropertyIterator *iter, PointerRN
rna_iterator_array_begin(iter, positions, sizeof(float[3]), size, true, NULL);
}
static void rna_Curves_update_data(struct Main *UNUSED(bmain),
struct Scene *UNUSED(scene),
static void rna_Curves_update_data(struct Main * /*bmain*/,
struct Scene * /*scene*/,
PointerRNA *ptr)
{
ID *id = ptr->owner_id;
@@ -282,7 +279,7 @@ static void rna_Curves_update_data(struct Main *UNUSED(bmain),
}
}
void rna_Curves_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
void rna_Curves_update_draw(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
ID *id = ptr->owner_id;
/* Avoid updates for importers creating curves. */

View File

@@ -582,7 +582,30 @@ static EnumPropertyItem rna_node_geometry_mesh_circle_fill_type_items[] = {
# include "DNA_scene_types.h"
# include "WM_api.h"
static void rna_Node_socket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr);
extern "C" {
extern FunctionRNA rna_NodeTree_poll_func;
extern FunctionRNA rna_NodeTree_update_func;
extern FunctionRNA rna_NodeTree_get_from_context_func;
extern FunctionRNA rna_NodeTree_valid_socket_type_func;
extern FunctionRNA rna_Node_poll_func;
extern FunctionRNA rna_Node_poll_instance_func;
extern FunctionRNA rna_Node_update_func;
extern FunctionRNA rna_Node_insert_link_func;
extern FunctionRNA rna_Node_init_func;
extern FunctionRNA rna_Node_copy_func;
extern FunctionRNA rna_Node_free_func;
extern FunctionRNA rna_Node_draw_buttons_func;
extern FunctionRNA rna_Node_draw_buttons_ext_func;
extern FunctionRNA rna_Node_draw_label_func;
extern FunctionRNA rna_NodeSocket_draw_func;
extern FunctionRNA rna_NodeSocket_draw_color_func;
extern FunctionRNA rna_NodeSocketInterface_draw_func;
extern FunctionRNA rna_NodeSocketInterface_draw_color_func;
extern FunctionRNA rna_NodeSocketInterface_init_socket_func;
extern FunctionRNA rna_NodeSocketInterface_from_socket_func;
}
static void rna_Node_socket_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr);
int rna_node_tree_type_to_enum(bNodeTreeType *typeinfo)
{
@@ -826,9 +849,9 @@ const EnumPropertyItem *rna_node_socket_type_itemf(void *data,
return item;
}
static const EnumPropertyItem *rna_node_static_type_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_node_static_type_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
EnumPropertyItem *item = NULL;
@@ -952,7 +975,7 @@ static const EnumPropertyItem *rna_node_static_type_itemf(bContext *UNUSED(C),
static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->data;
bNodeTree *ntree = static_cast<bNodeTree *>(ptr->data);
if (ntree->typeinfo->rna_ext.srna) {
return ntree->typeinfo->rna_ext.srna;
@@ -964,8 +987,6 @@ static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr)
static bool rna_NodeTree_poll(const bContext *C, bNodeTreeType *ntreetype)
{
extern FunctionRNA rna_NodeTree_poll_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -977,10 +998,10 @@ static bool rna_NodeTree_poll(const bContext *C, bNodeTreeType *ntreetype)
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
ntreetype->rna_ext.call((bContext *)C, &ptr, func, &list);
ntreetype->rna_ext.call(const_cast<bContext *>(C), &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret;
visible = *static_cast<bool *>(ret);
RNA_parameter_list_free(&list);
@@ -989,8 +1010,6 @@ static bool rna_NodeTree_poll(const bContext *C, bNodeTreeType *ntreetype)
static void rna_NodeTree_update_reg(bNodeTree *ntree)
{
extern FunctionRNA rna_NodeTree_update_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -1007,8 +1026,6 @@ static void rna_NodeTree_update_reg(bNodeTree *ntree)
static void rna_NodeTree_get_from_context(
const bContext *C, bNodeTreeType *ntreetype, bNodeTree **r_ntree, ID **r_id, ID **r_from)
{
extern FunctionRNA rna_NodeTree_get_from_context_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -1020,7 +1037,7 @@ static void rna_NodeTree_get_from_context(
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
ntreetype->rna_ext.call((bContext *)C, &ptr, func, &list);
ntreetype->rna_ext.call(const_cast<bContext *>(C), &ptr, func, &list);
RNA_parameter_get_lookup(&list, "result_1", &ret1);
RNA_parameter_get_lookup(&list, "result_2", &ret2);
@@ -1034,8 +1051,6 @@ static void rna_NodeTree_get_from_context(
static bool rna_NodeTree_valid_socket_type(bNodeTreeType *ntreetype, bNodeSocketType *socket_type)
{
extern FunctionRNA rna_NodeTree_valid_socket_type_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -1050,16 +1065,16 @@ static bool rna_NodeTree_valid_socket_type(bNodeTreeType *ntreetype, bNodeSocket
ntreetype->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "valid", &ret);
valid = *(bool *)ret;
valid = *static_cast<bool *>(ret);
RNA_parameter_list_free(&list);
return valid;
}
static bool rna_NodeTree_unregister(Main *UNUSED(bmain), StructRNA *type)
static bool rna_NodeTree_unregister(Main * /*bmain*/, StructRNA *type)
{
bNodeTreeType *nt = RNA_struct_blender_type_get(type);
bNodeTreeType *nt = static_cast<bNodeTreeType *>(RNA_struct_blender_type_get(type));
if (!nt) {
return false;
@@ -1126,7 +1141,7 @@ static StructRNA *rna_NodeTree_register(Main *bmain,
}
/* create a new node tree type */
nt = MEM_mallocN(sizeof(bNodeTreeType), "node tree type");
nt = static_cast<bNodeTreeType *>(MEM_mallocN(sizeof(bNodeTreeType), "node tree type"));
memcpy(nt, &dummy_nt, sizeof(dummy_nt));
nt->type = NTREE_CUSTOM;
@@ -1170,9 +1185,9 @@ static bool rna_NodeTree_check(bNodeTree *ntree, ReportList *reports)
}
}
static void rna_NodeTree_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_NodeTree_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
WM_main_add_notifier(NC_SCENE | ND_NODES, &ntree->id);
@@ -1241,7 +1256,7 @@ static void rna_NodeTree_node_remove(bNodeTree *ntree,
ReportList *reports,
PointerRNA *node_ptr)
{
bNode *node = node_ptr->data;
bNode *node = static_cast<bNode *>(node_ptr->data);
if (!rna_NodeTree_check(ntree, reports)) {
return;
@@ -1262,7 +1277,7 @@ static void rna_NodeTree_node_remove(bNodeTree *ntree,
static void rna_NodeTree_node_clear(bNodeTree *ntree, Main *bmain, ReportList *reports)
{
bNode *node = ntree->nodes.first;
bNode *node = static_cast<bNode *>(ntree->nodes.first);
if (!rna_NodeTree_check(ntree, reports)) {
return;
@@ -1282,17 +1297,17 @@ static void rna_NodeTree_node_clear(bNodeTree *ntree, Main *bmain, ReportList *r
static PointerRNA rna_NodeTree_active_node_get(PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->data;
bNodeTree *ntree = static_cast<bNodeTree *>(ptr->data);
bNode *node = nodeGetActive(ntree);
return rna_pointer_inherit_refine(ptr, &RNA_Node, node);
}
static void rna_NodeTree_active_node_set(PointerRNA *ptr,
const PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
bNodeTree *ntree = (bNodeTree *)ptr->data;
bNode *node = (bNode *)value.data;
bNodeTree *ntree = static_cast<bNodeTree *>(ptr->data);
bNode *node = static_cast<bNode *>(value.data);
if (node && BLI_findindex(&ntree->nodes, node) != -1) {
nodeSetActive(ntree, node);
@@ -1380,7 +1395,7 @@ static void rna_NodeTree_link_remove(bNodeTree *ntree,
ReportList *reports,
PointerRNA *link_ptr)
{
bNodeLink *link = link_ptr->data;
bNodeLink *link = static_cast<bNodeLink *>(link_ptr->data);
if (!rna_NodeTree_check(ntree, reports)) {
return;
@@ -1400,7 +1415,7 @@ static void rna_NodeTree_link_remove(bNodeTree *ntree,
static void rna_NodeTree_link_clear(bNodeTree *ntree, Main *bmain, ReportList *reports)
{
bNodeLink *link = ntree->links.first;
bNodeLink *link = static_cast<bNodeLink *>(ntree->links.first);
if (!rna_NodeTree_check(ntree, reports)) {
return;
@@ -1419,7 +1434,7 @@ static void rna_NodeTree_link_clear(bNodeTree *ntree, Main *bmain, ReportList *r
static int rna_NodeTree_active_input_get(PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->data;
bNodeTree *ntree = static_cast<bNodeTree *>(ptr->data);
int index = 0;
LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &ntree->inputs, index) {
if (socket->flag & SELECT) {
@@ -1431,7 +1446,7 @@ static int rna_NodeTree_active_input_get(PointerRNA *ptr)
static void rna_NodeTree_active_input_set(PointerRNA *ptr, int value)
{
bNodeTree *ntree = (bNodeTree *)ptr->data;
bNodeTree *ntree = static_cast<bNodeTree *>(ptr->data);
int index = 0;
LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &ntree->inputs, index) {
@@ -1441,7 +1456,7 @@ static void rna_NodeTree_active_input_set(PointerRNA *ptr, int value)
static int rna_NodeTree_active_output_get(PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->data;
bNodeTree *ntree = static_cast<bNodeTree *>(ptr->data);
int index = 0;
LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &ntree->outputs, index) {
if (socket->flag & SELECT) {
@@ -1453,7 +1468,7 @@ static int rna_NodeTree_active_output_get(PointerRNA *ptr)
static void rna_NodeTree_active_output_set(PointerRNA *ptr, int value)
{
bNodeTree *ntree = (bNodeTree *)ptr->data;
bNodeTree *ntree = static_cast<bNodeTree *>(ptr->data);
int index = 0;
LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &ntree->outputs, index) {
@@ -1563,16 +1578,16 @@ static void rna_NodeTree_inputs_move(bNodeTree *ntree, Main *bmain, int from_ind
return;
}
bNodeSocket *sock = BLI_findlink(&ntree->inputs, from_index);
bNodeSocket *sock = static_cast<bNodeSocket *>(BLI_findlink(&ntree->inputs, from_index));
if (to_index < from_index) {
bNodeSocket *nextsock = BLI_findlink(&ntree->inputs, to_index);
bNodeSocket *nextsock = static_cast<bNodeSocket *>(BLI_findlink(&ntree->inputs, to_index));
if (nextsock) {
BLI_remlink(&ntree->inputs, sock);
BLI_insertlinkbefore(&ntree->inputs, nextsock, sock);
}
}
else {
bNodeSocket *prevsock = BLI_findlink(&ntree->inputs, to_index);
bNodeSocket *prevsock = static_cast<bNodeSocket *>(BLI_findlink(&ntree->inputs, to_index));
if (prevsock) {
BLI_remlink(&ntree->inputs, sock);
BLI_insertlinkafter(&ntree->inputs, prevsock, sock);
@@ -1594,16 +1609,16 @@ static void rna_NodeTree_outputs_move(bNodeTree *ntree, Main *bmain, int from_in
return;
}
bNodeSocket *sock = BLI_findlink(&ntree->outputs, from_index);
bNodeSocket *sock = static_cast<bNodeSocket *>(BLI_findlink(&ntree->outputs, from_index));
if (to_index < from_index) {
bNodeSocket *nextsock = BLI_findlink(&ntree->outputs, to_index);
bNodeSocket *nextsock = static_cast<bNodeSocket *>(BLI_findlink(&ntree->outputs, to_index));
if (nextsock) {
BLI_remlink(&ntree->outputs, sock);
BLI_insertlinkbefore(&ntree->outputs, nextsock, sock);
}
}
else {
bNodeSocket *prevsock = BLI_findlink(&ntree->outputs, to_index);
bNodeSocket *prevsock = static_cast<bNodeSocket *>(BLI_findlink(&ntree->outputs, to_index));
if (prevsock) {
BLI_remlink(&ntree->outputs, sock);
BLI_insertlinkafter(&ntree->outputs, prevsock, sock);
@@ -1628,7 +1643,7 @@ static void rna_NodeTree_interface_update(bNodeTree *ntree, bContext *C)
static bool rna_NodeLink_is_hidden_get(PointerRNA *ptr)
{
bNodeLink *link = ptr->data;
bNodeLink *link = static_cast<bNodeLink *>(ptr->data);
return nodeLinkIsHidden(link);
}
@@ -1636,7 +1651,7 @@ static bool rna_NodeLink_is_hidden_get(PointerRNA *ptr)
static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
if (node->typeinfo->rna_ext.srna) {
return node->typeinfo->rna_ext.srna;
@@ -1648,7 +1663,7 @@ static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
static char *rna_Node_path(const PointerRNA *ptr)
{
const bNode *node = (bNode *)ptr->data;
const bNode *node = static_cast<bNode *>(ptr->data);
char name_esc[sizeof(node->name) * 2];
BLI_str_escape(name_esc, node->name, sizeof(name_esc));
@@ -1657,22 +1672,22 @@ static char *rna_Node_path(const PointerRNA *ptr)
char *rna_Node_ImageUser_path(const PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
if (!ELEM(ntree->type, NTREE_SHADER, NTREE_CUSTOM)) {
return NULL;
}
for (bNode *node = ntree->nodes.first; node; node = node->next) {
for (bNode *node = static_cast<bNode *>(ntree->nodes.first); node; node = node->next) {
switch (node->type) {
case SH_NODE_TEX_ENVIRONMENT: {
NodeTexEnvironment *data = node->storage;
NodeTexEnvironment *data = static_cast<NodeTexEnvironment *>(node->storage);
if (&data->iuser != ptr->data) {
continue;
}
break;
}
case SH_NODE_TEX_IMAGE: {
NodeTexImage *data = node->storage;
NodeTexImage *data = static_cast<NodeTexImage *>(node->storage);
if (&data->iuser != ptr->data) {
continue;
}
@@ -1692,10 +1707,8 @@ char *rna_Node_ImageUser_path(const PointerRNA *ptr)
static bool rna_Node_poll(const bNodeType *ntype,
const bNodeTree *ntree,
const char **UNUSED(r_disabled_hint))
const char ** /*r_disabled_hint*/)
{
extern FunctionRNA rna_Node_poll_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -1710,7 +1723,7 @@ static bool rna_Node_poll(const bNodeType *ntype,
ntype->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret;
visible = *static_cast<bool *>(ret);
RNA_parameter_list_free(&list);
@@ -1719,17 +1732,16 @@ static bool rna_Node_poll(const bNodeType *ntype,
static bool rna_Node_poll_instance(const bNode *node,
const bNodeTree *ntree,
const char **UNUSED(disabled_info))
const char ** /*disabled_info*/)
{
extern FunctionRNA rna_Node_poll_instance_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
void *ret;
bool visible;
RNA_pointer_create(NULL, node->typeinfo->rna_ext.srna, (bNode *)node, &ptr); /* dummy */
RNA_pointer_create(
NULL, node->typeinfo->rna_ext.srna, const_cast<bNode *>(node), &ptr); /* dummy */
func = &rna_Node_poll_instance_func; /* RNA_struct_find_function(&ptr, "poll_instance"); */
RNA_parameter_list_create(&list, &ptr, func);
@@ -1737,7 +1749,7 @@ static bool rna_Node_poll_instance(const bNode *node,
node->typeinfo->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret;
visible = *static_cast<bool *>(ret);
RNA_parameter_list_free(&list);
@@ -1754,13 +1766,11 @@ static bool rna_Node_poll_instance_default(const bNode *node,
static void rna_Node_update_reg(bNodeTree *ntree, bNode *node)
{
extern FunctionRNA rna_Node_update_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create((ID *)ntree, node->typeinfo->rna_ext.srna, node, &ptr);
RNA_pointer_create(reinterpret_cast<ID *>(ntree), node->typeinfo->rna_ext.srna, node, &ptr);
func = &rna_Node_update_func; /* RNA_struct_find_function(&ptr, "update"); */
RNA_parameter_list_create(&list, &ptr, func);
@@ -1771,13 +1781,11 @@ static void rna_Node_update_reg(bNodeTree *ntree, bNode *node)
static bool rna_Node_insert_link(bNodeTree *ntree, bNode *node, bNodeLink *link)
{
extern FunctionRNA rna_Node_insert_link_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create((ID *)ntree, node->typeinfo->rna_ext.srna, node, &ptr);
RNA_pointer_create(reinterpret_cast<ID *>(ntree), node->typeinfo->rna_ext.srna, node, &ptr);
func = &rna_Node_insert_link_func;
RNA_parameter_list_create(&list, &ptr, func);
@@ -1790,25 +1798,21 @@ static bool rna_Node_insert_link(bNodeTree *ntree, bNode *node, bNodeLink *link)
static void rna_Node_init(const bContext *C, PointerRNA *ptr)
{
extern FunctionRNA rna_Node_init_func;
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
ParameterList list;
FunctionRNA *func;
func = &rna_Node_init_func; /* RNA_struct_find_function(&ptr, "init"); */
RNA_parameter_list_create(&list, ptr, func);
node->typeinfo->rna_ext.call((bContext *)C, ptr, func, &list);
node->typeinfo->rna_ext.call(const_cast<bContext *>(C), ptr, func, &list);
RNA_parameter_list_free(&list);
}
static void rna_Node_copy(PointerRNA *ptr, const struct bNode *copynode)
{
extern FunctionRNA rna_Node_copy_func;
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
ParameterList list;
FunctionRNA *func;
@@ -1823,9 +1827,7 @@ static void rna_Node_copy(PointerRNA *ptr, const struct bNode *copynode)
static void rna_Node_free(PointerRNA *ptr)
{
extern FunctionRNA rna_Node_free_func;
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
ParameterList list;
FunctionRNA *func;
@@ -1839,9 +1841,7 @@ static void rna_Node_free(PointerRNA *ptr)
static void rna_Node_draw_buttons(struct uiLayout *layout, bContext *C, PointerRNA *ptr)
{
extern FunctionRNA rna_Node_draw_buttons_func;
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
ParameterList list;
FunctionRNA *func;
@@ -1857,9 +1857,7 @@ static void rna_Node_draw_buttons(struct uiLayout *layout, bContext *C, PointerR
static void rna_Node_draw_buttons_ext(struct uiLayout *layout, bContext *C, PointerRNA *ptr)
{
extern FunctionRNA rna_Node_draw_buttons_ext_func;
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
ParameterList list;
FunctionRNA *func;
@@ -1878,8 +1876,6 @@ static void rna_Node_draw_label(const bNodeTree *ntree,
char *label,
int label_maxncpy)
{
extern FunctionRNA rna_Node_draw_label_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@@ -1888,12 +1884,12 @@ static void rna_Node_draw_label(const bNodeTree *ntree,
func = &rna_Node_draw_label_func; /* RNA_struct_find_function(&ptr, "draw_label"); */
RNA_pointer_create((ID *)&ntree->id, &RNA_Node, (bNode *)node, &ptr);
RNA_pointer_create(const_cast<ID *>(&ntree->id), &RNA_Node, const_cast<bNode *>(node), &ptr);
RNA_parameter_list_create(&list, &ptr, func);
node->typeinfo->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "label", &ret);
rlabel = (char *)ret;
rlabel = static_cast<char *>(ret);
BLI_strncpy(label, rlabel != NULL ? rlabel : "", label_maxncpy);
RNA_parameter_list_free(&list);
@@ -1904,8 +1900,8 @@ static bool rna_Node_is_registered_node_type(StructRNA *type)
return (RNA_struct_blender_type_get(type) != NULL);
}
static void rna_Node_is_registered_node_type_runtime(bContext *UNUSED(C),
ReportList *UNUSED(reports),
static void rna_Node_is_registered_node_type_runtime(bContext * /*C*/,
ReportList * /*reports*/,
PointerRNA *ptr,
ParameterList *parms)
{
@@ -1913,9 +1909,9 @@ static void rna_Node_is_registered_node_type_runtime(bContext *UNUSED(C),
RNA_parameter_set_lookup(parms, "result", &result);
}
static bool rna_Node_unregister(Main *UNUSED(bmain), StructRNA *type)
static bool rna_Node_unregister(Main * /*bmain*/, StructRNA *type)
{
bNodeType *nt = RNA_struct_blender_type_get(type);
bNodeType *nt = static_cast<bNodeType *>(RNA_struct_blender_type_get(type));
if (!nt) {
return false;
@@ -1992,9 +1988,9 @@ static bNodeType *rna_Node_register_base(Main *bmain,
}
/* create a new node type */
nt = MEM_mallocN(sizeof(bNodeType), "node type");
nt = static_cast<bNodeType *>(MEM_mallocN(sizeof(bNodeType), "node type"));
memcpy(nt, &dummy_nt, sizeof(dummy_nt));
nt->free_self = (void (*)(bNodeType *))MEM_freeN;
nt->free_self = reinterpret_cast<void (*)(bNodeType *)>(MEM_freeN);
nt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, basetype);
nt->rna_ext.data = data;
@@ -2095,9 +2091,9 @@ static bool switch_type_supported(const EnumPropertyItem *item)
SOCK_IMAGE);
}
static const EnumPropertyItem *rna_GeometryNodeSwitch_type_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
static const EnumPropertyItem *rna_GeometryNodeSwitch_type_itemf(bContext * /*C*/,
PointerRNA * /*ptr*/,
PropertyRNA * /*prop*/,
bool *r_free)
{
*r_free = true;
@@ -2128,28 +2124,28 @@ static bool compare_string_operation_supported(const EnumPropertyItem *item)
return ELEM(item->value, NODE_COMPARE_EQUAL, NODE_COMPARE_NOT_EQUAL);
}
static bool compare_other_operation_supported(const EnumPropertyItem *UNUSED(item))
static bool compare_other_operation_supported(const EnumPropertyItem * /*item*/)
{
return false;
}
static const EnumPropertyItem *rna_FunctionNodeCompare_type_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
static const EnumPropertyItem *rna_FunctionNodeCompare_type_itemf(bContext * /*C*/,
PointerRNA * /*ptr*/,
PropertyRNA * /*prop*/,
bool *r_free)
{
*r_free = true;
return itemf_function_check(node_socket_data_type_items, compare_type_supported);
}
static const EnumPropertyItem *rna_FunctionNodeCompare_operation_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_FunctionNodeCompare_operation_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
*r_free = true;
bNode *node = ptr->data;
NodeFunctionCompare *data = (NodeFunctionCompare *)node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeFunctionCompare *data = static_cast<NodeFunctionCompare *>(node->storage);
if (ELEM(data->data_type, SOCK_FLOAT, SOCK_INT, SOCK_VECTOR)) {
return itemf_function_check(rna_enum_node_compare_operation_items,
@@ -2173,9 +2169,9 @@ static bool random_value_type_supported(const EnumPropertyItem *item)
{
return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3, CD_PROP_BOOL, CD_PROP_INT32);
}
static const EnumPropertyItem *rna_FunctionNodeRandomValue_type_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
static const EnumPropertyItem *rna_FunctionNodeRandomValue_type_itemf(bContext * /*C*/,
PointerRNA * /*ptr*/,
PropertyRNA * /*prop*/,
bool *r_free)
{
*r_free = true;
@@ -2187,9 +2183,9 @@ static bool accumulate_field_type_supported(const EnumPropertyItem *item)
return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3, CD_PROP_INT32);
}
static const EnumPropertyItem *rna_GeoNodeAccumulateField_type_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
static const EnumPropertyItem *rna_GeoNodeAccumulateField_type_itemf(bContext * /*C*/,
PointerRNA * /*ptr*/,
PropertyRNA * /*prop*/,
bool *r_free)
{
*r_free = true;
@@ -2198,8 +2194,8 @@ static const EnumPropertyItem *rna_GeoNodeAccumulateField_type_itemf(bContext *U
static void rna_GeometryNodeCompare_data_type_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNode *node = ptr->data;
NodeFunctionCompare *node_storage = (NodeFunctionCompare *)node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeFunctionCompare *node_storage = static_cast<NodeFunctionCompare *>(node->storage);
if (node_storage->data_type == SOCK_RGBA && !ELEM(node_storage->operation,
NODE_COMPARE_EQUAL,
@@ -2234,9 +2230,9 @@ static bool generic_attribute_type_supported(const EnumPropertyItem *item)
CD_PROP_INT32,
CD_PROP_BYTE_COLOR);
}
static const EnumPropertyItem *rna_GeometryNodeAttributeType_type_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
static const EnumPropertyItem *rna_GeometryNodeAttributeType_type_itemf(bContext * /*C*/,
PointerRNA * /*ptr*/,
PropertyRNA * /*prop*/,
bool *r_free)
{
*r_free = true;
@@ -2249,7 +2245,7 @@ static bool generic_attribute_type_supported_with_socket(const EnumPropertyItem
!ELEM(item->value, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2);
}
static const EnumPropertyItem *rna_GeometryNodeAttributeType_type_with_socket_itemf(
bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
bContext * /*C*/, PointerRNA * /*ptr*/, PropertyRNA * /*prop*/, bool *r_free)
{
*r_free = true;
return itemf_function_check(rna_enum_attribute_type_items,
@@ -2262,7 +2258,7 @@ static bool rna_GeometryNodeBlurAttribute_data_type_supported(const EnumProperty
}
static const EnumPropertyItem *rna_GeometryNodeBlurAttribute_data_type_itemf(
bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
bContext * /*C*/, PointerRNA * /*ptr*/, PropertyRNA * /*prop*/, bool *r_free)
{
*r_free = true;
return itemf_function_check(rna_enum_attribute_type_items,
@@ -2274,7 +2270,7 @@ static bool attribute_statistic_type_supported(const EnumPropertyItem *item)
return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3);
}
static const EnumPropertyItem *rna_GeometryNodeAttributeStatistic_type_itemf(
bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
bContext * /*C*/, PointerRNA * /*ptr*/, PropertyRNA * /*prop*/, bool *r_free)
{
*r_free = true;
return itemf_function_check(rna_enum_attribute_type_items, attribute_statistic_type_supported);
@@ -2392,17 +2388,15 @@ static StructRNA *rna_FunctionNode_register(Main *bmain,
static IDProperty **rna_Node_idprops(PointerRNA *ptr)
{
bNode *node = ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
return &node->prop;
}
static void rna_Node_parent_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
static void rna_Node_parent_set(PointerRNA *ptr, PointerRNA value, struct ReportList * /*reports*/)
{
bNode *node = ptr->data;
bNode *parent = value.data;
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = static_cast<bNode *>(ptr->data);
bNode *parent = static_cast<bNode *>(value.data);
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
if (!parent) {
nodeDetachNode(ntree, node);
@@ -2426,7 +2420,7 @@ static void rna_Node_parent_set(PointerRNA *ptr,
static void rna_Node_internal_links_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
bNode *node = ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
bNodeLink *begin;
int len;
nodeInternalLinks(node, &begin, &len);
@@ -2435,8 +2429,8 @@ static void rna_Node_internal_links_begin(CollectionPropertyIterator *iter, Poin
static bool rna_Node_parent_poll(PointerRNA *ptr, PointerRNA value)
{
bNode *node = ptr->data;
bNode *parent = value.data;
bNode *node = static_cast<bNode *>(ptr->data);
bNode *parent = static_cast<bNode *>(value.data);
/* XXX only Frame node allowed for now,
* in the future should have a poll function or so to test possible attachment.
@@ -2452,10 +2446,10 @@ static bool rna_Node_parent_poll(PointerRNA *ptr, PointerRNA value)
return true;
}
static void rna_Node_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_Node_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = (bNode *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
}
@@ -2466,22 +2460,22 @@ static void rna_Node_update_relations(Main *bmain, Scene *scene, PointerRNA *ptr
DEG_relations_tag_update(bmain);
}
static void rna_Node_socket_value_update(ID *id, bNode *UNUSED(node), bContext *C)
static void rna_Node_socket_value_update(ID *id, bNode * /*node*/, bContext *C)
{
BKE_ntree_update_tag_all((bNodeTree *)id);
ED_node_tree_propagate_change(C, CTX_data_main(C), (bNodeTree *)id);
BKE_ntree_update_tag_all(reinterpret_cast<bNodeTree *>(id));
ED_node_tree_propagate_change(C, CTX_data_main(C), reinterpret_cast<bNodeTree *>(id));
}
static void rna_Node_select_set(PointerRNA *ptr, bool value)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
nodeSetSelected(node, value);
}
static void rna_Node_name_set(PointerRNA *ptr, const char *value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = (bNode *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
char oldname[sizeof(node->name)];
/* make a copy of the old name first */
@@ -2513,7 +2507,7 @@ static bNodeSocket *rna_Node_inputs_new(ID *id,
return NULL;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_IN, type, identifier, name);
if (sock == NULL) {
@@ -2540,7 +2534,7 @@ static bNodeSocket *rna_Node_outputs_new(ID *id,
return NULL;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_OUT, type, identifier, name);
if (sock == NULL) {
@@ -2562,7 +2556,7 @@ static void rna_Node_socket_remove(
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
if (BLI_findindex(&node->inputs, sock) == -1 && BLI_findindex(&node->outputs, sock) == -1) {
BKE_reportf(reports, RPT_ERROR, "Unable to locate socket '%s' in node", sock->identifier);
@@ -2582,10 +2576,10 @@ static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain, ReportList *
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
bNodeSocket *sock, *nextsock;
for (sock = node->inputs.first; sock; sock = nextsock) {
for (sock = static_cast<bNodeSocket *>(node->inputs.first); sock; sock = nextsock) {
nextsock = sock->next;
nodeRemoveSocket(ntree, node, sock);
}
@@ -2601,10 +2595,10 @@ static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain, ReportList
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
bNodeSocket *sock, *nextsock;
for (sock = node->outputs.first; sock; sock = nextsock) {
for (sock = static_cast<bNodeSocket *>(node->outputs.first); sock; sock = nextsock) {
nextsock = sock->next;
nodeRemoveSocket(ntree, node, sock);
}
@@ -2621,7 +2615,7 @@ static void rna_Node_inputs_move(
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
bNodeSocket *sock;
if (from_index == to_index) {
@@ -2631,16 +2625,16 @@ static void rna_Node_inputs_move(
return;
}
sock = BLI_findlink(&node->inputs, from_index);
sock = static_cast<bNodeSocket *>(BLI_findlink(&node->inputs, from_index));
if (to_index < from_index) {
bNodeSocket *nextsock = BLI_findlink(&node->inputs, to_index);
bNodeSocket *nextsock = static_cast<bNodeSocket *>(BLI_findlink(&node->inputs, to_index));
if (nextsock) {
BLI_remlink(&node->inputs, sock);
BLI_insertlinkbefore(&node->inputs, nextsock, sock);
}
}
else {
bNodeSocket *prevsock = BLI_findlink(&node->inputs, to_index);
bNodeSocket *prevsock = static_cast<bNodeSocket *>(BLI_findlink(&node->inputs, to_index));
if (prevsock) {
BLI_remlink(&node->inputs, sock);
BLI_insertlinkafter(&node->inputs, prevsock, sock);
@@ -2659,7 +2653,7 @@ static void rna_Node_outputs_move(
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
bNodeSocket *sock;
if (from_index == to_index) {
@@ -2669,16 +2663,16 @@ static void rna_Node_outputs_move(
return;
}
sock = BLI_findlink(&node->outputs, from_index);
sock = static_cast<bNodeSocket *>(BLI_findlink(&node->outputs, from_index));
if (to_index < from_index) {
bNodeSocket *nextsock = BLI_findlink(&node->outputs, to_index);
bNodeSocket *nextsock = static_cast<bNodeSocket *>(BLI_findlink(&node->outputs, to_index));
if (nextsock) {
BLI_remlink(&node->outputs, sock);
BLI_insertlinkbefore(&node->outputs, nextsock, sock);
}
}
else {
bNodeSocket *prevsock = BLI_findlink(&node->outputs, to_index);
bNodeSocket *prevsock = static_cast<bNodeSocket *>(BLI_findlink(&node->outputs, to_index));
if (prevsock) {
BLI_remlink(&node->outputs, sock);
BLI_insertlinkafter(&node->outputs, prevsock, sock);
@@ -2692,7 +2686,7 @@ static void rna_Node_outputs_move(
static void rna_Node_width_range(
PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
bNode *node = ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
*min = *softmin = node->typeinfo->minwidth;
*max = *softmax = node->typeinfo->maxwidth;
}
@@ -2700,14 +2694,14 @@ static void rna_Node_width_range(
static void rna_Node_height_range(
PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
bNode *node = ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
*min = *softmin = node->typeinfo->minheight;
*max = *softmax = node->typeinfo->maxheight;
}
static void rna_Node_dimensions_get(PointerRNA *ptr, float *value)
{
bNode *node = ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
nodeDimensionsGet(node, &value[0], &value[1]);
}
@@ -2716,9 +2710,7 @@ static void rna_Node_dimensions_get(PointerRNA *ptr, float *value)
static void rna_NodeSocket_draw(
bContext *C, struct uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr, const char *text)
{
extern FunctionRNA rna_NodeSocket_draw_func;
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
ParameterList list;
FunctionRNA *func;
@@ -2739,9 +2731,7 @@ static void rna_NodeSocket_draw_color(bContext *C,
PointerRNA *node_ptr,
float *r_color)
{
extern FunctionRNA rna_NodeSocket_draw_color_func;
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
ParameterList list;
FunctionRNA *func;
void *ret;
@@ -2754,14 +2744,14 @@ static void rna_NodeSocket_draw_color(bContext *C,
sock->typeinfo->ext_socket.call(C, ptr, func, &list);
RNA_parameter_get_lookup(&list, "color", &ret);
copy_v4_v4(r_color, (float *)ret);
copy_v4_v4(r_color, static_cast<float *>(ret));
RNA_parameter_list_free(&list);
}
static bool rna_NodeSocket_unregister(Main *UNUSED(bmain), StructRNA *type)
static bool rna_NodeSocket_unregister(Main * /*bmain*/, StructRNA *type)
{
bNodeSocketType *st = RNA_struct_blender_type_get(type);
bNodeSocketType *st = static_cast<bNodeSocketType *>(RNA_struct_blender_type_get(type));
if (!st) {
return false;
}
@@ -2776,7 +2766,7 @@ static bool rna_NodeSocket_unregister(Main *UNUSED(bmain), StructRNA *type)
return true;
}
static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain),
static StructRNA *rna_NodeSocket_register(Main * /*bmain*/,
ReportList *reports,
void *data,
const char *identifier,
@@ -2815,7 +2805,7 @@ static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain),
st = nodeSocketTypeFind(dummy_st.idname);
if (!st) {
/* create a new node socket type */
st = MEM_mallocN(sizeof(bNodeSocketType), "node socket type");
st = static_cast<bNodeSocketType *>(MEM_mallocN(sizeof(bNodeSocketType), "node socket type"));
memcpy(st, &dummy_st, sizeof(dummy_st));
nodeRegisterSocketType(st);
@@ -2849,7 +2839,7 @@ static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain),
static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
{
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
if (sock->typeinfo->ext_socket.srna) {
return sock->typeinfo->ext_socket.srna;
@@ -2861,8 +2851,8 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
static char *rna_NodeSocket_path(const PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
bNode *node;
int socketindex;
char name_esc[sizeof(node->name) * 2];
@@ -2881,36 +2871,36 @@ static char *rna_NodeSocket_path(const PointerRNA *ptr)
static IDProperty **rna_NodeSocket_idprops(PointerRNA *ptr)
{
bNodeSocket *sock = ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
return &sock->prop;
}
static PointerRNA rna_NodeSocket_node_get(PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
bNode *node;
PointerRNA r_ptr;
nodeFindNode(ntree, sock, &node, NULL);
RNA_pointer_create((ID *)ntree, &RNA_Node, node, &r_ptr);
RNA_pointer_create(&ntree->id, &RNA_Node, node, &r_ptr);
return r_ptr;
}
static void rna_NodeSocket_type_set(PointerRNA *ptr, int value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
bNode *node;
nodeFindNode(ntree, sock, &node, NULL);
nodeModifySocketTypeStatic(ntree, node, sock, value, 0);
}
static void rna_NodeSocket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_NodeSocket_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
BKE_ntree_update_tag_socket_property(ntree, sock);
ED_node_tree_propagate_change(NULL, bmain, ntree);
@@ -2918,19 +2908,19 @@ static void rna_NodeSocket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA
static bool rna_NodeSocket_is_output_get(PointerRNA *ptr)
{
bNodeSocket *sock = ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
return sock->in_out == SOCK_OUT;
}
static void rna_NodeSocket_link_limit_set(PointerRNA *ptr, int value)
{
bNodeSocket *sock = ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
sock->limit = (value == 0 ? 0xFFF : value);
}
static void rna_NodeSocket_hide_set(PointerRNA *ptr, bool value)
{
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
/* don't hide linked sockets */
if (sock->flag & SOCK_IS_LINKED) {
@@ -2947,9 +2937,7 @@ static void rna_NodeSocket_hide_set(PointerRNA *ptr, bool value)
static void rna_NodeSocketInterface_draw(bContext *C, struct uiLayout *layout, PointerRNA *ptr)
{
extern FunctionRNA rna_NodeSocketInterface_draw_func;
bNodeSocket *stemp = (bNodeSocket *)ptr->data;
bNodeSocket *stemp = static_cast<bNodeSocket *>(ptr->data);
ParameterList list;
FunctionRNA *func;
@@ -2969,9 +2957,7 @@ static void rna_NodeSocketInterface_draw(bContext *C, struct uiLayout *layout, P
static void rna_NodeSocketInterface_draw_color(bContext *C, PointerRNA *ptr, float *r_color)
{
extern FunctionRNA rna_NodeSocketInterface_draw_color_func;
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
ParameterList list;
FunctionRNA *func;
void *ret;
@@ -2988,7 +2974,7 @@ static void rna_NodeSocketInterface_draw_color(bContext *C, PointerRNA *ptr, flo
sock->typeinfo->ext_interface.call(C, ptr, func, &list);
RNA_parameter_get_lookup(&list, "color", &ret);
copy_v4_v4(r_color, (float *)ret);
copy_v4_v4(r_color, static_cast<float *>(ret));
RNA_parameter_list_free(&list);
}
@@ -2999,8 +2985,6 @@ static void rna_NodeSocketInterface_init_socket(bNodeTree *ntree,
bNodeSocket *sock,
const char *data_path)
{
extern FunctionRNA rna_NodeSocketInterface_init_socket_func;
PointerRNA ptr, node_ptr, sock_ptr;
ParameterList list;
FunctionRNA *func;
@@ -3009,9 +2993,10 @@ static void rna_NodeSocketInterface_init_socket(bNodeTree *ntree,
return;
}
RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, (bNodeSocket *)interface_socket, &ptr);
RNA_pointer_create((ID *)ntree, &RNA_Node, node, &node_ptr);
RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &sock_ptr);
RNA_pointer_create(
&ntree->id, &RNA_NodeSocketInterface, const_cast<bNodeSocket *>(interface_socket), &ptr);
RNA_pointer_create(&ntree->id, &RNA_Node, node, &node_ptr);
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &sock_ptr);
// RNA_struct_find_function(&ptr, "init_socket");
func = &rna_NodeSocketInterface_init_socket_func;
@@ -3029,8 +3014,6 @@ static void rna_NodeSocketInterface_from_socket(bNodeTree *ntree,
const bNode *node,
const bNodeSocket *sock)
{
extern FunctionRNA rna_NodeSocketInterface_from_socket_func;
PointerRNA ptr, node_ptr, sock_ptr;
ParameterList list;
FunctionRNA *func;
@@ -3039,9 +3022,9 @@ static void rna_NodeSocketInterface_from_socket(bNodeTree *ntree,
return;
}
RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, interface_socket, &ptr);
RNA_pointer_create((ID *)ntree, &RNA_Node, (bNode *)node, &node_ptr);
RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, (bNodeSocket *)sock, &sock_ptr);
RNA_pointer_create(&ntree->id, &RNA_NodeSocketInterface, interface_socket, &ptr);
RNA_pointer_create(&ntree->id, &RNA_Node, const_cast<bNode *>(node), &node_ptr);
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, const_cast<bNodeSocket *>(sock), &sock_ptr);
// RNA_struct_find_function(&ptr, "from_socket");
func = &rna_NodeSocketInterface_from_socket_func;
@@ -3053,9 +3036,9 @@ static void rna_NodeSocketInterface_from_socket(bNodeTree *ntree,
RNA_parameter_list_free(&list);
}
static bool rna_NodeSocketInterface_unregister(Main *UNUSED(bmain), StructRNA *type)
static bool rna_NodeSocketInterface_unregister(Main * /*bmain*/, StructRNA *type)
{
bNodeSocketType *st = RNA_struct_blender_type_get(type);
bNodeSocketType *st = static_cast<bNodeSocketType *>(RNA_struct_blender_type_get(type));
if (!st) {
return false;
}
@@ -3069,8 +3052,8 @@ static bool rna_NodeSocketInterface_unregister(Main *UNUSED(bmain), StructRNA *t
return true;
}
static StructRNA *rna_NodeSocketInterface_register(Main *UNUSED(bmain),
ReportList *UNUSED(reports),
static StructRNA *rna_NodeSocketInterface_register(Main * /*bmain*/,
ReportList * /*reports*/,
void *data,
const char *identifier,
StructValidateFunc validate,
@@ -3101,7 +3084,7 @@ static StructRNA *rna_NodeSocketInterface_register(Main *UNUSED(bmain),
}
else {
/* create a new node socket type */
st = MEM_mallocN(sizeof(bNodeSocketType), "node socket type");
st = static_cast<bNodeSocketType *>(MEM_mallocN(sizeof(bNodeSocketType), "node socket type"));
memcpy(st, &dummy_st, sizeof(dummy_st));
nodeRegisterSocketType(st);
@@ -3134,7 +3117,7 @@ static StructRNA *rna_NodeSocketInterface_register(Main *UNUSED(bmain),
static StructRNA *rna_NodeSocketInterface_refine(PointerRNA *ptr)
{
bNodeSocket *sock = (bNodeSocket *)ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
if (sock->typeinfo && sock->typeinfo->ext_interface.srna) {
return sock->typeinfo->ext_interface.srna;
@@ -3146,8 +3129,8 @@ static StructRNA *rna_NodeSocketInterface_refine(PointerRNA *ptr)
static char *rna_NodeSocketInterface_path(const PointerRNA *ptr)
{
const bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
const bNodeSocket *sock = (bNodeSocket *)ptr->data;
const bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
const bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
int socketindex;
socketindex = BLI_findindex(&ntree->inputs, sock);
@@ -3165,14 +3148,14 @@ static char *rna_NodeSocketInterface_path(const PointerRNA *ptr)
static IDProperty **rna_NodeSocketInterface_idprops(PointerRNA *ptr)
{
bNodeSocket *sock = ptr->data;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
return &sock->prop;
}
static void rna_NodeSocketInterface_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_NodeSocketInterface_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeSocket *stemp = ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNodeSocket *stemp = static_cast<bNodeSocket *>(ptr->data);
if (!stemp->typeinfo) {
return;
@@ -3227,8 +3210,8 @@ static void rna_NodeSocketInterfaceStandard_draw_color(ID *id,
static void rna_NodeSocketStandard_float_range(
PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
bNodeSocket *sock = ptr->data;
bNodeSocketValueFloat *dval = sock->default_value;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
bNodeSocketValueFloat *dval = static_cast<bNodeSocketValueFloat *>(sock->default_value);
int subtype = sock->typeinfo->subtype;
if (dval->max < dval->min) {
@@ -3244,8 +3227,8 @@ static void rna_NodeSocketStandard_float_range(
static void rna_NodeSocketStandard_int_range(
PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
bNodeSocket *sock = ptr->data;
bNodeSocketValueInt *dval = sock->default_value;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
bNodeSocketValueInt *dval = static_cast<bNodeSocketValueInt *>(sock->default_value);
int subtype = sock->typeinfo->subtype;
if (dval->max < dval->min) {
@@ -3261,8 +3244,8 @@ static void rna_NodeSocketStandard_int_range(
static void rna_NodeSocketStandard_vector_range(
PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
bNodeSocket *sock = ptr->data;
bNodeSocketValueVector *dval = sock->default_value;
bNodeSocket *sock = static_cast<bNodeSocket *>(ptr->data);
bNodeSocketValueVector *dval = static_cast<bNodeSocketValueVector *>(sock->default_value);
if (dval->max < dval->min) {
dval->max = dval->min;
@@ -3292,37 +3275,37 @@ static void rna_NodeSocketStandard_value_and_relation_update(struct bContext *C,
static void rna_NodeInternalSocketTemplate_name_get(PointerRNA *ptr, char *value)
{
bNodeSocketTemplate *stemp = ptr->data;
bNodeSocketTemplate *stemp = static_cast<bNodeSocketTemplate *>(ptr->data);
strcpy(value, stemp->name);
}
static int rna_NodeInternalSocketTemplate_name_length(PointerRNA *ptr)
{
bNodeSocketTemplate *stemp = ptr->data;
bNodeSocketTemplate *stemp = static_cast<bNodeSocketTemplate *>(ptr->data);
return strlen(stemp->name);
}
static void rna_NodeInternalSocketTemplate_identifier_get(PointerRNA *ptr, char *value)
{
bNodeSocketTemplate *stemp = ptr->data;
bNodeSocketTemplate *stemp = static_cast<bNodeSocketTemplate *>(ptr->data);
strcpy(value, stemp->identifier);
}
static int rna_NodeInternalSocketTemplate_identifier_length(PointerRNA *ptr)
{
bNodeSocketTemplate *stemp = ptr->data;
bNodeSocketTemplate *stemp = static_cast<bNodeSocketTemplate *>(ptr->data);
return strlen(stemp->identifier);
}
static int rna_NodeInternalSocketTemplate_type_get(PointerRNA *ptr)
{
bNodeSocketTemplate *stemp = ptr->data;
bNodeSocketTemplate *stemp = static_cast<bNodeSocketTemplate *>(ptr->data);
return stemp->type;
}
static PointerRNA rna_NodeInternal_input_template(StructRNA *srna, int index)
{
bNodeType *ntype = RNA_struct_blender_type_get(srna);
bNodeType *ntype = static_cast<bNodeType *>(RNA_struct_blender_type_get(srna));
if (ntype && ntype->inputs) {
bNodeSocketTemplate *stemp = ntype->inputs;
int i = 0;
@@ -3341,7 +3324,7 @@ static PointerRNA rna_NodeInternal_input_template(StructRNA *srna, int index)
static PointerRNA rna_NodeInternal_output_template(StructRNA *srna, int index)
{
bNodeType *ntype = RNA_struct_blender_type_get(srna);
bNodeType *ntype = static_cast<bNodeType *>(RNA_struct_blender_type_get(srna));
if (ntype && ntype->outputs) {
bNodeSocketTemplate *stemp = ntype->outputs;
int i = 0;
@@ -3360,7 +3343,7 @@ static PointerRNA rna_NodeInternal_output_template(StructRNA *srna, int index)
static bool rna_NodeInternal_poll(StructRNA *srna, bNodeTree *ntree)
{
bNodeType *ntype = RNA_struct_blender_type_get(srna);
bNodeType *ntype = static_cast<bNodeType *>(RNA_struct_blender_type_get(srna));
const char *disabled_hint;
return ntype && (!ntype->poll || ntype->poll(ntype, ntree, &disabled_hint));
}
@@ -3380,7 +3363,7 @@ static bool rna_NodeInternal_poll_instance(bNode *node, bNodeTree *ntree)
static void rna_NodeInternal_update(ID *id, bNode *node, Main *bmain)
{
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
}
@@ -3520,20 +3503,20 @@ static void rna_CompositorNode_tag_need_exec(bNode *node)
ntreeCompositTagNeedExec(node);
}
static void rna_Node_tex_image_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_Node_tex_image_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = (bNode *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
WM_main_add_notifier(NC_IMAGE, NULL);
}
static void rna_NodeGroup_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_NodeGroup_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = (bNode *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
@@ -3542,11 +3525,11 @@ static void rna_NodeGroup_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
static void rna_NodeGroup_node_tree_set(PointerRNA *ptr,
const PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = ptr->data;
bNodeTree *ngroup = value.data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
bNodeTree *ngroup = static_cast<bNodeTree *>(value.data);
const char *disabled_hint = NULL;
if (nodeGroupPoll(ntree, ngroup, &disabled_hint)) {
@@ -3563,8 +3546,8 @@ static void rna_NodeGroup_node_tree_set(PointerRNA *ptr,
static bool rna_NodeGroup_node_tree_poll(PointerRNA *ptr, const PointerRNA value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNodeTree *ngroup = value.data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNodeTree *ngroup = static_cast<bNodeTree *>(value.data);
/* only allow node trees of the same type as the group node's tree */
if (ngroup->type != ntree->type) {
@@ -3577,32 +3560,32 @@ static bool rna_NodeGroup_node_tree_poll(PointerRNA *ptr, const PointerRNA value
static void rna_distance_matte_t1_set(PointerRNA *ptr, float value)
{
bNode *node = (bNode *)ptr->data;
NodeChroma *chroma = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeChroma *chroma = static_cast<NodeChroma *>(node->storage);
chroma->t1 = value;
}
static void rna_distance_matte_t2_set(PointerRNA *ptr, float value)
{
bNode *node = (bNode *)ptr->data;
NodeChroma *chroma = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeChroma *chroma = static_cast<NodeChroma *>(node->storage);
chroma->t2 = value;
}
static void rna_difference_matte_t1_set(PointerRNA *ptr, float value)
{
bNode *node = (bNode *)ptr->data;
NodeChroma *chroma = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeChroma *chroma = static_cast<NodeChroma *>(node->storage);
chroma->t1 = value;
}
static void rna_difference_matte_t2_set(PointerRNA *ptr, float value)
{
bNode *node = (bNode *)ptr->data;
NodeChroma *chroma = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeChroma *chroma = static_cast<NodeChroma *>(node->storage);
chroma->t2 = value;
}
@@ -3610,8 +3593,8 @@ static void rna_difference_matte_t2_set(PointerRNA *ptr, float value)
/* Button Set Functions for Matte Nodes */
static void rna_Matte_t1_set(PointerRNA *ptr, float value)
{
bNode *node = (bNode *)ptr->data;
NodeChroma *chroma = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeChroma *chroma = static_cast<NodeChroma *>(node->storage);
chroma->t1 = value;
@@ -3622,8 +3605,8 @@ static void rna_Matte_t1_set(PointerRNA *ptr, float value)
static void rna_Matte_t2_set(PointerRNA *ptr, float value)
{
bNode *node = (bNode *)ptr->data;
NodeChroma *chroma = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeChroma *chroma = static_cast<NodeChroma *>(node->storage);
if (value > chroma->t1) {
value = chroma->t1;
@@ -3632,27 +3615,25 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value)
chroma->t2 = value;
}
static void rna_Node_scene_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value, struct ReportList * /*reports*/)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
if (node->id) {
id_us_min(node->id);
node->id = NULL;
}
node->id = value.data;
node->id = static_cast<ID *>(value.data);
id_us_plus(node->id);
}
static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
Image *ima = (Image *)node->id;
ImageUser *iuser = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
Image *ima = reinterpret_cast<Image *>(node->id);
ImageUser *iuser = static_cast<ImageUser *>(node->storage);
if (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 != CMP_CRYPTOMATTE_SRC_IMAGE) {
return;
@@ -3694,13 +3675,13 @@ static const EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
return item;
}
static const EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_Node_image_layer_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
bNode *node = (bNode *)ptr->data;
Image *ima = (Image *)node->id;
bNode *node = static_cast<bNode *>(ptr->data);
Image *ima = reinterpret_cast<Image *>(node->id);
const EnumPropertyItem *item = NULL;
RenderLayer *rl;
@@ -3713,7 +3694,7 @@ static const EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C),
return DummyRNA_NULL_items;
}
rl = ima->rr->layers.first;
rl = static_cast<RenderLayer *>(ima->rr->layers.first);
item = renderresult_layers_add_enum(rl);
*r_free = true;
@@ -3723,8 +3704,8 @@ static const EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C),
static bool rna_Node_image_has_layers_get(PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
Image *ima = (Image *)node->id;
bNode *node = static_cast<bNode *>(ptr->data);
Image *ima = reinterpret_cast<Image *>(node->id);
if (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 != CMP_CRYPTOMATTE_SRC_IMAGE) {
return false;
@@ -3739,8 +3720,8 @@ static bool rna_Node_image_has_layers_get(PointerRNA *ptr)
static bool rna_Node_image_has_views_get(PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
Image *ima = (Image *)node->id;
bNode *node = static_cast<bNode *>(ptr->data);
Image *ima = reinterpret_cast<Image *>(node->id);
if (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 != CMP_CRYPTOMATTE_SRC_IMAGE) {
return false;
@@ -3782,13 +3763,13 @@ static const EnumPropertyItem *renderresult_views_add_enum(RenderView *rv)
return item;
}
static const EnumPropertyItem *rna_Node_image_view_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_Node_image_view_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
bNode *node = (bNode *)ptr->data;
Image *ima = (Image *)node->id;
bNode *node = static_cast<bNode *>(ptr->data);
Image *ima = reinterpret_cast<Image *>(node->id);
const EnumPropertyItem *item = NULL;
RenderView *rv;
@@ -3801,7 +3782,7 @@ static const EnumPropertyItem *rna_Node_image_view_itemf(bContext *UNUSED(C),
return DummyRNA_NULL_items;
}
rv = ima->rr->views.first;
rv = static_cast<RenderView *>(ima->rr->views.first);
item = renderresult_views_add_enum(rv);
*r_free = true;
@@ -3809,13 +3790,13 @@ static const EnumPropertyItem *rna_Node_image_view_itemf(bContext *UNUSED(C),
return item;
}
static const EnumPropertyItem *rna_Node_view_layer_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_Node_view_layer_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
bNode *node = (bNode *)ptr->data;
Scene *sce = (Scene *)node->id;
bNode *node = static_cast<bNode *>(ptr->data);
Scene *sce = reinterpret_cast<Scene *>(node->id);
const EnumPropertyItem *item = NULL;
RenderLayer *rl;
@@ -3824,7 +3805,7 @@ static const EnumPropertyItem *rna_Node_view_layer_itemf(bContext *UNUSED(C),
return DummyRNA_NULL_items;
}
rl = sce->view_layers.first;
rl = static_cast<RenderLayer *>(sce->view_layers.first);
item = renderresult_layers_add_enum(rl);
*r_free = true;
@@ -3840,12 +3821,12 @@ static void rna_Node_view_layer_update(Main *bmain, Scene *scene, PointerRNA *pt
}
}
static const EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_Node_channel_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0};
int totitem = 0;
@@ -3919,7 +3900,7 @@ static const EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C),
static void rna_Image_Node_update_id(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
nodeTagUpdateID(node);
rna_Node_update(bmain, scene, ptr);
@@ -3927,35 +3908,37 @@ static void rna_Image_Node_update_id(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_NodeOutputFile_slots_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
bNode *node = ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
rna_iterator_listbase_begin(iter, &node->inputs, NULL);
}
static PointerRNA rna_NodeOutputFile_slot_file_get(CollectionPropertyIterator *iter)
{
PointerRNA ptr;
bNodeSocket *sock = rna_iterator_listbase_get(iter);
bNodeSocket *sock = static_cast<bNodeSocket *>(rna_iterator_listbase_get(iter));
RNA_pointer_create(iter->parent.owner_id, &RNA_NodeOutputFileSlotFile, sock->storage, &ptr);
return ptr;
}
static void rna_NodeColorBalance_update_lgg(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ntreeCompositColorBalanceSyncFromLGG((bNodeTree *)ptr->owner_id, ptr->data);
ntreeCompositColorBalanceSyncFromLGG(reinterpret_cast<bNodeTree *>(ptr->owner_id),
static_cast<bNode *>(ptr->data));
rna_Node_update(bmain, scene, ptr);
}
static void rna_NodeColorBalance_update_cdl(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ntreeCompositColorBalanceSyncFromCDL((bNodeTree *)ptr->owner_id, ptr->data);
ntreeCompositColorBalanceSyncFromCDL(reinterpret_cast<bNodeTree *>(ptr->owner_id),
static_cast<bNode *>(ptr->data));
rna_Node_update(bmain, scene, ptr);
}
static void rna_NodeCryptomatte_source_set(PointerRNA *ptr, int value)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
if (node->id && node->custom1 != value) {
id_us_min((ID *)node->id);
id_us_min(node->id);
node->id = NULL;
}
node->custom1 = value;
@@ -3964,8 +3947,8 @@ static void rna_NodeCryptomatte_source_set(PointerRNA *ptr, int value)
static int rna_NodeCryptomatte_layer_name_get(PointerRNA *ptr)
{
int index = 0;
bNode *node = (bNode *)ptr->data;
NodeCryptomatte *storage = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeCryptomatte *storage = static_cast<NodeCryptomatte *>(node->storage);
LISTBASE_FOREACH_INDEX (CryptomatteLayer *, layer, &storage->runtime.layers, index) {
if (STREQLEN(storage->layer_name, layer->name, sizeof(storage->layer_name))) {
return index;
@@ -3976,10 +3959,11 @@ static int rna_NodeCryptomatte_layer_name_get(PointerRNA *ptr)
static void rna_NodeCryptomatte_layer_name_set(PointerRNA *ptr, int new_value)
{
bNode *node = (bNode *)ptr->data;
NodeCryptomatte *storage = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeCryptomatte *storage = static_cast<NodeCryptomatte *>(node->storage);
CryptomatteLayer *layer = BLI_findlink(&storage->runtime.layers, new_value);
CryptomatteLayer *layer = static_cast<CryptomatteLayer *>(
BLI_findlink(&storage->runtime.layers, new_value));
if (layer) {
STRNCPY(storage->layer_name, layer->name);
}
@@ -3987,22 +3971,22 @@ static void rna_NodeCryptomatte_layer_name_set(PointerRNA *ptr, int new_value)
static const EnumPropertyItem *rna_NodeCryptomatte_layer_name_itemf(bContext *C,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
bNode *node = (bNode *)ptr->data;
NodeCryptomatte *storage = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeCryptomatte *storage = static_cast<NodeCryptomatte *>(node->storage);
EnumPropertyItem *item = NULL;
EnumPropertyItem template = {0, "", 0, "", ""};
EnumPropertyItem temp = {0, "", 0, "", ""};
int totitem = 0;
ntreeCompositCryptomatteUpdateLayerNames(CTX_data_scene(C), node);
int layer_index;
LISTBASE_FOREACH_INDEX (CryptomatteLayer *, layer, &storage->runtime.layers, layer_index) {
template.value = layer_index;
template.identifier = layer->name;
template.name = layer->name;
RNA_enum_item_add(&item, &totitem, &template);
temp.value = layer_index;
temp.identifier = layer->name;
temp.name = layer->name;
RNA_enum_item_add(&item, &totitem, &temp);
}
RNA_enum_item_end(&item, &totitem);
@@ -4013,9 +3997,11 @@ static const EnumPropertyItem *rna_NodeCryptomatte_layer_name_itemf(bContext *C,
static PointerRNA rna_NodeCryptomatte_scene_get(PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
Scene *scene = (node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER) ? (Scene *)node->id : NULL;
Scene *scene = (node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER) ?
reinterpret_cast<Scene *>(node->id) :
NULL;
return rna_pointer_inherit_refine(ptr, &RNA_Scene, scene);
}
@@ -4023,7 +4009,7 @@ static void rna_NodeCryptomatte_scene_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *reports)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
if (node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER) {
rna_Node_scene_set(ptr, value, reports);
@@ -4032,38 +4018,40 @@ static void rna_NodeCryptomatte_scene_set(PointerRNA *ptr,
static PointerRNA rna_NodeCryptomatte_image_get(PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
Image *image = (node->custom1 == CMP_CRYPTOMATTE_SRC_IMAGE) ? (Image *)node->id : NULL;
Image *image = (node->custom1 == CMP_CRYPTOMATTE_SRC_IMAGE) ?
reinterpret_cast<Image *>(node->id) :
NULL;
return rna_pointer_inherit_refine(ptr, &RNA_Image, image);
}
static void rna_NodeCryptomatte_image_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
bNode *node = (bNode *)ptr->data;
bNode *node = static_cast<bNode *>(ptr->data);
if (node->custom1 == CMP_CRYPTOMATTE_SRC_IMAGE) {
if (node->id)
id_us_min((ID *)node->id);
id_us_min(node->id);
if (value.data)
id_us_plus((ID *)value.data);
id_us_plus(static_cast<ID *>(value.data));
node->id = value.data;
node->id = static_cast<ID *>(value.data);
}
}
static bool rna_NodeCryptomatte_image_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
static bool rna_NodeCryptomatte_image_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
Image *image = (Image *)value.owner_id;
Image *image = reinterpret_cast<Image *>(value.owner_id);
return image->type == IMA_TYPE_MULTILAYER;
}
static void rna_NodeCryptomatte_matte_get(PointerRNA *ptr, char *value)
{
bNode *node = (bNode *)ptr->data;
NodeCryptomatte *nc = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeCryptomatte *nc = static_cast<NodeCryptomatte *>(node->storage);
char *matte_id = BKE_cryptomatte_entries_to_matte_id(nc);
strcpy(value, matte_id);
MEM_freeN(matte_id);
@@ -4071,8 +4059,8 @@ static void rna_NodeCryptomatte_matte_get(PointerRNA *ptr, char *value)
static int rna_NodeCryptomatte_matte_length(PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
NodeCryptomatte *nc = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeCryptomatte *nc = static_cast<NodeCryptomatte *>(node->storage);
char *matte_id = BKE_cryptomatte_entries_to_matte_id(nc);
int result = strlen(matte_id);
MEM_freeN(matte_id);
@@ -4081,27 +4069,27 @@ static int rna_NodeCryptomatte_matte_length(PointerRNA *ptr)
static void rna_NodeCryptomatte_matte_set(PointerRNA *ptr, const char *value)
{
bNode *node = (bNode *)ptr->data;
NodeCryptomatte *nc = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeCryptomatte *nc = static_cast<NodeCryptomatte *>(node->storage);
BKE_cryptomatte_matte_id_to_entries(nc, value);
}
static void rna_NodeCryptomatte_update_add(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ntreeCompositCryptomatteSyncFromAdd(scene, ptr->data);
ntreeCompositCryptomatteSyncFromAdd(scene, static_cast<bNode *>(ptr->data));
rna_Node_update(bmain, scene, ptr);
}
static void rna_NodeCryptomatte_update_remove(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ntreeCompositCryptomatteSyncFromRemove(ptr->data);
ntreeCompositCryptomatteSyncFromRemove(static_cast<bNode *>(ptr->data));
rna_Node_update(bmain, scene, ptr);
}
static void rna_SimulationStateItem_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_SimulationStateItem_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
NodeSimulationItem *item = (NodeSimulationItem *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
NodeSimulationItem *item = static_cast<NodeSimulationItem *>(ptr->data);
bNode *node = NOD_geometry_simulation_output_find_node_by_item(ntree, item);
BKE_ntree_update_tag_node_property(ntree, node);
@@ -4114,9 +4102,9 @@ static bool rna_SimulationStateItem_socket_type_supported(const EnumPropertyItem
(eNodeSocketDatatype)item->value);
}
static const EnumPropertyItem *rna_SimulationStateItem_socket_type_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
static const EnumPropertyItem *rna_SimulationStateItem_socket_type_itemf(bContext * /*C*/,
PointerRNA * /*ptr*/,
PropertyRNA * /*prop*/,
bool *r_free)
{
*r_free = true;
@@ -4126,10 +4114,10 @@ static const EnumPropertyItem *rna_SimulationStateItem_socket_type_itemf(bContex
static void rna_SimulationStateItem_name_set(PointerRNA *ptr, const char *value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
NodeSimulationItem *item = (NodeSimulationItem *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
NodeSimulationItem *item = static_cast<NodeSimulationItem *>(ptr->data);
bNode *node = NOD_geometry_simulation_output_find_node_by_item(ntree, item);
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
NodeGeometrySimulationOutput *sim = static_cast<NodeGeometrySimulationOutput *>(node->storage);
const char *defname = nodeStaticSocketLabel(item->socket_type, 0);
NOD_geometry_simulation_output_item_set_unique_name(sim, item, value, defname);
@@ -4137,7 +4125,7 @@ static void rna_SimulationStateItem_name_set(PointerRNA *ptr, const char *value)
static void rna_SimulationStateItem_color_get(PointerRNA *ptr, float *values)
{
NodeSimulationItem *item = (NodeSimulationItem *)ptr->data;
NodeSimulationItem *item = static_cast<NodeSimulationItem *>(ptr->data);
const char *socket_type_idname = nodeStaticSocketType(item->socket_type, 0);
ED_node_type_draw_color(socket_type_idname, values);
@@ -4145,8 +4133,8 @@ static void rna_SimulationStateItem_color_get(PointerRNA *ptr, float *values)
static PointerRNA rna_NodeGeometrySimulationInput_paired_output_get(PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = (bNode *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
bNode *output_node = NOD_geometry_simulation_input_get_paired_output(ntree, node);
PointerRNA r_ptr;
RNA_pointer_create(&ntree->id, &RNA_Node, output_node, &r_ptr);
@@ -4156,7 +4144,7 @@ static PointerRNA rna_NodeGeometrySimulationInput_paired_output_get(PointerRNA *
static bool rna_GeometryNodeSimulationInput_pair_with_output(
ID *id, bNode *node, bContext *C, ReportList *reports, bNode *output_node)
{
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
if (!NOD_geometry_simulation_input_pair_with_output(ntree, node, output_node)) {
BKE_reportf(reports,
@@ -4177,7 +4165,7 @@ static bool rna_GeometryNodeSimulationInput_pair_with_output(
static NodeSimulationItem *rna_NodeGeometrySimulationOutput_items_new(
ID *id, bNode *node, Main *bmain, ReportList *reports, int socket_type, const char *name)
{
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
NodeGeometrySimulationOutput *sim = static_cast<NodeGeometrySimulationOutput *>(node->storage);
NodeSimulationItem *item = NOD_geometry_simulation_output_add_item(
sim, (short)socket_type, name);
@@ -4185,7 +4173,7 @@ static NodeSimulationItem *rna_NodeGeometrySimulationOutput_items_new(
BKE_report(reports, RPT_ERROR, "Unable to create socket");
}
else {
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
@@ -4197,14 +4185,14 @@ static NodeSimulationItem *rna_NodeGeometrySimulationOutput_items_new(
static void rna_NodeGeometrySimulationOutput_items_remove(
ID *id, bNode *node, Main *bmain, ReportList *reports, NodeSimulationItem *item)
{
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
NodeGeometrySimulationOutput *sim = static_cast<NodeGeometrySimulationOutput *>(node->storage);
if (!NOD_geometry_simulation_output_contains_item(sim, item)) {
BKE_reportf(reports, RPT_ERROR, "Unable to locate item '%s' in node", item->name);
}
else {
NOD_geometry_simulation_output_remove_item(sim, item);
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
@@ -4213,10 +4201,10 @@ static void rna_NodeGeometrySimulationOutput_items_remove(
static void rna_NodeGeometrySimulationOutput_items_clear(ID *id, bNode *node, Main *bmain)
{
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
NodeGeometrySimulationOutput *sim = static_cast<NodeGeometrySimulationOutput *>(node->storage);
NOD_geometry_simulation_output_clear_items(sim);
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
@@ -4225,7 +4213,7 @@ static void rna_NodeGeometrySimulationOutput_items_clear(ID *id, bNode *node, Ma
static void rna_NodeGeometrySimulationOutput_items_move(
ID *id, bNode *node, Main *bmain, int from_index, int to_index)
{
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
NodeGeometrySimulationOutput *sim = static_cast<NodeGeometrySimulationOutput *>(node->storage);
if (from_index < 0 || from_index >= sim->items_num || to_index < 0 || to_index >= sim->items_num)
{
@@ -4234,7 +4222,7 @@ static void rna_NodeGeometrySimulationOutput_items_move(
NOD_geometry_simulation_output_move_item(sim, from_index, to_index);
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
BKE_ntree_update_tag_node_property(ntree, node);
ED_node_tree_propagate_change(NULL, bmain, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
@@ -4242,8 +4230,8 @@ static void rna_NodeGeometrySimulationOutput_items_move(
static PointerRNA rna_NodeGeometrySimulationOutput_active_item_get(PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeGeometrySimulationOutput *sim = static_cast<NodeGeometrySimulationOutput *>(node->storage);
NodeSimulationItem *item = NOD_geometry_simulation_output_get_active_item(sim);
PointerRNA r_ptr;
RNA_pointer_create(ptr->owner_id, &RNA_SimulationStateItem, item, &r_ptr);
@@ -4252,11 +4240,12 @@ static PointerRNA rna_NodeGeometrySimulationOutput_active_item_get(PointerRNA *p
static void rna_NodeGeometrySimulationOutput_active_item_set(PointerRNA *ptr,
PointerRNA value,
ReportList *UNUSED(reports))
ReportList * /*reports*/)
{
bNode *node = (bNode *)ptr->data;
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
NOD_geometry_simulation_output_set_active_item(sim, (NodeSimulationItem *)value.data);
bNode *node = static_cast<bNode *>(ptr->data);
NodeGeometrySimulationOutput *sim = static_cast<NodeGeometrySimulationOutput *>(node->storage);
NOD_geometry_simulation_output_set_active_item(sim,
static_cast<NodeSimulationItem *>(value.data));
}
/* ******** Node Socket Types ******** */
@@ -4264,7 +4253,7 @@ static void rna_NodeGeometrySimulationOutput_active_item_set(PointerRNA *ptr,
static PointerRNA rna_NodeOutputFile_slot_layer_get(CollectionPropertyIterator *iter)
{
PointerRNA ptr;
bNodeSocket *sock = rna_iterator_listbase_get(iter);
bNodeSocket *sock = static_cast<bNodeSocket *>(rna_iterator_listbase_get(iter));
RNA_pointer_create(iter->parent.owner_id, &RNA_NodeOutputFileSlotLayer, sock->storage, &ptr);
return ptr;
}
@@ -4277,9 +4266,9 @@ static int rna_NodeOutputFileSocket_find_node(bNodeTree *ntree,
bNode *node;
bNodeSocket *sock;
for (node = ntree->nodes.first; node; node = node->next) {
for (sock = node->inputs.first; sock; sock = sock->next) {
NodeImageMultiFileSocket *sockdata = sock->storage;
for (node = static_cast<bNode *>(ntree->nodes.first); node; node = node->next) {
for (sock = static_cast<bNodeSocket *>(node->inputs.first); sock; sock = sock->next) {
NodeImageMultiFileSocket *sockdata = static_cast<NodeImageMultiFileSocket *>(sock->storage);
if (sockdata == data) {
*nodep = node;
*sockp = sock;
@@ -4295,8 +4284,8 @@ static int rna_NodeOutputFileSocket_find_node(bNodeTree *ntree,
static void rna_NodeOutputFileSlotFile_path_set(PointerRNA *ptr, const char *value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
NodeImageMultiFileSocket *sockdata = ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
NodeImageMultiFileSocket *sockdata = static_cast<NodeImageMultiFileSocket *>(ptr->data);
bNode *node;
bNodeSocket *sock;
@@ -4307,8 +4296,8 @@ static void rna_NodeOutputFileSlotFile_path_set(PointerRNA *ptr, const char *val
static void rna_NodeOutputFileSlotLayer_name_set(PointerRNA *ptr, const char *value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
NodeImageMultiFileSocket *sockdata = ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
NodeImageMultiFileSocket *sockdata = static_cast<NodeImageMultiFileSocket *>(ptr->data);
bNode *node;
bNodeSocket *sock;
@@ -4318,9 +4307,9 @@ static void rna_NodeOutputFileSlotLayer_name_set(PointerRNA *ptr, const char *va
}
static bNodeSocket *rna_NodeOutputFile_slots_new(
ID *id, bNode *node, bContext *C, ReportList *UNUSED(reports), const char *name)
ID *id, bNode *node, bContext *C, ReportList * /*reports*/, const char *name)
{
bNodeTree *ntree = (bNodeTree *)id;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
Scene *scene = CTX_data_scene(C);
ImageFormatData *im_format = NULL;
bNodeSocket *sock;
@@ -4344,8 +4333,8 @@ static void rna_FrameNode_label_size_update(Main *bmain, Scene *scene, PointerRN
static void rna_ShaderNodeTexIES_mode_set(PointerRNA *ptr, int value)
{
bNode *node = (bNode *)ptr->data;
NodeShaderTexIES *nss = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeShaderTexIES *nss = static_cast<NodeShaderTexIES *>(node->storage);
if (nss->mode != value) {
nss->mode = value;
@@ -4353,7 +4342,7 @@ static void rna_ShaderNodeTexIES_mode_set(PointerRNA *ptr, int value)
/* replace text datablock by filepath */
if (node->id) {
Text *text = (Text *)node->id;
Text *text = reinterpret_cast<Text *>(node->id);
if (value == NODE_IES_EXTERNAL && text->filepath) {
STRNCPY(nss->filepath, text->filepath);
@@ -4368,8 +4357,8 @@ static void rna_ShaderNodeTexIES_mode_set(PointerRNA *ptr, int value)
static void rna_ShaderNodeScript_mode_set(PointerRNA *ptr, int value)
{
bNode *node = (bNode *)ptr->data;
NodeShaderScript *nss = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeShaderScript *nss = static_cast<NodeShaderScript *>(node->storage);
if (nss->mode != value) {
nss->mode = value;
@@ -4378,7 +4367,7 @@ static void rna_ShaderNodeScript_mode_set(PointerRNA *ptr, int value)
/* replace text data-block by filepath */
if (node->id) {
Text *text = (Text *)node->id;
Text *text = reinterpret_cast<Text *>(node->id);
if (value == NODE_SCRIPT_EXTERNAL && text->filepath) {
STRNCPY(nss->filepath, text->filepath);
@@ -4401,24 +4390,24 @@ static void rna_ShaderNodeScript_mode_set(PointerRNA *ptr, int value)
static void rna_ShaderNodeScript_bytecode_get(PointerRNA *ptr, char *value)
{
bNode *node = (bNode *)ptr->data;
NodeShaderScript *nss = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeShaderScript *nss = static_cast<NodeShaderScript *>(node->storage);
strcpy(value, (nss->bytecode) ? nss->bytecode : "");
}
static int rna_ShaderNodeScript_bytecode_length(PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
NodeShaderScript *nss = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeShaderScript *nss = static_cast<NodeShaderScript *>(node->storage);
return (nss->bytecode) ? strlen(nss->bytecode) : 0;
}
static void rna_ShaderNodeScript_bytecode_set(PointerRNA *ptr, const char *value)
{
bNode *node = (bNode *)ptr->data;
NodeShaderScript *nss = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeShaderScript *nss = static_cast<NodeShaderScript *>(node->storage);
if (nss->bytecode) {
MEM_freeN(nss->bytecode);
@@ -4434,8 +4423,8 @@ static void rna_ShaderNodeScript_bytecode_set(PointerRNA *ptr, const char *value
static void rna_ShaderNodeScript_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = (bNode *)ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
RenderEngineType *engine_type = (scene != NULL) ? RE_engines_find(scene->r.engine) : NULL;
if (engine_type && engine_type->update_script_node) {
@@ -4471,8 +4460,8 @@ static void rna_CompositorNodeScale_update(Main *bmain, Scene *scene, PointerRNA
static void rna_ShaderNode_is_active_output_set(PointerRNA *ptr, bool value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
if (value) {
/* If this node becomes the active output, the others of the same type can't be the active
* output anymore. */
@@ -4490,8 +4479,8 @@ static void rna_ShaderNode_is_active_output_set(PointerRNA *ptr, bool value)
static void rna_GroupOutput_is_active_output_set(PointerRNA *ptr, bool value)
{
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
bNode *node = ptr->data;
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
bNode *node = static_cast<bNode *>(ptr->data);
if (value) {
/* Make sure that no other group output is active at the same time. */
LISTBASE_FOREACH (bNode *, other_node, &ntree->nodes) {
@@ -4508,14 +4497,16 @@ static void rna_GroupOutput_is_active_output_set(PointerRNA *ptr, bool value)
static PointerRNA rna_ShaderNodePointDensity_psys_get(PointerRNA *ptr)
{
bNode *node = ptr->data;
NodeShaderTexPointDensity *shader_point_density = node->storage;
Object *ob = (Object *)node->id;
bNode *node = static_cast<bNode *>(ptr->data);
NodeShaderTexPointDensity *shader_point_density = static_cast<NodeShaderTexPointDensity *>(
node->storage);
Object *ob = reinterpret_cast<Object *>(node->id);
ParticleSystem *psys = NULL;
PointerRNA value;
if (ob && shader_point_density->particle_system) {
psys = BLI_findlink(&ob->particlesystem, shader_point_density->particle_system - 1);
psys = static_cast<ParticleSystem *>(
BLI_findlink(&ob->particlesystem, shader_point_density->particle_system - 1));
}
RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &value);
@@ -4524,11 +4515,12 @@ static PointerRNA rna_ShaderNodePointDensity_psys_get(PointerRNA *ptr)
static void rna_ShaderNodePointDensity_psys_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
bNode *node = ptr->data;
NodeShaderTexPointDensity *shader_point_density = node->storage;
Object *ob = (Object *)node->id;
bNode *node = static_cast<bNode *>(ptr->data);
NodeShaderTexPointDensity *shader_point_density = static_cast<NodeShaderTexPointDensity *>(
node->storage);
Object *ob = reinterpret_cast<Object *>(node->id);
if (ob && value.owner_id == &ob->id) {
shader_point_density->particle_system = BLI_findindex(&ob->particlesystem, value.data) + 1;
@@ -4572,7 +4564,8 @@ static int point_density_vertex_color_source_from_shader(
void rna_ShaderNodePointDensity_density_cache(bNode *self, Depsgraph *depsgraph)
{
NodeShaderTexPointDensity *shader_point_density = self->storage;
NodeShaderTexPointDensity *shader_point_density = static_cast<NodeShaderTexPointDensity *>(
self->storage);
PointDensity *pd = &shader_point_density->pd;
if (depsgraph == NULL) {
@@ -4585,7 +4578,7 @@ void rna_ShaderNodePointDensity_density_cache(bNode *self, Depsgraph *depsgraph)
/* Create PointDensity structure from node for sampling. */
BKE_texture_pointdensity_init_data(pd);
pd->object = (Object *)self->id;
pd->object = reinterpret_cast<Object *>(self->id);
pd->radius = shader_point_density->radius;
if (shader_point_density->point_source == SHD_POINTDENSITY_SOURCE_PSYS) {
pd->source = TEX_PD_PSYS;
@@ -4613,7 +4606,8 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self,
int *length,
float **values)
{
NodeShaderTexPointDensity *shader_point_density = self->storage;
NodeShaderTexPointDensity *shader_point_density = static_cast<NodeShaderTexPointDensity *>(
self->storage);
PointDensity *pd = &shader_point_density->pd;
const int resolution = shader_point_density->cached_resolution;
@@ -4626,7 +4620,8 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self,
*length = 4 * resolution * resolution * resolution;
if (*values == NULL) {
*values = MEM_mallocN(sizeof(float) * (*length), "point density dynamic array");
*values = static_cast<float *>(
MEM_mallocN(sizeof(float) * (*length), "point density dynamic array"));
}
/* Single-threaded sampling of the voxel domain. */
@@ -4643,7 +4638,8 @@ void rna_ShaderNodePointDensity_density_minmax(bNode *self,
float r_min[3],
float r_max[3])
{
NodeShaderTexPointDensity *shader_point_density = self->storage;
NodeShaderTexPointDensity *shader_point_density = static_cast<NodeShaderTexPointDensity *>(
self->storage);
PointDensity *pd = &shader_point_density->pd;
if (depsgraph == NULL) {
@@ -4655,24 +4651,24 @@ void rna_ShaderNodePointDensity_density_minmax(bNode *self,
RE_point_density_minmax(depsgraph, pd, r_min, r_max);
}
bool rna_NodeSocketMaterial_default_value_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_NodeSocketMaterial_default_value_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
/* Do not show grease pencil materials for now. */
Material *ma = (Material *)value.data;
Material *ma = static_cast<Material *>(value.data);
return ma->gp_style == NULL;
}
static int rna_NodeConvertColorSpace_from_color_space_get(struct PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
NodeConvertColorSpace *node_storage = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeConvertColorSpace *node_storage = static_cast<NodeConvertColorSpace *>(node->storage);
return IMB_colormanagement_colorspace_get_named_index(node_storage->from_color_space);
}
static void rna_NodeConvertColorSpace_from_color_space_set(struct PointerRNA *ptr, int value)
{
bNode *node = (bNode *)ptr->data;
NodeConvertColorSpace *node_storage = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeConvertColorSpace *node_storage = static_cast<NodeConvertColorSpace *>(node->storage);
const char *name = IMB_colormanagement_colorspace_get_indexed_name(value);
if (name && name[0]) {
@@ -4681,15 +4677,15 @@ static void rna_NodeConvertColorSpace_from_color_space_set(struct PointerRNA *pt
}
static int rna_NodeConvertColorSpace_to_color_space_get(struct PointerRNA *ptr)
{
bNode *node = (bNode *)ptr->data;
NodeConvertColorSpace *node_storage = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeConvertColorSpace *node_storage = static_cast<NodeConvertColorSpace *>(node->storage);
return IMB_colormanagement_colorspace_get_named_index(node_storage->to_color_space);
}
static void rna_NodeConvertColorSpace_to_color_space_set(struct PointerRNA *ptr, int value)
{
bNode *node = (bNode *)ptr->data;
NodeConvertColorSpace *node_storage = node->storage;
bNode *node = static_cast<bNode *>(ptr->data);
NodeConvertColorSpace *node_storage = static_cast<NodeConvertColorSpace *>(node->storage);
const char *name = IMB_colormanagement_colorspace_get_indexed_name(value);
if (name && name[0]) {
@@ -4697,8 +4693,10 @@ static void rna_NodeConvertColorSpace_to_color_space_set(struct PointerRNA *ptr,
}
}
static const EnumPropertyItem *rna_NodeConvertColorSpace_color_space_itemf(
bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
static const EnumPropertyItem *rna_NodeConvertColorSpace_color_space_itemf(bContext * /*C*/,
PointerRNA * /*ptr*/,
PropertyRNA * /*prop*/,
bool *r_free)
{
EnumPropertyItem *items = NULL;
int totitem = 0;
@@ -4891,7 +4889,7 @@ static const EnumPropertyItem prop_image_extension[] = {
/* -- Common nodes ---------------------------------------------------------- */
static void def_group_input(StructRNA *UNUSED(srna)) {}
static void def_group_input(StructRNA * /*srna*/) {}
static void def_group_output(StructRNA *srna)
{
@@ -6220,7 +6218,7 @@ static void def_sh_tex_pointdensity(StructRNA *srna)
RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "");
/* TODO: See how array size of 0 works, this shouldn't be used. */
parm = RNA_def_float_array(func, "rgba_values", 1, NULL, 0, 0, "", "RGBA Values", 0, 0);
RNA_def_parameter_flags(parm, PROP_DYNAMIC, 0);
RNA_def_parameter_flags(parm, PROP_DYNAMIC, ParameterFlag(0));
RNA_def_function_output(func, parm);
func = RNA_def_function(
@@ -6229,11 +6227,11 @@ static void def_sh_tex_pointdensity(StructRNA *srna)
RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "");
parm = RNA_def_property(func, "min", PROP_FLOAT, PROP_COORDS);
RNA_def_property_array(parm, 3);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
RNA_def_function_output(func, parm);
parm = RNA_def_property(func, "max", PROP_FLOAT, PROP_COORDS);
RNA_def_property_array(parm, 3);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
RNA_def_function_output(func, parm);
}
@@ -7149,7 +7147,7 @@ static void rna_def_cmp_output_file_slots_api(BlenderRNA *brna,
RNA_def_function_ui_description(func, "Add a file slot to this node");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS | FUNC_USE_CONTEXT);
parm = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return value */
parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
RNA_def_function_return(func, parm);
@@ -7161,7 +7159,7 @@ static void rna_def_cmp_output_file_slots_api(BlenderRNA *brna,
RNA_def_function_ui_description(func, "Remove a file slot from this node");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "The socket to remove");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "clear", "rna_Node_inputs_clear");
RNA_def_function_ui_description(func, "Remove all file slots from this node");
@@ -7172,10 +7170,10 @@ static void rna_def_cmp_output_file_slots_api(BlenderRNA *brna,
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_int(
func, "to_index", -1, 0, INT_MAX, "To Index", "Target index for the socket", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
}
static void def_cmp_output_file(BlenderRNA *brna, StructRNA *srna)
{
@@ -8716,7 +8714,7 @@ static void def_cmp_switch(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
static void def_cmp_switch_view(StructRNA *UNUSED(srna)) {}
static void def_cmp_switch_view(StructRNA * /*srna*/) {}
static void def_cmp_colorcorrection(StructRNA *srna)
{
@@ -9932,7 +9930,7 @@ static void def_geo_simulation_input(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS | FUNC_USE_CONTEXT);
parm = RNA_def_pointer(
func, "output_node", "GeometryNode", "Output Node", "Simulation output node to pair with");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return value */
parm = RNA_def_boolean(
func, "result", false, "Result", "True if pairing the node was successful");
@@ -9996,9 +9994,9 @@ static void rna_def_geo_simulation_output_items(BlenderRNA *brna)
SOCK_GEOMETRY,
"Socket Type",
"Socket type of the item");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return value */
parm = RNA_def_pointer(func, "item", "SimulationStateItem", "Item", "New item");
RNA_def_function_return(func, parm);
@@ -10018,10 +10016,10 @@ static void rna_def_geo_simulation_output_items(BlenderRNA *brna)
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
parm = RNA_def_int(
func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the item to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_int(
func, "to_index", -1, 0, INT_MAX, "To Index", "Target index for the item", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
}
static void def_geo_simulation_output(StructRNA *srna)
@@ -11584,7 +11582,7 @@ static void rna_def_node_socket(BlenderRNA *brna)
parm = RNA_def_property(func, "text", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(parm, "Text", "Text label to draw alongside properties");
// RNA_def_property_string_default(parm, "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "draw_color", NULL);
RNA_def_function_ui_description(func, "Color of the socket icon");
@@ -11718,7 +11716,7 @@ static void rna_def_node_socket_interface(BlenderRNA *brna)
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
parm = RNA_def_string(
func, "data_path", NULL, 0, "Data Path", "Path to specialized socket data");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "from_socket", NULL);
RNA_def_function_ui_description(func, "Setup template parameters from an existing socket");
@@ -12313,7 +12311,7 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna)
parm = RNA_def_property(func, "text", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(parm, "Text", "Text label to draw alongside properties");
// RNA_def_property_string_default(parm, "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "draw_color", "rna_NodeSocketStandard_draw_color");
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
@@ -12481,14 +12479,14 @@ static void rna_def_internal_node(BlenderRNA *brna)
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_SELF_TYPE);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", ""));
parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "poll_instance", "rna_NodeInternal_poll_instance");
RNA_def_function_ui_description(
func, "If non-null output is returned, the node can be added to the tree");
RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", ""));
parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* update */
func = RNA_def_function(srna, "update", "rna_NodeInternal_update");
@@ -12539,9 +12537,9 @@ static void rna_def_node_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int i
RNA_def_function_ui_description(func, "Add a socket to this node");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_string(func, "type", NULL, MAX_NAME, "Type", "Data type");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
RNA_def_string(func, "identifier", NULL, MAX_NAME, "Identifier", "Unique socket identifier");
/* return value */
parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
@@ -12551,7 +12549,7 @@ static void rna_def_node_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int i
RNA_def_function_ui_description(func, "Remove a socket from this node");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "The socket to remove");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "clear", clearfunc);
RNA_def_function_ui_description(func, "Remove all sockets from this node");
@@ -12562,10 +12560,10 @@ static void rna_def_node_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int i
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_int(
func, "to_index", -1, 0, INT_MAX, "To Index", "Target index for the socket", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
}
static void rna_def_node(BlenderRNA *brna)
@@ -12791,7 +12789,7 @@ static void rna_def_node(BlenderRNA *brna)
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", ""));
parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "poll_instance", NULL);
RNA_def_function_ui_description(
@@ -12799,7 +12797,7 @@ static void rna_def_node(BlenderRNA *brna)
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", ""));
parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* update */
func = RNA_def_function(srna, "update", NULL);
@@ -12861,7 +12859,8 @@ static void rna_def_node(BlenderRNA *brna)
RNA_def_function_ui_description(func, "Returns a dynamic label string");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm = RNA_def_string(func, "label", NULL, MAX_NAME, "Label", "");
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); /* needed for string return value */
RNA_def_parameter_flags(
parm, PROP_THICK_WRAP, ParameterFlag(0)); /* needed for string return value */
RNA_def_function_output(func, parm);
}
@@ -12949,7 +12948,7 @@ static void rna_def_nodetree_nodes_api(BlenderRNA *brna, PropertyRNA *cprop)
MAX_NAME,
"Type",
"Type of node to add (Warning: should be same as node.bl_idname, not node.type!)");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return value */
parm = RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm);
@@ -12959,7 +12958,7 @@ static void rna_def_nodetree_nodes_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
@@ -13006,7 +13005,7 @@ static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
func = RNA_def_function(srna, "clear", "rna_NodeTree_link_clear");
RNA_def_function_ui_description(func, "remove all node links from the node tree");
@@ -13036,9 +13035,9 @@ static void rna_def_node_tree_sockets_api(BlenderRNA *brna, PropertyRNA *cprop,
RNA_def_function_ui_description(func, "Add a socket to this node tree");
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_string(func, "type", NULL, MAX_NAME, "Type", "Data type");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return value */
parm = RNA_def_pointer(func, "socket", "NodeSocketInterface", "", "New socket");
RNA_def_function_return(func, parm);
@@ -13047,7 +13046,7 @@ static void rna_def_node_tree_sockets_api(BlenderRNA *brna, PropertyRNA *cprop,
RNA_def_function_ui_description(func, "Remove a socket from this node tree");
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "socket", "NodeSocketInterface", "", "The socket to remove");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "clear", clearfunc);
RNA_def_function_ui_description(func, "Remove all sockets from this node tree");
@@ -13058,10 +13057,10 @@ static void rna_def_node_tree_sockets_api(BlenderRNA *brna, PropertyRNA *cprop,
RNA_def_function_flag(func, FUNC_USE_MAIN);
parm = RNA_def_int(
func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_int(
func, "to_index", -1, 0, INT_MAX, "To Index", "Target index for the socket", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
}
static void rna_def_nodetree(BlenderRNA *brna)
@@ -13319,7 +13318,7 @@ static void rna_def_shader_nodetree(BlenderRNA *brna)
"Return active shader output node for the specified target");
parm = RNA_def_enum(
func, "target", prop_shader_output_target_items, SHD_OUTPUT_ALL, "Target", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_pointer(func, "node", "ShaderNode", "Node", "");
RNA_def_function_return(func, parm);
}
@@ -13381,10 +13380,10 @@ static StructRNA *define_specific_node(BlenderRNA *brna,
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_SELF_TYPE);
parm = RNA_def_property(func, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(parm, "Index", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_property(func, "result", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(parm, "NodeInternalSocketTemplate");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "output_template", "rna_NodeInternal_output_template");
@@ -13392,10 +13391,10 @@ static StructRNA *define_specific_node(BlenderRNA *brna,
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_SELF_TYPE);
parm = RNA_def_property(func, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(parm, "Index", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_property(func, "result", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(parm, "NodeInternalSocketTemplate");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
RNA_def_function_return(func, parm);
if (def_func) {

View File

@@ -343,14 +343,12 @@ const EnumPropertyItem rna_enum_object_axis_items[] = {
# include "ED_object.h"
# include "ED_particle.h"
static void rna_Object_internal_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_Object_internal_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
DEG_id_tag_update(ptr->owner_id, ID_RECALC_TRANSFORM);
}
static void rna_Object_internal_update_draw(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
static void rna_Object_internal_update_draw(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
DEG_id_tag_update(ptr->owner_id, ID_RECALC_SHADING);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->owner_id);
@@ -359,42 +357,42 @@ static void rna_Object_internal_update_draw(Main *UNUSED(bmain),
static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
/* don't use compat so we get predictable rotation */
BKE_object_apply_mat4(
(Object *)ptr->owner_id, ((Object *)ptr->owner_id)->object_to_world, false, true);
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
BKE_object_apply_mat4(ob, ob->object_to_world, false, true);
rna_Object_internal_update(bmain, scene, ptr);
}
static void rna_Object_hide_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_Object_hide_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
BKE_main_collection_sync_remap(bmain);
DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &ob->id);
}
static void rna_Object_duplicator_visibility_flag_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
static void rna_Object_duplicator_visibility_flag_update(Main * /*bmain*/,
Scene * /*scene*/,
PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
}
static void rna_MaterialIndex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_MaterialIndex_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (ob && ob->type == OB_GPENCIL_LEGACY) {
/* Notifying material property in top-bar. */
WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL);
}
}
static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_GPencil_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (ob && ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = (bGPdata *)ob->data;
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
}
@@ -402,13 +400,13 @@ static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe
static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16])
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
BKE_object_matrix_local_get(ob, (float(*)[4])values);
}
static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16])
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
float local_mat[4][4];
/* Local-space matrix is truly relative to the parent,
@@ -430,13 +428,13 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16])
static void rna_Object_matrix_basis_get(PointerRNA *ptr, float values[16])
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
BKE_object_to_mat4(ob, (float(*)[4])values);
}
static void rna_Object_matrix_basis_set(PointerRNA *ptr, const float values[16])
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
BKE_object_apply_mat4(ob, (float(*)[4])values, false, false);
}
@@ -446,26 +444,26 @@ void rna_Object_internal_update_data_impl(PointerRNA *ptr)
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->owner_id);
}
void rna_Object_internal_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
void rna_Object_internal_update_data(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
rna_Object_internal_update_data_impl(ptr);
}
void rna_Object_internal_update_data_dependency(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
void rna_Object_internal_update_data_dependency(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
DEG_relations_tag_update(bmain);
rna_Object_internal_update_data_impl(ptr);
}
static void rna_Object_active_shape_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_Object_active_shape_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (BKE_object_is_in_editmode(ob)) {
/* exit/enter editmode to get new shape */
switch (ob->type) {
case OB_MESH: {
Mesh *me = ob->data;
Mesh *me = static_cast<Mesh *>(ob->data);
BMEditMesh *em = me->edit_mesh;
int select_mode = em->selectmode;
EDBM_mesh_load(bmain, ob);
@@ -492,7 +490,7 @@ static void rna_Object_active_shape_update(Main *bmain, Scene *UNUSED(scene), Po
rna_Object_internal_update_data_impl(ptr);
}
static void rna_Object_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_Object_dependency_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
DEG_id_tag_update(ptr->owner_id, ID_RECALC_TRANSFORM);
DEG_relations_tag_update(bmain);
@@ -506,9 +504,9 @@ void rna_Object_data_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static PointerRNA rna_Object_data_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
if (ob->type == OB_MESH) {
Mesh *me = (Mesh *)ob->data;
Mesh *me = static_cast<Mesh *>(ob->data);
me = BKE_mesh_wrapper_ensure_subdivision(me);
return rna_pointer_inherit_refine(ptr, &RNA_Mesh, me);
}
@@ -517,8 +515,8 @@ static PointerRNA rna_Object_data_get(PointerRNA *ptr)
static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value, struct ReportList *reports)
{
Object *ob = (Object *)ptr->data;
ID *id = value.data;
Object *ob = static_cast<Object *>(ptr->data);
ID *id = static_cast<ID *>(value.data);
if (ob->mode & OB_MODE_EDIT) {
return;
@@ -539,7 +537,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value, struct Report
if (ob->type == OB_EMPTY) {
if (ob->data) {
id_us_min((ID *)ob->data);
id_us_min(static_cast<ID *>(ob->data));
ob->data = NULL;
}
@@ -549,11 +547,11 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value, struct Report
}
}
else if (ob->type == OB_MESH) {
BKE_mesh_assign_object(G_MAIN, ob, (Mesh *)id);
BKE_mesh_assign_object(G_MAIN, ob, reinterpret_cast<Mesh *>(id));
}
else {
if (ob->data) {
id_us_min((ID *)ob->data);
id_us_min(static_cast<ID *>(ob->data));
}
/* no need to type-check here ID. this is done in the _typef() function */
@@ -567,14 +565,14 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value, struct Report
BKE_curve_type_test(ob);
}
else if (ob->type == OB_ARMATURE) {
BKE_pose_rebuild(G_MAIN, ob, ob->data, true);
BKE_pose_rebuild(G_MAIN, ob, static_cast<bArmature *>(ob->data), true);
}
}
}
static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* keep in sync with OB_DATA_SUPPORT_ID() macro */
switch (ob->type) {
@@ -619,11 +617,11 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
static bool rna_Object_data_poll(PointerRNA *ptr, const PointerRNA value)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
if (ob->type == OB_GPENCIL_LEGACY) {
/* GP Object - Don't allow using "Annotation" GP datablocks here */
bGPdata *gpd = value.data;
bGPdata *gpd = static_cast<bGPdata *>(value.data);
return (gpd->flag & GP_DATA_ANNOTATIONS) == 0;
}
@@ -632,10 +630,10 @@ static bool rna_Object_data_poll(PointerRNA *ptr, const PointerRNA value)
static void rna_Object_parent_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Object *ob = (Object *)ptr->data;
Object *par = (Object *)value.data;
Object *ob = static_cast<Object *>(ptr->data);
Object *par = static_cast<Object *>(value.data);
{
ED_object_parent(ob, par, ob->partype, ob->parsubstr);
@@ -648,13 +646,13 @@ static bool rna_Object_parent_override_apply(Main *bmain,
PointerRNA *ptr_storage,
PropertyRNA *prop_dst,
PropertyRNA *prop_src,
PropertyRNA *UNUSED(prop_storage),
PropertyRNA * /*prop_storage*/,
const int len_dst,
const int len_src,
const int len_storage,
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
PointerRNA * /*ptr_item_dst*/,
PointerRNA * /*ptr_item_src*/,
PointerRNA * /*ptr_item_storage*/,
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage) && len_dst == 0);
@@ -664,9 +662,9 @@ static bool rna_Object_parent_override_apply(Main *bmain,
/* We need a special handling here because setting parent resets invert parent matrix,
* which is evil in our case. */
Object *ob = (Object *)ptr_dst->data;
Object *parent_dst = RNA_property_pointer_get(ptr_dst, prop_dst).data;
Object *parent_src = RNA_property_pointer_get(ptr_src, prop_src).data;
Object *ob = static_cast<Object *>(ptr_dst->data);
Object *parent_dst = static_cast<Object *>(RNA_property_pointer_get(ptr_dst, prop_dst).data);
Object *parent_src = static_cast<Object *>(RNA_property_pointer_get(ptr_src, prop_src).data);
if (parent_src == parent_dst) {
return false;
@@ -685,7 +683,7 @@ static bool rna_Object_parent_override_apply(Main *bmain,
static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* Skip if type did not change (otherwise we loose parent inverse in ED_object_parent). */
if (ob->partype == value) {
@@ -695,12 +693,12 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
ED_object_parent(ob, ob->parent, value, ob->parsubstr);
}
static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
PropertyRNA * /*prop*/,
bool *r_free)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
EnumPropertyItem *item = NULL;
int totitem = 0;
@@ -733,24 +731,24 @@ static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C),
static void rna_Object_empty_display_type_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
BKE_object_empty_draw_type_set(ob, value);
}
static void rna_Object_parent_bone_set(PointerRNA *ptr, const char *value)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
ED_object_parent(ob, ob->parent, ob->partype, value);
}
static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext *UNUSED(C),
static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext * /*C*/,
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
bool *UNUSED(r_free))
PropertyRNA * /*prop*/,
bool * /*r_free*/)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
const EnumPropertyItem *item;
if (ob->type == OB_EMPTY) {
@@ -768,10 +766,10 @@ static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext *UNUSED(C
static void rna_Object_dup_collection_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Object *ob = (Object *)ptr->data;
Collection *grp = (Collection *)value.data;
Object *ob = static_cast<Object *>(ptr->data);
Collection *grp = static_cast<Collection *>(value.data);
/* Must not let this be set if the object belongs in this group already,
* thus causing a cycle/infinite-recursion leading to crashes on load #25298. */
@@ -796,7 +794,7 @@ static void rna_Object_dup_collection_set(PointerRNA *ptr,
static void rna_Object_vertex_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
if (!BKE_object_supports_vertex_groups(ob)) {
iter->valid = 0;
return;
@@ -810,19 +808,19 @@ static void rna_Object_vertex_groups_begin(CollectionPropertyIterator *iter, Poi
static void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
return;
}
bDeformGroup *dg = (bDeformGroup *)ptr->data;
bDeformGroup *dg = static_cast<bDeformGroup *>(ptr->data);
STRNCPY_UTF8(dg->name, value);
BKE_object_defgroup_unique_name(dg, ob);
}
static int rna_VertexGroup_index_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
return -1;
}
@@ -833,7 +831,7 @@ static int rna_VertexGroup_index_get(PointerRNA *ptr)
static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
return PointerRNA_NULL;
}
@@ -848,7 +846,7 @@ static void rna_Object_active_vertex_group_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *reports)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
return;
}
@@ -860,7 +858,7 @@ static void rna_Object_active_vertex_group_set(PointerRNA *ptr,
BKE_reportf(reports,
RPT_ERROR,
"VertexGroup '%s' not found in object '%s'",
((bDeformGroup *)value.data)->name,
(static_cast<bDeformGroup *>(value.data))->name,
ob->id.name + 2);
return;
}
@@ -870,7 +868,7 @@ static void rna_Object_active_vertex_group_set(PointerRNA *ptr,
static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
return -1;
}
@@ -880,7 +878,7 @@ static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr)
static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
return;
}
@@ -889,9 +887,9 @@ static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value)
}
static void rna_Object_active_vertex_group_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
*min = 0;
if (!BKE_object_supports_vertex_groups(ob)) {
@@ -904,14 +902,14 @@ static void rna_Object_active_vertex_group_index_range(
void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
value[0] = '\0';
return;
}
const ListBase *defbase = BKE_object_defgroup_list(ob);
const bDeformGroup *dg = BLI_findlink(defbase, index - 1);
const bDeformGroup *dg = static_cast<bDeformGroup *>(BLI_findlink(defbase, index - 1));
if (dg) {
strcpy(value, dg->name);
@@ -923,19 +921,19 @@ void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
return 0;
}
const ListBase *defbase = BKE_object_defgroup_list(ob);
bDeformGroup *dg = BLI_findlink(defbase, index - 1);
bDeformGroup *dg = static_cast<bDeformGroup *>(BLI_findlink(defbase, index - 1));
return (dg) ? strlen(dg->name) : 0;
}
void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
*index = -1;
return;
@@ -949,7 +947,7 @@ void rna_object_vgroup_name_set(PointerRNA *ptr,
char *result,
int result_maxncpy)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (!BKE_object_supports_vertex_groups(ob)) {
result[0] = '\0';
return;
@@ -970,13 +968,13 @@ void rna_object_uvlayer_name_set(PointerRNA *ptr,
char *result,
int result_maxncpy)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Mesh *me;
CustomDataLayer *layer;
int a;
if (ob->type == OB_MESH && ob->data) {
me = (Mesh *)ob->data;
me = static_cast<Mesh *>(ob->data);
for (a = 0; a < me->ldata.totlayer; a++) {
layer = &me->ldata.layers[a];
@@ -996,13 +994,13 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr,
char *result,
int result_maxncpy)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Mesh *me;
CustomDataLayer *layer;
int a;
if (ob->type == OB_MESH && ob->data) {
me = (Mesh *)ob->data;
me = static_cast<Mesh *>(ob->data);
for (a = 0; a < me->fdata.totlayer; a++) {
layer = &me->fdata.layers[a];
@@ -1019,17 +1017,17 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr,
static int rna_Object_active_material_index_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
return MAX2(ob->actcol - 1, 0);
}
static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
ob->actcol = value + 1;
if (ob->type == OB_MESH) {
Mesh *me = ob->data;
Mesh *me = static_cast<Mesh *>(ob->data);
if (me->edit_mesh) {
me->edit_mesh->mat_nr = value;
@@ -1038,9 +1036,9 @@ static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)
}
static void rna_Object_active_material_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
*min = 0;
*max = max_ii(ob->totcol - 1, 0);
}
@@ -1048,7 +1046,7 @@ static void rna_Object_active_material_index_range(
/* returns active base material */
static PointerRNA rna_Object_active_material_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Material *ma;
ma = (ob->totcol) ? BKE_object_material_get(ob, ob->actcol) : NULL;
@@ -1057,14 +1055,15 @@ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr)
static void rna_Object_active_material_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
DEG_id_tag_update(value.data, 0);
DEG_id_tag_update(static_cast<ID *>(value.data), 0);
BLI_assert(BKE_id_is_in_global_main(&ob->id));
BLI_assert(BKE_id_is_in_global_main(value.data));
BKE_object_material_assign(G_MAIN, ob, value.data, ob->actcol, BKE_MAT_ASSIGN_EXISTING);
BLI_assert(BKE_id_is_in_global_main(static_cast<ID *>(value.data)));
BKE_object_material_assign(
G_MAIN, ob, static_cast<Material *>(value.data), ob->actcol, BKE_MAT_ASSIGN_EXISTING);
if (ob->type == OB_GPENCIL_LEGACY) {
/* Notifying material property in top-bar. */
@@ -1072,9 +1071,9 @@ static void rna_Object_active_material_set(PointerRNA *ptr,
}
}
static int rna_Object_active_material_editable(PointerRNA *ptr, const char **UNUSED(r_info))
static int rna_Object_active_material_editable(PointerRNA *ptr, const char ** /*r_info*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
bool is_editable;
if ((ob->matbits == NULL) || (ob->actcol == 0) || ob->matbits[ob->actcol - 1]) {
@@ -1088,30 +1087,30 @@ static int rna_Object_active_material_editable(PointerRNA *ptr, const char **UNU
}
static void rna_Object_active_particle_system_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
*min = 0;
*max = max_ii(0, BLI_listbase_count(&ob->particlesystem) - 1);
}
static int rna_Object_active_particle_system_index_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
return psys_get_current_num(ob);
}
static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
psys_set_current_num(ob, value);
}
static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
static void rna_Object_particle_update(Main * /*bmain*/, Scene *scene, PointerRNA *ptr)
{
/* TODO: Disabled for now, because bContext is not available. */
# if 0
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
PE_current_changed(NULL, scene, ob);
# else
(void)scene;
@@ -1122,7 +1121,7 @@ static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, Pointe
/* rotation - axis-angle */
static void rna_Object_rotation_axis_angle_get(PointerRNA *ptr, float *value)
{
Object *ob = ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* for now, assume that rotation mode is axis-angle */
value[0] = ob->rotAngle;
@@ -1132,7 +1131,7 @@ static void rna_Object_rotation_axis_angle_get(PointerRNA *ptr, float *value)
/* rotation - axis-angle */
static void rna_Object_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
{
Object *ob = ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* for now, assume that rotation mode is axis-angle */
ob->rotAngle = value[0];
@@ -1143,7 +1142,7 @@ static void rna_Object_rotation_axis_angle_set(PointerRNA *ptr, const float *val
static void rna_Object_rotation_mode_set(PointerRNA *ptr, int value)
{
Object *ob = ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* use API Method for conversions... */
BKE_rotMode_change_values(
@@ -1155,19 +1154,19 @@ static void rna_Object_rotation_mode_set(PointerRNA *ptr, int value)
static void rna_Object_dimensions_get(PointerRNA *ptr, float *value)
{
Object *ob = ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
BKE_object_dimensions_get(ob, value);
}
static void rna_Object_dimensions_set(PointerRNA *ptr, const float *value)
{
Object *ob = ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
BKE_object_dimensions_set(ob, value, 0);
}
static int rna_Object_location_editable(PointerRNA *ptr, int index)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (ob->protectflag & OB_LOCK_LOCX)) {
@@ -1186,7 +1185,7 @@ static int rna_Object_location_editable(PointerRNA *ptr, int index)
static int rna_Object_scale_editable(PointerRNA *ptr, int index)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (ob->protectflag & OB_LOCK_SCALEX)) {
@@ -1205,7 +1204,7 @@ static int rna_Object_scale_editable(PointerRNA *ptr, int index)
static int rna_Object_rotation_euler_editable(PointerRNA *ptr, int index)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (ob->protectflag & OB_LOCK_ROTX)) {
@@ -1224,7 +1223,7 @@ static int rna_Object_rotation_euler_editable(PointerRNA *ptr, int index)
static int rna_Object_rotation_4d_editable(PointerRNA *ptr, int index)
{
Object *ob = (Object *)ptr->data;
Object *ob = static_cast<Object *>(ptr->data);
/* only consider locks if locking components individually... */
if (ob->protectflag & OB_LOCK_ROT4D) {
@@ -1257,9 +1256,9 @@ static int rna_MaterialSlot_index_get(PointerRNA *ptr)
return rna_MaterialSlot_index(ptr);
}
static int rna_MaterialSlot_material_editable(PointerRNA *ptr, const char **UNUSED(r_info))
static int rna_MaterialSlot_material_editable(PointerRNA *ptr, const char ** /*r_info*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
const int index = rna_MaterialSlot_index(ptr);
bool is_editable;
@@ -1275,7 +1274,7 @@ static int rna_MaterialSlot_material_editable(PointerRNA *ptr, const char **UNUS
static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Material *ma;
const int index = rna_MaterialSlot_index(ptr);
@@ -1290,20 +1289,21 @@ static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr)
static void rna_MaterialSlot_material_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
int index = rna_MaterialSlot_index(ptr);
BLI_assert(BKE_id_is_in_global_main(&ob->id));
BLI_assert(BKE_id_is_in_global_main(value.data));
BKE_object_material_assign(G_MAIN, ob, value.data, index + 1, BKE_MAT_ASSIGN_EXISTING);
BLI_assert(BKE_id_is_in_global_main(static_cast<ID *>(value.data)));
BKE_object_material_assign(
G_MAIN, ob, static_cast<Material *>(value.data), index + 1, BKE_MAT_ASSIGN_EXISTING);
}
static bool rna_MaterialSlot_material_poll(PointerRNA *ptr, PointerRNA value)
{
Object *ob = (Object *)ptr->owner_id;
Material *ma = (Material *)value.data;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Material *ma = static_cast<Material *>(value.data);
if (ob->type == OB_GPENCIL_LEGACY) {
/* GP Materials only */
@@ -1317,7 +1317,7 @@ static bool rna_MaterialSlot_material_poll(PointerRNA *ptr, PointerRNA value)
static int rna_MaterialSlot_link_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
int index = rna_MaterialSlot_index(ptr);
if (index < ob->totcol) {
return ob->matbits[index] != 0;
@@ -1327,7 +1327,7 @@ static int rna_MaterialSlot_link_get(PointerRNA *ptr)
static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
int index = rna_MaterialSlot_index(ptr);
if (value) {
@@ -1344,7 +1344,7 @@ static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value)
static int rna_MaterialSlot_name_length(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Material *ma;
int index = rna_MaterialSlot_index(ptr);
@@ -1359,7 +1359,7 @@ static int rna_MaterialSlot_name_length(PointerRNA *ptr)
static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Material *ma;
int index = rna_MaterialSlot_index(ptr);
@@ -1390,7 +1390,7 @@ static char *rna_MaterialSlot_path(const PointerRNA *ptr)
static int rna_Object_material_slots_length(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (DEG_is_evaluated_object(ob)) {
return BKE_object_material_count_eval(ob);
}
@@ -1417,7 +1417,7 @@ static void rna_Object_material_slots_next(CollectionPropertyIterator *iter)
static PointerRNA rna_Object_material_slots_get(CollectionPropertyIterator *iter)
{
PointerRNA ptr;
ID *id = (ID *)iter->internal.count.ptr;
ID *id = static_cast<ID *>(iter->internal.count.ptr);
RNA_pointer_create(id,
&RNA_MaterialSlot,
/* Add offset, so that `ptr->data` is not null and unique across IDs. */
@@ -1426,29 +1426,29 @@ static PointerRNA rna_Object_material_slots_get(CollectionPropertyIterator *iter
return ptr;
}
static void rna_Object_material_slots_end(CollectionPropertyIterator *UNUSED(iter)) {}
static void rna_Object_material_slots_end(CollectionPropertyIterator * /*iter*/) {}
static PointerRNA rna_Object_display_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_ObjectDisplay, ptr->data);
}
static char *rna_ObjectDisplay_path(const PointerRNA *UNUSED(ptr))
static char *rna_ObjectDisplay_path(const PointerRNA * /*ptr*/)
{
return BLI_strdup("display");
}
static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
ParticleSystem *psys = psys_get_current(ob);
return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys);
}
static void rna_Object_active_shape_key_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Key *key = BKE_key_from_object(ob);
*min = 0;
@@ -1465,21 +1465,21 @@ static void rna_Object_active_shape_key_index_range(
static int rna_Object_active_shape_key_index_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
return MAX2(ob->shapenr - 1, 0);
}
static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
ob->shapenr = value + 1;
}
static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
Key *key = BKE_key_from_object(ob);
KeyBlock *kb;
PointerRNA keyptr;
@@ -1488,21 +1488,21 @@ static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr)
return PointerRNA_NULL;
}
kb = BLI_findlink(&key->block, ob->shapenr - 1);
RNA_pointer_create((ID *)key, &RNA_ShapeKey, kb, &keyptr);
kb = static_cast<KeyBlock *>(BLI_findlink(&key->block, ob->shapenr - 1));
RNA_pointer_create(reinterpret_cast<ID *>(key), &RNA_ShapeKey, kb, &keyptr);
return keyptr;
}
static PointerRNA rna_Object_field_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd);
}
static PointerRNA rna_Object_collision_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (ob->type != OB_MESH) {
return PointerRNA_NULL;
@@ -1513,17 +1513,17 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr)
static PointerRNA rna_Object_active_constraint_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
bConstraint *con = BKE_constraints_active_get(&ob->constraints);
return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
}
static void rna_Object_active_constraint_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Object *ob = (Object *)ptr->owner_id;
BKE_constraints_active_set(&ob->constraints, (bConstraint *)value.data);
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
BKE_constraints_active_set(&ob->constraints, static_cast<bConstraint *>(value.data));
}
static bConstraint *rna_Object_constraints_new(Object *object, Main *bmain, int type)
@@ -1541,7 +1541,7 @@ static void rna_Object_constraints_remove(Object *object,
ReportList *reports,
PointerRNA *con_ptr)
{
bConstraint *con = con_ptr->data;
bConstraint *con = static_cast<bConstraint *>(con_ptr->data);
if (BLI_findindex(&object->constraints, con) == -1) {
BKE_reportf(reports,
RPT_ERROR,
@@ -1587,7 +1587,7 @@ static void rna_Object_constraints_move(
static bConstraint *rna_Object_constraints_copy(Object *object, Main *bmain, PointerRNA *con_ptr)
{
bConstraint *con = con_ptr->data;
bConstraint *con = static_cast<bConstraint *>(con_ptr->data);
bConstraint *new_con = BKE_constraint_copy_for_object(object, con);
new_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
@@ -1600,36 +1600,37 @@ static bConstraint *rna_Object_constraints_copy(Object *object, Main *bmain, Poi
bool rna_Object_constraints_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *UNUSED(ptr_storage),
PointerRNA * /*ptr_storage*/,
PropertyRNA *prop_dst,
PropertyRNA *UNUSED(prop_src),
PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst),
const int UNUSED(len_src),
const int UNUSED(len_storage),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
PropertyRNA * /*prop_src*/,
PropertyRNA * /*prop_storage*/,
const int /*len_dst*/,
const int /*len_src*/,
const int /*len_storage*/,
PointerRNA * /*ptr_item_dst*/,
PointerRNA * /*ptr_item_src*/,
PointerRNA * /*ptr_item_storage*/,
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(opop->operation == LIBOVERRIDE_OP_INSERT_AFTER &&
"Unsupported RNA override operation on constraints collection");
Object *ob_dst = (Object *)ptr_dst->owner_id;
Object *ob_src = (Object *)ptr_src->owner_id;
Object *ob_dst = reinterpret_cast<Object *>(ptr_dst->owner_id);
Object *ob_src = reinterpret_cast<Object *>(ptr_src->owner_id);
/* Remember that insertion operations are defined and stored in correct order, which means that
* even if we insert several items in a row, we always insert first one, then second one, etc.
* So we should always find 'anchor' constraint in both _src *and* _dst. */
const size_t name_offset = offsetof(bConstraint, name);
bConstraint *con_anchor = BLI_listbase_string_or_index_find(&ob_dst->constraints,
opop->subitem_reference_name,
name_offset,
opop->subitem_reference_index);
bConstraint *con_anchor = static_cast<bConstraint *>(
BLI_listbase_string_or_index_find(&ob_dst->constraints,
opop->subitem_reference_name,
name_offset,
opop->subitem_reference_index));
/* If `con_anchor` is NULL, `con_src` will be inserted in first position. */
bConstraint *con_src = BLI_listbase_string_or_index_find(
&ob_src->constraints, opop->subitem_local_name, name_offset, opop->subitem_local_index);
bConstraint *con_src = static_cast<bConstraint *>(BLI_listbase_string_or_index_find(
&ob_src->constraints, opop->subitem_local_name, name_offset, opop->subitem_local_index));
if (con_src == NULL) {
BLI_assert(con_src != NULL);
@@ -1666,7 +1667,7 @@ static void rna_Object_modifier_remove(Object *object,
ReportList *reports,
PointerRNA *md_ptr)
{
ModifierData *md = md_ptr->data;
ModifierData *md = static_cast<ModifierData *>(md_ptr->data);
if (ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md) == false)
{
/* error is already set */
@@ -1687,7 +1688,7 @@ static void rna_Object_modifier_clear(Object *object, bContext *C)
static void rna_Object_modifier_move(Object *object, ReportList *reports, int from, int to)
{
ModifierData *md = BLI_findlink(&object->modifiers, from);
ModifierData *md = static_cast<ModifierData *>(BLI_findlink(&object->modifiers, from));
if (!md) {
BKE_reportf(reports, RPT_ERROR, "Invalid original modifier index '%d'", from);
@@ -1699,15 +1700,15 @@ static void rna_Object_modifier_move(Object *object, ReportList *reports, int fr
static PointerRNA rna_Object_active_modifier_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
ModifierData *md = BKE_object_active_modifier(ob);
return rna_pointer_inherit_refine(ptr, &RNA_Modifier, md);
}
static void rna_Object_active_modifier_set(PointerRNA *ptr, PointerRNA value, ReportList *reports)
{
Object *ob = (Object *)ptr->owner_id;
ModifierData *md = value.data;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
ModifierData *md = static_cast<ModifierData *>(value.data);
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
@@ -1728,36 +1729,37 @@ static void rna_Object_active_modifier_set(PointerRNA *ptr, PointerRNA value, Re
bool rna_Object_modifiers_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *UNUSED(ptr_storage),
PointerRNA * /*ptr_storage*/,
PropertyRNA *prop_dst,
PropertyRNA *UNUSED(prop_src),
PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst),
const int UNUSED(len_src),
const int UNUSED(len_storage),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
PropertyRNA * /*prop_src*/,
PropertyRNA * /*prop_storage*/,
const int /*len_dst*/,
const int /*len_src*/,
const int /*len_storage*/,
PointerRNA * /*ptr_item_dst*/,
PointerRNA * /*ptr_item_src*/,
PointerRNA * /*ptr_item_storage*/,
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(opop->operation == LIBOVERRIDE_OP_INSERT_AFTER &&
"Unsupported RNA override operation on modifiers collection");
Object *ob_dst = (Object *)ptr_dst->owner_id;
Object *ob_src = (Object *)ptr_src->owner_id;
Object *ob_dst = reinterpret_cast<Object *>(ptr_dst->owner_id);
Object *ob_src = reinterpret_cast<Object *>(ptr_src->owner_id);
/* Remember that insertion operations are defined and stored in correct order, which means that
* even if we insert several items in a row, we always insert first one, then second one, etc.
* So we should always find 'anchor' modifier in both _src *and* _dst. */
const size_t name_offset = offsetof(ModifierData, name);
ModifierData *mod_anchor = BLI_listbase_string_or_index_find(&ob_dst->modifiers,
opop->subitem_reference_name,
name_offset,
opop->subitem_reference_index);
ModifierData *mod_anchor = static_cast<ModifierData *>(
BLI_listbase_string_or_index_find(&ob_dst->modifiers,
opop->subitem_reference_name,
name_offset,
opop->subitem_reference_index));
/* If `mod_anchor` is NULL, `mod_src` will be inserted in first position. */
ModifierData *mod_src = BLI_listbase_string_or_index_find(
&ob_src->modifiers, opop->subitem_local_name, name_offset, opop->subitem_local_index);
ModifierData *mod_src = static_cast<ModifierData *>(BLI_listbase_string_or_index_find(
&ob_src->modifiers, opop->subitem_local_name, name_offset, opop->subitem_local_index));
if (mod_src == NULL) {
BLI_assert(mod_src != NULL);
@@ -1795,12 +1797,12 @@ bool rna_Object_modifiers_override_apply(Main *bmain,
* a proper behavior would be everything but trivial, and this whole particle thingy is
* end-of-life. */
ParticleSystem *psys_dst = (mod_dst->type == eModifierType_ParticleSystem) ?
((ParticleSystemModifierData *)mod_dst)->psys :
(reinterpret_cast<ParticleSystemModifierData *>(mod_dst))->psys :
NULL;
BKE_modifier_copydata(mod_src, mod_dst);
if (mod_dst->type == eModifierType_ParticleSystem) {
psys_dst->flag &= ~PSYS_DELETE;
((ParticleSystemModifierData *)mod_dst)->psys = psys_dst;
(reinterpret_cast<ParticleSystemModifierData *>(mod_dst))->psys = psys_dst;
}
BLI_remlink(&ob_dst->modifiers, mod_dst);
@@ -1824,7 +1826,7 @@ static void rna_Object_greasepencil_modifier_remove(Object *object,
ReportList *reports,
PointerRNA *gmd_ptr)
{
GpencilModifierData *gmd = gmd_ptr->data;
GpencilModifierData *gmd = static_cast<GpencilModifierData *>(gmd_ptr->data);
if (ED_object_gpencil_modifier_remove(reports, CTX_data_main(C), object, gmd) == false) {
/* error is already set */
return;
@@ -1844,39 +1846,40 @@ static void rna_Object_greasepencil_modifier_clear(Object *object, bContext *C)
bool rna_Object_greasepencil_modifiers_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *UNUSED(ptr_storage),
PointerRNA * /*ptr_storage*/,
PropertyRNA *prop_dst,
PropertyRNA *UNUSED(prop_src),
PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst),
const int UNUSED(len_src),
const int UNUSED(len_storage),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
PropertyRNA * /*prop_src*/,
PropertyRNA * /*prop_storage*/,
const int /*len_dst*/,
const int /*len_src*/,
const int /*len_storage*/,
PointerRNA * /*ptr_item_dst*/,
PointerRNA * /*ptr_item_src*/,
PointerRNA * /*ptr_item_storage*/,
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(opop->operation == LIBOVERRIDE_OP_INSERT_AFTER &&
"Unsupported RNA override operation on modifiers collection");
Object *ob_dst = (Object *)ptr_dst->owner_id;
Object *ob_src = (Object *)ptr_src->owner_id;
Object *ob_dst = reinterpret_cast<Object *>(ptr_dst->owner_id);
Object *ob_src = reinterpret_cast<Object *>(ptr_src->owner_id);
/* Remember that insertion operations are defined and stored in correct order, which means that
* even if we insert several items in a row, we always insert first one, then second one, etc.
* So we should always find 'anchor' modifier in both _src *and* _dst. */
const size_t name_offset = offsetof(GpencilModifierData, name);
GpencilModifierData *mod_anchor = BLI_listbase_string_or_index_find(
&ob_dst->greasepencil_modifiers,
opop->subitem_reference_name,
name_offset,
opop->subitem_reference_index);
GpencilModifierData *mod_anchor = static_cast<GpencilModifierData *>(
BLI_listbase_string_or_index_find(&ob_dst->greasepencil_modifiers,
opop->subitem_reference_name,
name_offset,
opop->subitem_reference_index));
/* If `mod_anchor` is NULL, `mod_src` will be inserted in first position. */
GpencilModifierData *mod_src = BLI_listbase_string_or_index_find(&ob_src->greasepencil_modifiers,
opop->subitem_local_name,
name_offset,
opop->subitem_local_index);
GpencilModifierData *mod_src = static_cast<GpencilModifierData *>(
BLI_listbase_string_or_index_find(&ob_src->greasepencil_modifiers,
opop->subitem_local_name,
name_offset,
opop->subitem_local_index));
if (mod_src == NULL) {
BLI_assert(mod_src != NULL);
@@ -1912,7 +1915,7 @@ static void rna_Object_shaderfx_remove(Object *object,
ReportList *reports,
PointerRNA *gmd_ptr)
{
ShaderFxData *gmd = gmd_ptr->data;
ShaderFxData *gmd = static_cast<ShaderFxData *>(gmd_ptr->data);
if (ED_object_shaderfx_remove(reports, CTX_data_main(C), object, gmd) == false) {
/* error is already set */
return;
@@ -1931,7 +1934,7 @@ static void rna_Object_shaderfx_clear(Object *object, bContext *C)
static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
const BoundBox *bb = BKE_object_boundbox_get(ob);
if (bb) {
memcpy(values, bb->vec, sizeof(bb->vec));
@@ -1980,7 +1983,7 @@ static void rna_Object_vgroup_remove(Object *ob,
return;
}
bDeformGroup *defgroup = defgroup_ptr->data;
bDeformGroup *defgroup = static_cast<bDeformGroup *>(defgroup_ptr->data);
ListBase *defbase = BKE_object_defgroup_list_mutable(ob);
if (BLI_findindex(defbase, defgroup) == -1) {
@@ -2019,7 +2022,7 @@ static void rna_VertexGroup_vertex_add(ID *id,
float weight,
int assignmode)
{
Object *ob = (Object *)id;
Object *ob = reinterpret_cast<Object *>(id);
if (BKE_object_is_in_editmode_vgroup(ob)) {
BKE_report(
@@ -2033,13 +2036,13 @@ static void rna_VertexGroup_vertex_add(ID *id,
}
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_GEOM | ND_DATA, (ID *)ob->data);
WM_main_add_notifier(NC_GEOM | ND_DATA, static_cast<ID *>(ob->data));
}
static void rna_VertexGroup_vertex_remove(
ID *id, bDeformGroup *dg, ReportList *reports, int index_len, int *index)
{
Object *ob = (Object *)id;
Object *ob = reinterpret_cast<Object *>(id);
if (BKE_object_is_in_editmode_vgroup(ob)) {
BKE_report(
@@ -2052,12 +2055,12 @@ static void rna_VertexGroup_vertex_remove(
}
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_GEOM | ND_DATA, (ID *)ob->data);
WM_main_add_notifier(NC_GEOM | ND_DATA, static_cast<ID *>(ob->data));
}
static float rna_VertexGroup_weight(ID *id, bDeformGroup *dg, ReportList *reports, int index)
{
float weight = ED_vgroup_vert_weight((Object *)id, dg, index);
float weight = ED_vgroup_vert_weight(reinterpret_cast<Object *>(id), dg, index);
if (weight < 0) {
BKE_report(reports, RPT_ERROR, "Vertex not in group");
@@ -2066,65 +2069,65 @@ static float rna_VertexGroup_weight(ID *id, bDeformGroup *dg, ReportList *report
}
/* generic poll functions */
bool rna_Lattice_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_Lattice_object_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
return ((Object *)value.owner_id)->type == OB_LATTICE;
return (reinterpret_cast<Object *>(value.owner_id))->type == OB_LATTICE;
}
bool rna_Curve_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_Curve_object_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
return ((Object *)value.owner_id)->type == OB_CURVES_LEGACY;
return (reinterpret_cast<Object *>(value.owner_id))->type == OB_CURVES_LEGACY;
}
bool rna_Armature_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_Armature_object_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
return ((Object *)value.owner_id)->type == OB_ARMATURE;
return (reinterpret_cast<Object *>(value.owner_id))->type == OB_ARMATURE;
}
bool rna_Mesh_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_Mesh_object_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
return ((Object *)value.owner_id)->type == OB_MESH;
return (reinterpret_cast<Object *>(value.owner_id))->type == OB_MESH;
}
bool rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_Camera_object_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
return ((Object *)value.owner_id)->type == OB_CAMERA;
return (reinterpret_cast<Object *>(value.owner_id))->type == OB_CAMERA;
}
bool rna_Light_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_Light_object_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
return ((Object *)value.owner_id)->type == OB_LAMP;
return (reinterpret_cast<Object *>(value.owner_id))->type == OB_LAMP;
}
bool rna_GPencil_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
bool rna_GPencil_object_poll(PointerRNA * /*ptr*/, PointerRNA value)
{
return ((Object *)value.owner_id)->type == OB_GPENCIL_LEGACY;
return (reinterpret_cast<Object *>(value.owner_id))->type == OB_GPENCIL_LEGACY;
}
bool rna_Object_use_dynamic_topology_sculpting_get(PointerRNA *ptr)
{
return BKE_object_sculpt_use_dyntopo((Object *)ptr->owner_id);
return BKE_object_sculpt_use_dyntopo(reinterpret_cast<Object *>(ptr->owner_id));
}
static void rna_object_lineart_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_object_lineart_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->owner_id);
}
static char *rna_ObjectLineArt_path(const PointerRNA *UNUSED(ptr))
static char *rna_ObjectLineArt_path(const PointerRNA * /*ptr*/)
{
return BLI_strdup("lineart");
}
static bool mesh_symmetry_get_common(PointerRNA *ptr, const eMeshSymmetryType sym)
{
const Object *ob = (Object *)ptr->owner_id;
const Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (ob->type != OB_MESH) {
return false;
}
const Mesh *mesh = ob->data;
const Mesh *mesh = static_cast<Mesh *>(ob->data);
return mesh->symmetry & sym;
}
@@ -2147,12 +2150,12 @@ static void mesh_symmetry_set_common(PointerRNA *ptr,
const bool value,
const eMeshSymmetryType sym)
{
Object *ob = (Object *)ptr->owner_id;
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (ob->type != OB_MESH) {
return;
}
Mesh *mesh = ob->data;
Mesh *mesh = static_cast<Mesh *>(ob->data);
if (value) {
mesh->symmetry |= sym;
}
@@ -2176,14 +2179,14 @@ static void rna_Object_mesh_symmetry_z_set(PointerRNA *ptr, bool value)
mesh_symmetry_set_common(ptr, value, ME_SYMMETRY_Z);
}
static int rna_Object_mesh_symmetry_yz_editable(PointerRNA *ptr, const char **UNUSED(r_info))
static int rna_Object_mesh_symmetry_yz_editable(PointerRNA *ptr, const char ** /*r_info*/)
{
const Object *ob = (Object *)ptr->owner_id;
const Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
if (ob->type != OB_MESH) {
return 0;
}
const Mesh *mesh = ob->data;
const Mesh *mesh = static_cast<Mesh *>(ob->data);
if (ob->mode == OB_MODE_WEIGHT_PAINT && mesh->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) {
/* Only X symmetry is available in weightpaint mode. */
return 0;
@@ -2194,7 +2197,7 @@ static int rna_Object_mesh_symmetry_yz_editable(PointerRNA *ptr, const char **UN
void rna_Object_lightgroup_get(PointerRNA *ptr, char *value)
{
const LightgroupMembership *lgm = ((Object *)ptr->owner_id)->lightgroup;
const LightgroupMembership *lgm = (reinterpret_cast<Object *>(ptr->owner_id))->lightgroup;
char value_buf[sizeof(lgm->name)];
int len = BKE_lightgroup_membership_get(lgm, value_buf);
memcpy(value, value_buf, len + 1);
@@ -2202,13 +2205,13 @@ void rna_Object_lightgroup_get(PointerRNA *ptr, char *value)
int rna_Object_lightgroup_length(PointerRNA *ptr)
{
const LightgroupMembership *lgm = ((Object *)ptr->owner_id)->lightgroup;
const LightgroupMembership *lgm = (reinterpret_cast<Object *>(ptr->owner_id))->lightgroup;
return BKE_lightgroup_membership_length(lgm);
}
void rna_Object_lightgroup_set(PointerRNA *ptr, const char *value)
{
BKE_lightgroup_membership_set(&((Object *)ptr->owner_id)->lightgroup, value);
BKE_lightgroup_membership_set(&(reinterpret_cast<Object *>(ptr->owner_id))->lightgroup, value);
}
static PointerRNA rna_Object_light_linking_get(PointerRNA *ptr)
@@ -2216,50 +2219,52 @@ static PointerRNA rna_Object_light_linking_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_ObjectLightLinking, ptr->data);
}
static char *rna_ObjectLightLinking_path(const PointerRNA *UNUSED(ptr))
static char *rna_ObjectLightLinking_path(const PointerRNA * /*ptr*/)
{
return BLI_strdup("light_linking");
}
static PointerRNA rna_LightLinking_receiver_collection_get(PointerRNA *ptr)
{
Object *object = (Object *)ptr->owner_id;
Object *object = reinterpret_cast<Object *>(ptr->owner_id);
PointerRNA collection_ptr;
RNA_id_pointer_create((ID *)BKE_light_linking_collection_get(object, LIGHT_LINKING_RECEIVER),
&collection_ptr);
RNA_id_pointer_create(
reinterpret_cast<ID *>(BKE_light_linking_collection_get(object, LIGHT_LINKING_RECEIVER)),
&collection_ptr);
return collection_ptr;
}
static void rna_LightLinking_receiver_collection_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Object *object = (Object *)ptr->owner_id;
Collection *new_collection = (Collection *)value.data;
Object *object = reinterpret_cast<Object *>(ptr->owner_id);
Collection *new_collection = static_cast<Collection *>(value.data);
BKE_light_linking_collection_assign_only(object, new_collection, LIGHT_LINKING_RECEIVER);
}
static PointerRNA rna_LightLinking_blocker_collection_get(PointerRNA *ptr)
{
Object *object = (Object *)ptr->owner_id;
Object *object = reinterpret_cast<Object *>(ptr->owner_id);
PointerRNA collection_ptr;
RNA_id_pointer_create((ID *)BKE_light_linking_collection_get(object, LIGHT_LINKING_BLOCKER),
&collection_ptr);
RNA_id_pointer_create(
reinterpret_cast<ID *>(BKE_light_linking_collection_get(object, LIGHT_LINKING_BLOCKER)),
&collection_ptr);
return collection_ptr;
}
static void rna_LightLinking_blocker_collection_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
struct ReportList * /*reports*/)
{
Object *object = (Object *)ptr->owner_id;
Collection *new_collection = (Collection *)value.data;
Object *object = reinterpret_cast<Object *>(ptr->owner_id);
Collection *new_collection = static_cast<Collection *>(value.data);
BKE_light_linking_collection_assign_only(object, new_collection, LIGHT_LINKING_BLOCKER);
}
static void rna_LightLinking_collection_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_LightLinking_collection_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
{
DEG_id_tag_update(ptr->owner_id, ID_RECALC_SHADING);
@@ -2315,9 +2320,9 @@ static void rna_def_vertex_group(BlenderRNA *brna)
parm = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "List of indices", 0, 0);
RNA_def_parameter_flags(parm, PROP_DYNAMIC, PARM_REQUIRED);
parm = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove");
RNA_def_function_ui_description(func, "Remove vertices from the group");
@@ -2330,7 +2335,7 @@ static void rna_def_vertex_group(BlenderRNA *brna)
RNA_def_function_ui_description(func, "Get a vertex weight from the group");
RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
RNA_def_function_return(func, parm);
}
@@ -2424,7 +2429,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
/* object to add */
parm = RNA_def_enum(
func, "type", rna_enum_constraint_type_items, 1, "", "Constraint type to add");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return type */
parm = RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
RNA_def_function_return(func, parm);
@@ -2435,7 +2440,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
/* constraint to remove */
parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
func = RNA_def_function(srna, "clear", "rna_Object_constraints_clear");
RNA_def_function_flag(func, FUNC_USE_MAIN);
@@ -2446,9 +2451,9 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "from_index", -1, INT_MIN, INT_MAX, "From Index", "Index to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna, "copy", "rna_Object_constraints_copy");
RNA_def_function_ui_description(func, "Add a new constraint that is a copy of the given one");
@@ -2460,7 +2465,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
"",
"Constraint to copy - may belong to a different object");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
/* return type */
parm = RNA_def_pointer(func, "new_constraint", "Constraint", "", "New constraint");
RNA_def_function_return(func, parm);
@@ -2498,11 +2503,11 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new modifier");
parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the modifier");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* modifier to add */
parm = RNA_def_enum(
func, "type", rna_enum_object_modifier_type_items, 1, "", "Modifier type to add");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return type */
parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier");
RNA_def_function_return(func, parm);
@@ -2514,7 +2519,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
/* modifier to remove */
parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
/* clear all modifiers */
func = RNA_def_function(srna, "clear", "rna_Object_modifier_clear");
@@ -2527,9 +2532,9 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "from_index", -1, INT_MIN, INT_MAX, "From Index", "Index to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* Active modifier. */
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
@@ -2562,7 +2567,7 @@ static void rna_def_object_grease_pencil_modifiers(BlenderRNA *brna, PropertyRNA
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new greasepencil_modifier");
parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the greasepencil_modifier");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* greasepencil_modifier to add */
parm = RNA_def_enum(func,
"type",
@@ -2570,7 +2575,7 @@ static void rna_def_object_grease_pencil_modifiers(BlenderRNA *brna, PropertyRNA
1,
"",
"Modifier type to add");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return type */
parm = RNA_def_pointer(
func, "greasepencil_modifier", "GpencilModifier", "", "Newly created modifier");
@@ -2585,7 +2590,7 @@ static void rna_def_object_grease_pencil_modifiers(BlenderRNA *brna, PropertyRNA
parm = RNA_def_pointer(
func, "greasepencil_modifier", "GpencilModifier", "", "Modifier to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
/* clear all greasepencil modifiers */
func = RNA_def_function(srna, "clear", "rna_Object_greasepencil_modifier_clear");
@@ -2611,11 +2616,11 @@ static void rna_def_object_shaderfxs(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new shader fx");
parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the effect");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* shader to add */
parm = RNA_def_enum(
func, "type", rna_enum_object_shaderfx_type_items, 1, "", "Effect type to add");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* return type */
parm = RNA_def_pointer(func, "shader_fx", "ShaderFx", "", "Newly created effect");
RNA_def_function_return(func, parm);
@@ -2627,7 +2632,7 @@ static void rna_def_object_shaderfxs(BlenderRNA *brna, PropertyRNA *cprop)
/* shader to remove */
parm = RNA_def_pointer(func, "shader_fx", "ShaderFx", "", "Effect to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
/* clear all shader fx */
func = RNA_def_function(srna, "clear", "rna_Object_shaderfx_clear");
@@ -2717,7 +2722,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Delete vertex group from object");
parm = RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
func = RNA_def_function(srna, "clear", "rna_Object_vgroup_clear");
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);

View File

@@ -86,7 +86,7 @@ static Base *find_view_layer_base_with_synced_ensure(
ViewLayer *view_layer;
if (view_layer_ptr->data) {
scene = (Scene *)view_layer_ptr->owner_id;
view_layer = view_layer_ptr->data;
view_layer = static_cast<ViewLayer *>(view_layer_ptr->data);
}
else {
scene = CTX_data_scene(C);
@@ -228,7 +228,7 @@ static Base *rna_Object_local_view_property_helper(bScreen *screen,
}
if (view_layer == NULL) {
win = ED_screen_window_find(screen, G_MAIN->wm.first);
win = ED_screen_window_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
view_layer = WM_window_get_active_view_layer(win);
}
@@ -260,7 +260,7 @@ static void rna_Object_local_view_set(Object *ob,
bool state)
{
bScreen *screen = (bScreen *)v3d_ptr->owner_id;
View3D *v3d = v3d_ptr->data;
View3D *v3d = static_cast<View3D *>(v3d_ptr->data);
Scene *scene;
Base *base = rna_Object_local_view_property_helper(screen, v3d, NULL, ob, reports, &scene);
if (base == NULL) {
@@ -482,7 +482,7 @@ static void rna_Object_shape_key_remove(Object *ob,
ReportList *reports,
PointerRNA *kb_ptr)
{
KeyBlock *kb = kb_ptr->data;
KeyBlock *kb = static_cast<KeyBlock *>(kb_ptr->data);
Key *key = BKE_key_from_object(ob);
if ((key == NULL) || BLI_findindex(&key->block, kb) == -1) {
@@ -552,7 +552,8 @@ static int mesh_looptri_to_poly_index(Mesh *me_eval, const int tri_index)
{
const int *looptri_polys = BKE_mesh_runtime_looptri_polys_ensure(me_eval);
const int poly_i = looptri_polys[tri_index];
const int *index_mp_to_orig = CustomData_get_layer(&me_eval->pdata, CD_ORIGINDEX);
const int *index_mp_to_orig = static_cast<const int *>(
CustomData_get_layer(&me_eval->pdata, CD_ORIGINDEX));
return index_mp_to_orig ? index_mp_to_orig[poly_i] : poly_i;
}
@@ -565,7 +566,9 @@ static Object *eval_object_ensure(Object *ob,
{
if (ob->runtime.data_eval == NULL) {
Object *ob_orig = ob;
Depsgraph *depsgraph = rnaptr_depsgraph != NULL ? rnaptr_depsgraph->data : NULL;
Depsgraph *depsgraph = rnaptr_depsgraph != NULL ?
static_cast<Depsgraph *>(rnaptr_depsgraph->data) :
NULL;
if (depsgraph == NULL) {
depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
}
@@ -746,7 +749,7 @@ void rna_Object_me_eval_info(
switch (type) {
case 0:
if (ob->type == OB_MESH) {
me_eval = ob->data;
me_eval = static_cast<Mesh *>(ob->data);
}
break;
case 1:
@@ -766,10 +769,10 @@ void rna_Object_me_eval_info(
}
}
# else
void rna_Object_me_eval_info(struct Object *UNUSED(ob),
bContext *UNUSED(C),
int UNUSED(type),
PointerRNA *UNUSED(rnaptr_depsgraph),
void rna_Object_me_eval_info(struct Object * /*ob*/,
bContext * /*C*/,
int /*type*/,
PointerRNA * /*rnaptr_depsgraph*/,
char *result)
{
result[0] = '\0';
@@ -842,7 +845,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm = RNA_def_pointer(
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
parm = RNA_def_boolean(func, "result", 0, "", "Object selected");
RNA_def_function_return(func, parm);
@@ -851,10 +854,10 @@ void RNA_api_object(StructRNA *srna)
func, "Select or deselect the object. The selection state is per view layer");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
parm = RNA_def_boolean(func, "state", 0, "", "Selection state to define");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_pointer(
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
func = RNA_def_function(srna, "hide_get", "rna_Object_hide_get");
RNA_def_function_ui_description(
@@ -863,7 +866,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm = RNA_def_pointer(
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
parm = RNA_def_boolean(func, "result", 0, "", "Object hidden");
RNA_def_function_return(func, parm);
@@ -872,10 +875,10 @@ void RNA_api_object(StructRNA *srna)
func, "Hide the object for viewport editing. This hiding state is per view layer");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
parm = RNA_def_boolean(func, "state", 0, "", "Hide state to define");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_pointer(
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
func = RNA_def_function(srna, "visible_get", "rna_Object_visible_get");
RNA_def_function_ui_description(func,
@@ -884,7 +887,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm = RNA_def_pointer(
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
parm = RNA_def_pointer(
func, "viewport", "SpaceView3D", "", "Use this instead of the active 3D viewport");
parm = RNA_def_boolean(func, "result", 0, "", "Object visible");
@@ -895,7 +898,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm = RNA_def_pointer(
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
parm = RNA_def_boolean(func, "result", 0, "", "Object holdout");
RNA_def_function_return(func, parm);
@@ -906,7 +909,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm = RNA_def_pointer(
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
parm = RNA_def_boolean(func, "result", 0, "", "Object indirect only");
RNA_def_function_return(func, parm);
@@ -915,7 +918,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_ui_description(func, "Get the local view state for this object");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "viewport", "SpaceView3D", "", "Viewport in local view");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_boolean(func, "result", 0, "", "Object local view state");
RNA_def_function_return(func, parm);
@@ -923,16 +926,16 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_ui_description(func, "Set the local view state for this object");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "viewport", "SpaceView3D", "", "Viewport in local view");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR | PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR | PARM_REQUIRED);
parm = RNA_def_boolean(func, "state", 0, "", "Local view state to define");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* Viewport */
func = RNA_def_function(srna, "visible_in_viewport_get", "rna_Object_visible_in_viewport_get");
RNA_def_function_ui_description(
func, "Check for local view and local collections for this viewport and object");
parm = RNA_def_pointer(func, "viewport", "SpaceView3D", "", "Viewport in local collections");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_boolean(func, "result", 0, "", "Object viewport visibility");
RNA_def_function_return(func, parm);
@@ -975,7 +978,7 @@ void RNA_api_object(StructRNA *srna)
"(mostly useful for Camera and Light types)");
parm = RNA_def_pointer(
func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_property(func, "result", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(parm, "", "The camera projection matrix");
@@ -993,7 +996,7 @@ void RNA_api_object(StructRNA *srna)
"given object should be to 'see' all given coordinates");
parm = RNA_def_pointer(
func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_float_array(func,
"coordinates",
1,
@@ -1008,11 +1011,11 @@ void RNA_api_object(StructRNA *srna)
parm = RNA_def_property(func, "co_return", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(parm, 3);
RNA_def_property_ui_text(parm, "", "The location to aim to be able to see all given points");
RNA_def_parameter_flags(parm, 0, PARM_OUTPUT);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_OUTPUT);
parm = RNA_def_property(func, "scale_return", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(
parm, "", "The ortho scale to aim to be able to see all given points (if relevant)");
RNA_def_parameter_flags(parm, 0, PARM_OUTPUT);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_OUTPUT);
/* Crazy-space access. */
@@ -1025,9 +1028,9 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(
func, "depsgraph", "Depsgraph", "Dependency Graph", "Evaluated dependency graph");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_pointer(func, "scene", "Scene", "Scene", "Scene of the object");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
func = RNA_def_function(srna,
"crazyspace_displacement_to_deformed",
@@ -1036,7 +1039,7 @@ void RNA_api_object(StructRNA *srna)
func, "Convert displacement vector from non-deformed object space to deformed object space");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_property(func, "vertex_index", PROP_INT, PROP_NONE);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_property(func, "displacement", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(parm, 3);
parm = RNA_def_property(func, "displacement_deformed", PROP_FLOAT, PROP_XYZ);
@@ -1050,7 +1053,7 @@ void RNA_api_object(StructRNA *srna)
func, "Convert displacement vector from deformed object space to non-deformed object space");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_property(func, "vertex_index", PROP_INT, PROP_NONE);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_property(func, "displacement", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(parm, 3);
parm = RNA_def_property(func, "displacement_original", PROP_FLOAT, PROP_XYZ);
@@ -1097,7 +1100,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(
func, "depsgraph", "Depsgraph", "Dependency Graph", "Evaluated dependency graph");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
RNA_def_boolean(func,
"apply_modifiers",
false,
@@ -1125,7 +1128,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keyblock"); /* optional */
RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes");
parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "shape_key_remove", "rna_Object_shape_key_remove");
@@ -1133,7 +1136,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "key", "ShapeKey", "", "Keyblock to be removed");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
func = RNA_def_function(srna, "shape_key_clear", "rna_Object_shape_key_clear");
RNA_def_function_ui_description(func, "Remove all Shape Keys from this object");
@@ -1158,7 +1161,7 @@ void RNA_api_object(StructRNA *srna)
"Origin of the ray, in object space",
-1e4,
1e4);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_float_vector(func,
"direction",
3,
@@ -1169,7 +1172,7 @@ void RNA_api_object(StructRNA *srna)
"Direction of the ray, in object space",
-1e4,
1e4);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
RNA_def_float(func,
"distance",
BVH_RAYCAST_DIST_MAX,
@@ -1186,7 +1189,7 @@ void RNA_api_object(StructRNA *srna)
"",
"Depsgraph to use to get evaluated data, when called from original object "
"(only needed if current Context's depsgraph is not suitable)");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
/* return location and normal */
parm = RNA_def_boolean(func, "result", 0, "", "Whether the ray successfully hit the geometry");
@@ -1201,7 +1204,7 @@ void RNA_api_object(StructRNA *srna)
"The hit location of this ray cast",
-1e4,
1e4);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
RNA_def_function_output(func, parm);
parm = RNA_def_float_vector(func,
"normal",
@@ -1213,7 +1216,7 @@ void RNA_api_object(StructRNA *srna)
"The face normal at the ray cast hit location",
-1e4,
1e4);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
RNA_def_function_output(func, parm);
parm = RNA_def_int(
func, "index", 0, 0, 0, "", "The face index, -1 when original data isn't available", 0, 0);
@@ -1238,7 +1241,7 @@ void RNA_api_object(StructRNA *srna)
"Point to find closest geometry from (in object space)",
-1e4,
1e4);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
/* default is sqrt(FLT_MAX) */
RNA_def_float(
func, "distance", 1.844674352395373e+19, 0.0, FLT_MAX, "", "Maximum distance", 0.0, FLT_MAX);
@@ -1249,7 +1252,7 @@ void RNA_api_object(StructRNA *srna)
"",
"Depsgraph to use to get evaluated data, when called from original object "
"(only needed if current Context's depsgraph is not suitable)");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
/* return location and normal */
parm = RNA_def_boolean(func, "result", 0, "", "Whether closest point on geometry was found");
@@ -1264,7 +1267,7 @@ void RNA_api_object(StructRNA *srna)
"The location on the object closest to the point",
-1e4,
1e4);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
RNA_def_function_output(func, parm);
parm = RNA_def_float_vector(func,
"normal",
@@ -1276,7 +1279,7 @@ void RNA_api_object(StructRNA *srna)
"The face normal at the closest point",
-1e4,
1e4);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
RNA_def_function_output(func, parm);
parm = RNA_def_int(
@@ -1292,7 +1295,7 @@ void RNA_api_object(StructRNA *srna)
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene in which to check the object");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_boolean(func, "result", 0, "", "Whether the object is modified");
RNA_def_function_return(func, parm);
@@ -1302,7 +1305,7 @@ void RNA_api_object(StructRNA *srna)
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene in which to check the object");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_boolean(func, "result", 0, "", "Whether the object is deform-modified");
RNA_def_function_return(func, parm);
@@ -1316,7 +1319,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm = RNA_def_enum(func, "type", mesh_dm_info_items, 0, "", "Modifier settings to apply");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
parm = RNA_def_pointer(
func,
"depsgraph",
@@ -1324,10 +1327,11 @@ void RNA_api_object(StructRNA *srna)
"",
"Depsgraph to use to get evaluated data, when called from original object "
"(only needed if current Context's depsgraph is not suitable)");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR);
/* weak!, no way to return dynamic string type */
parm = RNA_def_string(func, "result", NULL, 16384, "", "Requested information");
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); /* needed for string return value */
RNA_def_parameter_flags(
parm, PROP_THICK_WRAP, ParameterFlag(0)); /* needed for string return value */
RNA_def_function_output(func, parm);
# endif /* NDEBUG */