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:
parent
cfede90082
commit
f3dd63e25c
@ -30,9 +30,9 @@ set(DEFSRC
|
|||||||
rna_color.c
|
rna_color.c
|
||||||
rna_constraint.c
|
rna_constraint.c
|
||||||
rna_context.c
|
rna_context.c
|
||||||
rna_curve.c
|
rna_curve.cc
|
||||||
rna_curveprofile.c
|
rna_curveprofile.c
|
||||||
rna_curves.c
|
rna_curves.cc
|
||||||
rna_depsgraph.c
|
rna_depsgraph.c
|
||||||
rna_dynamicpaint.c
|
rna_dynamicpaint.c
|
||||||
rna_fcurve.c
|
rna_fcurve.c
|
||||||
@ -54,8 +54,8 @@ set(DEFSRC
|
|||||||
rna_modifier.c
|
rna_modifier.c
|
||||||
rna_movieclip.c
|
rna_movieclip.c
|
||||||
rna_nla.c
|
rna_nla.c
|
||||||
rna_nodetree.c
|
rna_nodetree.cc
|
||||||
rna_object.c
|
rna_object.cc
|
||||||
rna_object_force.c
|
rna_object_force.c
|
||||||
rna_packedfile.c
|
rna_packedfile.c
|
||||||
rna_palette.c
|
rna_palette.c
|
||||||
@ -103,7 +103,7 @@ set(APISRC
|
|||||||
rna_animation_api.c
|
rna_animation_api.c
|
||||||
rna_armature_api.c
|
rna_armature_api.c
|
||||||
rna_camera_api.c
|
rna_camera_api.c
|
||||||
rna_curve_api.c
|
rna_curve_api.cc
|
||||||
rna_fcurve_api.c
|
rna_fcurve_api.c
|
||||||
rna_image_api.c
|
rna_image_api.c
|
||||||
rna_lattice_api.cc
|
rna_lattice_api.cc
|
||||||
@ -111,7 +111,7 @@ set(APISRC
|
|||||||
rna_material_api.c
|
rna_material_api.c
|
||||||
rna_mesh_api.cc
|
rna_mesh_api.cc
|
||||||
rna_meta_api.c
|
rna_meta_api.c
|
||||||
rna_object_api.c
|
rna_object_api.cc
|
||||||
rna_pose_api.c
|
rna_pose_api.c
|
||||||
rna_scene_api.c
|
rna_scene_api.c
|
||||||
rna_sequencer_api.c
|
rna_sequencer_api.c
|
||||||
|
@ -4546,12 +4546,12 @@ static RNAProcessItem PROCESS_ITEMS[] = {
|
|||||||
{"rna_color.c", NULL, RNA_def_color},
|
{"rna_color.c", NULL, RNA_def_color},
|
||||||
{"rna_constraint.c", NULL, RNA_def_constraint},
|
{"rna_constraint.c", NULL, RNA_def_constraint},
|
||||||
{"rna_context.c", NULL, RNA_def_context},
|
{"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_dynamicpaint.c", NULL, RNA_def_dynamic_paint},
|
||||||
{"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve},
|
{"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve},
|
||||||
{"rna_gpencil_legacy.c", NULL, RNA_def_gpencil},
|
{"rna_gpencil_legacy.c", NULL, RNA_def_gpencil},
|
||||||
{"rna_grease_pencil.c", NULL, RNA_def_grease_pencil},
|
{"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_image.c", "rna_image_api.c", RNA_def_image},
|
||||||
{"rna_key.c", NULL, RNA_def_key},
|
{"rna_key.c", NULL, RNA_def_key},
|
||||||
{"rna_light.c", NULL, RNA_def_light},
|
{"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_gpencil_legacy_modifier.c", NULL, RNA_def_greasepencil_modifier},
|
||||||
{"rna_shader_fx.c", NULL, RNA_def_shader_fx},
|
{"rna_shader_fx.c", NULL, RNA_def_shader_fx},
|
||||||
{"rna_nla.c", NULL, RNA_def_nla},
|
{"rna_nla.c", NULL, RNA_def_nla},
|
||||||
{"rna_nodetree.c", NULL, RNA_def_nodetree},
|
{"rna_nodetree.cc", NULL, RNA_def_nodetree},
|
||||||
{"rna_object.c", "rna_object_api.c", RNA_def_object},
|
{"rna_object.cc", "rna_object_api.cc", RNA_def_object},
|
||||||
{"rna_object_force.c", NULL, RNA_def_object_force},
|
{"rna_object_force.c", NULL, RNA_def_object_force},
|
||||||
{"rna_depsgraph.c", NULL, RNA_def_depsgraph},
|
{"rna_depsgraph.c", NULL, RNA_def_depsgraph},
|
||||||
{"rna_packedfile.c", NULL, RNA_def_packedfile},
|
{"rna_packedfile.c", NULL, RNA_def_packedfile},
|
||||||
|
@ -10,16 +10,13 @@
|
|||||||
|
|
||||||
#include "DNA_curve_types.h"
|
#include "DNA_curve_types.h"
|
||||||
#include "DNA_key_types.h"
|
#include "DNA_key_types.h"
|
||||||
#include "DNA_material_types.h"
|
|
||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
|
|
||||||
#include "BLI_math.h"
|
#include "BLI_math_rotation.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
|
|
||||||
#include "BLT_translation.h"
|
#include "BLT_translation.h"
|
||||||
|
|
||||||
#include "BKE_vfont.h"
|
|
||||||
|
|
||||||
#include "RNA_access.h"
|
#include "RNA_access.h"
|
||||||
#include "RNA_define.h"
|
#include "RNA_define.h"
|
||||||
#include "RNA_enum_types.h"
|
#include "RNA_enum_types.h"
|
||||||
@ -154,9 +151,12 @@ static const EnumPropertyItem curve2d_fill_mode_items[] = {
|
|||||||
|
|
||||||
# include "DNA_object_types.h"
|
# include "DNA_object_types.h"
|
||||||
|
|
||||||
|
# include "BLI_math.h"
|
||||||
|
|
||||||
# include "BKE_curve.h"
|
# include "BKE_curve.h"
|
||||||
# include "BKE_curveprofile.h"
|
# include "BKE_curveprofile.h"
|
||||||
# include "BKE_main.h"
|
# include "BKE_main.h"
|
||||||
|
# include "BKE_vfont.h"
|
||||||
|
|
||||||
# include "DEG_depsgraph.h"
|
# include "DEG_depsgraph.h"
|
||||||
# include "DEG_depsgraph_build.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;
|
Nurb *nu;
|
||||||
int i = 0;
|
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 (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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,10 +197,10 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
|
|||||||
|
|
||||||
if (pt_index) {
|
if (pt_index) {
|
||||||
if (nu->type == CU_BEZIER) {
|
if (nu->type == CU_BEZIER) {
|
||||||
*pt_index = (int)((BezTriple *)point - nu->bezt);
|
*pt_index = int(static_cast<const BezTriple *>(point) - nu->bezt);
|
||||||
}
|
}
|
||||||
else {
|
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)
|
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);
|
short obtype = BKE_curve_type_get(cu);
|
||||||
|
|
||||||
if (obtype == OB_FONT) {
|
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)
|
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]);
|
copy_v3_v3(values, bezt->vec[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
|
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);
|
copy_v3_v3(bezt->vec[0], values);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *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]);
|
copy_v3_v3(values, bezt->vec[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
|
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);
|
copy_v3_v3(bezt->vec[2], values);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *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]);
|
copy_v3_v3(values, bezt->vec[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
|
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);
|
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) {
|
if (cu->texspace_flag & CU_TEXSPACE_FLAG_AUTO) {
|
||||||
BKE_curve_texspace_calc(cu);
|
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;
|
return (cu->texspace_flag & CU_TEXSPACE_FLAG_AUTO) ? 0 : PROP_EDITABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Curve_texspace_location_get(PointerRNA *ptr, float *values)
|
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);
|
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)
|
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);
|
copy_v3_v3(cu->texspace_location, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *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);
|
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)
|
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);
|
copy_v3_v3(cu->texspace_size, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Curve_material_index_range(
|
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;
|
*min = 0;
|
||||||
*max = max_ii(0, cu->totcol - 1);
|
*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 */
|
/* simply offset by don't expose -1 */
|
||||||
static int rna_ChariInfo_material_index_get(PointerRNA *ptr)
|
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;
|
return info->mat_nr ? info->mat_nr - 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_ChariInfo_material_index_set(PointerRNA *ptr, int value)
|
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;
|
info->mat_nr = value + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Curve_active_textbox_index_range(
|
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;
|
*min = 0;
|
||||||
*max = max_ii(0, cu->totbox - 1);
|
*max = max_ii(0, cu->totbox - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
|
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) {
|
if (value == CU_3D) {
|
||||||
cu->flag |= 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,
|
PointerRNA *ptr,
|
||||||
PropertyRNA *UNUSED(prop),
|
PropertyRNA * /*prop*/,
|
||||||
bool *UNUSED(r_free))
|
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 */
|
/* cast to quiet warning it IS a const still */
|
||||||
return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items :
|
return static_cast<const EnumPropertyItem *>((cu->flag & CU_3D) ? curve3d_fill_mode_items :
|
||||||
curve2d_fill_mode_items);
|
curve2d_fill_mode_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rna_Nurb_length(PointerRNA *ptr)
|
static int rna_Nurb_length(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Nurb *nu = (Nurb *)ptr->data;
|
Nurb *nu = static_cast<Nurb *>(ptr->data);
|
||||||
if (nu->type == CU_BEZIER) {
|
if (nu->type == CU_BEZIER) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -368,8 +371,8 @@ static int rna_Nurb_length(PointerRNA *ptr)
|
|||||||
|
|
||||||
static void rna_Nurb_type_set(PointerRNA *ptr, int value)
|
static void rna_Nurb_type_set(PointerRNA *ptr, int value)
|
||||||
{
|
{
|
||||||
Curve *cu = (Curve *)ptr->owner_id;
|
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
|
||||||
Nurb *nu = (Nurb *)ptr->data;
|
Nurb *nu = static_cast<Nurb *>(ptr->data);
|
||||||
const int pntsu_prev = nu->pntsu;
|
const int pntsu_prev = nu->pntsu;
|
||||||
|
|
||||||
if (BKE_nurb_type_convert(nu, value, true, NULL)) {
|
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)
|
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,
|
rna_iterator_array_begin(iter,
|
||||||
(void *)nu->bp,
|
static_cast<void *>(nu->bp),
|
||||||
sizeof(BPoint),
|
sizeof(BPoint),
|
||||||
nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu,
|
nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu,
|
||||||
0,
|
0,
|
||||||
NULL);
|
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);
|
DEG_id_tag_update(id, 0);
|
||||||
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
|
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)
|
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);
|
Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL);
|
||||||
|
|
||||||
if (nu) {
|
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)
|
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;
|
Object *ob = cu->bevobj;
|
||||||
|
|
||||||
if (ob) {
|
if (ob) {
|
||||||
@ -433,17 +436,17 @@ static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
|
|||||||
|
|
||||||
static void rna_Curve_bevelObject_set(PointerRNA *ptr,
|
static void rna_Curve_bevelObject_set(PointerRNA *ptr,
|
||||||
PointerRNA value,
|
PointerRNA value,
|
||||||
struct ReportList *UNUSED(reports))
|
struct ReportList * /*reports*/)
|
||||||
{
|
{
|
||||||
Curve *cu = (Curve *)ptr->owner_id;
|
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
|
||||||
Object *ob = (Object *)value.data;
|
Object *ob = static_cast<Object *>(value.data);
|
||||||
|
|
||||||
if (ob) {
|
if (ob) {
|
||||||
/* If bevel object has got the save curve, as object, for which it's set as bevobj,
|
/* 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. */
|
* there could be an infinite loop in curve evaluation. */
|
||||||
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
|
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
|
||||||
cu->bevobj = ob;
|
cu->bevobj = ob;
|
||||||
id_lib_extern((ID *)ob);
|
id_lib_extern(&ob->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
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) {
|
if (cu->bevel_mode == CU_BEV_MODE_CURVE_PROFILE) {
|
||||||
BKE_curveprofile_init(cu->bevel_profile, cu->bevresol + 1);
|
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)
|
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 (value == CU_BEV_MODE_CURVE_PROFILE) {
|
||||||
if (cu->bevel_profile == NULL) {
|
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)
|
static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
|
||||||
{
|
{
|
||||||
Curve *cu = (Curve *)ptr->owner_id;
|
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
|
||||||
Object *ob = (Object *)value.data;
|
Object *ob = static_cast<Object *>(value.data);
|
||||||
|
|
||||||
if (ob) {
|
if (ob) {
|
||||||
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
|
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)
|
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;
|
Object *ob = cu->taperobj;
|
||||||
|
|
||||||
if (ob) {
|
if (ob) {
|
||||||
@ -508,17 +511,17 @@ static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
|
|||||||
|
|
||||||
static void rna_Curve_taperObject_set(PointerRNA *ptr,
|
static void rna_Curve_taperObject_set(PointerRNA *ptr,
|
||||||
PointerRNA value,
|
PointerRNA value,
|
||||||
struct ReportList *UNUSED(reports))
|
struct ReportList * /*reports*/)
|
||||||
{
|
{
|
||||||
Curve *cu = (Curve *)ptr->owner_id;
|
Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
|
||||||
Object *ob = (Object *)value.data;
|
Object *ob = static_cast<Object *>(value.data);
|
||||||
|
|
||||||
if (ob) {
|
if (ob) {
|
||||||
/* If taper object has got the save curve, as object, for which it's set as bevobj,
|
/* 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. */
|
* there could be an infinite loop in curve evaluation. */
|
||||||
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
|
if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
|
||||||
cu->taperobj = ob;
|
cu->taperobj = ob;
|
||||||
id_lib_extern((ID *)ob);
|
id_lib_extern(&ob->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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)
|
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 *nurbs = BKE_curve_nurbs_get(cu);
|
||||||
|
|
||||||
LISTBASE_FOREACH (Nurb *, nu, nurbs) {
|
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)
|
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 *nurbs = BKE_curve_nurbs_get(cu);
|
||||||
|
|
||||||
LISTBASE_FOREACH (Nurb *, nu, nurbs) {
|
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)
|
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;
|
return cu->offset - 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Curve_offset_set(PointerRNA *ptr, float value)
|
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;
|
cu->offset = 1.0f + value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rna_Curve_body_length(PointerRNA *ptr);
|
static int rna_Curve_body_length(PointerRNA *ptr);
|
||||||
static void rna_Curve_body_get(PointerRNA *ptr, char *value)
|
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);
|
memcpy(value, cu->str, rna_Curve_body_length(ptr) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rna_Curve_body_length(PointerRNA *ptr)
|
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;
|
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_bytes;
|
||||||
size_t len_chars = BLI_strlen_utf8_ex(value, &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_char32 = len_chars;
|
||||||
cu->len = len_bytes;
|
cu->len = len_bytes;
|
||||||
@ -594,15 +597,16 @@ static void rna_Curve_body_set(PointerRNA *ptr, const char *value)
|
|||||||
MEM_freeN(cu->strinfo);
|
MEM_freeN(cu->strinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
cu->str = MEM_mallocN(len_bytes + sizeof(char32_t), "str");
|
cu->str = static_cast<char *>(MEM_mallocN(len_bytes + sizeof(char32_t), "str"));
|
||||||
cu->strinfo = MEM_callocN((len_chars + 4) * sizeof(CharInfo), "strinfo");
|
cu->strinfo = static_cast<CharInfo *>(
|
||||||
|
MEM_callocN((len_chars + 4) * sizeof(CharInfo), "strinfo"));
|
||||||
|
|
||||||
memcpy(cu->str, value, len_bytes + 1);
|
memcpy(cu->str, value, len_bytes + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
|
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) {
|
if (nu->type == CU_BEZIER) {
|
||||||
BKE_nurb_handles_calc(nu);
|
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)
|
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);
|
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)
|
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_order_clamp_u(nu);
|
||||||
BKE_nurb_knot_calc_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)
|
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_order_clamp_v(nu);
|
||||||
BKE_nurb_knot_calc_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)
|
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) {
|
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;
|
bezt->radius = 1.0;
|
||||||
nu->bezt = bezt;
|
nu->bezt = bezt;
|
||||||
}
|
}
|
||||||
else {
|
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;
|
bp->radius = 1.0f;
|
||||||
nu->bp = bp;
|
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)
|
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);
|
ListBase *nurbs = BKE_curve_nurbs_get(cu);
|
||||||
|
|
||||||
if (BLI_remlink_safe(nurbs, nu) == false) {
|
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)
|
static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Curve *cu = (Curve *)ptr->data;
|
Curve *cu = static_cast<Curve *>(ptr->data);
|
||||||
Nurb *nu;
|
Nurb *nu;
|
||||||
ListBase *nurbs = BKE_curve_nurbs_get(cu);
|
ListBase *nurbs = BKE_curve_nurbs_get(cu);
|
||||||
|
|
||||||
/* For curve outside editmode will set to -1,
|
/* For curve outside editmode will set to -1,
|
||||||
* should be changed to be allowed outside of editmode. */
|
* 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) {
|
if (nu) {
|
||||||
return rna_pointer_inherit_refine(ptr, &RNA_Spline, 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,
|
static void rna_Curve_active_spline_set(PointerRNA *ptr,
|
||||||
PointerRNA value,
|
PointerRNA value,
|
||||||
struct ReportList *UNUSED(reports))
|
struct ReportList * /*reports*/)
|
||||||
{
|
{
|
||||||
Curve *cu = (Curve *)ptr->data;
|
Curve *cu = static_cast<Curve *>(ptr->data);
|
||||||
Nurb *nu = value.data;
|
Nurb *nu = static_cast<Nurb *>(value.data);
|
||||||
ListBase *nubase = BKE_curve_nurbs_get(cu);
|
ListBase *nubase = BKE_curve_nurbs_get(cu);
|
||||||
|
|
||||||
/* -1 is ok for an unset index */
|
/* -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)
|
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);
|
ListBase *nubase = BKE_curve_nurbs_get(cu);
|
||||||
Nurb *nu = ptr->data;
|
Nurb *nu = static_cast<Nurb *>(ptr->data);
|
||||||
int index = BLI_findindex(nubase, nu);
|
int index = BLI_findindex(nubase, nu);
|
||||||
|
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
@ -788,7 +792,7 @@ static char *rna_Curve_spline_path(const PointerRNA *ptr)
|
|||||||
/* use for both bezier and nurbs */
|
/* use for both bezier and nurbs */
|
||||||
static char *rna_Curve_spline_point_path(const PointerRNA *ptr)
|
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;
|
Nurb *nu;
|
||||||
void *point = ptr->data;
|
void *point = ptr->data;
|
||||||
int nu_index, pt_index;
|
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)
|
static char *rna_TextBox_path(const PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
const Curve *cu = (Curve *)ptr->owner_id;
|
const Curve *cu = reinterpret_cast<Curve *>(ptr->owner_id);
|
||||||
const TextBox *tb = ptr->data;
|
const TextBox *tb = static_cast<TextBox *>(ptr->data);
|
||||||
int index = (int)(tb - cu->tb);
|
int index = int(tb - cu->tb);
|
||||||
|
|
||||||
if (index >= 0 && index < cu->totbox) {
|
if (index >= 0 && index < cu->totbox) {
|
||||||
return BLI_sprintfN("text_boxes[%d]", index);
|
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)
|
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);
|
rna_iterator_listbase_begin(iter, BKE_curve_nurbs_get(cu), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool rna_Curve_is_editmode_get(PointerRNA *ptr)
|
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);
|
const short type = BKE_curve_type_get(cu);
|
||||||
if (type == OB_FONT) {
|
if (type == OB_FONT) {
|
||||||
return (cu->editfont != NULL);
|
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)
|
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)
|
if (cu->editfont != NULL)
|
||||||
return (cu->editfont->selboxes != NULL);
|
return (cu->editfont->selboxes != NULL);
|
||||||
else
|
else
|
||||||
@ -998,7 +1002,7 @@ static void rna_def_beztriple(BlenderRNA *brna)
|
|||||||
RNA_def_struct_path_func(srna, "rna_Curve_spline_point_path");
|
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;
|
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");
|
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. */
|
/* Nothing. */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
|
static void rna_def_font(BlenderRNA * /*brna*/, StructRNA *srna)
|
||||||
{
|
{
|
||||||
PropertyRNA *prop;
|
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);
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_int(
|
parm = RNA_def_int(
|
||||||
func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
|
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
|
# if 0
|
||||||
func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
|
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);
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_int(
|
parm = RNA_def_int(
|
||||||
func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
|
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
|
# if 0
|
||||||
func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
|
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");
|
func = RNA_def_function(srna, "new", "rna_Curve_spline_new");
|
||||||
RNA_def_function_ui_description(func, "Add a new spline to the curve");
|
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");
|
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");
|
parm = RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
|
||||||
RNA_def_function_return(func, parm);
|
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);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
|
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_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");
|
func = RNA_def_function(srna, "clear", "rna_Curve_spline_clear");
|
||||||
RNA_def_function_ui_description(func, "Remove all splines from a curve");
|
RNA_def_function_ui_description(func, "Remove all splines from a curve");
|
@ -77,7 +77,7 @@ void RNA_api_curve(StructRNA *srna)
|
|||||||
func = RNA_def_function(srna, "transform", "rna_Curve_transform");
|
func = RNA_def_function(srna, "transform", "rna_Curve_transform");
|
||||||
RNA_def_function_ui_description(func, "Transform curve by a matrix");
|
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);
|
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");
|
RNA_def_boolean(func, "shape_keys", 0, "", "Transform Shape Keys");
|
||||||
|
|
||||||
func = RNA_def_function(srna, "validate_material_indices", "BKE_curve_material_index_validate");
|
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");
|
RNA_def_function_ui_description(func, "Return the message");
|
||||||
parm = RNA_def_int(
|
parm = RNA_def_int(
|
||||||
func, "direction", 0, 0, 1, "Direction", "The direction where 0-1 maps to U-V", 0, 1);
|
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 */
|
/* return value */
|
||||||
parm = RNA_def_string(func,
|
parm = RNA_def_string(func,
|
||||||
"result",
|
"result",
|
@ -15,9 +15,6 @@
|
|||||||
|
|
||||||
#include "DNA_curves_types.h"
|
#include "DNA_curves_types.h"
|
||||||
|
|
||||||
#include "BLI_math_base.h"
|
|
||||||
#include "BLI_string.h"
|
|
||||||
|
|
||||||
#include "WM_types.h"
|
#include "WM_types.h"
|
||||||
|
|
||||||
const EnumPropertyItem rna_enum_curves_types[] = {
|
const EnumPropertyItem rna_enum_curves_types[] = {
|
||||||
@ -59,7 +56,7 @@ const EnumPropertyItem rna_enum_curve_normal_modes[] = {
|
|||||||
|
|
||||||
static Curves *rna_curves(const PointerRNA *ptr)
|
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)
|
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)
|
static int rna_CurvePoint_index_get_const(const PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
const Curves *curves = rna_curves(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);
|
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)
|
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])
|
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])
|
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)
|
static float rna_CurvePoint_radius_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
const Curves *curves = rna_curves(ptr);
|
const Curves *curves = rna_curves(ptr);
|
||||||
const float *radii = (const float *)CustomData_get_layer_named(
|
const float *radii = static_cast<const float *>(
|
||||||
&curves->geometry.point_data, CD_PROP_FLOAT, "radius");
|
CustomData_get_layer_named(&curves->geometry.point_data, CD_PROP_FLOAT, "radius"));
|
||||||
if (radii == NULL) {
|
if (radii == NULL) {
|
||||||
return 0.0f;
|
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)
|
static void rna_CurvePoint_radius_set(PointerRNA *ptr, float value)
|
||||||
{
|
{
|
||||||
Curves *curves = rna_curves(ptr);
|
Curves *curves = rna_curves(ptr);
|
||||||
float *radii = (float *)CustomData_get_layer_named_for_write(
|
float *radii = static_cast<float *>(CustomData_get_layer_named_for_write(
|
||||||
&curves->geometry.point_data, CD_PROP_FLOAT, "radius", curves->geometry.point_num);
|
&curves->geometry.point_data, CD_PROP_FLOAT, "radius", curves->geometry.point_num));
|
||||||
if (radii == NULL) {
|
if (radii == NULL) {
|
||||||
return;
|
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)
|
static int rna_CurveSlice_index_get_const(const PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Curves *curves = rna_curves(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)
|
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)
|
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;
|
return *offset_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rna_CurveSlice_points_length_get(PointerRNA *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;
|
const int offset = *offset_ptr;
|
||||||
return *(offset_ptr + 1) - offset;
|
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);
|
rna_iterator_array_begin(iter, positions, sizeof(float[3]), size, true, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Curves_update_data(struct Main *UNUSED(bmain),
|
static void rna_Curves_update_data(struct Main * /*bmain*/,
|
||||||
struct Scene *UNUSED(scene),
|
struct Scene * /*scene*/,
|
||||||
PointerRNA *ptr)
|
PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
ID *id = ptr->owner_id;
|
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;
|
ID *id = ptr->owner_id;
|
||||||
/* Avoid updates for importers creating curves. */
|
/* Avoid updates for importers creating curves. */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
102
source/blender/makesrna/intern/rna_object_api.c → source/blender/makesrna/intern/rna_object_api.cc
102
source/blender/makesrna/intern/rna_object_api.c → source/blender/makesrna/intern/rna_object_api.cc
@ -86,7 +86,7 @@ static Base *find_view_layer_base_with_synced_ensure(
|
|||||||
ViewLayer *view_layer;
|
ViewLayer *view_layer;
|
||||||
if (view_layer_ptr->data) {
|
if (view_layer_ptr->data) {
|
||||||
scene = (Scene *)view_layer_ptr->owner_id;
|
scene = (Scene *)view_layer_ptr->owner_id;
|
||||||
view_layer = view_layer_ptr->data;
|
view_layer = static_cast<ViewLayer *>(view_layer_ptr->data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scene = CTX_data_scene(C);
|
scene = CTX_data_scene(C);
|
||||||
@ -228,7 +228,7 @@ static Base *rna_Object_local_view_property_helper(bScreen *screen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (view_layer == NULL) {
|
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);
|
view_layer = WM_window_get_active_view_layer(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ static void rna_Object_local_view_set(Object *ob,
|
|||||||
bool state)
|
bool state)
|
||||||
{
|
{
|
||||||
bScreen *screen = (bScreen *)v3d_ptr->owner_id;
|
bScreen *screen = (bScreen *)v3d_ptr->owner_id;
|
||||||
View3D *v3d = v3d_ptr->data;
|
View3D *v3d = static_cast<View3D *>(v3d_ptr->data);
|
||||||
Scene *scene;
|
Scene *scene;
|
||||||
Base *base = rna_Object_local_view_property_helper(screen, v3d, NULL, ob, reports, &scene);
|
Base *base = rna_Object_local_view_property_helper(screen, v3d, NULL, ob, reports, &scene);
|
||||||
if (base == NULL) {
|
if (base == NULL) {
|
||||||
@ -482,7 +482,7 @@ static void rna_Object_shape_key_remove(Object *ob,
|
|||||||
ReportList *reports,
|
ReportList *reports,
|
||||||
PointerRNA *kb_ptr)
|
PointerRNA *kb_ptr)
|
||||||
{
|
{
|
||||||
KeyBlock *kb = kb_ptr->data;
|
KeyBlock *kb = static_cast<KeyBlock *>(kb_ptr->data);
|
||||||
Key *key = BKE_key_from_object(ob);
|
Key *key = BKE_key_from_object(ob);
|
||||||
|
|
||||||
if ((key == NULL) || BLI_findindex(&key->block, kb) == -1) {
|
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 *looptri_polys = BKE_mesh_runtime_looptri_polys_ensure(me_eval);
|
||||||
const int poly_i = looptri_polys[tri_index];
|
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;
|
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) {
|
if (ob->runtime.data_eval == NULL) {
|
||||||
Object *ob_orig = ob;
|
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) {
|
if (depsgraph == NULL) {
|
||||||
depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||||
}
|
}
|
||||||
@ -746,7 +749,7 @@ void rna_Object_me_eval_info(
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 0:
|
||||||
if (ob->type == OB_MESH) {
|
if (ob->type == OB_MESH) {
|
||||||
me_eval = ob->data;
|
me_eval = static_cast<Mesh *>(ob->data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -766,10 +769,10 @@ void rna_Object_me_eval_info(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
void rna_Object_me_eval_info(struct Object *UNUSED(ob),
|
void rna_Object_me_eval_info(struct Object * /*ob*/,
|
||||||
bContext *UNUSED(C),
|
bContext * /*C*/,
|
||||||
int UNUSED(type),
|
int /*type*/,
|
||||||
PointerRNA *UNUSED(rnaptr_depsgraph),
|
PointerRNA * /*rnaptr_depsgraph*/,
|
||||||
char *result)
|
char *result)
|
||||||
{
|
{
|
||||||
result[0] = '\0';
|
result[0] = '\0';
|
||||||
@ -842,7 +845,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Object selected");
|
||||||
RNA_def_function_return(func, parm);
|
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");
|
func, "Select or deselect the object. The selection state is per view layer");
|
||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_boolean(func, "state", 0, "", "Selection state to define");
|
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(
|
parm = RNA_def_pointer(
|
||||||
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
|
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");
|
func = RNA_def_function(srna, "hide_get", "rna_Object_hide_get");
|
||||||
RNA_def_function_ui_description(
|
RNA_def_function_ui_description(
|
||||||
@ -863,7 +866,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Object hidden");
|
||||||
RNA_def_function_return(func, parm);
|
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");
|
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);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_boolean(func, "state", 0, "", "Hide state to define");
|
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(
|
parm = RNA_def_pointer(
|
||||||
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
|
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");
|
func = RNA_def_function(srna, "visible_get", "rna_Object_visible_get");
|
||||||
RNA_def_function_ui_description(func,
|
RNA_def_function_ui_description(func,
|
||||||
@ -884,7 +887,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
|
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(
|
parm = RNA_def_pointer(
|
||||||
func, "viewport", "SpaceView3D", "", "Use this instead of the active 3D viewport");
|
func, "viewport", "SpaceView3D", "", "Use this instead of the active 3D viewport");
|
||||||
parm = RNA_def_boolean(func, "result", 0, "", "Object visible");
|
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);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Object holdout");
|
||||||
RNA_def_function_return(func, parm);
|
RNA_def_function_return(func, parm);
|
||||||
|
|
||||||
@ -906,7 +909,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "view_layer", "ViewLayer", "", "Use this instead of the active view layer");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Object indirect only");
|
||||||
RNA_def_function_return(func, parm);
|
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_ui_description(func, "Get the local view state for this object");
|
||||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_pointer(func, "viewport", "SpaceView3D", "", "Viewport in local view");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Object local view state");
|
||||||
RNA_def_function_return(func, parm);
|
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_ui_description(func, "Set the local view state for this object");
|
||||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_pointer(func, "viewport", "SpaceView3D", "", "Viewport in local view");
|
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");
|
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 */
|
/* Viewport */
|
||||||
func = RNA_def_function(srna, "visible_in_viewport_get", "rna_Object_visible_in_viewport_get");
|
func = RNA_def_function(srna, "visible_in_viewport_get", "rna_Object_visible_in_viewport_get");
|
||||||
RNA_def_function_ui_description(
|
RNA_def_function_ui_description(
|
||||||
func, "Check for local view and local collections for this viewport and object");
|
func, "Check for local view and local collections for this viewport and object");
|
||||||
parm = RNA_def_pointer(func, "viewport", "SpaceView3D", "", "Viewport in local collections");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Object viewport visibility");
|
||||||
RNA_def_function_return(func, parm);
|
RNA_def_function_return(func, parm);
|
||||||
|
|
||||||
@ -975,7 +978,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
"(mostly useful for Camera and Light types)");
|
"(mostly useful for Camera and Light types)");
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from");
|
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);
|
parm = RNA_def_property(func, "result", PROP_FLOAT, PROP_MATRIX);
|
||||||
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
|
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
|
||||||
RNA_def_property_ui_text(parm, "", "The camera projection matrix");
|
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");
|
"given object should be to 'see' all given coordinates");
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from");
|
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,
|
parm = RNA_def_float_array(func,
|
||||||
"coordinates",
|
"coordinates",
|
||||||
1,
|
1,
|
||||||
@ -1008,11 +1011,11 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
parm = RNA_def_property(func, "co_return", PROP_FLOAT, PROP_XYZ);
|
parm = RNA_def_property(func, "co_return", PROP_FLOAT, PROP_XYZ);
|
||||||
RNA_def_property_array(parm, 3);
|
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_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);
|
parm = RNA_def_property(func, "scale_return", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
parm, "", "The ortho scale to aim to be able to see all given points (if relevant)");
|
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. */
|
/* Crazy-space access. */
|
||||||
|
|
||||||
@ -1025,9 +1028,9 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "depsgraph", "Depsgraph", "Dependency Graph", "Evaluated dependency graph");
|
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");
|
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,
|
func = RNA_def_function(srna,
|
||||||
"crazyspace_displacement_to_deformed",
|
"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");
|
func, "Convert displacement vector from non-deformed object space to deformed object space");
|
||||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
RNA_def_property(func, "vertex_index", PROP_INT, PROP_NONE);
|
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);
|
parm = RNA_def_property(func, "displacement", PROP_FLOAT, PROP_XYZ);
|
||||||
RNA_def_property_array(parm, 3);
|
RNA_def_property_array(parm, 3);
|
||||||
parm = RNA_def_property(func, "displacement_deformed", PROP_FLOAT, PROP_XYZ);
|
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");
|
func, "Convert displacement vector from deformed object space to non-deformed object space");
|
||||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
RNA_def_property(func, "vertex_index", PROP_INT, PROP_NONE);
|
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);
|
parm = RNA_def_property(func, "displacement", PROP_FLOAT, PROP_XYZ);
|
||||||
RNA_def_property_array(parm, 3);
|
RNA_def_property_array(parm, 3);
|
||||||
parm = RNA_def_property(func, "displacement_original", PROP_FLOAT, PROP_XYZ);
|
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);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_pointer(
|
parm = RNA_def_pointer(
|
||||||
func, "depsgraph", "Depsgraph", "Dependency Graph", "Evaluated dependency graph");
|
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,
|
RNA_def_boolean(func,
|
||||||
"apply_modifiers",
|
"apply_modifiers",
|
||||||
false,
|
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_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");
|
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");
|
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);
|
RNA_def_function_return(func, parm);
|
||||||
|
|
||||||
func = RNA_def_function(srna, "shape_key_remove", "rna_Object_shape_key_remove");
|
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);
|
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS);
|
||||||
parm = RNA_def_pointer(func, "key", "ShapeKey", "", "Keyblock to be removed");
|
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_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");
|
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");
|
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",
|
"Origin of the ray, in object space",
|
||||||
-1e4,
|
-1e4,
|
||||||
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,
|
parm = RNA_def_float_vector(func,
|
||||||
"direction",
|
"direction",
|
||||||
3,
|
3,
|
||||||
@ -1169,7 +1172,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
"Direction of the ray, in object space",
|
"Direction of the ray, in object space",
|
||||||
-1e4,
|
-1e4,
|
||||||
1e4);
|
1e4);
|
||||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
|
||||||
RNA_def_float(func,
|
RNA_def_float(func,
|
||||||
"distance",
|
"distance",
|
||||||
BVH_RAYCAST_DIST_MAX,
|
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 "
|
"Depsgraph to use to get evaluated data, when called from original object "
|
||||||
"(only needed if current Context's depsgraph is not suitable)");
|
"(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 */
|
/* return location and normal */
|
||||||
parm = RNA_def_boolean(func, "result", 0, "", "Whether the ray successfully hit the geometry");
|
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",
|
"The hit location of this ray cast",
|
||||||
-1e4,
|
-1e4,
|
||||||
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);
|
RNA_def_function_output(func, parm);
|
||||||
parm = RNA_def_float_vector(func,
|
parm = RNA_def_float_vector(func,
|
||||||
"normal",
|
"normal",
|
||||||
@ -1213,7 +1216,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
"The face normal at the ray cast hit location",
|
"The face normal at the ray cast hit location",
|
||||||
-1e4,
|
-1e4,
|
||||||
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);
|
RNA_def_function_output(func, parm);
|
||||||
parm = RNA_def_int(
|
parm = RNA_def_int(
|
||||||
func, "index", 0, 0, 0, "", "The face index, -1 when original data isn't available", 0, 0);
|
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)",
|
"Point to find closest geometry from (in object space)",
|
||||||
-1e4,
|
-1e4,
|
||||||
1e4);
|
1e4);
|
||||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
|
||||||
/* default is sqrt(FLT_MAX) */
|
/* default is sqrt(FLT_MAX) */
|
||||||
RNA_def_float(
|
RNA_def_float(
|
||||||
func, "distance", 1.844674352395373e+19, 0.0, FLT_MAX, "", "Maximum distance", 0.0, FLT_MAX);
|
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 "
|
"Depsgraph to use to get evaluated data, when called from original object "
|
||||||
"(only needed if current Context's depsgraph is not suitable)");
|
"(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 */
|
/* return location and normal */
|
||||||
parm = RNA_def_boolean(func, "result", 0, "", "Whether closest point on geometry was found");
|
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",
|
"The location on the object closest to the point",
|
||||||
-1e4,
|
-1e4,
|
||||||
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);
|
RNA_def_function_output(func, parm);
|
||||||
parm = RNA_def_float_vector(func,
|
parm = RNA_def_float_vector(func,
|
||||||
"normal",
|
"normal",
|
||||||
@ -1276,7 +1279,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
"The face normal at the closest point",
|
"The face normal at the closest point",
|
||||||
-1e4,
|
-1e4,
|
||||||
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);
|
RNA_def_function_output(func, parm);
|
||||||
|
|
||||||
parm = RNA_def_int(
|
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");
|
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene in which to check the object");
|
||||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
|
||||||
parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Whether the object is modified");
|
||||||
RNA_def_function_return(func, parm);
|
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");
|
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene in which to check the object");
|
||||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
|
||||||
parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
|
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");
|
parm = RNA_def_boolean(func, "result", 0, "", "Whether the object is deform-modified");
|
||||||
RNA_def_function_return(func, parm);
|
RNA_def_function_return(func, parm);
|
||||||
|
|
||||||
@ -1316,7 +1319,7 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
|
|
||||||
parm = RNA_def_enum(func, "type", mesh_dm_info_items, 0, "", "Modifier settings to apply");
|
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(
|
parm = RNA_def_pointer(
|
||||||
func,
|
func,
|
||||||
"depsgraph",
|
"depsgraph",
|
||||||
@ -1324,10 +1327,11 @@ void RNA_api_object(StructRNA *srna)
|
|||||||
"",
|
"",
|
||||||
"Depsgraph to use to get evaluated data, when called from original object "
|
"Depsgraph to use to get evaluated data, when called from original object "
|
||||||
"(only needed if current Context's depsgraph is not suitable)");
|
"(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 */
|
/* weak!, no way to return dynamic string type */
|
||||||
parm = RNA_def_string(func, "result", NULL, 16384, "", "Requested information");
|
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);
|
RNA_def_function_output(func, parm);
|
||||||
# endif /* NDEBUG */
|
# endif /* NDEBUG */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user