RNA: return PointerRNA from rna create functions
There are a couple of functions that create rna pointers. For example `RNA_main_pointer_create` and `RNA_pointer_create`. Currently, those take an output parameter `r_ptr` as last argument. This patch changes it so that the functions actually return a` PointerRNA` instead of using the output parameters. This has a few benefits: * Output parameters should only be used when there is an actual benefit. Otherwise, one should default to returning the value. * It's simpler to use the API in the large majority of cases (note that this patch reduces the number of lines of code). * It allows the `PointerRNA` to be const on the call-site, if that is desired. No performance regression has been measured in production files. If one of these functions happened to be called in a hot loop where there is a regression, the solution should be to use an inline function there which allows the compiler to optimize it even better. Pull Request: https://projects.blender.org/blender/blender/pulls/111976
This commit is contained in:
@@ -172,29 +172,27 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
|
||||
/* RNA */
|
||||
ID *bScreen = (ID *)PyLong_AsVoidPtr(pyscreen);
|
||||
|
||||
PointerRNA engineptr;
|
||||
RNA_pointer_create(NULL, &RNA_RenderEngine, (void *)PyLong_AsVoidPtr(pyengine), &engineptr);
|
||||
PointerRNA engineptr = RNA_pointer_create(
|
||||
NULL, &RNA_RenderEngine, (void *)PyLong_AsVoidPtr(pyengine));
|
||||
BL::RenderEngine engine(engineptr);
|
||||
|
||||
PointerRNA preferencesptr;
|
||||
RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences), &preferencesptr);
|
||||
PointerRNA preferencesptr = RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences));
|
||||
BL::Preferences preferences(preferencesptr);
|
||||
|
||||
PointerRNA dataptr;
|
||||
RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
PointerRNA dataptr = RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata));
|
||||
BL::BlendData data(dataptr);
|
||||
|
||||
PointerRNA regionptr;
|
||||
RNA_pointer_create(bScreen, &RNA_Region, pylong_as_voidptr_typesafe(pyregion), ®ionptr);
|
||||
PointerRNA regionptr = RNA_pointer_create(
|
||||
bScreen, &RNA_Region, pylong_as_voidptr_typesafe(pyregion));
|
||||
BL::Region region(regionptr);
|
||||
|
||||
PointerRNA v3dptr;
|
||||
RNA_pointer_create(bScreen, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d), &v3dptr);
|
||||
PointerRNA v3dptr = RNA_pointer_create(
|
||||
bScreen, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d));
|
||||
BL::SpaceView3D v3d(v3dptr);
|
||||
|
||||
PointerRNA rv3dptr;
|
||||
RNA_pointer_create(bScreen, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr);
|
||||
PointerRNA rv3dptr = RNA_pointer_create(
|
||||
bScreen, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d));
|
||||
BL::RegionView3D rv3d(rv3dptr);
|
||||
|
||||
/* create session */
|
||||
@@ -231,8 +229,8 @@ static PyObject *render_func(PyObject * /*self*/, PyObject *args)
|
||||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, (ID *)PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, (ID *)PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
/* Allow Blender to execute other Python scripts. */
|
||||
@@ -277,11 +275,8 @@ static PyObject *draw_func(PyObject * /*self*/, PyObject *args)
|
||||
|
||||
ID *b_screen = (ID *)PyLong_AsVoidPtr(py_screen);
|
||||
|
||||
PointerRNA b_space_image_ptr;
|
||||
RNA_pointer_create(b_screen,
|
||||
&RNA_SpaceImageEditor,
|
||||
pylong_as_voidptr_typesafe(py_space_image),
|
||||
&b_space_image_ptr);
|
||||
PointerRNA b_space_image_ptr = RNA_pointer_create(
|
||||
b_screen, &RNA_SpaceImageEditor, pylong_as_voidptr_typesafe(py_space_image));
|
||||
BL::SpaceImageEditor b_space_image(b_space_image_ptr);
|
||||
|
||||
session->draw(b_space_image);
|
||||
@@ -309,12 +304,11 @@ static PyObject *bake_func(PyObject * /*self*/, PyObject *args)
|
||||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
PointerRNA objectptr;
|
||||
RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyobject), &objectptr);
|
||||
PointerRNA objectptr = RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyobject));
|
||||
BL::Object b_object(objectptr);
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
@@ -355,12 +349,11 @@ static PyObject *reset_func(PyObject * /*self*/, PyObject *args)
|
||||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA dataptr;
|
||||
RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
PointerRNA dataptr = RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata));
|
||||
BL::BlendData b_data(dataptr);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
@@ -381,8 +374,8 @@ static PyObject *sync_func(PyObject * /*self*/, PyObject *args)
|
||||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
@@ -439,15 +432,12 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
||||
return NULL;
|
||||
|
||||
/* RNA */
|
||||
PointerRNA dataptr;
|
||||
RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
PointerRNA dataptr = RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata));
|
||||
BL::BlendData b_data(dataptr);
|
||||
|
||||
PointerRNA nodeptr;
|
||||
RNA_pointer_create((ID *)PyLong_AsVoidPtr(pynodegroup),
|
||||
&RNA_ShaderNodeScript,
|
||||
(void *)PyLong_AsVoidPtr(pynode),
|
||||
&nodeptr);
|
||||
PointerRNA nodeptr = RNA_pointer_create((ID *)PyLong_AsVoidPtr(pynodegroup),
|
||||
&RNA_ShaderNodeScript,
|
||||
(void *)PyLong_AsVoidPtr(pynode));
|
||||
BL::ShaderNodeScript b_node(nodeptr);
|
||||
|
||||
/* update bytecode hash */
|
||||
@@ -747,23 +737,18 @@ static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *key
|
||||
}
|
||||
|
||||
/* Get device specification from preferences and scene. */
|
||||
PointerRNA preferencesptr;
|
||||
RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences), &preferencesptr);
|
||||
PointerRNA preferencesptr = RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences));
|
||||
BL::Preferences b_preferences(preferencesptr);
|
||||
|
||||
PointerRNA sceneptr;
|
||||
RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene), &sceneptr);
|
||||
PointerRNA sceneptr = RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene));
|
||||
BL::Scene b_scene(sceneptr);
|
||||
|
||||
DeviceInfo device = blender_device_info(b_preferences, b_scene, true, true);
|
||||
|
||||
/* Get denoising parameters from view layer. */
|
||||
PointerRNA viewlayerptr;
|
||||
RNA_pointer_create((ID *)PyLong_AsVoidPtr(pyscene),
|
||||
&RNA_ViewLayer,
|
||||
PyLong_AsVoidPtr(pyviewlayer),
|
||||
&viewlayerptr);
|
||||
PointerRNA viewlayerptr = RNA_pointer_create(
|
||||
(ID *)PyLong_AsVoidPtr(pyscene), &RNA_ViewLayer, PyLong_AsVoidPtr(pyviewlayer));
|
||||
BL::ViewLayer b_view_layer(viewlayerptr);
|
||||
|
||||
DenoiseParams params = BlenderSync::get_denoise_params(b_scene, b_view_layer, true);
|
||||
@@ -851,8 +836,7 @@ static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PointerRNA sceneptr;
|
||||
RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene), &sceneptr);
|
||||
PointerRNA sceneptr = RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene));
|
||||
BL::Scene b_scene(sceneptr);
|
||||
|
||||
debug_flags_sync_from_scene(b_scene);
|
||||
|
||||
@@ -120,8 +120,7 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
|
||||
if (geom->is_mesh()) {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
if (mesh->get_subdivision_type() != Mesh::SUBDIVISION_NONE) {
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create((::ID *)iter.first.id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create((::ID *)iter.first.id);
|
||||
geometry_map.set_recalc(BL::ID(id_ptr));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1485,10 +1485,10 @@ eAction_TransformFlags BKE_action_get_item_transform_flags(bAction *act,
|
||||
|
||||
/* build PointerRNA from provided data to obtain the paths to use */
|
||||
if (pchan) {
|
||||
RNA_pointer_create((ID *)ob, &RNA_PoseBone, pchan, &ptr);
|
||||
ptr = RNA_pointer_create((ID *)ob, &RNA_PoseBone, pchan);
|
||||
}
|
||||
else if (ob) {
|
||||
RNA_id_pointer_create((ID *)ob, &ptr);
|
||||
ptr = RNA_id_pointer_create((ID *)ob);
|
||||
}
|
||||
else {
|
||||
return eAction_TransformFlags(0);
|
||||
@@ -1755,10 +1755,9 @@ void what_does_obaction(Object *ob,
|
||||
* (though a bit more dangerous). */
|
||||
if (agrp) {
|
||||
/* specifically evaluate this group only */
|
||||
PointerRNA id_ptr;
|
||||
|
||||
/* get RNA-pointer for the workob's ID */
|
||||
RNA_id_pointer_create(&workob->id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(&workob->id);
|
||||
|
||||
/* execute action for this group only */
|
||||
animsys_evaluate_action_group(&id_ptr, act, agrp, anim_eval_context);
|
||||
|
||||
@@ -698,11 +698,11 @@ void BKE_animdata_transfer_by_basepath(Main *bmain, ID *srcID, ID *dstID, ListBa
|
||||
* and seeing if we can resolve it. */
|
||||
static bool check_rna_path_is_valid(ID *owner_id, const char *path)
|
||||
{
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop = nullptr;
|
||||
|
||||
/* make initial RNA pointer to start resolving from */
|
||||
RNA_id_pointer_create(owner_id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(owner_id);
|
||||
|
||||
/* try to resolve */
|
||||
return RNA_path_resolve_property(&id_ptr, path, &ptr, &prop);
|
||||
|
||||
@@ -912,10 +912,9 @@ static void nlastrip_evaluate_controls(NlaStrip *strip,
|
||||
{
|
||||
/* now strip's evaluate F-Curves for these settings (if applicable) */
|
||||
if (strip->fcurves.first) {
|
||||
PointerRNA strip_ptr;
|
||||
|
||||
/* create RNA-pointer needed to set values */
|
||||
RNA_pointer_create(nullptr, &RNA_NlaStrip, strip, &strip_ptr);
|
||||
PointerRNA strip_ptr = RNA_pointer_create(nullptr, &RNA_NlaStrip, strip);
|
||||
|
||||
/* execute these settings as per normal */
|
||||
animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, anim_eval_context, flush_to_original);
|
||||
@@ -3793,8 +3792,7 @@ void BKE_animsys_nla_remap_keyframe_values(NlaKeyframingContext *context,
|
||||
BLI_bitmap_copy_all(blended_necs->remap_domain.ptr, remap_domain, count);
|
||||
|
||||
/* Need to send id_ptr instead of prop_ptr so fcurve RNA paths resolve properly. */
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(prop_ptr->owner_id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(prop_ptr->owner_id);
|
||||
|
||||
/* Per iteration, remove effect of upper strip which gives output of nla stack below it. */
|
||||
LISTBASE_FOREACH_BACKWARD (NlaEvalStrip *, nes, &context->upper_estrips) {
|
||||
@@ -3896,7 +3894,6 @@ void BKE_animsys_evaluate_animdata(ID *id,
|
||||
eAnimData_Recalc recalc,
|
||||
const bool flush_to_original)
|
||||
{
|
||||
PointerRNA id_ptr;
|
||||
|
||||
/* sanity checks */
|
||||
if (ELEM(nullptr, id, adt)) {
|
||||
@@ -3904,7 +3901,7 @@ void BKE_animsys_evaluate_animdata(ID *id,
|
||||
}
|
||||
|
||||
/* get pointer to ID-block for RNA to use */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
/* recalculate keyframe data:
|
||||
* - NLA before Active Action, as Active Action behaves as 'tweaking track'
|
||||
@@ -4131,7 +4128,6 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph, ID *id, int driver_index, FCu
|
||||
BLI_assert(fcu_orig != nullptr);
|
||||
|
||||
/* TODO(sergey): De-duplicate with BKE animsys. */
|
||||
PointerRNA id_ptr;
|
||||
bool ok = false;
|
||||
|
||||
/* Lookup driver, accelerated with driver array map. */
|
||||
@@ -4148,7 +4144,7 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph, ID *id, int driver_index, FCu
|
||||
DEG_debug_print_eval_subdata_index(
|
||||
depsgraph, __func__, id->name, id, "fcu", fcu->rna_path, fcu, fcu->array_index);
|
||||
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
/* check if this driver's curve should be skipped */
|
||||
if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) {
|
||||
|
||||
@@ -55,8 +55,7 @@ void BKE_pose_apply_action_all_bones(Object *ob,
|
||||
bAction *action,
|
||||
AnimationEvalContext *anim_eval_context)
|
||||
{
|
||||
PointerRNA pose_owner_ptr;
|
||||
RNA_id_pointer_create(&ob->id, &pose_owner_ptr);
|
||||
PointerRNA pose_owner_ptr = RNA_id_pointer_create(&ob->id);
|
||||
animsys_evaluate_action(&pose_owner_ptr, action, anim_eval_context, false);
|
||||
}
|
||||
|
||||
@@ -96,8 +95,7 @@ void pose_apply(Object *ob,
|
||||
}
|
||||
|
||||
/* Apply the Action. */
|
||||
PointerRNA pose_owner_ptr;
|
||||
RNA_id_pointer_create(&ob->id, &pose_owner_ptr);
|
||||
PointerRNA pose_owner_ptr = RNA_id_pointer_create(&ob->id);
|
||||
|
||||
applier(&pose_owner_ptr, action, anim_eval_context);
|
||||
|
||||
|
||||
@@ -44,8 +44,7 @@ void BKE_callback_exec_null(Main *bmain, eCbEvent evt)
|
||||
|
||||
void BKE_callback_exec_id(Main *bmain, ID *id, eCbEvent evt)
|
||||
{
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
PointerRNA *pointers[1] = {&id_ptr};
|
||||
|
||||
@@ -54,11 +53,9 @@ void BKE_callback_exec_id(Main *bmain, ID *id, eCbEvent evt)
|
||||
|
||||
void BKE_callback_exec_id_depsgraph(Main *bmain, ID *id, Depsgraph *depsgraph, eCbEvent evt)
|
||||
{
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
PointerRNA depsgraph_ptr;
|
||||
RNA_pointer_create(nullptr, &RNA_Depsgraph, depsgraph, &depsgraph_ptr);
|
||||
PointerRNA depsgraph_ptr = RNA_pointer_create(nullptr, &RNA_Depsgraph, depsgraph);
|
||||
|
||||
PointerRNA *pointers[2] = {&id_ptr, &depsgraph_ptr};
|
||||
|
||||
@@ -67,10 +64,9 @@ void BKE_callback_exec_id_depsgraph(Main *bmain, ID *id, Depsgraph *depsgraph, e
|
||||
|
||||
void BKE_callback_exec_string(Main *bmain, eCbEvent evt, const char *str)
|
||||
{
|
||||
PointerRNA str_ptr;
|
||||
PrimitiveStringRNA data = {nullptr};
|
||||
data.value = str;
|
||||
RNA_pointer_create(nullptr, &RNA_PrimitiveString, &data, &str_ptr);
|
||||
PointerRNA str_ptr = RNA_pointer_create(nullptr, &RNA_PrimitiveString, &data);
|
||||
|
||||
PointerRNA *pointers[1] = {&str_ptr};
|
||||
|
||||
|
||||
@@ -554,8 +554,7 @@ ListBase CTX_data_dir_get_ex(const bContext *C,
|
||||
int namelen;
|
||||
|
||||
PropertyRNA *iterprop;
|
||||
PointerRNA ctx_ptr;
|
||||
RNA_pointer_create(nullptr, &RNA_Context, (void *)C, &ctx_ptr);
|
||||
PointerRNA ctx_ptr = RNA_pointer_create(nullptr, &RNA_Context, (void *)C);
|
||||
|
||||
iterprop = RNA_struct_iterator_property(ctx_ptr.type);
|
||||
|
||||
@@ -627,12 +626,12 @@ bool CTX_data_dir(const char *member)
|
||||
|
||||
void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)
|
||||
{
|
||||
RNA_id_pointer_create(id, &result->ptr);
|
||||
result->ptr = RNA_id_pointer_create(id);
|
||||
}
|
||||
|
||||
void CTX_data_pointer_set(bContextDataResult *result, ID *id, StructRNA *type, void *data)
|
||||
{
|
||||
RNA_pointer_create(id, type, data, &result->ptr);
|
||||
result->ptr = RNA_pointer_create(id, type, data);
|
||||
}
|
||||
|
||||
void CTX_data_pointer_set_ptr(bContextDataResult *result, const PointerRNA *ptr)
|
||||
@@ -643,7 +642,7 @@ void CTX_data_pointer_set_ptr(bContextDataResult *result, const PointerRNA *ptr)
|
||||
void CTX_data_id_list_add(bContextDataResult *result, ID *id)
|
||||
{
|
||||
CollectionPointerLink *link = MEM_cnew<CollectionPointerLink>(__func__);
|
||||
RNA_id_pointer_create(id, &link->ptr);
|
||||
link->ptr = RNA_id_pointer_create(id);
|
||||
|
||||
BLI_addtail(&result->list, link);
|
||||
}
|
||||
@@ -651,7 +650,7 @@ void CTX_data_id_list_add(bContextDataResult *result, ID *id)
|
||||
void CTX_data_list_add(bContextDataResult *result, ID *id, StructRNA *type, void *data)
|
||||
{
|
||||
CollectionPointerLink *link = MEM_cnew<CollectionPointerLink>(__func__);
|
||||
RNA_pointer_create(id, type, data, &link->ptr);
|
||||
link->ptr = RNA_pointer_create(id, type, data);
|
||||
|
||||
BLI_addtail(&result->list, link);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,6 @@ FCurve *id_data_find_fcurve(
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
|
||||
/* Rna vars */
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
if (r_driven) {
|
||||
@@ -232,7 +231,7 @@ FCurve *id_data_find_fcurve(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RNA_pointer_create(id, type, data, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(id, type, data);
|
||||
prop = RNA_struct_find_property(&ptr, prop_name);
|
||||
if (prop == nullptr) {
|
||||
return nullptr;
|
||||
|
||||
@@ -104,14 +104,12 @@ static bool driver_get_target_context_property(const DriverTargetContext *driver
|
||||
{
|
||||
switch (dtar->context_property) {
|
||||
case DTAR_CONTEXT_PROPERTY_ACTIVE_SCENE:
|
||||
RNA_id_pointer_create(&driver_target_context->scene->id, r_property_ptr);
|
||||
*r_property_ptr = RNA_id_pointer_create(&driver_target_context->scene->id);
|
||||
return true;
|
||||
|
||||
case DTAR_CONTEXT_PROPERTY_ACTIVE_VIEW_LAYER: {
|
||||
RNA_pointer_create(&driver_target_context->scene->id,
|
||||
&RNA_ViewLayer,
|
||||
driver_target_context->view_layer,
|
||||
r_property_ptr);
|
||||
*r_property_ptr = RNA_pointer_create(
|
||||
&driver_target_context->scene->id, &RNA_ViewLayer, driver_target_context->view_layer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -142,7 +140,7 @@ bool driver_get_target_property(const DriverTargetContext *driver_target_context
|
||||
return false;
|
||||
}
|
||||
|
||||
RNA_id_pointer_create(dtar->id, r_prop);
|
||||
*r_prop = RNA_id_pointer_create(dtar->id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1954,7 +1954,6 @@ void BKE_keyblock_copy_settings(KeyBlock *kb_dst, const KeyBlock *kb_src)
|
||||
|
||||
char *BKE_keyblock_curval_rnapath_get(const Key *key, const KeyBlock *kb)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* sanity checks */
|
||||
@@ -1963,7 +1962,7 @@ char *BKE_keyblock_curval_rnapath_get(const Key *key, const KeyBlock *kb)
|
||||
}
|
||||
|
||||
/* create the RNA pointer */
|
||||
RNA_pointer_create((ID *)&key->id, &RNA_ShapeKey, (KeyBlock *)kb, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create((ID *)&key->id, &RNA_ShapeKey, (KeyBlock *)kb);
|
||||
/* get pointer to the property too */
|
||||
prop = RNA_struct_find_property(&ptr, "value");
|
||||
|
||||
|
||||
@@ -93,8 +93,7 @@ static void test_render_pass_conflict(Scene *scene,
|
||||
const char *render_pass_name,
|
||||
const char *rna_prop_name)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&scene->id, &RNA_ViewLayer, view_layer, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&scene->id, &RNA_ViewLayer, view_layer);
|
||||
RNA_boolean_set(&ptr, rna_prop_name, false);
|
||||
|
||||
/* Rename to Conflicting name */
|
||||
|
||||
@@ -935,7 +935,6 @@ void BKE_lib_id_swap_full(
|
||||
bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
ID *newid = nullptr;
|
||||
PointerRNA idptr;
|
||||
|
||||
if (id && (ID_REAL_USERS(id) > 1)) {
|
||||
/* If property isn't editable,
|
||||
@@ -950,7 +949,7 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
|
||||
id_us_min(newid);
|
||||
|
||||
/* assign copy */
|
||||
RNA_id_pointer_create(newid, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(newid);
|
||||
RNA_property_pointer_set(ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, ptr, prop);
|
||||
|
||||
|
||||
@@ -2294,9 +2294,8 @@ static bool lib_override_library_resync(Main *bmain,
|
||||
/* Apply rules on new override ID using old one as 'source' data. */
|
||||
/* Note that since we already remapped ID pointers in old override IDs to new ones, we
|
||||
* can also apply ID pointer override rules safely here. */
|
||||
PointerRNA rnaptr_src, rnaptr_dst;
|
||||
RNA_id_pointer_create(id_override_old, &rnaptr_src);
|
||||
RNA_id_pointer_create(id_override_new, &rnaptr_dst);
|
||||
PointerRNA rnaptr_src = RNA_id_pointer_create(id_override_old);
|
||||
PointerRNA rnaptr_dst = RNA_id_pointer_create(id_override_new);
|
||||
|
||||
/* In case the parent of the liboverride object matches hierarchy-wise the parent of its
|
||||
* linked reference, also enforce clearing any override of the other related parenting
|
||||
@@ -4099,9 +4098,8 @@ bool BKE_lib_override_library_status_check_local(Main *bmain, ID *local)
|
||||
|
||||
/* Note that reference is assumed always valid, caller has to ensure that itself. */
|
||||
|
||||
PointerRNA rnaptr_local, rnaptr_reference;
|
||||
RNA_id_pointer_create(local, &rnaptr_local);
|
||||
RNA_id_pointer_create(reference, &rnaptr_reference);
|
||||
PointerRNA rnaptr_local = RNA_id_pointer_create(local);
|
||||
PointerRNA rnaptr_reference = RNA_id_pointer_create(reference);
|
||||
|
||||
if (!RNA_struct_override_matches(
|
||||
bmain,
|
||||
@@ -4158,9 +4156,8 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local)
|
||||
}
|
||||
}
|
||||
|
||||
PointerRNA rnaptr_local, rnaptr_reference;
|
||||
RNA_id_pointer_create(local, &rnaptr_local);
|
||||
RNA_id_pointer_create(reference, &rnaptr_reference);
|
||||
PointerRNA rnaptr_local = RNA_id_pointer_create(local);
|
||||
PointerRNA rnaptr_reference = RNA_id_pointer_create(reference);
|
||||
|
||||
if (!RNA_struct_override_matches(bmain,
|
||||
&rnaptr_local,
|
||||
@@ -4209,9 +4206,8 @@ static void lib_override_library_operations_create(Main *bmain,
|
||||
}
|
||||
}
|
||||
|
||||
PointerRNA rnaptr_local, rnaptr_reference;
|
||||
RNA_id_pointer_create(local, &rnaptr_local);
|
||||
RNA_id_pointer_create(local->override_library->reference, &rnaptr_reference);
|
||||
PointerRNA rnaptr_local = RNA_id_pointer_create(local);
|
||||
PointerRNA rnaptr_reference = RNA_id_pointer_create(local->override_library->reference);
|
||||
|
||||
eRNAOverrideMatchResult local_report_flags = RNA_OVERRIDE_MATCH_RESULT_INIT;
|
||||
RNA_struct_override_matches(bmain,
|
||||
@@ -4261,9 +4257,8 @@ void BKE_lib_override_library_operations_restore(Main *bmain, ID *local, int *r_
|
||||
return;
|
||||
}
|
||||
|
||||
PointerRNA rnaptr_src, rnaptr_dst;
|
||||
RNA_id_pointer_create(local, &rnaptr_dst);
|
||||
RNA_id_pointer_create(local->override_library->reference, &rnaptr_src);
|
||||
PointerRNA rnaptr_src = RNA_id_pointer_create(local);
|
||||
PointerRNA rnaptr_dst = RNA_id_pointer_create(local->override_library->reference);
|
||||
RNA_struct_override_apply(
|
||||
bmain,
|
||||
&rnaptr_dst,
|
||||
@@ -4445,14 +4440,12 @@ static bool lib_override_library_id_reset_do(Main *bmain,
|
||||
bool do_op_delete = true;
|
||||
const bool is_collection = op->rna_prop_type == PROP_COLLECTION;
|
||||
if (is_collection || op->rna_prop_type == PROP_POINTER) {
|
||||
PointerRNA ptr_root, ptr_root_lib, ptr, ptr_lib;
|
||||
PointerRNA ptr, ptr_lib;
|
||||
PropertyRNA *prop, *prop_lib;
|
||||
|
||||
RNA_pointer_create(id_root, &RNA_ID, id_root, &ptr_root);
|
||||
RNA_pointer_create(id_root->override_library->reference,
|
||||
&RNA_ID,
|
||||
id_root->override_library->reference,
|
||||
&ptr_root_lib);
|
||||
PointerRNA ptr_root = RNA_pointer_create(id_root, &RNA_ID, id_root);
|
||||
PointerRNA ptr_root_lib = RNA_pointer_create(
|
||||
id_root->override_library->reference, &RNA_ID, id_root->override_library->reference);
|
||||
|
||||
bool prop_exists = RNA_path_resolve_property(&ptr_root, op->rna_path, &ptr, &prop);
|
||||
if (prop_exists) {
|
||||
@@ -4746,12 +4739,12 @@ void BKE_lib_override_library_update(Main *bmain, ID *local)
|
||||
STRNCPY(tmp_key->id.name, local_key->id.name);
|
||||
}
|
||||
|
||||
PointerRNA rnaptr_src, rnaptr_dst, rnaptr_storage_stack, *rnaptr_storage = nullptr;
|
||||
RNA_id_pointer_create(local, &rnaptr_src);
|
||||
RNA_id_pointer_create(tmp_id, &rnaptr_dst);
|
||||
PointerRNA rnaptr_src = RNA_id_pointer_create(local);
|
||||
PointerRNA rnaptr_dst = RNA_id_pointer_create(tmp_id);
|
||||
PointerRNA rnaptr_storage_stack, *rnaptr_storage = nullptr;
|
||||
if (local->override_library->storage) {
|
||||
rnaptr_storage_stack = RNA_id_pointer_create(local->override_library->storage);
|
||||
rnaptr_storage = &rnaptr_storage_stack;
|
||||
RNA_id_pointer_create(local->override_library->storage, rnaptr_storage);
|
||||
}
|
||||
|
||||
RNA_struct_override_apply(bmain,
|
||||
@@ -4961,10 +4954,9 @@ ID *BKE_lib_override_library_operations_store_start(Main *bmain,
|
||||
storage_id = BKE_id_copy(reinterpret_cast<Main *>(liboverride_storage), local);
|
||||
|
||||
if (storage_id != nullptr) {
|
||||
PointerRNA rnaptr_reference, rnaptr_final, rnaptr_storage;
|
||||
RNA_id_pointer_create(local->override_library->reference, &rnaptr_reference);
|
||||
RNA_id_pointer_create(local, &rnaptr_final);
|
||||
RNA_id_pointer_create(storage_id, &rnaptr_storage);
|
||||
PointerRNA rnaptr_reference = RNA_id_pointer_create(local->override_library->reference);
|
||||
PointerRNA rnaptr_final = RNA_id_pointer_create(local);
|
||||
PointerRNA rnaptr_storage = RNA_id_pointer_create(storage_id);
|
||||
|
||||
if (!RNA_struct_override_store(
|
||||
bmain, &rnaptr_final, &rnaptr_reference, &rnaptr_storage, local->override_library))
|
||||
|
||||
@@ -1090,10 +1090,8 @@ void BKE_nlameta_flush_transforms(NlaStrip *mstrip)
|
||||
LISTBASE_FOREACH (NlaStrip *, strip, &mstrip->strips) {
|
||||
/* only if scale changed, need to perform RNA updates */
|
||||
if (scaleChanged) {
|
||||
PointerRNA ptr;
|
||||
|
||||
/* use RNA updates to compute scale properly */
|
||||
RNA_pointer_create(nullptr, &RNA_NlaStrip, strip, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(nullptr, &RNA_NlaStrip, strip);
|
||||
|
||||
RNA_float_set(&ptr, "frame_start", strip->start);
|
||||
RNA_float_set(&ptr, "frame_end", strip->end);
|
||||
|
||||
@@ -1236,8 +1236,7 @@ static void node_init(const bContext *C, bNodeTree *ntree, bNode *node)
|
||||
}
|
||||
|
||||
if (ntype->initfunc_api) {
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ntree->id, &RNA_Node, node);
|
||||
|
||||
/* XXX WARNING: context can be nullptr in case nodes are added in do_versions.
|
||||
* Delayed init is not supported for nodes with context-based `initfunc_api` at the moment. */
|
||||
@@ -2522,8 +2521,7 @@ bNode *node_copy_with_mapping(bNodeTree *dst_tree,
|
||||
/* Only call copy function when a copy is made for the main database, not
|
||||
* for cases like the dependency graph and localization. */
|
||||
if (node_dst->typeinfo->copyfunc_api && !(flag & LIB_ID_CREATE_NO_MAIN)) {
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(reinterpret_cast<ID *>(dst_tree), &RNA_Node, node_dst, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(reinterpret_cast<ID *>(dst_tree), &RNA_Node, node_dst);
|
||||
|
||||
node_dst->typeinfo->copyfunc_api(&ptr, &node_src);
|
||||
}
|
||||
@@ -3309,8 +3307,7 @@ void nodeRemoveNode(Main *bmain, bNodeTree *ntree, bNode *node, const bool do_id
|
||||
if (do_id_user) {
|
||||
/* Free callback for NodeCustomGroup. */
|
||||
if (node->typeinfo->freefunc_api) {
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ntree->id, &RNA_Node, node);
|
||||
|
||||
node->typeinfo->freefunc_api(&ptr);
|
||||
}
|
||||
|
||||
@@ -1935,8 +1935,7 @@ static bool find_rna_property_rgba(PointerRNA *id_ptr, const char *name, float r
|
||||
|
||||
static bool find_rna_property_rgba(ID *id, const char *name, float r_data[4])
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_id_pointer_create(id, &ptr);
|
||||
PointerRNA ptr = RNA_id_pointer_create(id);
|
||||
return find_rna_property_rgba(&ptr, name, r_data);
|
||||
}
|
||||
|
||||
@@ -1984,8 +1983,7 @@ bool BKE_view_layer_find_rgba_attribute(Scene *scene,
|
||||
float r_value[4])
|
||||
{
|
||||
if (layer) {
|
||||
PointerRNA layer_ptr;
|
||||
RNA_pointer_create(&scene->id, &RNA_ViewLayer, layer, &layer_ptr);
|
||||
PointerRNA layer_ptr = RNA_pointer_create(&scene->id, &RNA_ViewLayer, layer);
|
||||
|
||||
if (find_rna_property_rgba(&layer_ptr, name, r_value)) {
|
||||
return true;
|
||||
|
||||
@@ -2844,8 +2844,7 @@ enum eCyclesFeatureSet {
|
||||
bool BKE_scene_uses_cycles_experimental_features(Scene *scene)
|
||||
{
|
||||
BLI_assert(BKE_scene_uses_cycles(scene));
|
||||
PointerRNA scene_ptr;
|
||||
RNA_id_pointer_create(&scene->id, &scene_ptr);
|
||||
PointerRNA scene_ptr = RNA_id_pointer_create(&scene->id);
|
||||
PointerRNA cycles_ptr = RNA_pointer_get(&scene_ptr, "cycles");
|
||||
|
||||
if (RNA_pointer_is_null(&cycles_ptr)) {
|
||||
|
||||
@@ -135,22 +135,22 @@ void NodeInput::set_link(NodeOutput *link)
|
||||
|
||||
float NodeInput::get_editor_value_float() const
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket(), &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(
|
||||
(ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket());
|
||||
return RNA_float_get(&ptr, "default_value");
|
||||
}
|
||||
|
||||
void NodeInput::get_editor_value_color(float *value) const
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket(), &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(
|
||||
(ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket());
|
||||
return RNA_float_get_array(&ptr, "default_value", value);
|
||||
}
|
||||
|
||||
void NodeInput::get_editor_value_vector(float *value) const
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket(), &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(
|
||||
(ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket());
|
||||
return RNA_float_get_array(&ptr, "default_value", value);
|
||||
}
|
||||
|
||||
@@ -165,22 +165,22 @@ NodeOutput::NodeOutput(Node *node, bNodeSocket *b_socket, DataType datatype)
|
||||
|
||||
float NodeOutput::get_editor_value_float()
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket(), &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(
|
||||
(ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket());
|
||||
return RNA_float_get(&ptr, "default_value");
|
||||
}
|
||||
|
||||
void NodeOutput::get_editor_value_color(float *value)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket(), &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(
|
||||
(ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket());
|
||||
return RNA_float_get_array(&ptr, "default_value", value);
|
||||
}
|
||||
|
||||
void NodeOutput::get_editor_value_vector(float *value)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket(), &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(
|
||||
(ID *)get_node()->get_bnodetree(), &RNA_NodeSocket, get_bnode_socket());
|
||||
return RNA_float_get_array(&ptr, "default_value", value);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ AnimatedPropertyStorage::AnimatedPropertyStorage() : is_fully_initialized(false)
|
||||
void AnimatedPropertyStorage::initializeFromID(DepsgraphBuilderCache *builder_cache, const ID *id)
|
||||
{
|
||||
AnimatedPropertyCallbackData data;
|
||||
RNA_id_pointer_create(const_cast<ID *>(id), &data.pointer_rna);
|
||||
data.pointer_rna = RNA_id_pointer_create(const_cast<ID *>(id));
|
||||
data.animated_property_storage = this;
|
||||
data.builder_cache = builder_cache;
|
||||
BKE_fcurves_id_cb(const_cast<ID *>(id), animated_property_cb, &data);
|
||||
|
||||
@@ -70,8 +70,7 @@ string OperationKey::identifier() const
|
||||
RNAPathKey::RNAPathKey(ID *id, const char *path, RNAPointerSource source) : id(id), source(source)
|
||||
{
|
||||
/* Create ID pointer for root of path lookup. */
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
/* Try to resolve path. */
|
||||
int index;
|
||||
if (!RNA_path_resolve_full(&id_ptr, path, &ptr, &prop, &index)) {
|
||||
|
||||
@@ -1276,8 +1276,7 @@ void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index
|
||||
|
||||
void DepsgraphNodeBuilder::build_driver_variables(ID *id, FCurve *fcurve)
|
||||
{
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
build_driver_id_property(id_ptr, fcurve->rna_path);
|
||||
|
||||
@@ -1321,8 +1320,7 @@ void DepsgraphNodeBuilder::build_driver_scene_camera_variable(Scene *scene,
|
||||
/* This skips scene->camera, which was already handled by the caller. */
|
||||
LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
|
||||
if (!ELEM(marker->camera, nullptr, scene->camera)) {
|
||||
PointerRNA camera_ptr;
|
||||
RNA_id_pointer_create(&marker->camera->id, &camera_ptr);
|
||||
PointerRNA camera_ptr = RNA_id_pointer_create(&marker->camera->id);
|
||||
build_driver_id_property(camera_ptr, camera_path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1576,8 +1576,7 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id,
|
||||
ListBase *curves)
|
||||
{
|
||||
/* Iterate over all curves and build relations. */
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
LISTBASE_FOREACH (FCurve *, fcu, curves) {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
@@ -1833,9 +1832,8 @@ void DepsgraphRelationBuilder::build_driver_data(ID *id, FCurve *fcu)
|
||||
* data-block, which means driver execution should wait for that
|
||||
* data-block to be copied. */
|
||||
{
|
||||
PointerRNA id_ptr;
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
PointerRNA ptr;
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
if (RNA_path_resolve_full(&id_ptr, fcu->rna_path, &ptr, nullptr, nullptr)) {
|
||||
if (id_ptr.owner_id != ptr.owner_id) {
|
||||
ComponentKey cow_key(ptr.owner_id, NodeType::COPY_ON_WRITE);
|
||||
@@ -1977,8 +1975,7 @@ void DepsgraphRelationBuilder::build_driver_scene_camera_variable(const Operatio
|
||||
|
||||
LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
|
||||
if (!ELEM(marker->camera, nullptr, scene->camera)) {
|
||||
PointerRNA camera_ptr;
|
||||
RNA_id_pointer_create(&marker->camera->id, &camera_ptr);
|
||||
PointerRNA camera_ptr = RNA_id_pointer_create(&marker->camera->id);
|
||||
build_driver_id_property(camera_ptr, rna_path);
|
||||
build_driver_rna_path_variable(driver_key, self_key, &scene->id, camera_ptr, rna_path);
|
||||
animated = true;
|
||||
|
||||
@@ -166,8 +166,7 @@ void DepsgraphRelationBuilder::build_driver_relations(IDNode *id_node)
|
||||
/* Mapping from RNA prefix -> set of driver descriptors: */
|
||||
Map<string, Vector<DriverDescriptor>> driver_groups;
|
||||
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id_orig, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id_orig);
|
||||
|
||||
LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
|
||||
if (fcu->rna_path == nullptr) {
|
||||
|
||||
@@ -77,8 +77,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *object,
|
||||
* one Init IK node per armature, this link has quite high risk of spurious dependency cycles.
|
||||
*/
|
||||
const bool is_itasc = (object->pose->iksolver == IKSOLVER_ITASC);
|
||||
PointerRNA con_ptr;
|
||||
RNA_pointer_create(&object->id, &RNA_Constraint, con, &con_ptr);
|
||||
PointerRNA con_ptr = RNA_pointer_create(&object->id, &RNA_Constraint, con);
|
||||
if (is_itasc || cache_->isAnyPropertyAnimated(&con_ptr)) {
|
||||
add_relation(pchan_local_key, init_ik_key, "IK Constraint -> Init IK Tree");
|
||||
}
|
||||
|
||||
@@ -256,8 +256,7 @@ void DEG_get_evaluated_rna_pointer(const Depsgraph *depsgraph,
|
||||
* common types too above (e.g. modifiers) */
|
||||
char *path = RNA_path_from_ID_to_struct(ptr);
|
||||
if (path) {
|
||||
PointerRNA cow_id_ptr;
|
||||
RNA_id_pointer_create(cow_id, &cow_id_ptr);
|
||||
PointerRNA cow_id_ptr = RNA_id_pointer_create(cow_id);
|
||||
if (!RNA_path_resolve(&cow_id_ptr, path, r_ptr_eval, nullptr)) {
|
||||
/* Couldn't find COW copy of data */
|
||||
fprintf(stderr,
|
||||
|
||||
@@ -87,7 +87,7 @@ void AnimationBackup::init_from_id(ID *id)
|
||||
AnimatedPropertyStoreCalbackData data;
|
||||
data.backup = this;
|
||||
data.id = id;
|
||||
RNA_id_pointer_create(id, &data.id_pointer_rna);
|
||||
data.id_pointer_rna = RNA_id_pointer_create(id);
|
||||
BKE_fcurves_id_cb(id, animated_property_store_cb, &data);
|
||||
}
|
||||
|
||||
@@ -95,8 +95,7 @@ void AnimationBackup::restore_to_id(ID *id)
|
||||
{
|
||||
return;
|
||||
|
||||
PointerRNA id_pointer_rna;
|
||||
RNA_id_pointer_create(id, &id_pointer_rna);
|
||||
PointerRNA id_pointer_rna = RNA_id_pointer_create(id);
|
||||
for (const AnimationValueBackup &value_backup : values_backup) {
|
||||
/* Resolve path to the property.
|
||||
*
|
||||
|
||||
@@ -375,7 +375,7 @@ static bool acf_generic_idblock_name_prop(bAnimListElem *ale,
|
||||
PointerRNA *r_ptr,
|
||||
PropertyRNA **r_prop)
|
||||
{
|
||||
RNA_id_pointer_create(static_cast<ID *>(ale->data), r_ptr);
|
||||
*r_ptr = RNA_id_pointer_create(static_cast<ID *>(ale->data));
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -387,7 +387,7 @@ static bool acf_generic_idfill_name_prop(bAnimListElem *ale,
|
||||
PropertyRNA **r_prop)
|
||||
{
|
||||
/* actual ID we're representing is stored in ale->data not ale->id, as id gives the owner */
|
||||
RNA_id_pointer_create(static_cast<ID *>(ale->data), r_ptr);
|
||||
*r_ptr = RNA_id_pointer_create(static_cast<ID *>(ale->data));
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -706,7 +706,7 @@ static void acf_object_name(bAnimListElem *ale, char *name)
|
||||
/* name property for object */
|
||||
static bool acf_object_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
RNA_id_pointer_create(ale->id, r_ptr);
|
||||
*r_ptr = RNA_id_pointer_create(ale->id);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -893,7 +893,7 @@ static void acf_group_name(bAnimListElem *ale, char *name)
|
||||
/* name property for group entries */
|
||||
static bool acf_group_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
RNA_pointer_create(ale->fcurve_owner_id, &RNA_ActionGroup, ale->data, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->fcurve_owner_id, &RNA_ActionGroup, ale->data);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -1014,7 +1014,7 @@ static bool acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, Property
|
||||
* as our "name" so that user can perform quick fixes
|
||||
*/
|
||||
if (fcu->flag & FCURVE_DISABLED) {
|
||||
RNA_pointer_create(ale->fcurve_owner_id, &RNA_FCurve, ale->data, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->fcurve_owner_id, &RNA_FCurve, ale->data);
|
||||
*r_prop = RNA_struct_find_property(r_ptr, "data_path");
|
||||
}
|
||||
else {
|
||||
@@ -3221,7 +3221,7 @@ static bool acf_shapekey_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, Proper
|
||||
|
||||
/* if the KeyBlock had a name, use it, otherwise use the index */
|
||||
if (kb && kb->name[0]) {
|
||||
RNA_pointer_create(ale->id, &RNA_ShapeKey, kb, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->id, &RNA_ShapeKey, kb);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -3408,7 +3408,7 @@ static void acf_gpl_name_legacy(bAnimListElem *ale, char *name)
|
||||
static bool acf_gpl_name_prop_legacy(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
if (ale->data) {
|
||||
RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -3559,7 +3559,7 @@ static bool layer_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA *
|
||||
return false;
|
||||
}
|
||||
|
||||
RNA_pointer_create(ale->id, &RNA_GreasePencilLayer, ale->data, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->id, &RNA_GreasePencilLayer, ale->data);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -3822,7 +3822,7 @@ static void acf_masklay_name(bAnimListElem *ale, char *name)
|
||||
static bool acf_masklay_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
if (ale->data) {
|
||||
RNA_pointer_create(ale->id, &RNA_MaskLayer, ale->data, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->id, &RNA_MaskLayer, ale->data);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -3937,7 +3937,7 @@ static void acf_nlatrack_name(bAnimListElem *ale, char *name)
|
||||
static bool acf_nlatrack_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
if (ale->data) {
|
||||
RNA_pointer_create(ale->id, &RNA_NlaTrack, ale->data, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->id, &RNA_NlaTrack, ale->data);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -4138,7 +4138,7 @@ static void acf_nlaaction_name(bAnimListElem *ale, char *name)
|
||||
static bool acf_nlaaction_name_prop(bAnimListElem *ale, PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
if (ale->data) {
|
||||
RNA_pointer_create(ale->fcurve_owner_id, &RNA_Action, ale->data, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(ale->fcurve_owner_id, &RNA_Action, ale->data);
|
||||
*r_prop = RNA_struct_name_property(r_ptr->type);
|
||||
|
||||
return (*r_prop != nullptr);
|
||||
@@ -4965,14 +4965,14 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
ToolSettings *ts = scene->toolsettings;
|
||||
ListBase nla_cache = {nullptr, nullptr};
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
eInsertKeyFlags flag = INSERTKEY_NOFLAGS;
|
||||
bool done = false;
|
||||
float cfra;
|
||||
|
||||
/* Get RNA pointer */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
/* Get NLA context for value remapping */
|
||||
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
|
||||
@@ -5028,13 +5028,13 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
ToolSettings *ts = scene->toolsettings;
|
||||
ListBase nla_cache = {nullptr, nullptr};
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
eInsertKeyFlags flag = INSERTKEY_NOFLAGS;
|
||||
bool done = false;
|
||||
|
||||
/* Get RNA pointer */
|
||||
RNA_id_pointer_create((ID *)key, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create((ID *)key);
|
||||
|
||||
/* Get NLA context for value remapping */
|
||||
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
|
||||
@@ -5394,9 +5394,8 @@ static void draw_grease_pencil_layer_widgets(bAnimListElem *ale,
|
||||
offset += SLIDER_WIDTH;
|
||||
|
||||
/* Create the RNA pointers. */
|
||||
PointerRNA ptr, id_ptr;
|
||||
RNA_pointer_create(ale->id, &RNA_GreasePencilLayer, ale->data, &ptr);
|
||||
RNA_id_pointer_create(ale->id, &id_ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(ale->id, &RNA_GreasePencilLayer, ale->data);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(ale->id);
|
||||
|
||||
/* Layer onion skinning switch. */
|
||||
offset -= ICON_WIDTH;
|
||||
@@ -5705,11 +5704,10 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
||||
if (ale->type == ANIMTYPE_NLACURVE) {
|
||||
NlaStrip *strip = (NlaStrip *)ale->owner;
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* create RNA pointers */
|
||||
RNA_pointer_create(ale->id, &RNA_NlaStrip, strip, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(ale->id, &RNA_NlaStrip, strip);
|
||||
prop = RNA_struct_find_property(&ptr, fcu->rna_path);
|
||||
|
||||
/* create property slider */
|
||||
@@ -5733,7 +5731,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
||||
}
|
||||
}
|
||||
else if (ale->id) { /* Slider using RNA Access --------------- */
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
char *rna_path = nullptr;
|
||||
int array_index = 0;
|
||||
@@ -5764,8 +5762,8 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
||||
bGPDlayer *gpl = (bGPDlayer *)ale->data;
|
||||
|
||||
/* Create the RNA pointers. */
|
||||
RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
|
||||
RNA_id_pointer_create(ale->id, &id_ptr);
|
||||
ptr = RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(ale->id);
|
||||
int icon;
|
||||
|
||||
/* Layer onion skinning switch. */
|
||||
@@ -5842,7 +5840,7 @@ void ANIM_channel_draw_widgets(const bContext *C,
|
||||
/* Only if RNA-Path found. */
|
||||
if (rna_path) {
|
||||
/* get RNA pointer, and resolve the path */
|
||||
RNA_id_pointer_create(ale->id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(ale->id);
|
||||
|
||||
/* try to resolve the path */
|
||||
if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop)) {
|
||||
|
||||
@@ -78,10 +78,10 @@ void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale)
|
||||
/* If we have an fcurve, call the update for the property we
|
||||
* are editing, this is then expected to do the proper redraws
|
||||
* and depsgraph updates. */
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &ptr, &prop)) {
|
||||
RNA_property_update_main(bmain, scene, &ptr, prop);
|
||||
|
||||
@@ -542,11 +542,11 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag
|
||||
|
||||
/* sanity checks */
|
||||
if (id && fcu && fcu->rna_path) {
|
||||
PointerRNA ptr, id_ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* get RNA property that F-Curve affects */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &ptr, &prop)) {
|
||||
/* rotations: radians <-> degrees? */
|
||||
if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION) {
|
||||
|
||||
@@ -56,11 +56,11 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
|
||||
}
|
||||
}
|
||||
else {
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* get RNA pointer, and resolve the path */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
/* try to resolve the path */
|
||||
if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &ptr, &prop)) {
|
||||
|
||||
@@ -294,15 +294,15 @@ int ANIM_add_driver_with_target(ReportList *reports,
|
||||
int driver_type,
|
||||
short mapping_type)
|
||||
{
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
PointerRNA id_ptr2, ptr2;
|
||||
PointerRNA ptr2;
|
||||
PropertyRNA *prop2;
|
||||
int done_tot = 0;
|
||||
|
||||
/* validate pointers first - exit if failure */
|
||||
RNA_id_pointer_create(dst_id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(dst_id);
|
||||
if (RNA_path_resolve_property(&id_ptr, dst_path, &ptr, &prop) == false) {
|
||||
BKE_reportf(
|
||||
reports,
|
||||
@@ -313,7 +313,7 @@ int ANIM_add_driver_with_target(ReportList *reports,
|
||||
return 0;
|
||||
}
|
||||
|
||||
RNA_id_pointer_create(src_id, &id_ptr2);
|
||||
PointerRNA id_ptr2 = RNA_id_pointer_create(src_id);
|
||||
if ((RNA_path_resolve_property(&id_ptr2, src_path, &ptr2, &prop2) == false) ||
|
||||
(mapping_type == CREATEDRIVER_MAPPING_NONE))
|
||||
{
|
||||
@@ -400,14 +400,14 @@ int ANIM_add_driver_with_target(ReportList *reports,
|
||||
int ANIM_add_driver(
|
||||
ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type)
|
||||
{
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
FCurve *fcu;
|
||||
int array_index_max;
|
||||
int done_tot = 0;
|
||||
|
||||
/* validate pointer first - exit if failure */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop) == false) {
|
||||
BKE_reportf(
|
||||
reports,
|
||||
@@ -591,12 +591,12 @@ bool ANIM_driver_can_paste()
|
||||
bool ANIM_copy_driver(
|
||||
ReportList *reports, ID *id, const char rna_path[], int array_index, short /*flag*/)
|
||||
{
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
FCurve *fcu;
|
||||
|
||||
/* validate pointer first - exit if failure */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop) == false) {
|
||||
BKE_reportf(reports,
|
||||
RPT_ERROR,
|
||||
@@ -639,12 +639,12 @@ bool ANIM_copy_driver(
|
||||
bool ANIM_paste_driver(
|
||||
ReportList *reports, ID *id, const char rna_path[], int array_index, short /*flag*/)
|
||||
{
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
FCurve *fcu;
|
||||
|
||||
/* validate pointer first - exit if failure */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop) == false) {
|
||||
BKE_reportf(
|
||||
reports,
|
||||
|
||||
@@ -705,8 +705,7 @@ static void envelope_panel_draw(const bContext *C, Panel *panel)
|
||||
|
||||
FCM_EnvelopeData *fed = env->data;
|
||||
for (int i = 0; i < env->totvert; i++, fed++) {
|
||||
PointerRNA ctrl_ptr;
|
||||
RNA_pointer_create(owner_id, &RNA_FModifierEnvelopeControlPoint, fed, &ctrl_ptr);
|
||||
PointerRNA ctrl_ptr = RNA_pointer_create(owner_id, &RNA_FModifierEnvelopeControlPoint, fed);
|
||||
|
||||
/* get a new row to operate on */
|
||||
row = uiLayoutRow(col, true);
|
||||
@@ -890,7 +889,7 @@ void ANIM_fmodifier_panels(const bContext *C,
|
||||
|
||||
PointerRNA *fcm_ptr = static_cast<PointerRNA *>(
|
||||
MEM_mallocN(sizeof(PointerRNA), "panel customdata"));
|
||||
RNA_pointer_create(owner_id, &RNA_FModifier, fcm, fcm_ptr);
|
||||
*fcm_ptr = RNA_pointer_create(owner_id, &RNA_FModifier, fcm);
|
||||
|
||||
UI_panel_add_instanced(C, region, ®ion->panels, panel_idname, fcm_ptr);
|
||||
}
|
||||
@@ -909,7 +908,7 @@ void ANIM_fmodifier_panels(const bContext *C,
|
||||
|
||||
PointerRNA *fcm_ptr = static_cast<PointerRNA *>(
|
||||
MEM_mallocN(sizeof(PointerRNA), "panel customdata"));
|
||||
RNA_pointer_create(owner_id, &RNA_FModifier, fcm, fcm_ptr);
|
||||
*fcm_ptr = RNA_pointer_create(owner_id, &RNA_FModifier, fcm);
|
||||
UI_panel_custom_data_set(panel, fcm_ptr);
|
||||
|
||||
panel = panel->next;
|
||||
|
||||
@@ -206,9 +206,9 @@ void clean_fcurve(bAnimContext *ac, bAnimListElem *ale, float thresh, bool clear
|
||||
* the default value and if is, remove fcurve completely. */
|
||||
if (cleardefault && fcu->totvert == 1) {
|
||||
float default_value = 0.0f;
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
RNA_id_pointer_create(ale->id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(ale->id);
|
||||
|
||||
/* get property to read from, and get value as appropriate */
|
||||
if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &ptr, &prop)) {
|
||||
@@ -1476,10 +1476,10 @@ static tAnimCopybufItem *pastebuf_match_path_property(Main *bmain,
|
||||
printf("paste_animedit_keys: error ID has been removed!\n");
|
||||
}
|
||||
else {
|
||||
PointerRNA id_ptr, rptr;
|
||||
PointerRNA rptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_id_pointer_create(aci->id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(aci->id);
|
||||
|
||||
if (RNA_path_resolve_property(&id_ptr, aci->rna_path, &rptr, &prop)) {
|
||||
const char *identifier = RNA_property_identifier(prop);
|
||||
|
||||
@@ -1479,7 +1479,7 @@ int insert_keyframe(Main *bmain,
|
||||
ListBase *nla_cache,
|
||||
eInsertKeyFlags flag)
|
||||
{
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop = nullptr;
|
||||
AnimData *adt;
|
||||
ListBase tmp_nla_cache = {nullptr, nullptr};
|
||||
@@ -1497,7 +1497,7 @@ int insert_keyframe(Main *bmain,
|
||||
return 0;
|
||||
}
|
||||
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop) == false) {
|
||||
BKE_reportf(
|
||||
reports,
|
||||
@@ -1749,7 +1749,7 @@ int delete_keyframe(Main *bmain,
|
||||
float cfra)
|
||||
{
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
int array_index_max = array_index + 1;
|
||||
int ret = 0;
|
||||
@@ -1761,7 +1761,7 @@ int delete_keyframe(Main *bmain,
|
||||
}
|
||||
|
||||
/* validate pointer first - exit if failure */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop) == false) {
|
||||
BKE_reportf(
|
||||
reports,
|
||||
@@ -1856,7 +1856,7 @@ static int clear_keyframe(Main *bmain,
|
||||
eInsertKeyFlags /*flag*/)
|
||||
{
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
int array_index_max = array_index + 1;
|
||||
int ret = 0;
|
||||
@@ -1868,7 +1868,7 @@ static int clear_keyframe(Main *bmain,
|
||||
}
|
||||
|
||||
/* validate pointer first - exit if failure */
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop) == false) {
|
||||
BKE_reportf(
|
||||
reports,
|
||||
|
||||
@@ -946,10 +946,10 @@ void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *s
|
||||
|
||||
/* depending on what data we have, create using ID or full pointer call */
|
||||
if (srna && data) {
|
||||
RNA_pointer_create(id, srna, data, &ds->ptr);
|
||||
ds->ptr = RNA_pointer_create(id, srna, data);
|
||||
}
|
||||
else {
|
||||
RNA_id_pointer_create(id, &ds->ptr);
|
||||
ds->ptr = RNA_id_pointer_create(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1117,10 +1117,10 @@ int ANIM_apply_keyingset(
|
||||
|
||||
/* get length of array if whole array option is enabled */
|
||||
if (ksp->flag & KSP_FLAG_WHOLE_ARRAY) {
|
||||
PointerRNA id_ptr, ptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_id_pointer_create(ksp->id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(ksp->id);
|
||||
if (RNA_path_resolve_property(&id_ptr, ksp->rna_path, &ptr, &prop)) {
|
||||
arraylen = RNA_property_array_length(&ptr, prop);
|
||||
/* start from start of array, instead of the previously specified index - #48020 */
|
||||
|
||||
@@ -207,8 +207,7 @@ void ED_time_scrub_channel_search_draw(const bContext *C, ARegion *region, bDope
|
||||
immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
|
||||
immUnbindProgram();
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&CTX_wm_screen(C)->id, &RNA_DopeSheet, dopesheet, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&CTX_wm_screen(C)->id, &RNA_DopeSheet, dopesheet);
|
||||
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
const float padding_x = 2 * UI_SCALE_FAC;
|
||||
|
||||
@@ -225,9 +225,8 @@ static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEven
|
||||
/* set default settings from existing/stored settings */
|
||||
{
|
||||
bAnimVizSettings *avs = &ob->pose->avs;
|
||||
PointerRNA avs_ptr;
|
||||
|
||||
RNA_pointer_create(nullptr, &RNA_AnimVizMotionPaths, avs, &avs_ptr);
|
||||
PointerRNA avs_ptr = RNA_pointer_create(nullptr, &RNA_AnimVizMotionPaths, avs);
|
||||
RNA_enum_set(op->ptr, "display_type", RNA_enum_get(&avs_ptr, "type"));
|
||||
RNA_enum_set(op->ptr, "range", RNA_enum_get(&avs_ptr, "range"));
|
||||
RNA_enum_set(op->ptr, "bake_location", RNA_enum_get(&avs_ptr, "bake_location"));
|
||||
@@ -254,13 +253,12 @@ static int pose_calculate_paths_exec(bContext *C, wmOperator *op)
|
||||
/* grab baking settings from operator settings */
|
||||
{
|
||||
bAnimVizSettings *avs = &ob->pose->avs;
|
||||
PointerRNA avs_ptr;
|
||||
|
||||
avs->path_type = RNA_enum_get(op->ptr, "display_type");
|
||||
avs->path_range = RNA_enum_get(op->ptr, "range");
|
||||
animviz_motionpath_compute_range(ob, scene);
|
||||
|
||||
RNA_pointer_create(nullptr, &RNA_AnimVizMotionPaths, avs, &avs_ptr);
|
||||
PointerRNA avs_ptr = RNA_pointer_create(nullptr, &RNA_AnimVizMotionPaths, avs);
|
||||
RNA_enum_set(&avs_ptr, "bake_location", RNA_enum_get(op->ptr, "bake_location"));
|
||||
}
|
||||
|
||||
@@ -700,7 +698,6 @@ static int pose_armature_layers_showall_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
bArmature *arm = armature_layers_get_data(&ob);
|
||||
PointerRNA ptr;
|
||||
int maxLayers = RNA_boolean_get(op->ptr, "all") ? 32 : 16;
|
||||
/* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
|
||||
bool layers[32] = {false};
|
||||
@@ -714,7 +711,7 @@ static int pose_armature_layers_showall_exec(bContext *C, wmOperator *op)
|
||||
* although it would be faster to just set directly using bitflags, we still
|
||||
* need to setup a RNA pointer so that we get the "update" callbacks for free...
|
||||
*/
|
||||
RNA_id_pointer_create(&arm->id, &ptr);
|
||||
PointerRNA ptr = RNA_id_pointer_create(&arm->id);
|
||||
|
||||
for (int i = 0; i < maxLayers; i++) {
|
||||
layers[i] = true;
|
||||
@@ -756,7 +753,6 @@ static int armature_layers_invoke(bContext *C, wmOperator *op, const wmEvent *ev
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
bArmature *arm = armature_layers_get_data(&ob);
|
||||
PointerRNA ptr;
|
||||
/* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
|
||||
bool layers[32];
|
||||
|
||||
@@ -767,7 +763,7 @@ static int armature_layers_invoke(bContext *C, wmOperator *op, const wmEvent *ev
|
||||
|
||||
/* Get RNA pointer to armature data to use that to retrieve the layers as ints
|
||||
* to init the operator. */
|
||||
RNA_id_pointer_create((ID *)arm, &ptr);
|
||||
PointerRNA ptr = RNA_id_pointer_create((ID *)arm);
|
||||
RNA_boolean_get_array(&ptr, "layers", layers);
|
||||
RNA_boolean_set_array(op->ptr, "layers", layers);
|
||||
|
||||
@@ -780,7 +776,6 @@ static int armature_layers_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
bArmature *arm = armature_layers_get_data(&ob);
|
||||
PointerRNA ptr;
|
||||
/* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
|
||||
bool layers[32];
|
||||
|
||||
@@ -792,7 +787,7 @@ static int armature_layers_exec(bContext *C, wmOperator *op)
|
||||
RNA_boolean_get_array(op->ptr, "layers", layers);
|
||||
|
||||
/* get pointer for armature, and write data there... */
|
||||
RNA_id_pointer_create((ID *)arm, &ptr);
|
||||
PointerRNA ptr = RNA_id_pointer_create((ID *)arm);
|
||||
RNA_boolean_set_array(&ptr, "layers", layers);
|
||||
|
||||
/* NOTE: notifier might evolve. */
|
||||
@@ -851,7 +846,6 @@ static int pose_bone_layers_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
||||
/* Set the visible layers for the active armature (edit and pose modes) */
|
||||
static int pose_bone_layers_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
/* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
|
||||
bool layers[32];
|
||||
|
||||
@@ -878,7 +872,7 @@ static int pose_bone_layers_exec(bContext *C, wmOperator *op)
|
||||
/* set layers of pchans based on the values set in the operator props */
|
||||
CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
|
||||
/* get pointer for pchan, and write flags this way */
|
||||
RNA_pointer_create((ID *)ob->data, &RNA_Bone, pchan->bone, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create((ID *)ob->data, &RNA_Bone, pchan->bone);
|
||||
RNA_boolean_set_array(&ptr, "layers", layers);
|
||||
|
||||
if (prev_ob != ob) {
|
||||
|
||||
@@ -476,11 +476,10 @@ static void pose_slide_apply_props(tPoseSlideOp *pso,
|
||||
tPChanFCurveLink *pfl,
|
||||
const char prop_prefix[])
|
||||
{
|
||||
PointerRNA ptr = {nullptr};
|
||||
int len = strlen(pfl->pchan_path);
|
||||
|
||||
/* Setup pointer RNA for resolving paths. */
|
||||
RNA_pointer_create(nullptr, &RNA_PoseBone, pfl->pchan, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(nullptr, &RNA_PoseBone, pfl->pchan);
|
||||
|
||||
/* - custom properties are just denoted using ["..."][etc.] after the end of the base path,
|
||||
* so just check for opening pair after the end of the path
|
||||
|
||||
@@ -471,9 +471,8 @@ static void apply_armature_pose2bones_ui(bContext *C, wmOperator *op)
|
||||
{
|
||||
uiLayout *layout = op->layout;
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
PointerRNA ptr;
|
||||
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
|
||||
uiItemR(layout, &ptr, "selected", UI_ITEM_NONE, nullptr, ICON_NONE);
|
||||
}
|
||||
|
||||
@@ -67,14 +67,13 @@ static void fcurves_to_pchan_links_get(ListBase *pfLinks,
|
||||
/* make new linkage data */
|
||||
tPChanFCurveLink *pfl = static_cast<tPChanFCurveLink *>(
|
||||
MEM_callocN(sizeof(tPChanFCurveLink), "tPChanFCurveLink"));
|
||||
PointerRNA ptr;
|
||||
|
||||
pfl->ob = ob;
|
||||
pfl->fcurves = curves;
|
||||
pfl->pchan = pchan;
|
||||
|
||||
/* get the RNA path to this pchan - this needs to be freed! */
|
||||
RNA_pointer_create((ID *)ob, &RNA_PoseBone, pchan, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create((ID *)ob, &RNA_PoseBone, pchan);
|
||||
pfl->pchan_path = RNA_path_from_ID_to_struct(&ptr);
|
||||
|
||||
/* add linkage data to operator data */
|
||||
|
||||
@@ -196,13 +196,11 @@ void AssetViewItem::disable_asset_drag()
|
||||
|
||||
void AssetViewItem::build_grid_tile(uiLayout &layout) const
|
||||
{
|
||||
PointerRNA file_ptr;
|
||||
RNA_pointer_create(
|
||||
PointerRNA file_ptr = RNA_pointer_create(
|
||||
nullptr,
|
||||
&RNA_FileSelectEntry,
|
||||
/* XXX passing file pointer here, should be asset handle or asset representation. */
|
||||
const_cast<FileDirEntry *>(asset_.file_data),
|
||||
&file_ptr);
|
||||
const_cast<FileDirEntry *>(asset_.file_data));
|
||||
|
||||
uiBlock *block = uiLayoutGetBlock(&layout);
|
||||
UI_but_context_ptr_set(
|
||||
|
||||
@@ -2245,7 +2245,6 @@ static int font_open_exec(bContext *C, wmOperator *op)
|
||||
Main *bmain = CTX_data_main(C);
|
||||
VFont *font;
|
||||
PropertyPointerRNA *pprop;
|
||||
PointerRNA idptr;
|
||||
char filepath[FILE_MAX];
|
||||
RNA_string_get(op->ptr, "filepath", filepath);
|
||||
|
||||
@@ -2270,7 +2269,7 @@ static int font_open_exec(bContext *C, wmOperator *op)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&font->id);
|
||||
|
||||
RNA_id_pointer_create(&font->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&font->id);
|
||||
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, nullptr);
|
||||
RNA_property_update(C, &pprop->ptr, pprop->prop);
|
||||
}
|
||||
@@ -2353,7 +2352,6 @@ static int font_unlink_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
VFont *builtin_font;
|
||||
|
||||
PointerRNA idptr;
|
||||
PropertyPointerRNA pprop;
|
||||
|
||||
UI_context_active_but_prop_get_templateID(C, &pprop.ptr, &pprop.prop);
|
||||
@@ -2365,7 +2363,7 @@ static int font_unlink_exec(bContext *C, wmOperator *op)
|
||||
|
||||
builtin_font = BKE_vfont_builtin_get();
|
||||
|
||||
RNA_id_pointer_create(&builtin_font->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&builtin_font->id);
|
||||
RNA_property_pointer_set(&pprop.ptr, pprop.prop, idptr, nullptr);
|
||||
RNA_property_update(C, &pprop.ptr, pprop.prop);
|
||||
|
||||
|
||||
@@ -422,8 +422,7 @@ static void run_node_group_ui(bContext *C, wmOperator *op)
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
uiLayoutSetPropDecorate(layout, false);
|
||||
Main *bmain = CTX_data_main(C);
|
||||
PointerRNA bmain_ptr;
|
||||
RNA_main_pointer_create(bmain, &bmain_ptr);
|
||||
PointerRNA bmain_ptr = RNA_main_pointer_create(bmain);
|
||||
|
||||
const bNodeTree *node_tree = get_node_group(*C, *op->ptr, nullptr);
|
||||
if (!node_tree) {
|
||||
|
||||
@@ -501,7 +501,6 @@ static void gpencil_stroke_path_animation(bContext *C,
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
bAction *act;
|
||||
FCurve *fcu;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop = nullptr;
|
||||
int gaps_count = 0;
|
||||
|
||||
@@ -518,7 +517,7 @@ static void gpencil_stroke_path_animation(bContext *C,
|
||||
cu->pathlen = gtd->frame_range;
|
||||
|
||||
/* Get RNA pointer to read/write path time values */
|
||||
RNA_id_pointer_create((ID *)cu, &ptr);
|
||||
PointerRNA ptr = RNA_id_pointer_create((ID *)cu);
|
||||
prop = RNA_struct_find_property(&ptr, "eval_time");
|
||||
|
||||
/* Ensure we have an F-Curve to add keyframes to */
|
||||
|
||||
@@ -1475,9 +1475,8 @@ static void gpencil_interpolate_seq_ui(bContext *C, wmOperator *op)
|
||||
/* Get an RNA pointer to ToolSettings to give to the custom curve. */
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ToolSettings *ts = scene->toolsettings;
|
||||
PointerRNA gpsettings_ptr;
|
||||
RNA_pointer_create(
|
||||
&scene->id, &RNA_GPencilInterpolateSettings, &ts->gp_interpolate, &gpsettings_ptr);
|
||||
PointerRNA gpsettings_ptr = RNA_pointer_create(
|
||||
&scene->id, &RNA_GPencilInterpolateSettings, &ts->gp_interpolate);
|
||||
uiTemplateCurveMapping(
|
||||
layout, &gpsettings_ptr, "interpolation_curve", 0, false, true, true, false);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *area, Object *ob, Pointer
|
||||
if (ob && (ob->type == OB_GPENCIL_LEGACY)) {
|
||||
/* GP Object. */
|
||||
if (r_ptr) {
|
||||
RNA_id_pointer_create(&ob->id, r_ptr);
|
||||
*r_ptr = RNA_id_pointer_create(&ob->id);
|
||||
}
|
||||
return (bGPdata **)&ob->data;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
|
||||
case SPACE_VIEW3D: /* 3D-View */
|
||||
{
|
||||
if (r_ptr) {
|
||||
RNA_id_pointer_create(&scene->id, r_ptr);
|
||||
*r_ptr = RNA_id_pointer_create(&scene->id);
|
||||
}
|
||||
return &scene->gpd;
|
||||
|
||||
@@ -149,7 +149,7 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
|
||||
/* for now, as long as there's an active node tree,
|
||||
* default to using that in the Nodes Editor */
|
||||
if (r_ptr) {
|
||||
RNA_id_pointer_create(&snode->nodetree->id, r_ptr);
|
||||
*r_ptr = RNA_id_pointer_create(&snode->nodetree->id);
|
||||
}
|
||||
return &snode->nodetree->gpd;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
|
||||
/* For now, Grease Pencil data is associated with the space
|
||||
* (actually preview region only). */
|
||||
if (r_ptr) {
|
||||
RNA_pointer_create(screen_id, &RNA_SpaceSequenceEditor, sseq, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(screen_id, &RNA_SpaceSequenceEditor, sseq);
|
||||
}
|
||||
return &sseq->gpd;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
|
||||
|
||||
/* For now, Grease Pencil data is associated with the space... */
|
||||
if (r_ptr) {
|
||||
RNA_pointer_create(screen_id, &RNA_SpaceImageEditor, sima, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(screen_id, &RNA_SpaceImageEditor, sima);
|
||||
}
|
||||
return &sima->gpd;
|
||||
}
|
||||
@@ -194,12 +194,12 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
|
||||
}
|
||||
|
||||
if (r_ptr) {
|
||||
RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track);
|
||||
}
|
||||
return &track->gpd;
|
||||
}
|
||||
if (r_ptr) {
|
||||
RNA_id_pointer_create(&clip->id, r_ptr);
|
||||
*r_ptr = RNA_id_pointer_create(&clip->id);
|
||||
}
|
||||
return &clip->gpd;
|
||||
}
|
||||
|
||||
@@ -181,8 +181,7 @@ static void datadropper_id_sample_pt(
|
||||
}
|
||||
}
|
||||
|
||||
PointerRNA idptr;
|
||||
RNA_id_pointer_create(id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(id);
|
||||
|
||||
if (id && RNA_property_pointer_poll(&ddr->ptr, ddr->prop, &idptr)) {
|
||||
SNPRINTF(ddr->name, "%s: %s", ddr->idcode_name, id->name + 2);
|
||||
@@ -203,9 +202,7 @@ static void datadropper_id_sample_pt(
|
||||
/* sets the ID, returns success */
|
||||
static bool datadropper_id_set(bContext *C, DataDropper *ddr, ID *id)
|
||||
{
|
||||
PointerRNA ptr_value;
|
||||
|
||||
RNA_id_pointer_create(id, &ptr_value);
|
||||
PointerRNA ptr_value = RNA_id_pointer_create(id);
|
||||
|
||||
RNA_property_pointer_set(&ddr->ptr, ddr->prop, ptr_value, nullptr);
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ static int depthdropper_init(bContext *C, wmOperator *op)
|
||||
BKE_id_is_editable(CTX_data_main(C), static_cast<const ID *>(v3d->camera->data)))
|
||||
{
|
||||
Camera *camera = (Camera *)v3d->camera->data;
|
||||
RNA_pointer_create(&camera->id, &RNA_CameraDOFSettings, &camera->dof, &ddr->ptr);
|
||||
ddr->ptr = RNA_pointer_create(&camera->id, &RNA_CameraDOFSettings, &camera->dof);
|
||||
ddr->prop = RNA_struct_find_property(&ddr->ptr, "focus_distance");
|
||||
ddr->is_undo = true;
|
||||
}
|
||||
|
||||
@@ -2846,11 +2846,10 @@ void ui_but_string_get_ex(uiBut *but,
|
||||
const char *buf = nullptr;
|
||||
if ((but->type == UI_BTYPE_TAB) && (but->custom_data)) {
|
||||
StructRNA *ptr_type = RNA_property_pointer_type(&but->rnapoin, but->rnaprop);
|
||||
PointerRNA ptr;
|
||||
|
||||
/* uiBut.custom_data points to data this tab represents (e.g. workspace).
|
||||
* uiBut.rnapoin/prop store an active value (e.g. active workspace). */
|
||||
RNA_pointer_create(but->rnapoin.owner_id, ptr_type, but->custom_data, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(but->rnapoin.owner_id, ptr_type, but->custom_data);
|
||||
buf = RNA_struct_name_get_alloc(&ptr, str, str_maxncpy, &buf_len);
|
||||
}
|
||||
else if (type == PROP_STRING) {
|
||||
@@ -3183,10 +3182,9 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
|
||||
RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr, nullptr);
|
||||
}
|
||||
else if (search_but->item_active != nullptr) {
|
||||
RNA_pointer_create(nullptr,
|
||||
RNA_property_pointer_type(&but->rnapoin, but->rnaprop),
|
||||
search_but->item_active,
|
||||
&rptr);
|
||||
rptr = RNA_pointer_create(nullptr,
|
||||
RNA_property_pointer_type(&but->rnapoin, but->rnaprop),
|
||||
search_but->item_active);
|
||||
RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr, nullptr);
|
||||
}
|
||||
|
||||
@@ -3212,12 +3210,11 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
|
||||
else if (but->type == UI_BTYPE_TAB) {
|
||||
if (but->rnaprop && but->custom_data) {
|
||||
StructRNA *ptr_type = RNA_property_pointer_type(&but->rnapoin, but->rnaprop);
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* uiBut.custom_data points to data this tab represents (e.g. workspace).
|
||||
* uiBut.rnapoin/prop store an active value (e.g. active workspace). */
|
||||
RNA_pointer_create(but->rnapoin.owner_id, ptr_type, but->custom_data, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(but->rnapoin.owner_id, ptr_type, but->custom_data);
|
||||
prop = RNA_struct_name_property(ptr_type);
|
||||
if (RNA_property_editable(&ptr, prop)) {
|
||||
RNA_property_string_set(&ptr, prop, str);
|
||||
|
||||
@@ -147,7 +147,6 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *region, void *arg)
|
||||
{
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
uiBut *but = (uiBut *)arg;
|
||||
PointerRNA ptr;
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
IDProperty *prop;
|
||||
const char *idname = shortcut_get_operator_property(C, but, &prop);
|
||||
@@ -164,7 +163,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *region, void *arg)
|
||||
|
||||
BLI_assert(kmi != nullptr);
|
||||
|
||||
RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi);
|
||||
|
||||
uiBlock *block = UI_block_begin(C, region, "_popup", UI_EMBOSS);
|
||||
UI_block_func_handle_set(block, but_shortcut_name_func, but);
|
||||
@@ -200,7 +199,6 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg)
|
||||
{
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
uiBut *but = (uiBut *)arg;
|
||||
PointerRNA ptr;
|
||||
const uiStyle *style = UI_style_get_dpi();
|
||||
IDProperty *prop;
|
||||
const char *idname = shortcut_get_operator_property(C, but, &prop);
|
||||
@@ -226,7 +224,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg)
|
||||
km = WM_keymap_guess_opname(C, idname);
|
||||
kmi = WM_keymap_item_find_id(km, kmi_id);
|
||||
|
||||
RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi);
|
||||
|
||||
uiBlock *block = UI_block_begin(C, region, "_popup", UI_EMBOSS);
|
||||
UI_block_func_handle_set(block, but_shortcut_name_func, but);
|
||||
@@ -1307,8 +1305,7 @@ void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *panel)
|
||||
return;
|
||||
}
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_Panel, panel, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&screen->id, &RNA_Panel, panel);
|
||||
|
||||
uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Panel"), ICON_NONE);
|
||||
uiLayout *layout = UI_popup_menu_layout(pup);
|
||||
|
||||
@@ -33,8 +33,7 @@ void context_path_add_generic(Vector<ContextPathItem> &path,
|
||||
return;
|
||||
}
|
||||
|
||||
PointerRNA rna_ptr;
|
||||
RNA_pointer_create(nullptr, &rna_type, ptr, &rna_ptr);
|
||||
PointerRNA rna_ptr = RNA_pointer_create(nullptr, &rna_type, ptr);
|
||||
char name[128];
|
||||
RNA_struct_name_get_alloc(&rna_ptr, name, sizeof(name), nullptr);
|
||||
|
||||
|
||||
@@ -6369,10 +6369,9 @@ static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, co
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
PointerRNA brush_ptr;
|
||||
PropertyRNA *brush_color_prop;
|
||||
|
||||
RNA_id_pointer_create(&brush->id, &brush_ptr);
|
||||
PointerRNA brush_ptr = RNA_id_pointer_create(&brush->id);
|
||||
brush_color_prop = RNA_struct_find_property(&brush_ptr, "color");
|
||||
RNA_property_update(C, &brush_ptr, brush_color_prop);
|
||||
}
|
||||
|
||||
@@ -2742,7 +2742,7 @@ static void search_id_collection(StructRNA *ptype, PointerRNA *r_ptr, PropertyRN
|
||||
{
|
||||
/* look for collection property in Main */
|
||||
/* NOTE: using global Main is OK-ish here, UI shall not access other Mains anyway. */
|
||||
RNA_main_pointer_create(G_MAIN, r_ptr);
|
||||
*r_ptr = RNA_main_pointer_create(G_MAIN);
|
||||
|
||||
*r_prop = nullptr;
|
||||
|
||||
@@ -5869,8 +5869,7 @@ void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but)
|
||||
|
||||
if (but->rnapoin.data && but->rnaprop) {
|
||||
/* TODO: index could be supported as well */
|
||||
PointerRNA ptr_prop;
|
||||
RNA_pointer_create(nullptr, &RNA_Property, but->rnaprop, &ptr_prop);
|
||||
PointerRNA ptr_prop = RNA_pointer_create(nullptr, &RNA_Property, but->rnaprop);
|
||||
uiLayoutSetContextPointer(layout, "button_prop", &ptr_prop);
|
||||
uiLayoutSetContextPointer(layout, "button_pointer", &but->rnapoin);
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ static bool override_remove_button_poll(bContext *C)
|
||||
static int override_remove_button_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
PointerRNA ptr, id_refptr, src;
|
||||
PointerRNA ptr, src;
|
||||
PropertyRNA *prop;
|
||||
int index;
|
||||
const bool all = RNA_boolean_get(op->ptr, "all");
|
||||
@@ -689,7 +689,7 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
|
||||
* If this is an override template, we obviously do not need to restore anything. */
|
||||
if (!is_template) {
|
||||
PropertyRNA *src_prop;
|
||||
RNA_id_pointer_create(id->override_library->reference, &id_refptr);
|
||||
PointerRNA id_refptr = RNA_id_pointer_create(id->override_library->reference);
|
||||
if (!RNA_path_resolve_property(&id_refptr, oprop->rna_path, &src, &src_prop)) {
|
||||
BLI_assert_msg(0, "Failed to create matching source (linked data) RNA pointer");
|
||||
}
|
||||
@@ -828,7 +828,6 @@ static int override_idtemplate_make_exec(bContext *C, wmOperator * /*op*/)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
PointerRNA idptr;
|
||||
/* `idptr` is re-assigned to owner property to ensure proper updates etc. Here we also use it
|
||||
* to ensure remapping of the owner property from the linked data to the newly created
|
||||
* liboverride (note that in theory this remapping has already been done by code above), but
|
||||
@@ -837,7 +836,7 @@ static int override_idtemplate_make_exec(bContext *C, wmOperator * /*op*/)
|
||||
* Otherwise, owner ID will also have been overridden, and remapped already to use it's
|
||||
* override of the data too. */
|
||||
if (!ID_IS_LINKED(owner_id)) {
|
||||
RNA_id_pointer_create(id_override, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(id_override);
|
||||
RNA_property_pointer_set(&owner_ptr, prop, idptr, nullptr);
|
||||
}
|
||||
RNA_property_update(C, &owner_ptr, prop);
|
||||
@@ -890,9 +889,8 @@ static int override_idtemplate_reset_exec(bContext *C, wmOperator * /*op*/)
|
||||
|
||||
BKE_lib_override_library_id_reset(CTX_data_main(C), id, false);
|
||||
|
||||
PointerRNA idptr;
|
||||
/* `idptr` is re-assigned to owner property to ensure proper updates etc. */
|
||||
RNA_id_pointer_create(id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(id);
|
||||
RNA_property_pointer_set(&owner_ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &owner_ptr, prop);
|
||||
|
||||
@@ -1050,7 +1048,7 @@ static void ui_context_selected_bones_via_pose(bContext *C, ListBase *r_lb)
|
||||
if (!BLI_listbase_is_empty(&lb)) {
|
||||
LISTBASE_FOREACH (CollectionPointerLink *, link, &lb) {
|
||||
bPoseChannel *pchan = static_cast<bPoseChannel *>(link->ptr.data);
|
||||
RNA_pointer_create(link->ptr.owner_id, &RNA_Bone, pchan->bone, &link->ptr);
|
||||
link->ptr = RNA_pointer_create(link->ptr.owner_id, &RNA_Bone, pchan->bone);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1093,7 +1091,7 @@ bool UI_context_copy_to_selected_list(bContext *C,
|
||||
}
|
||||
else {
|
||||
bPoseChannel *pchan = static_cast<bPoseChannel *>(owner_ptr.data);
|
||||
RNA_pointer_create(owner_ptr.owner_id, &RNA_Bone, pchan->bone, &owner_ptr);
|
||||
owner_ptr = RNA_pointer_create(owner_ptr.owner_id, &RNA_Bone, pchan->bone);
|
||||
|
||||
if (NOT_NULL(idpath = RNA_path_from_struct_to_idproperty(
|
||||
&owner_ptr, static_cast<IDProperty *>(ptr->data))))
|
||||
@@ -1280,7 +1278,7 @@ bool UI_context_copy_to_selected_list(bContext *C,
|
||||
}
|
||||
else {
|
||||
/* Avoid prepending 'data' to the path. */
|
||||
RNA_id_pointer_create(id_data, &link->ptr);
|
||||
link->ptr = RNA_id_pointer_create(id_data);
|
||||
}
|
||||
|
||||
if (id_data) {
|
||||
@@ -1340,7 +1338,6 @@ bool UI_context_copy_to_selected_check(PointerRNA *ptr,
|
||||
PointerRNA *r_ptr,
|
||||
PropertyRNA **r_prop)
|
||||
{
|
||||
PointerRNA idptr;
|
||||
PropertyRNA *lprop;
|
||||
PointerRNA lptr;
|
||||
|
||||
@@ -1351,7 +1348,7 @@ bool UI_context_copy_to_selected_check(PointerRNA *ptr,
|
||||
if (use_path_from_id) {
|
||||
/* Path relative to ID. */
|
||||
lprop = nullptr;
|
||||
RNA_id_pointer_create(ptr_link->owner_id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(ptr_link->owner_id);
|
||||
RNA_path_resolve_property(&idptr, path, &lptr, &lprop);
|
||||
}
|
||||
else if (path) {
|
||||
|
||||
@@ -255,13 +255,12 @@ int UI_pie_menu_invoke_from_rna_enum(bContext *C,
|
||||
const char *path,
|
||||
const wmEvent *event)
|
||||
{
|
||||
PointerRNA ctx_ptr;
|
||||
PointerRNA r_ptr;
|
||||
PropertyRNA *r_prop;
|
||||
uiPieMenu *pie;
|
||||
uiLayout *layout;
|
||||
|
||||
RNA_pointer_create(nullptr, &RNA_Context, C, &ctx_ptr);
|
||||
PointerRNA ctx_ptr = RNA_pointer_create(nullptr, &RNA_Context, C);
|
||||
|
||||
if (!RNA_path_resolve(&ctx_ptr, path, &r_ptr, &r_prop)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
@@ -78,11 +78,9 @@ static void asset_view_draw_item(uiList *ui_list,
|
||||
AssetHandle asset_handle = ED_assetlist_asset_handle_get_by_index(&list_data->asset_library_ref,
|
||||
index);
|
||||
|
||||
PointerRNA file_ptr;
|
||||
RNA_pointer_create(&list_data->screen->id,
|
||||
&RNA_FileSelectEntry,
|
||||
const_cast<FileDirEntry *>(asset_handle.file_data),
|
||||
&file_ptr);
|
||||
PointerRNA file_ptr = RNA_pointer_create(&list_data->screen->id,
|
||||
&RNA_FileSelectEntry,
|
||||
const_cast<FileDirEntry *>(asset_handle.file_data));
|
||||
uiLayoutSetContextPointer(layout, "active_file", &file_ptr);
|
||||
|
||||
uiBlock *block = uiLayoutGetBlock(layout);
|
||||
@@ -204,10 +202,9 @@ static void populate_asset_collection(const AssetLibraryReference &asset_library
|
||||
* because the #FileDirEntry may be freed while iterating, there's a cache for them with a
|
||||
* maximum size. Further code will query as needed it using the collection index. */
|
||||
|
||||
PointerRNA itemptr, fileptr;
|
||||
PointerRNA itemptr;
|
||||
RNA_property_collection_add(&assets_dataptr, assets_prop, &itemptr);
|
||||
|
||||
RNA_pointer_create(nullptr, &RNA_FileSelectEntry, nullptr, &fileptr);
|
||||
PointerRNA fileptr = RNA_pointer_create(nullptr, &RNA_FileSelectEntry, nullptr);
|
||||
RNA_pointer_set(&itemptr, "file_data", fileptr);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -183,9 +183,9 @@ class LayerViewItem : public AbstractTreeViewItem {
|
||||
|
||||
void on_activate(bContext &C) override
|
||||
{
|
||||
PointerRNA grease_pencil_ptr, value_ptr;
|
||||
RNA_pointer_create(&grease_pencil_.id, &RNA_GreasePencilv3Layers, nullptr, &grease_pencil_ptr);
|
||||
RNA_pointer_create(&grease_pencil_.id, &RNA_GreasePencilLayer, &layer_, &value_ptr);
|
||||
PointerRNA grease_pencil_ptr = RNA_pointer_create(
|
||||
&grease_pencil_.id, &RNA_GreasePencilv3Layers, nullptr);
|
||||
PointerRNA value_ptr = RNA_pointer_create(&grease_pencil_.id, &RNA_GreasePencilLayer, &layer_);
|
||||
|
||||
PropertyRNA *prop = RNA_struct_find_property(&grease_pencil_ptr, "active");
|
||||
|
||||
@@ -239,8 +239,7 @@ class LayerViewItem : public AbstractTreeViewItem {
|
||||
void build_layer_buttons(uiLayout &row)
|
||||
{
|
||||
uiBut *but;
|
||||
PointerRNA layer_ptr;
|
||||
RNA_pointer_create(&grease_pencil_.id, &RNA_GreasePencilLayer, &layer_, &layer_ptr);
|
||||
PointerRNA layer_ptr = RNA_pointer_create(&grease_pencil_.id, &RNA_GreasePencilLayer, &layer_);
|
||||
|
||||
uiBlock *block = uiLayoutGetBlock(&row);
|
||||
but = uiDefIconButR(block,
|
||||
@@ -341,8 +340,8 @@ class LayerGroupViewItem : public AbstractTreeViewItem {
|
||||
|
||||
void build_layer_group_buttons(uiLayout &row)
|
||||
{
|
||||
PointerRNA group_ptr;
|
||||
RNA_pointer_create(&grease_pencil_.id, &RNA_GreasePencilLayerGroup, &group_, &group_ptr);
|
||||
PointerRNA group_ptr = RNA_pointer_create(
|
||||
&grease_pencil_.id, &RNA_GreasePencilLayerGroup, &group_);
|
||||
|
||||
uiItemR(&row, &group_ptr, "hide", UI_ITEM_R_ICON_ONLY, nullptr, ICON_NONE);
|
||||
uiItemR(&row, &group_ptr, "lock", UI_ITEM_R_ICON_ONLY, nullptr, ICON_NONE);
|
||||
|
||||
@@ -150,11 +150,8 @@ class CollectionViewItem : public BasicTreeViewItem {
|
||||
uiBlock *block = uiLayoutGetBlock(&row);
|
||||
const int icon = get_state_icon();
|
||||
|
||||
PointerRNA collection_light_linking_ptr;
|
||||
RNA_pointer_create(&collection_.id,
|
||||
&RNA_CollectionLightLinking,
|
||||
&collection_light_linking_,
|
||||
&collection_light_linking_ptr);
|
||||
PointerRNA collection_light_linking_ptr = RNA_pointer_create(
|
||||
&collection_.id, &RNA_CollectionLightLinking, &collection_light_linking_);
|
||||
|
||||
uiBut *button = uiDefIconButR(block,
|
||||
UI_BTYPE_BUT,
|
||||
@@ -178,11 +175,8 @@ class CollectionViewItem : public BasicTreeViewItem {
|
||||
|
||||
void build_remove_button(uiLayout &row)
|
||||
{
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(id_, &id_ptr);
|
||||
|
||||
PointerRNA collection_ptr;
|
||||
RNA_id_pointer_create(&collection_.id, &collection_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id_);
|
||||
PointerRNA collection_ptr = RNA_id_pointer_create(&collection_.id);
|
||||
|
||||
uiLayoutSetContextPointer(&row, "id", &id_ptr);
|
||||
uiLayoutSetContextPointer(&row, "collection", &collection_ptr);
|
||||
|
||||
@@ -121,8 +121,7 @@ static void uilist_draw_item_default(uiList *ui_list,
|
||||
|
||||
static void uilist_draw_filter_default(uiList *ui_list, const bContext * /*C*/, uiLayout *layout)
|
||||
{
|
||||
PointerRNA listptr;
|
||||
RNA_pointer_create(nullptr, &RNA_UIList, ui_list, &listptr);
|
||||
PointerRNA listptr = RNA_pointer_create(nullptr, &RNA_UIList, ui_list);
|
||||
|
||||
uiLayout *row = uiLayoutRow(layout, false);
|
||||
|
||||
|
||||
@@ -513,8 +513,7 @@ static MenuSearch_Data *menu_items_from_ui_create(
|
||||
/* Anything besides #SPACE_EMPTY is fine,
|
||||
* as this value is only included in the enum when set. */
|
||||
area_dummy.spacetype = SPACE_TOPBAR;
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_Area, &area_dummy, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&screen->id, &RNA_Area, &area_dummy);
|
||||
prop_ui_type = RNA_struct_find_property(&ptr, "ui_type");
|
||||
RNA_property_enum_items(C,
|
||||
&ptr,
|
||||
@@ -533,8 +532,7 @@ static MenuSearch_Data *menu_items_from_ui_create(
|
||||
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
|
||||
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
||||
if (region != nullptr) {
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_Area, area, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&screen->id, &RNA_Area, area);
|
||||
const int space_type_ui = RNA_property_enum_get(&ptr, prop_ui_type);
|
||||
|
||||
const int space_type_ui_index = RNA_enum_from_value(space_type_ui_items, space_type_ui);
|
||||
|
||||
@@ -348,9 +348,7 @@ static void template_ID_set_property_exec_fn(bContext *C, void *arg_template, vo
|
||||
|
||||
/* ID */
|
||||
if (item) {
|
||||
PointerRNA idptr;
|
||||
|
||||
RNA_id_pointer_create(static_cast<ID *>(item), &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(static_cast<ID *>(item));
|
||||
RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr, nullptr);
|
||||
RNA_property_update(C, &template_ui->ptr, template_ui->prop);
|
||||
}
|
||||
@@ -367,8 +365,7 @@ static bool id_search_allows_id(TemplateID *template_ui, const int flag, ID *id,
|
||||
|
||||
/* Use filter. */
|
||||
if (RNA_property_type(template_ui->prop) == PROP_POINTER) {
|
||||
PointerRNA ptr;
|
||||
RNA_id_pointer_create(id, &ptr);
|
||||
PointerRNA ptr = RNA_id_pointer_create(id);
|
||||
if (RNA_property_pointer_poll(&template_ui->ptr, template_ui->prop, &ptr) == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -931,7 +928,7 @@ static void template_id_liboverride_hierarchy_make(bContext *C,
|
||||
* Otherwise, owner ID will also have been overridden, and remapped already to use it's
|
||||
* override of the data too. */
|
||||
if (!ID_IS_LINKED(owner_id)) {
|
||||
RNA_id_pointer_create(id_override, idptr);
|
||||
*idptr = RNA_id_pointer_create(id_override);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -2024,9 +2021,8 @@ static void template_search_exec_fn(bContext *C, void *arg_template, void *item)
|
||||
TemplateSearch *template_search = static_cast<TemplateSearch *>(arg_template);
|
||||
uiRNACollectionSearch *coll_search = &template_search->search_data;
|
||||
StructRNA *type = RNA_property_pointer_type(&coll_search->target_ptr, coll_search->target_prop);
|
||||
PointerRNA item_ptr;
|
||||
|
||||
RNA_pointer_create(nullptr, type, item, &item_ptr);
|
||||
PointerRNA item_ptr = RNA_pointer_create(nullptr, type, item);
|
||||
RNA_property_pointer_set(&coll_search->target_ptr, coll_search->target_prop, item_ptr, nullptr);
|
||||
RNA_property_update(C, &coll_search->target_ptr, coll_search->target_prop);
|
||||
}
|
||||
@@ -2311,7 +2307,7 @@ void uiTemplateModifiers(uiLayout * /*layout*/, bContext *C)
|
||||
|
||||
/* Create custom data RNA pointer. */
|
||||
PointerRNA *md_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_Modifier, md, md_ptr);
|
||||
*md_ptr = RNA_pointer_create(&ob->id, &RNA_Modifier, md);
|
||||
|
||||
UI_panel_add_instanced(C, region, ®ion->panels, panel_idname, md_ptr);
|
||||
}
|
||||
@@ -2333,7 +2329,7 @@ void uiTemplateModifiers(uiLayout * /*layout*/, bContext *C)
|
||||
}
|
||||
|
||||
PointerRNA *md_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_Modifier, md, md_ptr);
|
||||
*md_ptr = RNA_pointer_create(&ob->id, &RNA_Modifier, md);
|
||||
UI_panel_custom_data_set(panel, md_ptr);
|
||||
|
||||
panel = panel->next;
|
||||
@@ -2477,7 +2473,7 @@ void uiTemplateConstraints(uiLayout * /*layout*/, bContext *C, bool use_bone_con
|
||||
|
||||
/* Create custom data RNA pointer. */
|
||||
PointerRNA *con_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_Constraint, con, con_ptr);
|
||||
*con_ptr = RNA_pointer_create(&ob->id, &RNA_Constraint, con);
|
||||
|
||||
Panel *new_panel = UI_panel_add_instanced(C, region, ®ion->panels, panel_idname, con_ptr);
|
||||
|
||||
@@ -2512,7 +2508,7 @@ void uiTemplateConstraints(uiLayout * /*layout*/, bContext *C, bool use_bone_con
|
||||
}
|
||||
|
||||
PointerRNA *con_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_Constraint, con, con_ptr);
|
||||
*con_ptr = RNA_pointer_create(&ob->id, &RNA_Constraint, con);
|
||||
UI_panel_custom_data_set(panel, con_ptr);
|
||||
|
||||
panel = panel->next;
|
||||
@@ -2561,7 +2557,7 @@ void uiTemplateGpencilModifiers(uiLayout * /*layout*/, bContext *C)
|
||||
|
||||
/* Create custom data RNA pointer. */
|
||||
PointerRNA *md_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_GpencilModifier, md, md_ptr);
|
||||
*md_ptr = RNA_pointer_create(&ob->id, &RNA_GpencilModifier, md);
|
||||
|
||||
UI_panel_add_instanced(C, region, ®ion->panels, panel_idname, md_ptr);
|
||||
}
|
||||
@@ -2584,7 +2580,7 @@ void uiTemplateGpencilModifiers(uiLayout * /*layout*/, bContext *C)
|
||||
}
|
||||
|
||||
PointerRNA *md_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_GpencilModifier, md, md_ptr);
|
||||
*md_ptr = RNA_pointer_create(&ob->id, &RNA_GpencilModifier, md);
|
||||
UI_panel_custom_data_set(panel, md_ptr);
|
||||
|
||||
panel = panel->next;
|
||||
@@ -2628,7 +2624,7 @@ void uiTemplateShaderFx(uiLayout * /*layout*/, bContext *C)
|
||||
|
||||
/* Create custom data RNA pointer. */
|
||||
PointerRNA *fx_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_ShaderFx, fx, fx_ptr);
|
||||
*fx_ptr = RNA_pointer_create(&ob->id, &RNA_ShaderFx, fx);
|
||||
|
||||
UI_panel_add_instanced(C, region, ®ion->panels, panel_idname, fx_ptr);
|
||||
}
|
||||
@@ -2650,7 +2646,7 @@ void uiTemplateShaderFx(uiLayout * /*layout*/, bContext *C)
|
||||
}
|
||||
|
||||
PointerRNA *fx_ptr = static_cast<PointerRNA *>(MEM_mallocN(sizeof(PointerRNA), __func__));
|
||||
RNA_pointer_create(&ob->id, &RNA_ShaderFx, fx, fx_ptr);
|
||||
*fx_ptr = RNA_pointer_create(&ob->id, &RNA_ShaderFx, fx);
|
||||
UI_panel_custom_data_set(panel, fx_ptr);
|
||||
|
||||
panel = panel->next;
|
||||
@@ -2759,8 +2755,7 @@ static eAutoPropButsReturn template_operator_property_buts_draw_single(
|
||||
user_data.flag = layout_flags;
|
||||
const bool use_prop_split = (layout_flags & UI_TEMPLATE_OP_PROPS_NO_SPLIT_LAYOUT) == 0;
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
|
||||
uiLayoutSetPropSep(layout, use_prop_split);
|
||||
uiLayoutSetPropDecorate(layout, false);
|
||||
@@ -2878,9 +2873,8 @@ static bool ui_layout_operator_properties_only_booleans(const bContext *C,
|
||||
user_data.C = C;
|
||||
user_data.op = op;
|
||||
user_data.flag = layout_flags;
|
||||
PointerRNA ptr;
|
||||
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
|
||||
RNA_STRUCT_BEGIN (&ptr, prop) {
|
||||
if (RNA_property_flag(prop) & PROP_HIDDEN) {
|
||||
@@ -2977,10 +2971,9 @@ static void constraint_ops_extra_draw(bContext *C, uiLayout *layout, void *con_v
|
||||
uiLayout *row;
|
||||
bConstraint *con = (bConstraint *)con_v;
|
||||
|
||||
PointerRNA ptr;
|
||||
Object *ob = ED_object_active_context(C);
|
||||
|
||||
RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_Constraint, con);
|
||||
uiLayoutSetContextPointer(layout, "constraint", &ptr);
|
||||
uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT);
|
||||
|
||||
@@ -3043,8 +3036,7 @@ static void draw_constraint_header(uiLayout *layout, Object *ob, bConstraint *co
|
||||
uiBlock *block = uiLayoutGetBlock(layout);
|
||||
UI_block_func_set(block, constraint_active_func, ob, con);
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_Constraint, con);
|
||||
|
||||
if (block->panel) {
|
||||
UI_panel_context_pointer_set(block->panel, "constraint", &ptr);
|
||||
@@ -3137,8 +3129,6 @@ void uiTemplatePreview(uiLayout *layout,
|
||||
Material *ma = nullptr;
|
||||
Tex *tex = (Tex *)id;
|
||||
short *pr_texture = nullptr;
|
||||
PointerRNA material_ptr;
|
||||
PointerRNA texture_ptr;
|
||||
|
||||
char _preview_id[UI_MAX_NAME_STR];
|
||||
|
||||
@@ -3250,7 +3240,7 @@ void uiTemplatePreview(uiLayout *layout,
|
||||
}
|
||||
|
||||
/* Create RNA Pointer */
|
||||
RNA_pointer_create(&ma->id, &RNA_Material, ma, &material_ptr);
|
||||
PointerRNA material_ptr = RNA_pointer_create(&ma->id, &RNA_Material, ma);
|
||||
|
||||
col = uiLayoutColumn(row, true);
|
||||
uiLayoutSetScaleX(col, 1.5);
|
||||
@@ -3266,7 +3256,7 @@ void uiTemplatePreview(uiLayout *layout,
|
||||
|
||||
if (pr_texture) {
|
||||
/* Create RNA Pointer */
|
||||
RNA_pointer_create(id, &RNA_Texture, tex, &texture_ptr);
|
||||
PointerRNA texture_ptr = RNA_pointer_create(id, &RNA_Texture, tex);
|
||||
|
||||
uiLayoutRow(layout, true);
|
||||
uiDefButS(block,
|
||||
@@ -3474,8 +3464,7 @@ static uiBlock *colorband_tools_func(bContext *C, ARegion *region, void *coba_v)
|
||||
style);
|
||||
UI_block_layout_set_current(block, layout);
|
||||
{
|
||||
PointerRNA coba_ptr;
|
||||
RNA_pointer_create(nullptr, &RNA_ColorRamp, coba, &coba_ptr);
|
||||
PointerRNA coba_ptr = RNA_pointer_create(nullptr, &RNA_ColorRamp, coba);
|
||||
uiLayoutSetContextPointer(layout, "color_ramp", &coba_ptr);
|
||||
}
|
||||
|
||||
@@ -3606,8 +3595,7 @@ static void colorband_buttons_layout(uiLayout *layout,
|
||||
const float xs = butr->xmin;
|
||||
const float ys = butr->ymin;
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(cb->ptr.owner_id, &RNA_ColorRamp, coba, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(cb->ptr.owner_id, &RNA_ColorRamp, coba);
|
||||
|
||||
uiLayout *split = uiLayoutSplit(layout, 0.4f, false);
|
||||
|
||||
@@ -3699,7 +3687,7 @@ static void colorband_buttons_layout(uiLayout *layout,
|
||||
if (coba->tot) {
|
||||
CBData *cbd = coba->data + coba->cur;
|
||||
|
||||
RNA_pointer_create(cb->ptr.owner_id, &RNA_ColorRampElement, cbd, &ptr);
|
||||
ptr = RNA_pointer_create(cb->ptr.owner_id, &RNA_ColorRampElement, cbd);
|
||||
|
||||
if (!expand) {
|
||||
split = uiLayoutSplit(layout, 0.3f, false);
|
||||
@@ -5490,8 +5478,7 @@ static void CurveProfile_buttons_layout(uiLayout *layout, PointerRNA *ptr, RNAUp
|
||||
|
||||
row = uiLayoutRow(layout, true);
|
||||
|
||||
PointerRNA point_ptr;
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_CurveProfilePoint, point, &point_ptr);
|
||||
PointerRNA point_ptr = RNA_pointer_create(ptr->owner_id, &RNA_CurveProfilePoint, point);
|
||||
PropertyRNA *prop_handle_type = RNA_struct_find_property(&point_ptr, "handle_type_1");
|
||||
uiItemFullR(row,
|
||||
&point_ptr,
|
||||
@@ -5923,8 +5910,7 @@ void uiTemplatePalette(uiLayout *layout, PointerRNA *ptr, const char *propname,
|
||||
row_cols = 0;
|
||||
}
|
||||
|
||||
PointerRNA color_ptr;
|
||||
RNA_pointer_create(&palette->id, &RNA_PaletteColor, color, &color_ptr);
|
||||
PointerRNA color_ptr = RNA_pointer_create(&palette->id, &RNA_PaletteColor, color);
|
||||
uiButColor *color_but = (uiButColor *)uiDefButR(block,
|
||||
UI_BTYPE_COLOR,
|
||||
0,
|
||||
|
||||
@@ -693,8 +693,7 @@ int UI_icon_from_id(const ID *id)
|
||||
|
||||
/* otherwise get it through RNA, creating the pointer
|
||||
* will set the right type, also with subclassing */
|
||||
PointerRNA ptr;
|
||||
RNA_id_pointer_create((ID *)id, &ptr);
|
||||
PointerRNA ptr = RNA_id_pointer_create((ID *)id);
|
||||
|
||||
return (ptr.type) ? RNA_struct_ui_icon(ptr.type) : ICON_NONE;
|
||||
}
|
||||
|
||||
@@ -97,8 +97,7 @@ static int cachefile_open_exec(bContext *C, wmOperator *op)
|
||||
* pointer see also increases user, so this compensates it. */
|
||||
id_us_min(&cache_file->id);
|
||||
|
||||
PointerRNA idptr;
|
||||
RNA_id_pointer_create(&cache_file->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&cache_file->id);
|
||||
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, nullptr);
|
||||
RNA_property_update(C, &pprop->ptr, pprop->prop);
|
||||
}
|
||||
|
||||
@@ -193,8 +193,7 @@ static void ui_obj_export_settings(uiLayout *layout, PointerRNA *imfptr)
|
||||
|
||||
static void wm_obj_export_draw(bContext * /*C*/, wmOperator *op)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(nullptr, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(nullptr, op->type->srna, op->properties);
|
||||
ui_obj_export_settings(op->layout, &ptr);
|
||||
}
|
||||
|
||||
@@ -470,9 +469,8 @@ static void ui_obj_import_settings(uiLayout *layout, PointerRNA *imfptr)
|
||||
|
||||
static void wm_obj_import_draw(bContext *C, wmOperator *op)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
ui_obj_import_settings(op->layout, &ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +130,7 @@ static void ui_ply_export_settings(uiLayout *layout, PointerRNA *imfptr)
|
||||
|
||||
static void wm_ply_export_draw(bContext * /*C*/, wmOperator *op)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(nullptr, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(nullptr, op->type->srna, op->properties);
|
||||
ui_ply_export_settings(op->layout, &ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -901,7 +901,6 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
|
||||
{
|
||||
uiLayout *layout = op->layout;
|
||||
uiLayout *col, *row;
|
||||
PointerRNA toolsettings_ptr;
|
||||
|
||||
int profile_type = RNA_enum_get(op->ptr, "profile_type");
|
||||
int offset_type = RNA_enum_get(op->ptr, "offset_type");
|
||||
@@ -970,7 +969,8 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
|
||||
if (profile_type == BEVEL_PROFILE_CUSTOM) {
|
||||
/* Get an RNA pointer to ToolSettings to give to the curve profile template code. */
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
RNA_pointer_create(&scene->id, &RNA_ToolSettings, scene->toolsettings, &toolsettings_ptr);
|
||||
PointerRNA toolsettings_ptr = RNA_pointer_create(
|
||||
&scene->id, &RNA_ToolSettings, scene->toolsettings);
|
||||
uiTemplateCurveProfile(layout, &toolsettings_ptr, "custom_bevel_profile_preset");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,8 +429,7 @@ static void gizmo_mesh_spin_init_message_subscribe(const bContext *C,
|
||||
msg_sub_value_gz_tag_refresh.user_data = gzgroup->parent_gzmap;
|
||||
msg_sub_value_gz_tag_refresh.notify = WM_gizmo_do_msg_notify_tag_refresh;
|
||||
|
||||
PointerRNA cursor_ptr;
|
||||
RNA_pointer_create(&scene->id, &RNA_View3DCursor, &scene->cursor, &cursor_ptr);
|
||||
PointerRNA cursor_ptr = RNA_pointer_create(&scene->id, &RNA_View3DCursor, &scene->cursor);
|
||||
/* All cursor properties. */
|
||||
WM_msg_subscribe_rna(mbus, &cursor_ptr, nullptr, &msg_sub_value_gz_tag_refresh, __func__);
|
||||
|
||||
|
||||
@@ -3967,9 +3967,8 @@ static void edbm_blend_from_shape_ui(bContext *C, wmOperator *op)
|
||||
uiLayout *layout = op->layout;
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
Mesh *me = static_cast<Mesh *>(obedit->data);
|
||||
PointerRNA ptr_key;
|
||||
|
||||
RNA_id_pointer_create((ID *)me->key, &ptr_key);
|
||||
PointerRNA ptr_key = RNA_id_pointer_create((ID *)me->key);
|
||||
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
uiLayoutSetPropDecorate(layout, false);
|
||||
@@ -8866,9 +8865,8 @@ static void edbm_point_normals_ui(bContext *C, wmOperator *op)
|
||||
{
|
||||
uiLayout *layout = op->layout;
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
PointerRNA ptr;
|
||||
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
|
||||
@@ -9361,9 +9359,8 @@ static void edbm_average_normals_ui(bContext *C, wmOperator *op)
|
||||
{
|
||||
uiLayout *layout = op->layout;
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
PointerRNA ptr;
|
||||
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
|
||||
@@ -9619,9 +9616,8 @@ static void edbm_normals_tools_ui(bContext *C, wmOperator *op)
|
||||
{
|
||||
uiLayout *layout = op->layout;
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
PointerRNA ptr;
|
||||
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
|
||||
/* Main auto-draw call */
|
||||
uiDefAutoButsRNA(layout,
|
||||
|
||||
@@ -1084,12 +1084,11 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
else {
|
||||
/* animate constraint's "fixed offset" */
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
char *path;
|
||||
|
||||
/* get RNA pointer to constraint's "offset_factor" property - to build RNA path */
|
||||
RNA_pointer_create(&ob->id, &RNA_FollowPathConstraint, con, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_FollowPathConstraint, con);
|
||||
prop = RNA_struct_find_property(&ptr, "offset_factor");
|
||||
|
||||
path = RNA_path_from_ID_to_property(&ptr, prop);
|
||||
|
||||
@@ -303,10 +303,8 @@ static int rigidbody_objects_shape_change_exec(bContext *C, wmOperator *op)
|
||||
/* apply this to all selected objects... */
|
||||
CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
|
||||
if (ob->rigidbody_object) {
|
||||
PointerRNA ptr;
|
||||
|
||||
/* use RNA-system to change the property and perform all necessary changes */
|
||||
RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object);
|
||||
RNA_enum_set(&ptr, "collision_shape", shape);
|
||||
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
|
||||
@@ -481,8 +479,6 @@ static int rigidbody_objects_calc_mass_exec(bContext *C, wmOperator *op)
|
||||
/* Apply this to all selected objects (with rigid-bodies). */
|
||||
CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
|
||||
if (ob->rigidbody_object) {
|
||||
PointerRNA ptr;
|
||||
|
||||
float volume; /* m^3 */
|
||||
float mass; /* kg */
|
||||
|
||||
@@ -494,7 +490,7 @@ static int rigidbody_objects_calc_mass_exec(bContext *C, wmOperator *op)
|
||||
mass = volume * density;
|
||||
|
||||
/* use RNA-system to change the property and perform all necessary changes */
|
||||
RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_RigidBodyObject, ob->rigidbody_object);
|
||||
RNA_float_set(&ptr, "mass", mass);
|
||||
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
|
||||
|
||||
@@ -756,7 +756,7 @@ static int new_material_exec(bContext *C, wmOperator * /*op*/)
|
||||
Material *ma = static_cast<Material *>(
|
||||
CTX_data_pointer_get_type(C, "material", &RNA_Material).data);
|
||||
Main *bmain = CTX_data_main(C);
|
||||
PointerRNA ptr, idptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* hook into UI */
|
||||
@@ -796,7 +796,7 @@ static int new_material_exec(bContext *C, wmOperator * /*op*/)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&ma->id);
|
||||
|
||||
RNA_id_pointer_create(&ma->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&ma->id);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
@@ -831,7 +831,7 @@ static int new_texture_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
Tex *tex = static_cast<Tex *>(CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data);
|
||||
Main *bmain = CTX_data_main(C);
|
||||
PointerRNA ptr, idptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* add or copy texture */
|
||||
@@ -850,7 +850,7 @@ static int new_texture_exec(bContext *C, wmOperator * /*op*/)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&tex->id);
|
||||
|
||||
RNA_id_pointer_create(&tex->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&tex->id);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
@@ -884,7 +884,7 @@ static int new_world_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
World *wo = static_cast<World *>(CTX_data_pointer_get_type(C, "world", &RNA_World).data);
|
||||
Main *bmain = CTX_data_main(C);
|
||||
PointerRNA ptr, idptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* add or copy world */
|
||||
@@ -907,7 +907,7 @@ static int new_world_exec(bContext *C, wmOperator * /*op*/)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&wo->id);
|
||||
|
||||
RNA_id_pointer_create(&wo->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&wo->id);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
|
||||
@@ -608,8 +608,7 @@ void ED_region_do_draw(bContext *C, ARegion *region)
|
||||
{
|
||||
SpaceLink *sl = static_cast<SpaceLink *>(area->spacedata.first);
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_Space, sl, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&screen->id, &RNA_Space, sl);
|
||||
|
||||
/* All properties for this space type. */
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
|
||||
@@ -2718,10 +2717,9 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
PointerRNA areaptr;
|
||||
int xco = 0.4 * U.widget_unit;
|
||||
|
||||
RNA_pointer_create(&(screen->id), &RNA_Area, area, &areaptr);
|
||||
PointerRNA areaptr = RNA_pointer_create(&(screen->id), &RNA_Area, area);
|
||||
|
||||
uiDefButR(block,
|
||||
UI_BTYPE_MENU,
|
||||
|
||||
@@ -4370,8 +4370,7 @@ void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void * /
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, area->spacedata.first, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, area->spacedata.first);
|
||||
if (!ELEM(area->spacetype, SPACE_TOPBAR)) {
|
||||
uiItemR(layout, &ptr, "show_region_header", UI_ITEM_NONE, IFACE_("Show Header"), ICON_NONE);
|
||||
}
|
||||
@@ -4408,8 +4407,7 @@ void ED_screens_footer_tools_menu_create(bContext *C, uiLayout *layout, void * /
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, area->spacedata.first, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, area->spacedata.first);
|
||||
uiItemR(layout, &ptr, "show_region_footer", UI_ITEM_NONE, IFACE_("Show Footer"), ICON_NONE);
|
||||
}
|
||||
|
||||
@@ -4435,9 +4433,7 @@ void ED_screens_region_flip_menu_create(bContext *C, uiLayout *layout, void * /*
|
||||
|
||||
static void ed_screens_statusbar_menu_create(uiLayout *layout, void * /*arg*/)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
|
||||
RNA_pointer_create(nullptr, &RNA_PreferencesView, &U, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(nullptr, &RNA_PreferencesView, &U);
|
||||
uiItemR(
|
||||
layout, &ptr, "show_statusbar_stats", UI_ITEM_NONE, IFACE_("Scene Statistics"), ICON_NONE);
|
||||
uiItemR(layout,
|
||||
@@ -5183,8 +5179,7 @@ static int userpref_show_exec(bContext *C, wmOperator *op)
|
||||
if (prop && RNA_property_is_set(op->ptr, prop)) {
|
||||
/* Set active section via RNA, so it can fail properly. */
|
||||
|
||||
PointerRNA pref_ptr;
|
||||
RNA_pointer_create(nullptr, &RNA_Preferences, &U, &pref_ptr);
|
||||
PointerRNA pref_ptr = RNA_pointer_create(nullptr, &RNA_Preferences, &U);
|
||||
PropertyRNA *active_section_prop = RNA_struct_find_property(&pref_ptr, "active_section");
|
||||
|
||||
RNA_property_enum_set(&pref_ptr, active_section_prop, RNA_property_enum_get(op->ptr, prop));
|
||||
@@ -5617,9 +5612,8 @@ static int space_type_set_or_cycle_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
const int space_type = RNA_enum_get(op->ptr, "space_type");
|
||||
|
||||
PointerRNA ptr;
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Area, area, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Area, area);
|
||||
PropertyRNA *prop_type = RNA_struct_find_property(&ptr, "type");
|
||||
PropertyRNA *prop_ui_type = RNA_struct_find_property(&ptr, "ui_type");
|
||||
|
||||
@@ -5700,11 +5694,11 @@ static void context_cycle_prop_get(bScreen *screen,
|
||||
|
||||
switch (area->spacetype) {
|
||||
case SPACE_PROPERTIES:
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceProperties, area->spacedata.first, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(&screen->id, &RNA_SpaceProperties, area->spacedata.first);
|
||||
propname = "context";
|
||||
break;
|
||||
case SPACE_USERPREF:
|
||||
RNA_pointer_create(nullptr, &RNA_Preferences, &U, r_ptr);
|
||||
*r_ptr = RNA_pointer_create(nullptr, &RNA_Preferences, &U);
|
||||
propname = "active_section";
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -278,8 +278,7 @@ static void screen_user_menu_draw(const bContext *C, Menu *menu)
|
||||
}
|
||||
PointerRNA ptr = CTX_data_pointer_get(C, umi_pr->context_data_path);
|
||||
if (ptr.type == nullptr) {
|
||||
PointerRNA ctx_ptr;
|
||||
RNA_pointer_create(nullptr, &RNA_Context, (void *)C, &ctx_ptr);
|
||||
PointerRNA ctx_ptr = RNA_pointer_create(nullptr, &RNA_Context, (void *)C);
|
||||
if (!RNA_path_resolve_full(&ctx_ptr, umi_pr->context_data_path, &ptr, nullptr, nullptr))
|
||||
{
|
||||
ptr.type = nullptr;
|
||||
|
||||
@@ -217,8 +217,7 @@ static void screenshot_draw(bContext * /*C*/, wmOperator *op)
|
||||
uiLayoutSetPropDecorate(layout, false);
|
||||
|
||||
/* image template */
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(nullptr, &RNA_ImageFormatSettings, &scd->im_format, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(nullptr, &RNA_ImageFormatSettings, &scd->im_format);
|
||||
uiTemplateImageSettings(layout, &ptr, false);
|
||||
|
||||
/* main draw call */
|
||||
|
||||
@@ -1166,9 +1166,7 @@ static void cavity_bake_ui(bContext *C, wmOperator *op)
|
||||
uiItemR(layout, op->ptr, "use_curve", UI_ITEM_NONE, nullptr, ICON_NONE);
|
||||
|
||||
if (sd && RNA_boolean_get(op->ptr, "use_curve")) {
|
||||
PointerRNA sculpt_ptr;
|
||||
|
||||
RNA_pointer_create(&scene->id, &RNA_Sculpt, sd, &sculpt_ptr);
|
||||
PointerRNA sculpt_ptr = RNA_pointer_create(&scene->id, &RNA_Sculpt, sd);
|
||||
uiTemplateCurveMapping(
|
||||
layout, &sculpt_ptr, "automasking_cavity_curve_op", 'v', false, false, false, false);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ static int sound_open_exec(bContext *C, wmOperator *op)
|
||||
char filepath[FILE_MAX];
|
||||
bSound *sound;
|
||||
PropertyPointerRNA *pprop;
|
||||
PointerRNA idptr;
|
||||
Main *bmain = CTX_data_main(C);
|
||||
|
||||
RNA_string_get(op->ptr, "filepath", filepath);
|
||||
@@ -103,7 +102,7 @@ static int sound_open_exec(bContext *C, wmOperator *op)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&sound->id);
|
||||
|
||||
RNA_id_pointer_create(&sound->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&sound->id);
|
||||
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, nullptr);
|
||||
RNA_property_update(C, &pprop->ptr, pprop->prop);
|
||||
}
|
||||
@@ -550,7 +549,6 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
|
||||
|
||||
uiLayout *layout = op->layout;
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop_format;
|
||||
PropertyRNA *prop_codec;
|
||||
PropertyRNA *prop_bitrate;
|
||||
@@ -648,7 +646,7 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op)
|
||||
break;
|
||||
}
|
||||
|
||||
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&wm->id, op->type->srna, op->properties);
|
||||
|
||||
/* main draw call */
|
||||
uiDefAutoButsRNA(layout,
|
||||
|
||||
@@ -140,15 +140,14 @@ static void actedit_change_action(bContext *C, bAction *act)
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
|
||||
PointerRNA ptr, idptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* create RNA pointers and get the property */
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, saction, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, saction);
|
||||
prop = RNA_struct_find_property(&ptr, "action");
|
||||
|
||||
/* NOTE: act may be nullptr here, so better to just use a cast here */
|
||||
RNA_id_pointer_create((ID *)act, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create((ID *)act);
|
||||
|
||||
/* set the new pointer, and force a refresh */
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
@@ -208,7 +207,7 @@ static bool action_new_poll(bContext *C)
|
||||
|
||||
static int action_new_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
PointerRNA ptr, idptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
bAction *oldact = nullptr;
|
||||
@@ -272,7 +271,7 @@ static int action_new_exec(bContext *C, wmOperator * /*op*/)
|
||||
/* set this new action
|
||||
* NOTE: we can't use actedit_change_action, as this function is also called from the NLA
|
||||
*/
|
||||
RNA_id_pointer_create(&action->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&action->id);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
@@ -641,11 +640,10 @@ void ED_animedit_unlink_action(
|
||||
}
|
||||
else {
|
||||
/* clear AnimData -> action */
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* create AnimData RNA pointers */
|
||||
RNA_pointer_create(id, &RNA_AnimData, adt, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(id, &RNA_AnimData, adt);
|
||||
prop = RNA_struct_find_property(&ptr, "action");
|
||||
|
||||
/* clear... */
|
||||
|
||||
@@ -365,13 +365,8 @@ static void action_channel_region_listener(const wmRegionListenerParams *params)
|
||||
static void saction_channel_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
|
||||
{
|
||||
wmMsgBus *mbus = params->message_bus;
|
||||
bScreen *screen = params->screen;
|
||||
ScrArea *area = params->area;
|
||||
ARegion *region = params->region;
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr);
|
||||
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
|
||||
msg_sub_value_region_tag_redraw.owner = region;
|
||||
msg_sub_value_region_tag_redraw.user_data = region;
|
||||
@@ -467,13 +462,8 @@ static void saction_main_region_message_subscribe(const wmRegionMessageSubscribe
|
||||
{
|
||||
wmMsgBus *mbus = params->message_bus;
|
||||
Scene *scene = params->scene;
|
||||
bScreen *screen = params->screen;
|
||||
ScrArea *area = params->area;
|
||||
ARegion *region = params->region;
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr);
|
||||
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
|
||||
msg_sub_value_region_tag_redraw.owner = region;
|
||||
msg_sub_value_region_tag_redraw.user_data = region;
|
||||
@@ -489,8 +479,7 @@ static void saction_main_region_message_subscribe(const wmRegionMessageSubscribe
|
||||
&rna_Scene_frame_current,
|
||||
};
|
||||
|
||||
PointerRNA idptr;
|
||||
RNA_id_pointer_create(&scene->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&scene->id);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(props); i++) {
|
||||
WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
|
||||
|
||||
@@ -105,7 +105,7 @@ static bool buttons_context_path_view_layer(ButsContextPath *path, wmWindow *win
|
||||
ViewLayer *view_layer = (win->scene == scene) ? WM_window_get_active_view_layer(win) :
|
||||
BKE_view_layer_default_view(scene);
|
||||
|
||||
RNA_pointer_create(&scene->id, &RNA_ViewLayer, view_layer, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_pointer_create(&scene->id, &RNA_ViewLayer, view_layer);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ static bool buttons_context_path_world(ButsContextPath *path)
|
||||
World *world = scene->world;
|
||||
|
||||
if (world) {
|
||||
RNA_id_pointer_create(&scene->world->id, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create(&scene->world->id);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ static bool buttons_context_path_collection(const bContext *C,
|
||||
}
|
||||
|
||||
if (c) {
|
||||
RNA_id_pointer_create(&c->id, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create(&c->id);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ static bool buttons_context_path_linestyle(ButsContextPath *path, wmWindow *wind
|
||||
ViewLayer *view_layer = static_cast<ViewLayer *>(path->ptr[path->len - 1].data);
|
||||
FreestyleLineStyle *linestyle = BKE_linestyle_active_from_view_layer(view_layer);
|
||||
if (linestyle) {
|
||||
RNA_id_pointer_create(&linestyle->id, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create(&linestyle->id);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ static bool buttons_context_path_object(ButsContextPath *path)
|
||||
Object *ob = BKE_view_layer_active_object_get(view_layer);
|
||||
|
||||
if (ob) {
|
||||
RNA_id_pointer_create(&ob->id, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create(&ob->id);
|
||||
path->len++;
|
||||
|
||||
return true;
|
||||
@@ -281,7 +281,7 @@ static bool buttons_context_path_data(ButsContextPath *path, int type)
|
||||
Object *ob = static_cast<Object *>(path->ptr[path->len - 1].data);
|
||||
|
||||
if (ob && ELEM(type, -1, ob->type)) {
|
||||
RNA_id_pointer_create(static_cast<ID *>(ob->data), &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create(static_cast<ID *>(ob->data));
|
||||
path->len++;
|
||||
|
||||
return true;
|
||||
@@ -311,7 +311,7 @@ static bool buttons_context_path_modifier(ButsContextPath *path)
|
||||
{
|
||||
ModifierData *md = BKE_object_active_modifier(ob);
|
||||
if (md != nullptr) {
|
||||
RNA_pointer_create(&ob->id, &RNA_Modifier, md, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_pointer_create(&ob->id, &RNA_Modifier, md);
|
||||
path->len++;
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ static bool buttons_context_path_material(ButsContextPath *path)
|
||||
if (ob && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
|
||||
Material *ma = BKE_object_material_get(ob, ob->actcol);
|
||||
if (ma != nullptr) {
|
||||
RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create(&ma->id);
|
||||
path->len++;
|
||||
}
|
||||
return true;
|
||||
@@ -370,14 +370,14 @@ static bool buttons_context_path_bone(ButsContextPath *path)
|
||||
if (arm->edbo) {
|
||||
if (arm->act_edbone) {
|
||||
EditBone *edbo = arm->act_edbone;
|
||||
RNA_pointer_create(&arm->id, &RNA_EditBone, edbo, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_pointer_create(&arm->id, &RNA_EditBone, edbo);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (arm->act_bone) {
|
||||
RNA_pointer_create(&arm->id, &RNA_Bone, arm->act_bone, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_pointer_create(&arm->id, &RNA_Bone, arm->act_bone);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
@@ -410,7 +410,7 @@ static bool buttons_context_path_pose_bone(ButsContextPath *path)
|
||||
if (arm->act_bone) {
|
||||
bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, arm->act_bone->name);
|
||||
if (pchan) {
|
||||
RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
@@ -436,7 +436,7 @@ static bool buttons_context_path_particle(ButsContextPath *path)
|
||||
if (ob && ob->type == OB_MESH) {
|
||||
ParticleSystem *psys = psys_get_current(ob);
|
||||
|
||||
RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys);
|
||||
path->len++;
|
||||
return true;
|
||||
}
|
||||
@@ -466,7 +466,7 @@ static bool buttons_context_path_brush(const bContext *C, ButsContextPath *path)
|
||||
}
|
||||
|
||||
if (br) {
|
||||
RNA_id_pointer_create((ID *)br, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create((ID *)br);
|
||||
path->len++;
|
||||
|
||||
return true;
|
||||
@@ -514,7 +514,7 @@ static bool buttons_context_path_texture(const bContext *C,
|
||||
}
|
||||
|
||||
if (ct->texture) {
|
||||
RNA_id_pointer_create(&ct->texture->id, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_id_pointer_create(&ct->texture->id);
|
||||
path->len++;
|
||||
}
|
||||
|
||||
@@ -561,12 +561,12 @@ static bool buttons_context_path(
|
||||
if (sbuts->pinid) {
|
||||
ID *id = sbuts->pinid;
|
||||
|
||||
RNA_id_pointer_create(id, &path->ptr[0]);
|
||||
path->ptr[0] = RNA_id_pointer_create(id);
|
||||
path->len++;
|
||||
}
|
||||
/* No pinned root, use scene as initial root. */
|
||||
else if (mainb != BCONTEXT_TOOL) {
|
||||
RNA_id_pointer_create(&scene->id, &path->ptr[0]);
|
||||
path->ptr[0] = RNA_id_pointer_create(&scene->id);
|
||||
path->len++;
|
||||
|
||||
if (!ELEM(mainb,
|
||||
@@ -576,7 +576,7 @@ static bool buttons_context_path(
|
||||
BCONTEXT_VIEW_LAYER,
|
||||
BCONTEXT_WORLD))
|
||||
{
|
||||
RNA_pointer_create(nullptr, &RNA_ViewLayer, view_layer, &path->ptr[path->len]);
|
||||
path->ptr[path->len] = RNA_pointer_create(nullptr, &RNA_ViewLayer, view_layer);
|
||||
path->len++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,15 +106,13 @@ static int toggle_pin_exec(bContext *C, wmOperator * /*op*/)
|
||||
sbuts->flag ^= SB_PIN_CONTEXT;
|
||||
|
||||
/* Create the properties space pointer. */
|
||||
PointerRNA sbuts_ptr;
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceProperties, sbuts, &sbuts_ptr);
|
||||
PointerRNA sbuts_ptr = RNA_pointer_create(&screen->id, &RNA_SpaceProperties, sbuts);
|
||||
|
||||
/* Create the new ID pointer and set the pin ID with RNA
|
||||
* so we can use the property's RNA update functionality. */
|
||||
ID *new_id = (sbuts->flag & SB_PIN_CONTEXT) ? buttons_context_id_path(C) : nullptr;
|
||||
PointerRNA new_id_ptr;
|
||||
RNA_id_pointer_create(new_id, &new_id_ptr);
|
||||
PointerRNA new_id_ptr = RNA_id_pointer_create(new_id);
|
||||
RNA_pointer_set(&sbuts_ptr, "pin_id", new_id_ptr);
|
||||
|
||||
ED_area_tag_redraw(CTX_wm_area(C));
|
||||
|
||||
@@ -137,10 +137,8 @@ static void buttons_texture_users_find_nodetree(ListBase *users,
|
||||
if (ntree) {
|
||||
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
|
||||
if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
|
||||
PointerRNA ptr;
|
||||
PointerRNA ptr = RNA_pointer_create(&ntree->id, &RNA_Node, node);
|
||||
// PropertyRNA *prop; /* UNUSED */
|
||||
|
||||
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
|
||||
// prop = RNA_struct_find_property(&ptr, "texture"); /* UNUSED */
|
||||
|
||||
buttons_texture_user_node_add(
|
||||
@@ -160,7 +158,6 @@ static void buttons_texture_modifier_geonodes_users_add(
|
||||
ListBase *users,
|
||||
blender::Set<const bNodeTree *> &handled_groups)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
for (bNode *node : node_tree->all_nodes()) {
|
||||
@@ -178,7 +175,7 @@ static void buttons_texture_modifier_geonodes_users_add(
|
||||
if (socket->type != SOCK_TEXTURE) {
|
||||
continue;
|
||||
}
|
||||
RNA_pointer_create(&node_tree->id, &RNA_NodeSocket, socket, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&node_tree->id, &RNA_NodeSocket, socket);
|
||||
prop = RNA_struct_find_property(&ptr, "default_value");
|
||||
|
||||
PointerRNA texptr = RNA_property_pointer_get(&ptr, prop);
|
||||
@@ -214,10 +211,9 @@ static void buttons_texture_modifier_foreach(void *user_data,
|
||||
}
|
||||
}
|
||||
else {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_pointer_create(&ob->id, &RNA_Modifier, md, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_Modifier, md);
|
||||
prop = RNA_struct_find_property(&ptr, propname);
|
||||
|
||||
buttons_texture_user_property_add(
|
||||
@@ -230,11 +226,10 @@ static void buttons_texture_modifier_gpencil_foreach(void *user_data,
|
||||
GpencilModifierData *md,
|
||||
const char *propname)
|
||||
{
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
ListBase *users = static_cast<ListBase *>(user_data);
|
||||
|
||||
RNA_pointer_create(&ob->id, &RNA_GpencilModifier, md, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_GpencilModifier, md);
|
||||
prop = RNA_struct_find_property(&ptr, propname);
|
||||
|
||||
buttons_texture_user_property_add(users,
|
||||
@@ -314,10 +309,10 @@ static void buttons_texture_users_from_context(ListBase *users,
|
||||
mtex = psys->part->mtex[a];
|
||||
|
||||
if (mtex) {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_pointer_create(&psys->part->id, &RNA_ParticleSettingsTextureSlot, mtex, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(
|
||||
&psys->part->id, &RNA_ParticleSettingsTextureSlot, mtex);
|
||||
prop = RNA_struct_find_property(&ptr, "texture");
|
||||
|
||||
buttons_texture_user_property_add(users,
|
||||
@@ -333,10 +328,9 @@ static void buttons_texture_users_from_context(ListBase *users,
|
||||
|
||||
/* field */
|
||||
if (ob->pd && ob->pd->forcefield == PFIELD_TEXTURE) {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_pointer_create(&ob->id, &RNA_FieldSettings, ob->pd, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_FieldSettings, ob->pd);
|
||||
prop = RNA_struct_find_property(&ptr, "texture");
|
||||
|
||||
buttons_texture_user_property_add(
|
||||
@@ -346,18 +340,17 @@ static void buttons_texture_users_from_context(ListBase *users,
|
||||
|
||||
/* brush */
|
||||
if (brush) {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* texture */
|
||||
RNA_pointer_create(&brush->id, &RNA_BrushTextureSlot, &brush->mtex, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&brush->id, &RNA_BrushTextureSlot, &brush->mtex);
|
||||
prop = RNA_struct_find_property(&ptr, "texture");
|
||||
|
||||
buttons_texture_user_property_add(
|
||||
users, &brush->id, ptr, prop, N_("Brush"), ICON_BRUSH_DATA, IFACE_("Brush"));
|
||||
|
||||
/* mask texture */
|
||||
RNA_pointer_create(&brush->id, &RNA_BrushTextureSlot, &brush->mask_mtex, &ptr);
|
||||
ptr = RNA_pointer_create(&brush->id, &RNA_BrushTextureSlot, &brush->mask_mtex);
|
||||
prop = RNA_struct_find_property(&ptr, "texture");
|
||||
|
||||
buttons_texture_user_property_add(
|
||||
|
||||
@@ -878,7 +878,7 @@ static void buttons_id_remap(ScrArea * /*area*/, SpaceLink *slink, const IDRemap
|
||||
break;
|
||||
}
|
||||
case ID_REMAP_RESULT_SOURCE_REMAPPED: {
|
||||
RNA_id_pointer_create(path->ptr[i].owner_id, &path->ptr[i]);
|
||||
path->ptr[i] = RNA_id_pointer_create(path->ptr[i].owner_id);
|
||||
/* There is no easy way to check/make path downwards valid, just nullify it.
|
||||
* Next redraw will rebuild this anyway. */
|
||||
i++;
|
||||
|
||||
@@ -382,9 +382,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
|
||||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax)) {
|
||||
MovieTrackingTrack *track = channel->track;
|
||||
const int icon = (track->flag & TRACK_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
|
||||
PointerRNA ptr;
|
||||
|
||||
RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track);
|
||||
|
||||
UI_block_emboss_set(block, UI_EMBOSS_NONE);
|
||||
uiDefIconButR_prop(block,
|
||||
|
||||
@@ -183,7 +183,6 @@ static int open_exec(bContext *C, wmOperator *op)
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
Main *bmain = CTX_data_main(C);
|
||||
PropertyPointerRNA *pprop;
|
||||
PointerRNA idptr;
|
||||
MovieClip *clip = nullptr;
|
||||
char filepath[FILE_MAX];
|
||||
|
||||
@@ -242,7 +241,7 @@ static int open_exec(bContext *C, wmOperator *op)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&clip->id);
|
||||
|
||||
RNA_id_pointer_create(&clip->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&clip->id);
|
||||
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, nullptr);
|
||||
RNA_property_update(C, &pprop->ptr, pprop->prop);
|
||||
}
|
||||
|
||||
@@ -65,13 +65,12 @@ void ED_file_path_button(bScreen *screen,
|
||||
FileSelectParams *params,
|
||||
uiBlock *block)
|
||||
{
|
||||
PointerRNA params_rna_ptr;
|
||||
uiBut *but;
|
||||
|
||||
BLI_assert_msg(params != nullptr,
|
||||
"File select parameters not set. The caller is expected to check this.");
|
||||
|
||||
RNA_pointer_create(&screen->id, &RNA_FileSelectParams, params, ¶ms_rna_ptr);
|
||||
PointerRNA params_rna_ptr = RNA_pointer_create(&screen->id, &RNA_FileSelectParams, params);
|
||||
|
||||
/* callbacks for operator check functions */
|
||||
UI_block_func_set(block, file_draw_check_cb, nullptr, nullptr);
|
||||
|
||||
@@ -131,7 +131,7 @@ static void file_panel_execution_buttons_draw(const bContext *C, Panel *panel)
|
||||
uiBlock *block = uiLayoutGetBlock(panel->layout);
|
||||
uiBut *but;
|
||||
uiLayout *row;
|
||||
PointerRNA params_rna_ptr, *but_extra_rna_ptr;
|
||||
PointerRNA *but_extra_rna_ptr;
|
||||
|
||||
const bool overwrite_alert = file_draw_check_exists(sfile);
|
||||
const bool windows_layout =
|
||||
@@ -141,7 +141,7 @@ static void file_panel_execution_buttons_draw(const bContext *C, Panel *panel)
|
||||
false;
|
||||
#endif
|
||||
|
||||
RNA_pointer_create(&screen->id, &RNA_FileSelectParams, params, ¶ms_rna_ptr);
|
||||
PointerRNA params_rna_ptr = RNA_pointer_create(&screen->id, &RNA_FileSelectParams, params);
|
||||
|
||||
row = uiLayoutRow(panel->layout, false);
|
||||
uiLayoutSetScaleY(row, 1.3f);
|
||||
@@ -231,8 +231,7 @@ static void file_panel_asset_catalog_buttons_draw(const bContext *C, Panel *pane
|
||||
uiLayout *col = uiLayoutColumn(panel->layout, false);
|
||||
uiLayout *row = uiLayoutRow(col, true);
|
||||
|
||||
PointerRNA params_ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_FileAssetSelectParams, params, ¶ms_ptr);
|
||||
PointerRNA params_ptr = RNA_pointer_create(&screen->id, &RNA_FileAssetSelectParams, params);
|
||||
|
||||
uiItemR(row, ¶ms_ptr, "asset_library_ref", UI_ITEM_NONE, "", ICON_NONE);
|
||||
if (params->asset_library_ref.type == ASSET_LIBRARY_LOCAL) {
|
||||
|
||||
@@ -488,8 +488,7 @@ static void file_main_region_message_subscribe(const wmRegionMessageSubscribePar
|
||||
|
||||
/* SpaceFile itself. */
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceFileBrowser, sfile, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&screen->id, &RNA_SpaceFileBrowser, sfile);
|
||||
|
||||
/* All properties for this space type. */
|
||||
WM_msg_subscribe_rna(mbus, &ptr, nullptr, &msg_sub_value_area_tag_refresh, __func__);
|
||||
@@ -497,8 +496,7 @@ static void file_main_region_message_subscribe(const wmRegionMessageSubscribePar
|
||||
|
||||
/* FileSelectParams */
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_FileSelectParams, file_params, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(&screen->id, &RNA_FileSelectParams, file_params);
|
||||
|
||||
/* All properties for this space type. */
|
||||
WM_msg_subscribe_rna(mbus, &ptr, nullptr, &msg_sub_value_area_tag_refresh, __func__);
|
||||
@@ -506,8 +504,7 @@ static void file_main_region_message_subscribe(const wmRegionMessageSubscribePar
|
||||
|
||||
/* Experimental Asset Browser features option. */
|
||||
{
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(nullptr, &RNA_PreferencesExperimental, &U.experimental, &ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(nullptr, &RNA_PreferencesExperimental, &U.experimental);
|
||||
PropertyRNA *prop = RNA_struct_find_property(&ptr, "use_extended_asset_browser");
|
||||
|
||||
/* All properties for this space type. */
|
||||
|
||||
@@ -119,13 +119,10 @@ static void graph_panel_cursor_header(const bContext *C, Panel *panel)
|
||||
{
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
SpaceGraph *sipo = CTX_wm_space_graph(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
PointerRNA spaceptr, sceneptr;
|
||||
uiLayout *col;
|
||||
|
||||
/* get RNA pointers for use when creating the UI elements */
|
||||
RNA_id_pointer_create(&scene->id, &sceneptr);
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, sipo, &spaceptr);
|
||||
PointerRNA spaceptr = RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, sipo);
|
||||
|
||||
/* 2D-Cursor */
|
||||
col = uiLayoutColumn(panel->layout, false);
|
||||
@@ -137,13 +134,12 @@ static void graph_panel_cursor(const bContext *C, Panel *panel)
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
SpaceGraph *sipo = CTX_wm_space_graph(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
PointerRNA spaceptr, sceneptr;
|
||||
uiLayout *layout = panel->layout;
|
||||
uiLayout *col, *sub;
|
||||
|
||||
/* get RNA pointers for use when creating the UI elements */
|
||||
RNA_id_pointer_create(&scene->id, &sceneptr);
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, sipo, &spaceptr);
|
||||
PointerRNA sceneptr = RNA_id_pointer_create(&scene->id);
|
||||
PointerRNA spaceptr = RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, sipo);
|
||||
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
uiLayoutSetPropDecorate(layout, false);
|
||||
@@ -177,7 +173,6 @@ static void graph_panel_properties(const bContext *C, Panel *panel)
|
||||
{
|
||||
bAnimListElem *ale;
|
||||
FCurve *fcu;
|
||||
PointerRNA fcu_ptr;
|
||||
uiLayout *layout = panel->layout;
|
||||
uiLayout *col;
|
||||
char name[256];
|
||||
@@ -188,7 +183,7 @@ static void graph_panel_properties(const bContext *C, Panel *panel)
|
||||
}
|
||||
|
||||
/* F-Curve pointer */
|
||||
RNA_pointer_create(ale->fcurve_owner_id, &RNA_FCurve, fcu, &fcu_ptr);
|
||||
PointerRNA fcu_ptr = RNA_pointer_create(ale->fcurve_owner_id, &RNA_FCurve, fcu);
|
||||
|
||||
/* user-friendly 'name' for F-Curve */
|
||||
col = uiLayoutColumn(layout, false);
|
||||
@@ -369,16 +364,16 @@ static void graph_panel_key_properties(const bContext *C, Panel *panel)
|
||||
|
||||
/* only show this info if there are keyframes to edit */
|
||||
if (get_active_fcurve_keyframe_edit(fcu, &bezt, &prevbezt)) {
|
||||
PointerRNA bezt_ptr, id_ptr, fcu_prop_ptr;
|
||||
PointerRNA fcu_prop_ptr;
|
||||
PropertyRNA *fcu_prop = nullptr;
|
||||
uiBut *but;
|
||||
int unit = B_UNIT_NONE;
|
||||
|
||||
/* RNA pointer to keyframe, to allow editing */
|
||||
RNA_pointer_create(ale->fcurve_owner_id, &RNA_Keyframe, bezt, &bezt_ptr);
|
||||
PointerRNA bezt_ptr = RNA_pointer_create(ale->fcurve_owner_id, &RNA_Keyframe, bezt);
|
||||
|
||||
/* get property that F-Curve affects, for some unit-conversion magic */
|
||||
RNA_id_pointer_create(ale->id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(ale->id);
|
||||
if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &fcu_prop_ptr, &fcu_prop)) {
|
||||
/* determine the unit for this property */
|
||||
unit = RNA_SUBTYPE_UNIT(RNA_property_subtype(fcu_prop));
|
||||
@@ -749,11 +744,10 @@ static bool graph_panel_drivers_poll(const bContext *C, PanelType * /*pt*/)
|
||||
static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVar *dvar)
|
||||
{
|
||||
DriverTarget *dtar = &dvar->targets[0];
|
||||
PointerRNA dtar_ptr;
|
||||
uiLayout *row, *col;
|
||||
|
||||
/* initialize RNA pointer to the target */
|
||||
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
|
||||
PointerRNA dtar_ptr = RNA_pointer_create(id, &RNA_DriverTarget, dtar);
|
||||
|
||||
/* Target ID */
|
||||
row = uiLayoutRow(layout, false);
|
||||
@@ -762,10 +756,8 @@ static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVa
|
||||
|
||||
/* Target Property */
|
||||
if (dtar->id) {
|
||||
PointerRNA root_ptr;
|
||||
|
||||
/* get pointer for resolving the property selected */
|
||||
RNA_id_pointer_create(dtar->id, &root_ptr);
|
||||
PointerRNA root_ptr = RNA_id_pointer_create(dtar->id);
|
||||
|
||||
/* rna path */
|
||||
col = uiLayoutColumn(layout, true);
|
||||
@@ -786,12 +778,11 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
|
||||
DriverTarget *dtar2 = &dvar->targets[1];
|
||||
Object *ob1 = (Object *)dtar->id;
|
||||
Object *ob2 = (Object *)dtar2->id;
|
||||
PointerRNA dtar_ptr, dtar2_ptr;
|
||||
uiLayout *col;
|
||||
|
||||
/* initialize RNA pointer to the target */
|
||||
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
|
||||
RNA_pointer_create(id, &RNA_DriverTarget, dtar2, &dtar2_ptr);
|
||||
PointerRNA dtar_ptr = RNA_pointer_create(id, &RNA_DriverTarget, dtar);
|
||||
PointerRNA dtar2_ptr = RNA_pointer_create(id, &RNA_DriverTarget, dtar2);
|
||||
|
||||
/* Object 1 */
|
||||
col = uiLayoutColumn(layout, true);
|
||||
@@ -799,9 +790,7 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
|
||||
uiItemR(col, &dtar_ptr, "id", UI_ITEM_NONE, IFACE_("Object 1"), ICON_NONE);
|
||||
|
||||
if (dtar->id && GS(dtar->id->name) == ID_OB && ob1->pose) {
|
||||
PointerRNA tar_ptr;
|
||||
|
||||
RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose, &tar_ptr);
|
||||
PointerRNA tar_ptr = RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose);
|
||||
uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
|
||||
}
|
||||
|
||||
@@ -811,9 +800,7 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
|
||||
uiItemR(col, &dtar2_ptr, "id", UI_ITEM_NONE, IFACE_("Object 2"), ICON_NONE);
|
||||
|
||||
if (dtar2->id && GS(dtar2->id->name) == ID_OB && ob2->pose) {
|
||||
PointerRNA tar_ptr;
|
||||
|
||||
RNA_pointer_create(dtar2->id, &RNA_Pose, ob2->pose, &tar_ptr);
|
||||
PointerRNA tar_ptr = RNA_pointer_create(dtar2->id, &RNA_Pose, ob2->pose);
|
||||
uiItemPointerR(col, &dtar2_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
|
||||
}
|
||||
}
|
||||
@@ -825,12 +812,11 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
|
||||
DriverTarget *dtar2 = &dvar->targets[1];
|
||||
Object *ob1 = (Object *)dtar->id;
|
||||
Object *ob2 = (Object *)dtar2->id;
|
||||
PointerRNA dtar_ptr, dtar2_ptr;
|
||||
uiLayout *col;
|
||||
|
||||
/* initialize RNA pointer to the target */
|
||||
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
|
||||
RNA_pointer_create(id, &RNA_DriverTarget, dtar2, &dtar2_ptr);
|
||||
PointerRNA dtar_ptr = RNA_pointer_create(id, &RNA_DriverTarget, dtar);
|
||||
PointerRNA dtar2_ptr = RNA_pointer_create(id, &RNA_DriverTarget, dtar2);
|
||||
|
||||
/* Object 1 */
|
||||
col = uiLayoutColumn(layout, true);
|
||||
@@ -838,9 +824,7 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
|
||||
uiItemR(col, &dtar_ptr, "id", UI_ITEM_NONE, IFACE_("Object 1"), ICON_NONE);
|
||||
|
||||
if (dtar->id && GS(dtar->id->name) == ID_OB && ob1->pose) {
|
||||
PointerRNA tar_ptr;
|
||||
|
||||
RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose, &tar_ptr);
|
||||
PointerRNA tar_ptr = RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose);
|
||||
uiItemPointerR(
|
||||
col, &dtar_ptr, "bone_target", &tar_ptr, "bones", IFACE_("Bone"), ICON_BONE_DATA);
|
||||
}
|
||||
@@ -856,9 +840,7 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
|
||||
uiItemR(col, &dtar2_ptr, "id", UI_ITEM_NONE, IFACE_("Object 2"), ICON_NONE);
|
||||
|
||||
if (dtar2->id && GS(dtar2->id->name) == ID_OB && ob2->pose) {
|
||||
PointerRNA tar_ptr;
|
||||
|
||||
RNA_pointer_create(dtar2->id, &RNA_Pose, ob2->pose, &tar_ptr);
|
||||
PointerRNA tar_ptr = RNA_pointer_create(dtar2->id, &RNA_Pose, ob2->pose);
|
||||
uiItemPointerR(
|
||||
col, &dtar2_ptr, "bone_target", &tar_ptr, "bones", IFACE_("Bone"), ICON_BONE_DATA);
|
||||
}
|
||||
@@ -874,11 +856,10 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
|
||||
{
|
||||
DriverTarget *dtar = &dvar->targets[0];
|
||||
Object *ob = (Object *)dtar->id;
|
||||
PointerRNA dtar_ptr;
|
||||
uiLayout *col, *sub;
|
||||
|
||||
/* initialize RNA pointer to the target */
|
||||
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
|
||||
PointerRNA dtar_ptr = RNA_pointer_create(id, &RNA_DriverTarget, dtar);
|
||||
|
||||
/* properties */
|
||||
col = uiLayoutColumn(layout, true);
|
||||
@@ -886,9 +867,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
|
||||
uiItemR(col, &dtar_ptr, "id", UI_ITEM_NONE, IFACE_("Object"), ICON_NONE);
|
||||
|
||||
if (dtar->id && GS(dtar->id->name) == ID_OB && ob->pose) {
|
||||
PointerRNA tar_ptr;
|
||||
|
||||
RNA_pointer_create(dtar->id, &RNA_Pose, ob->pose, &tar_ptr);
|
||||
PointerRNA tar_ptr = RNA_pointer_create(dtar->id, &RNA_Pose, ob->pose);
|
||||
uiItemPointerR(
|
||||
col, &dtar_ptr, "bone_target", &tar_ptr, "bones", IFACE_("Bone"), ICON_BONE_DATA);
|
||||
}
|
||||
@@ -914,8 +893,7 @@ static void graph_panel_driverVar__contextProp(uiLayout *layout, ID *id, DriverV
|
||||
DriverTarget *dtar = &dvar->targets[0];
|
||||
|
||||
/* Initialize RNA pointer to the target. */
|
||||
PointerRNA dtar_ptr;
|
||||
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
|
||||
PointerRNA dtar_ptr = RNA_pointer_create(id, &RNA_DriverTarget, dtar);
|
||||
|
||||
/* Target Property. */
|
||||
{
|
||||
@@ -944,8 +922,7 @@ static void graph_draw_driven_property_enabled_btn(uiLayout *layout,
|
||||
FCurve *fcu,
|
||||
const char *label)
|
||||
{
|
||||
PointerRNA fcurve_ptr;
|
||||
RNA_pointer_create(id, &RNA_FCurve, fcu, &fcurve_ptr);
|
||||
PointerRNA fcurve_ptr = RNA_pointer_create(id, &RNA_FCurve, fcu);
|
||||
|
||||
uiBlock *block = uiLayoutGetBlock(layout);
|
||||
uiDefButR(block,
|
||||
@@ -980,14 +957,10 @@ static void graph_panel_drivers_header(const bContext *C, Panel *panel)
|
||||
|
||||
static void graph_draw_driven_property_panel(uiLayout *layout, ID *id, FCurve *fcu)
|
||||
{
|
||||
PointerRNA fcu_ptr;
|
||||
uiLayout *row;
|
||||
char name[256];
|
||||
int icon = 0;
|
||||
|
||||
/* F-Curve pointer */
|
||||
RNA_pointer_create(id, &RNA_FCurve, fcu, &fcu_ptr);
|
||||
|
||||
/* get user-friendly 'name' for F-Curve */
|
||||
icon = getname_anim_fcurve(name, id, fcu);
|
||||
|
||||
@@ -1013,7 +986,6 @@ static void graph_draw_driver_settings_panel(uiLayout *layout,
|
||||
{
|
||||
ChannelDriver *driver = fcu->driver;
|
||||
|
||||
PointerRNA driver_ptr;
|
||||
uiLayout *col, *row, *row_outer;
|
||||
uiBlock *block;
|
||||
uiBut *but;
|
||||
@@ -1023,7 +995,7 @@ static void graph_draw_driver_settings_panel(uiLayout *layout,
|
||||
UI_block_func_handle_set(block, do_graph_region_driver_buttons, id);
|
||||
|
||||
/* driver-level settings - type, expressions, and errors */
|
||||
RNA_pointer_create(id, &RNA_Driver, driver, &driver_ptr);
|
||||
PointerRNA driver_ptr = RNA_pointer_create(id, &RNA_Driver, driver);
|
||||
|
||||
col = uiLayoutColumn(layout, true);
|
||||
block = uiLayoutGetBlock(col);
|
||||
@@ -1153,7 +1125,6 @@ static void graph_draw_driver_settings_panel(uiLayout *layout,
|
||||
|
||||
/* loop over targets, drawing them */
|
||||
LISTBASE_FOREACH (DriverVar *, dvar, &driver->variables) {
|
||||
PointerRNA dvar_ptr;
|
||||
uiLayout *box;
|
||||
uiLayout *subrow, *sub;
|
||||
|
||||
@@ -1162,7 +1133,7 @@ static void graph_draw_driver_settings_panel(uiLayout *layout,
|
||||
|
||||
/* 1) header panel */
|
||||
box = uiLayoutBox(col);
|
||||
RNA_pointer_create(id, &RNA_DriverVariable, dvar, &dvar_ptr);
|
||||
PointerRNA dvar_ptr = RNA_pointer_create(id, &RNA_DriverVariable, dvar);
|
||||
|
||||
row = uiLayoutRow(box, false);
|
||||
block = uiLayoutGetBlock(row);
|
||||
@@ -1380,8 +1351,7 @@ static void graph_panel_drivers_popover(const bContext *C, Panel *panel)
|
||||
if (fcu && fcu->driver) {
|
||||
ID *id = ptr.owner_id;
|
||||
|
||||
PointerRNA ptr_fcurve;
|
||||
RNA_pointer_create(id, &RNA_FCurve, fcu, &ptr_fcurve);
|
||||
PointerRNA ptr_fcurve = RNA_pointer_create(id, &RNA_FCurve, fcu);
|
||||
uiLayoutSetContextPointer(layout, "active_editable_fcurve", &ptr_fcurve);
|
||||
|
||||
/* Driven Property Settings */
|
||||
|
||||
@@ -807,8 +807,7 @@ static void blend_to_default_graph_keys(bAnimContext *ac, const float factor)
|
||||
continue;
|
||||
}
|
||||
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create(ale->id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(ale->id);
|
||||
|
||||
blend_to_default_fcurve(&id_ptr, fcu, factor);
|
||||
ale->update |= ANIM_UPDATE_DEFAULT;
|
||||
|
||||
@@ -489,13 +489,8 @@ static void graph_region_message_subscribe(const wmRegionMessageSubscribeParams
|
||||
{
|
||||
wmMsgBus *mbus = params->message_bus;
|
||||
Scene *scene = params->scene;
|
||||
bScreen *screen = params->screen;
|
||||
ScrArea *area = params->area;
|
||||
ARegion *region = params->region;
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, area->spacedata.first, &ptr);
|
||||
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
|
||||
msg_sub_value_region_tag_redraw.owner = region;
|
||||
msg_sub_value_region_tag_redraw.user_data = region;
|
||||
@@ -511,8 +506,7 @@ static void graph_region_message_subscribe(const wmRegionMessageSubscribeParams
|
||||
&rna_Scene_frame_current,
|
||||
};
|
||||
|
||||
PointerRNA idptr;
|
||||
RNA_id_pointer_create(&scene->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&scene->id);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(props); i++) {
|
||||
WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
|
||||
|
||||
@@ -1373,8 +1373,7 @@ static int image_open_exec(bContext *C, wmOperator *op)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&ima->id);
|
||||
|
||||
PointerRNA imaptr;
|
||||
RNA_id_pointer_create(&ima->id, &imaptr);
|
||||
PointerRNA imaptr = RNA_id_pointer_create(&ima->id);
|
||||
RNA_property_pointer_set(&iod->pprop.ptr, iod->pprop.prop, imaptr, nullptr);
|
||||
RNA_property_update(C, &iod->pprop.ptr, iod->pprop.prop);
|
||||
}
|
||||
@@ -1506,7 +1505,6 @@ static void image_open_draw(bContext * /*C*/, wmOperator *op)
|
||||
uiLayout *layout = op->layout;
|
||||
ImageOpenData *iod = static_cast<ImageOpenData *>(op->customdata);
|
||||
ImageFormatData *imf = &iod->im_format;
|
||||
PointerRNA imf_ptr;
|
||||
|
||||
/* main draw call */
|
||||
uiDefAutoButsRNA(layout,
|
||||
@@ -1518,7 +1516,7 @@ static void image_open_draw(bContext * /*C*/, wmOperator *op)
|
||||
false);
|
||||
|
||||
/* image template */
|
||||
RNA_pointer_create(nullptr, &RNA_ImageFormatSettings, imf, &imf_ptr);
|
||||
PointerRNA imf_ptr = RNA_pointer_create(nullptr, &RNA_ImageFormatSettings, imf);
|
||||
|
||||
/* multiview template */
|
||||
if (RNA_boolean_get(op->ptr, "show_multiview")) {
|
||||
@@ -1594,9 +1592,8 @@ static int image_file_browse_exec(bContext *C, wmOperator *op)
|
||||
BKE_image_ensure_tile_token(filepath, sizeof(filepath));
|
||||
}
|
||||
|
||||
PointerRNA imaptr;
|
||||
PropertyRNA *imaprop;
|
||||
RNA_id_pointer_create(&ima->id, &imaptr);
|
||||
PointerRNA imaptr = RNA_id_pointer_create(&ima->id);
|
||||
imaprop = RNA_struct_find_property(&imaptr, "filepath");
|
||||
|
||||
RNA_property_string_set(&imaptr, imaprop, filepath);
|
||||
@@ -1996,7 +1993,6 @@ static void image_save_as_draw(bContext * /*C*/, wmOperator *op)
|
||||
{
|
||||
uiLayout *layout = op->layout;
|
||||
ImageSaveData *isd = static_cast<ImageSaveData *>(op->customdata);
|
||||
PointerRNA imf_ptr;
|
||||
const bool is_multiview = RNA_boolean_get(op->ptr, "show_multiview");
|
||||
const bool save_as_render = RNA_boolean_get(op->ptr, "save_as_render");
|
||||
|
||||
@@ -2015,7 +2011,7 @@ static void image_save_as_draw(bContext * /*C*/, wmOperator *op)
|
||||
uiItemS(layout);
|
||||
|
||||
/* Image format settings. */
|
||||
RNA_pointer_create(nullptr, &RNA_ImageFormatSettings, &isd->opts.im_format, &imf_ptr);
|
||||
PointerRNA imf_ptr = RNA_pointer_create(nullptr, &RNA_ImageFormatSettings, &isd->opts.im_format);
|
||||
uiTemplateImageSettings(layout, &imf_ptr, save_as_render);
|
||||
|
||||
if (!save_as_render) {
|
||||
@@ -2601,8 +2597,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
|
||||
* pointer use also increases user, so this compensates it */
|
||||
id_us_min(&ima->id);
|
||||
|
||||
PointerRNA imaptr;
|
||||
RNA_id_pointer_create(&ima->id, &imaptr);
|
||||
PointerRNA imaptr = RNA_id_pointer_create(&ima->id);
|
||||
RNA_property_pointer_set(&data->pprop.ptr, data->pprop.prop, imaptr, nullptr);
|
||||
RNA_property_update(C, &data->pprop.ptr, data->pprop.prop);
|
||||
}
|
||||
|
||||
@@ -92,16 +92,16 @@ bool nla_panel_context(const bContext *C,
|
||||
/* found it, now set the pointers */
|
||||
if (adt_ptr) {
|
||||
/* AnimData pointer */
|
||||
RNA_pointer_create(ale->id, &RNA_AnimData, adt, adt_ptr);
|
||||
*adt_ptr = RNA_pointer_create(ale->id, &RNA_AnimData, adt);
|
||||
}
|
||||
if (nlt_ptr) {
|
||||
/* NLA-Track pointer */
|
||||
RNA_pointer_create(ale->id, &RNA_NlaTrack, nlt, nlt_ptr);
|
||||
*nlt_ptr = RNA_pointer_create(ale->id, &RNA_NlaTrack, nlt);
|
||||
}
|
||||
if (strip_ptr) {
|
||||
/* NLA-Strip pointer */
|
||||
NlaStrip *strip = BKE_nlastrip_find_active(nlt);
|
||||
RNA_pointer_create(ale->id, &RNA_NlaStrip, strip, strip_ptr);
|
||||
*strip_ptr = RNA_pointer_create(ale->id, &RNA_NlaStrip, strip);
|
||||
}
|
||||
|
||||
found = 1;
|
||||
@@ -146,7 +146,7 @@ bool nla_panel_context(const bContext *C,
|
||||
|
||||
/* AnimData pointer */
|
||||
if (adt_ptr) {
|
||||
RNA_pointer_create(id, &RNA_AnimData, ale->adt, adt_ptr);
|
||||
*adt_ptr = RNA_pointer_create(id, &RNA_AnimData, ale->adt);
|
||||
}
|
||||
|
||||
/* set found status to -1, since setting to 1 would break the loop
|
||||
@@ -293,9 +293,7 @@ static void nla_panel_animdata(const bContext *C, Panel *panel)
|
||||
*/
|
||||
if (adt_ptr.owner_id) {
|
||||
ID *id = adt_ptr.owner_id;
|
||||
PointerRNA id_ptr;
|
||||
|
||||
RNA_id_pointer_create(id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create(id);
|
||||
|
||||
/* ID-block name > AnimData */
|
||||
row = uiLayoutRow(layout, true);
|
||||
|
||||
@@ -2271,9 +2271,7 @@ static int nlaedit_clear_scale_exec(bContext *C, wmOperator * /*op*/)
|
||||
/* strip must be selected, and must be action-clip only
|
||||
* (transitions don't have scale) */
|
||||
if ((strip->flag & NLASTRIP_FLAG_SELECT) && (strip->type == NLASTRIP_TYPE_CLIP)) {
|
||||
PointerRNA strip_ptr;
|
||||
|
||||
RNA_pointer_create(nullptr, &RNA_NlaStrip, strip, &strip_ptr);
|
||||
PointerRNA strip_ptr = RNA_pointer_create(nullptr, &RNA_NlaStrip, strip);
|
||||
RNA_float_set(&strip_ptr, "scale", 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,13 +405,8 @@ static void nla_main_region_message_subscribe(const wmRegionMessageSubscribePara
|
||||
{
|
||||
wmMsgBus *mbus = params->message_bus;
|
||||
Scene *scene = params->scene;
|
||||
bScreen *screen = params->screen;
|
||||
ScrArea *area = params->area;
|
||||
ARegion *region = params->region;
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceNLA, area->spacedata.first, &ptr);
|
||||
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {};
|
||||
msg_sub_value_region_tag_redraw.owner = region;
|
||||
msg_sub_value_region_tag_redraw.user_data = region;
|
||||
@@ -427,8 +422,7 @@ static void nla_main_region_message_subscribe(const wmRegionMessageSubscribePara
|
||||
&rna_Scene_frame_current,
|
||||
};
|
||||
|
||||
PointerRNA idptr;
|
||||
RNA_id_pointer_create(&scene->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&scene->id);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(props); i++) {
|
||||
WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
|
||||
@@ -487,13 +481,8 @@ static void nla_channel_region_listener(const wmRegionListenerParams *params)
|
||||
static void nla_channel_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
|
||||
{
|
||||
wmMsgBus *mbus = params->message_bus;
|
||||
bScreen *screen = params->screen;
|
||||
ScrArea *area = params->area;
|
||||
ARegion *region = params->region;
|
||||
|
||||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceNLA, area->spacedata.first, &ptr);
|
||||
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {};
|
||||
msg_sub_value_region_tag_redraw.owner = region;
|
||||
msg_sub_value_region_tag_redraw.user_data = region;
|
||||
|
||||
@@ -91,8 +91,7 @@ static void node_buts_value(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
|
||||
bNode *node = (bNode *)ptr->data;
|
||||
/* first output stores value */
|
||||
bNodeSocket *output = (bNodeSocket *)node->outputs.first;
|
||||
PointerRNA sockptr;
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr);
|
||||
PointerRNA sockptr = RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output);
|
||||
|
||||
uiItemR(layout, &sockptr, "default_value", DEFAULT_FLAGS, "", ICON_NONE);
|
||||
}
|
||||
@@ -102,9 +101,8 @@ static void node_buts_rgb(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
|
||||
bNode *node = (bNode *)ptr->data;
|
||||
/* first output stores value */
|
||||
bNodeSocket *output = (bNodeSocket *)node->outputs.first;
|
||||
PointerRNA sockptr;
|
||||
uiLayout *col;
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr);
|
||||
PointerRNA sockptr = RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output);
|
||||
|
||||
col = uiLayoutColumn(layout, false);
|
||||
uiTemplateColorPicker(col, &sockptr, "default_value", true, false, false, false);
|
||||
@@ -190,8 +188,7 @@ static void node_buts_normal(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr
|
||||
bNode *node = (bNode *)ptr->data;
|
||||
/* first output stores normal */
|
||||
bNodeSocket *output = (bNodeSocket *)node->outputs.first;
|
||||
PointerRNA sockptr;
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr);
|
||||
PointerRNA sockptr = RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output);
|
||||
|
||||
uiItemR(layout, &sockptr, "default_value", DEFAULT_FLAGS, "", ICON_NONE);
|
||||
}
|
||||
@@ -550,8 +547,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
|
||||
{
|
||||
bNode *node = (bNode *)ptr->data;
|
||||
|
||||
PointerRNA iuserptr;
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr);
|
||||
PointerRNA iuserptr = RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage);
|
||||
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
||||
uiTemplateID(layout,
|
||||
C,
|
||||
@@ -578,8 +574,7 @@ static void node_composit_buts_image_ex(uiLayout *layout, bContext *C, PointerRN
|
||||
{
|
||||
bNode *node = (bNode *)ptr->data;
|
||||
|
||||
PointerRNA iuserptr;
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr);
|
||||
PointerRNA iuserptr = RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage);
|
||||
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
||||
uiTemplateImage(layout, C, ptr, "image", &iuserptr, false, true);
|
||||
}
|
||||
@@ -792,8 +787,7 @@ static void node_composit_buts_cryptomatte(uiLayout *layout, bContext *C, Pointe
|
||||
|
||||
NodeCryptomatte *crypto = (NodeCryptomatte *)node->storage;
|
||||
PointerRNA imaptr = RNA_pointer_get(ptr, "image");
|
||||
PointerRNA iuserptr;
|
||||
RNA_pointer_create((ID *)ptr->owner_id, &RNA_ImageUser, &crypto->iuser, &iuserptr);
|
||||
PointerRNA iuserptr = RNA_pointer_create((ID *)ptr->owner_id, &RNA_ImageUser, &crypto->iuser);
|
||||
uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
|
||||
|
||||
node_buts_image_user(col, C, ptr, &imaptr, &iuserptr, false, false);
|
||||
@@ -892,13 +886,12 @@ static void node_texture_buts_bricks(uiLayout *layout, bContext * /*C*/, Pointer
|
||||
|
||||
static void node_texture_buts_proc(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
|
||||
{
|
||||
PointerRNA tex_ptr;
|
||||
bNode *node = (bNode *)ptr->data;
|
||||
ID *id = ptr->owner_id;
|
||||
Tex *tex = (Tex *)node->storage;
|
||||
uiLayout *col, *row;
|
||||
|
||||
RNA_pointer_create(id, &RNA_Texture, tex, &tex_ptr);
|
||||
PointerRNA tex_ptr = RNA_pointer_create(id, &RNA_Texture, tex);
|
||||
|
||||
col = uiLayoutColumn(layout, false);
|
||||
|
||||
@@ -995,9 +988,7 @@ static void node_texture_buts_image(uiLayout *layout, bContext *C, PointerRNA *p
|
||||
static void node_texture_buts_image_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
|
||||
{
|
||||
bNode *node = (bNode *)ptr->data;
|
||||
PointerRNA iuserptr;
|
||||
|
||||
RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr);
|
||||
PointerRNA iuserptr = RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage);
|
||||
uiTemplateImage(layout, C, ptr, "image", &iuserptr, false, false);
|
||||
}
|
||||
|
||||
@@ -1262,14 +1253,14 @@ static void node_file_output_socket_draw(bContext *C,
|
||||
|
||||
if (imtype == R_IMF_IMTYPE_MULTILAYER) {
|
||||
NodeImageMultiFileSocket *input = (NodeImageMultiFileSocket *)sock->storage;
|
||||
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotLayer, input, &inputptr);
|
||||
inputptr = RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotLayer, input);
|
||||
|
||||
uiItemL(row, input->layer, ICON_NONE);
|
||||
}
|
||||
else {
|
||||
NodeImageMultiFileSocket *input = (NodeImageMultiFileSocket *)sock->storage;
|
||||
uiBlock *block;
|
||||
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotFile, input, &inputptr);
|
||||
inputptr = RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotFile, input);
|
||||
|
||||
uiItemL(row, input->path, ICON_NONE);
|
||||
|
||||
@@ -1457,9 +1448,7 @@ static void std_node_socket_interface_draw(ID *id,
|
||||
bContext * /*C*/,
|
||||
uiLayout *layout)
|
||||
{
|
||||
PointerRNA ptr, tree_ptr;
|
||||
RNA_pointer_create(id, &RNA_NodeTreeInterfaceSocket, interface_socket, &ptr);
|
||||
RNA_id_pointer_create(id, &tree_ptr);
|
||||
PointerRNA ptr = RNA_pointer_create(id, &RNA_NodeTreeInterfaceSocket, interface_socket);
|
||||
|
||||
const bNodeSocketType *typeinfo = interface_socket->socket_typeinfo();
|
||||
BLI_assert(typeinfo != nullptr);
|
||||
|
||||
@@ -932,7 +932,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
Main *bmain = CTX_data_main(C);
|
||||
bNodeTree *ntree;
|
||||
PointerRNA ptr, idptr;
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
const char *idname;
|
||||
char treename_buf[MAX_ID_NAME - 2];
|
||||
@@ -973,7 +973,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
|
||||
* user. */
|
||||
id_us_min(&ntree->id);
|
||||
|
||||
RNA_id_pointer_create(&ntree->id, &idptr);
|
||||
PointerRNA idptr = RNA_id_pointer_create(&ntree->id);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
|
||||
@@ -362,8 +362,7 @@ static bool node_update_basis_buttons(
|
||||
return false;
|
||||
}
|
||||
|
||||
PointerRNA nodeptr;
|
||||
RNA_pointer_create(&ntree.id, &RNA_Node, &node, &nodeptr);
|
||||
PointerRNA nodeptr = RNA_pointer_create(&ntree.id, &RNA_Node, &node);
|
||||
|
||||
/* Get "global" coordinates. */
|
||||
float2 loc = node_to_view(node, float2(0));
|
||||
@@ -412,9 +411,8 @@ static bool node_update_basis_socket(const bContext &C,
|
||||
}
|
||||
|
||||
const int topy = locy;
|
||||
PointerRNA nodeptr, sockptr;
|
||||
RNA_pointer_create(&ntree.id, &RNA_Node, &node, &nodeptr);
|
||||
RNA_pointer_create(&ntree.id, &RNA_NodeSocket, &socket, &sockptr);
|
||||
PointerRNA nodeptr = RNA_pointer_create(&ntree.id, &RNA_Node, &node);
|
||||
PointerRNA sockptr = RNA_pointer_create(&ntree.id, &RNA_NodeSocket, &socket);
|
||||
|
||||
const eNodeSocketInOut in_out = eNodeSocketInOut(socket.in_out);
|
||||
|
||||
@@ -659,9 +657,6 @@ static void node_update_basis(const bContext &C,
|
||||
bNode &node,
|
||||
uiBlock &block)
|
||||
{
|
||||
PointerRNA nodeptr;
|
||||
RNA_pointer_create(&ntree.id, &RNA_Node, &node, &nodeptr);
|
||||
|
||||
/* Get "global" coordinates. */
|
||||
float2 loc = node_to_view(node, float2(0));
|
||||
/* Round the node origin because text contents are always pixel-aligned. */
|
||||
@@ -1565,10 +1560,6 @@ static void node_draw_sockets(const View2D &v2d,
|
||||
return;
|
||||
}
|
||||
|
||||
PointerRNA node_ptr;
|
||||
RNA_pointer_create(
|
||||
&const_cast<ID &>(ntree.id), &RNA_Node, &const_cast<bNode &>(node), &node_ptr);
|
||||
|
||||
bool selected = false;
|
||||
|
||||
GPUVertFormat *format = immVertexFormat();
|
||||
|
||||
@@ -149,8 +149,7 @@ static void WIDGETGROUP_node_transform_refresh(const bContext *C, wmGizmoGroup *
|
||||
/* Need to set property here for undo. TODO: would prefer to do this in _init. */
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
#if 0
|
||||
PointerRNA nodeptr;
|
||||
RNA_pointer_create(snode->id, &RNA_SpaceNodeEditor, snode, &nodeptr);
|
||||
PointerRNA nodeptr = RNA_pointer_create(snode->id, &RNA_SpaceNodeEditor, snode);
|
||||
WM_gizmo_target_property_def_rna(cage, "offset", &nodeptr, "backdrop_offset", -1);
|
||||
WM_gizmo_target_property_def_rna(cage, "scale", &nodeptr, "backdrop_zoom", -1);
|
||||
#endif
|
||||
@@ -361,8 +360,8 @@ static void WIDGETGROUP_node_crop_refresh(const bContext *C, wmGizmoGroup *gzgro
|
||||
bNode *node = nodeGetActive(snode->edittree);
|
||||
|
||||
crop_group->update_data.context = (bContext *)C;
|
||||
RNA_pointer_create(
|
||||
(ID *)snode->edittree, &RNA_CompositorNodeCrop, node, &crop_group->update_data.ptr);
|
||||
crop_group->update_data.ptr = RNA_pointer_create(
|
||||
(ID *)snode->edittree, &RNA_CompositorNodeCrop, node);
|
||||
crop_group->update_data.prop = RNA_struct_find_property(&crop_group->update_data.ptr,
|
||||
"relative");
|
||||
|
||||
@@ -472,8 +471,8 @@ static void WIDGETGROUP_node_sbeam_refresh(const bContext *C, wmGizmoGroup *gzgr
|
||||
bNode *node = nodeGetActive(snode->edittree);
|
||||
|
||||
/* Need to set property here for undo. TODO: would prefer to do this in _init. */
|
||||
PointerRNA nodeptr;
|
||||
RNA_pointer_create((ID *)snode->edittree, &RNA_CompositorNodeSunBeams, node, &nodeptr);
|
||||
PointerRNA nodeptr = RNA_pointer_create(
|
||||
(ID *)snode->edittree, &RNA_CompositorNodeSunBeams, node);
|
||||
WM_gizmo_target_property_def_rna(gz, "offset", &nodeptr, "source", -1);
|
||||
|
||||
WM_gizmo_set_flag(gz, WM_GIZMO_DRAW_MODAL, true);
|
||||
@@ -589,8 +588,7 @@ static void WIDGETGROUP_node_corner_pin_refresh(const bContext *C, wmGizmoGroup
|
||||
if (sock->type == SOCK_VECTOR) {
|
||||
wmGizmo *gz = cpin_group->gizmos[i++];
|
||||
|
||||
PointerRNA sockptr;
|
||||
RNA_pointer_create((ID *)snode->edittree, &RNA_NodeSocket, sock, &sockptr);
|
||||
PointerRNA sockptr = RNA_pointer_create((ID *)snode->edittree, &RNA_NodeSocket, sock);
|
||||
WM_gizmo_target_property_def_rna(gz, "offset", &sockptr, "default_value", -1);
|
||||
|
||||
WM_gizmo_set_flag(gz, WM_GIZMO_DRAW_MODAL, true);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user