diff options
Diffstat (limited to 'source/blender/modifiers')
56 files changed, 931 insertions, 1056 deletions
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index e7f47a09d95..f42f67417c3 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -238,29 +238,28 @@ static void deformMatrices(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + uiItemR(layout, ptr, "object", 0, NULL, ICON_NONE); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "use_deform_preserve_volume", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_multi_modifier", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_deform_preserve_volume", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_multi_modifier", 0, NULL, ICON_NONE); col = uiLayoutColumnWithHeading(layout, true, IFACE_("Bind to")); - uiItemR(col, &ptr, "use_vertex_groups", 0, IFACE_("Vertex Groups"), ICON_NONE); - uiItemR(col, &ptr, "use_bone_envelopes", 0, IFACE_("Bone Envelopes"), ICON_NONE); + uiItemR(col, ptr, "use_vertex_groups", 0, IFACE_("Vertex Groups"), ICON_NONE); + uiItemR(col, ptr, "use_bone_envelopes", 0, IFACE_("Bone Envelopes"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 1c98cec915e..60e1a3de67e 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -835,163 +835,152 @@ static bool isDisabled(const struct Scene *UNUSED(scene), return false; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "fit_type", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "fit_type", 0, NULL, ICON_NONE); - int fit_type = RNA_enum_get(&ptr, "fit_type"); + int fit_type = RNA_enum_get(ptr, "fit_type"); if (fit_type == MOD_ARR_FIXEDCOUNT) { - uiItemR(layout, &ptr, "count", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "count", 0, NULL, ICON_NONE); } else if (fit_type == MOD_ARR_FITLENGTH) { - uiItemR(layout, &ptr, "fit_length", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "fit_length", 0, NULL, ICON_NONE); } else if (fit_type == MOD_ARR_FITCURVE) { - uiItemR(layout, &ptr, "curve", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "curve", 0, NULL, ICON_NONE); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void relative_offset_header_draw(const bContext *C, Panel *panel) +static void relative_offset_header_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_relative_offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_relative_offset", 0, NULL, ICON_NONE); } -static void relative_offset_draw(const bContext *C, Panel *panel) +static void relative_offset_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); uiLayout *col = uiLayoutColumn(layout, false); - uiLayoutSetActive(col, RNA_boolean_get(&ptr, "use_relative_offset")); - uiItemR(col, &ptr, "relative_offset_displace", 0, IFACE_("Factor"), ICON_NONE); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_relative_offset")); + uiItemR(col, ptr, "relative_offset_displace", 0, IFACE_("Factor"), ICON_NONE); } -static void constant_offset_header_draw(const bContext *C, Panel *panel) +static void constant_offset_header_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_constant_offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_constant_offset", 0, NULL, ICON_NONE); } -static void constant_offset_draw(const bContext *C, Panel *panel) +static void constant_offset_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); uiLayout *col = uiLayoutColumn(layout, false); - uiLayoutSetActive(col, RNA_boolean_get(&ptr, "use_constant_offset")); - uiItemR(col, &ptr, "constant_offset_displace", 0, IFACE_("Distance"), ICON_NONE); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_constant_offset")); + uiItemR(col, ptr, "constant_offset_displace", 0, IFACE_("Distance"), ICON_NONE); } /** * Object offset in a subpanel for consistency with the other offset types. */ -static void object_offset_header_draw(const bContext *C, Panel *panel) +static void object_offset_header_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_object_offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_object_offset", 0, NULL, ICON_NONE); } -static void object_offset_draw(const bContext *C, Panel *panel) +static void object_offset_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); uiLayout *col = uiLayoutColumn(layout, false); - uiLayoutSetActive(col, RNA_boolean_get(&ptr, "use_object_offset")); - uiItemR(col, &ptr, "offset_object", 0, IFACE_("Object"), ICON_NONE); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_object_offset")); + uiItemR(col, ptr, "offset_object", 0, IFACE_("Object"), ICON_NONE); } -static void symmetry_panel_header_draw(const bContext *C, Panel *panel) +static void symmetry_panel_header_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_merge_vertices", 0, IFACE_("Merge"), ICON_NONE); + uiItemR(layout, ptr, "use_merge_vertices", 0, IFACE_("Merge"), ICON_NONE); } -static void symmetry_panel_draw(const bContext *C, Panel *panel) +static void symmetry_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); uiLayout *col = uiLayoutColumn(layout, false); - uiLayoutSetActive(col, RNA_boolean_get(&ptr, "use_merge_vertices")); - uiItemR(col, &ptr, "merge_threshold", 0, IFACE_("Distance"), ICON_NONE); - uiItemR(col, &ptr, "use_merge_vertices_cap", 0, IFACE_("First and Last Copies"), ICON_NONE); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_merge_vertices")); + uiItemR(col, ptr, "merge_threshold", 0, IFACE_("Distance"), ICON_NONE); + uiItemR(col, ptr, "use_merge_vertices_cap", 0, IFACE_("First and Last Copies"), ICON_NONE); } -static void uv_panel_draw(const bContext *C, Panel *panel) +static void uv_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "offset_u", UI_ITEM_R_EXPAND, IFACE_("Offset U"), ICON_NONE); - uiItemR(col, &ptr, "offset_v", UI_ITEM_R_EXPAND, IFACE_("V"), ICON_NONE); + uiItemR(col, ptr, "offset_u", UI_ITEM_R_EXPAND, IFACE_("Offset U"), ICON_NONE); + uiItemR(col, ptr, "offset_v", UI_ITEM_R_EXPAND, IFACE_("V"), ICON_NONE); } -static void caps_panel_draw(const bContext *C, Panel *panel) +static void caps_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "start_cap", 0, IFACE_("Cap Start"), ICON_NONE); - uiItemR(col, &ptr, "end_cap", 0, IFACE_("End"), ICON_NONE); + uiItemR(col, ptr, "start_cap", 0, IFACE_("Cap Start"), ICON_NONE); + uiItemR(col, ptr, "end_cap", 0, IFACE_("End"), ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index c0428785009..ab024bd824d 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -276,63 +276,61 @@ static bool isDisabled(const Scene *UNUSED(scene), ModifierData *md, bool UNUSED return (bmd->value == 0.0f); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; + bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; - uiItemR(layout, &ptr, "affect", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "affect", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "offset_type", 0, NULL, ICON_NONE); - if (RNA_enum_get(&ptr, "offset_type") == BEVEL_AMT_PERCENT) { - uiItemR(col, &ptr, "width_pct", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "offset_type", 0, NULL, ICON_NONE); + if (RNA_enum_get(ptr, "offset_type") == BEVEL_AMT_PERCENT) { + uiItemR(col, ptr, "width_pct", 0, NULL, ICON_NONE); } else { - uiItemR(col, &ptr, "width", 0, IFACE_("Amount"), ICON_NONE); + uiItemR(col, ptr, "width", 0, IFACE_("Amount"), ICON_NONE); } - uiItemR(layout, &ptr, "segments", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "segments", 0, NULL, ICON_NONE); uiItemS(layout); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "limit_method", 0, NULL, ICON_NONE); - int limit_method = RNA_enum_get(&ptr, "limit_method"); + uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE); + int limit_method = RNA_enum_get(ptr, "limit_method"); if (limit_method == MOD_BEVEL_ANGLE) { sub = uiLayoutColumn(col, false); uiLayoutSetActive(sub, edge_bevel); - uiItemR(col, &ptr, "angle_limit", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "angle_limit", 0, NULL, ICON_NONE); } else if (limit_method == MOD_BEVEL_VGROUP) { - modifier_vgroup_ui(col, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(col, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void profile_panel_draw(const bContext *C, Panel *panel) +static void profile_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - int profile_type = RNA_enum_get(&ptr, "profile_type"); - int miter_inner = RNA_enum_get(&ptr, "miter_inner"); - int miter_outer = RNA_enum_get(&ptr, "miter_outer"); - bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; + int profile_type = RNA_enum_get(ptr, "profile_type"); + int miter_inner = RNA_enum_get(ptr, "miter_inner"); + int miter_outer = RNA_enum_get(ptr, "miter_outer"); + bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; - uiItemR(layout, &ptr, "profile_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "profile_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); @@ -344,7 +342,7 @@ static void profile_panel_draw(const bContext *C, Panel *panel) (profile_type == MOD_BEVEL_PROFILE_CUSTOM && edge_bevel && !((miter_inner == MOD_BEVEL_MITER_SHARP) && (miter_outer == MOD_BEVEL_MITER_SHARP)))); uiItemR(row, - &ptr, + ptr, "profile", UI_ITEM_R_SLIDER, (profile_type == MOD_BEVEL_PROFILE_SUPERELLIPSE) ? IFACE_("Shape") : @@ -354,66 +352,64 @@ static void profile_panel_draw(const bContext *C, Panel *panel) if (profile_type == MOD_BEVEL_PROFILE_CUSTOM) { uiLayout *sub = uiLayoutColumn(layout, false); uiLayoutSetPropDecorate(sub, false); - uiTemplateCurveProfile(sub, &ptr, "custom_profile"); + uiTemplateCurveProfile(sub, ptr, "custom_profile"); } } } -static void geometry_panel_draw(const bContext *C, Panel *panel) +static void geometry_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; + bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; uiLayoutSetPropSep(layout, true); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, edge_bevel); - uiItemR(row, &ptr, "miter_outer", 0, IFACE_("Miter Outer"), ICON_NONE); + uiItemR(row, ptr, "miter_outer", 0, IFACE_("Miter Outer"), ICON_NONE); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, edge_bevel); - uiItemR(row, &ptr, "miter_inner", 0, IFACE_("Inner"), ICON_NONE); - if (RNA_enum_get(&ptr, "miter_inner") == BEVEL_MITER_ARC) { + uiItemR(row, ptr, "miter_inner", 0, IFACE_("Inner"), ICON_NONE); + if (RNA_enum_get(ptr, "miter_inner") == BEVEL_MITER_ARC) { row = uiLayoutRow(layout, false); uiLayoutSetActive(row, edge_bevel); - uiItemR(row, &ptr, "spread", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "spread", 0, NULL, ICON_NONE); } uiItemS(layout); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, edge_bevel); - uiItemR(row, &ptr, "vmesh_method", 0, IFACE_("Intersections"), ICON_NONE); - uiItemR(layout, &ptr, "use_clamp_overlap", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "vmesh_method", 0, IFACE_("Intersections"), ICON_NONE); + uiItemR(layout, ptr, "use_clamp_overlap", 0, NULL, ICON_NONE); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, edge_bevel); - uiItemR(row, &ptr, "loop_slide", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "loop_slide", 0, NULL, ICON_NONE); } -static void shading_panel_draw(const bContext *C, Panel *panel) +static void shading_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; + bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES; uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "harden_normals", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "harden_normals", 0, NULL, ICON_NONE); col = uiLayoutColumnWithHeading(layout, true, IFACE_("Mark")); uiLayoutSetActive(col, edge_bevel); - uiItemR(col, &ptr, "mark_seam", 0, IFACE_("Seam"), ICON_NONE); - uiItemR(col, &ptr, "mark_sharp", 0, IFACE_("Sharp"), ICON_NONE); + uiItemR(col, ptr, "mark_seam", 0, IFACE_("Seam"), ICON_NONE); + uiItemR(col, ptr, "mark_sharp", 0, IFACE_("Sharp"), ICON_NONE); - uiItemR(layout, &ptr, "material", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "face_strength_mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "material", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "face_strength_mode", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index 37c3f32f529..1a6ceefe5e8 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -382,32 +382,31 @@ static void requiredDataMask(Object *UNUSED(ob), r_cddata_masks->fmask |= CD_MASK_MTFACE; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "operation", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "operation", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); - const bool use_exact = RNA_enum_get(&ptr, "solver") == eBooleanModifierSolver_Exact; + const bool use_exact = RNA_enum_get(ptr, "solver") == eBooleanModifierSolver_Exact; - uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "object", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE); if (!use_exact) { - uiItemR(layout, &ptr, "double_threshold", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "double_threshold", 0, NULL, ICON_NONE); } if (G.debug) { uiLayout *col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "debug_options", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "debug_options", 0, NULL, ICON_NONE); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index be0ca6af032..d3caffb819c 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -284,43 +284,40 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, struct return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "frame_start", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "frame_duration", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_reverse", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "frame_start", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "frame_duration", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_reverse", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void random_panel_header_draw(const bContext *C, Panel *panel) +static void random_panel_header_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_random_order", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_random_order", 0, NULL, ICON_NONE); } -static void random_panel_draw(const bContext *C, Panel *panel) +static void random_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - uiLayoutSetActive(layout, RNA_boolean_get(&ptr, "use_random_order")); - uiItemR(layout, &ptr, "seed", 0, NULL, ICON_NONE); + uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_random_order")); + uiItemR(layout, ptr, "seed", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index cc9def73e12..4f2f6d219d8 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -535,40 +535,39 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - PointerRNA cast_object_ptr = RNA_pointer_get(&ptr, "object"); + PointerRNA cast_object_ptr = RNA_pointer_get(ptr, "object"); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "cast_type", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "cast_type", 0, NULL, ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis")); - uiItemR(row, &ptr, "use_x", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_y", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_z", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_x", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_y", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_z", toggles_flag, NULL, ICON_NONE); - uiItemR(layout, &ptr, "factor", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "radius", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "size", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_radius_as_size", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "factor", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "radius", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "size", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_radius_as_size", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "object", 0, NULL, ICON_NONE); if (!RNA_pointer_is_null(&cast_object_ptr)) { - uiItemR(layout, &ptr, "use_transform", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_transform", 0, NULL, ICON_NONE); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 0cd3430f009..7d0f245ecad 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -264,16 +264,15 @@ static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *u } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiItemL(layout, IFACE_("Settings are inside the Physics tab"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index a355558a3ba..863e0ab7395 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -254,16 +254,15 @@ static void updateDepsgraph(ModifierData *UNUSED(md), const ModifierUpdateDepsgr DEG_add_modifier_to_transform_relation(ctx->node, "Collision Modifier"); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiItemL(layout, IFACE_("Settings are inside the Physics tab"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c index ac91056ed7d..5eee196423e 100644 --- a/source/blender/modifiers/intern/MOD_correctivesmooth.c +++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c @@ -783,35 +783,34 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "factor", 0, IFACE_("Factor"), ICON_NONE); - uiItemR(layout, &ptr, "iterations", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "scale", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "smooth_type", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "factor", 0, IFACE_("Factor"), ICON_NONE); + uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "scale", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "smooth_type", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - uiItemR(layout, &ptr, "use_only_smooth", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_pin_boundary", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_only_smooth", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_pin_boundary", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "rest_source", 0, NULL, ICON_NONE); - if (RNA_enum_get(&ptr, "rest_source") == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) { + uiItemR(layout, ptr, "rest_source", 0, NULL, ICON_NONE); + if (RNA_enum_get(ptr, "rest_source") == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) { uiItemO(layout, - (RNA_boolean_get(&ptr, "is_bind") ? IFACE_("Unbind") : IFACE_("Bind")), + (RNA_boolean_get(ptr, "is_bind") ? IFACE_("Unbind") : IFACE_("Bind")), ICON_NONE, "OBJECT_OT_correctivesmooth_bind"); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c index 42adf305ee9..ccbe8ff94d8 100644 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@ -192,22 +192,21 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "object", 0, IFACE_("Curve Object"), ICON_NONE); - uiItemR(layout, &ptr, "deform_axis", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "object", 0, IFACE_("Curve Object"), ICON_NONE); + uiItemR(layout, ptr, "deform_axis", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c index c8f49694a2f..6d89b76c9f7 100644 --- a/source/blender/modifiers/intern/MOD_datatransfer.c +++ b/source/blender/modifiers/intern/MOD_datatransfer.c @@ -247,200 +247,187 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub, *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); row = uiLayoutRow(layout, true); - uiItemR(row, &ptr, "object", 0, IFACE_("Source"), ICON_NONE); + uiItemR(row, ptr, "object", 0, IFACE_("Source"), ICON_NONE); sub = uiLayoutRow(row, true); uiLayoutSetPropDecorate(sub, false); - uiItemR(sub, &ptr, "use_object_transform", 0, "", ICON_ORIENTATION_GLOBAL); + uiItemR(sub, ptr, "use_object_transform", 0, "", ICON_ORIENTATION_GLOBAL); - uiItemR(layout, &ptr, "mix_mode", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "mix_factor", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "mix_mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "mix_factor", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); uiItemO(layout, "Generate Data Layers", ICON_NONE, "OBJECT_OT_datalayout_transfer"); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void vertex_panel_draw_header(const bContext *C, Panel *panel) +static void vertex_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayout *layout = panel->layout; - uiItemR(layout, &ptr, "use_vert_data", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_vert_data", 0, NULL, ICON_NONE); } -static void vertex_panel_draw(const bContext *C, Panel *panel) +static void vertex_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_vert_data = RNA_boolean_get(&ptr, "use_vert_data"); + bool use_vert_data = RNA_boolean_get(ptr, "use_vert_data"); uiLayoutSetActive(layout, use_vert_data); - uiItemR(layout, &ptr, "data_types_verts", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "data_types_verts", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "vert_mapping", 0, IFACE_("Mapping"), ICON_NONE); + uiItemR(layout, ptr, "vert_mapping", 0, IFACE_("Mapping"), ICON_NONE); } -static void vertex_vgroup_panel_draw(const bContext *C, Panel *panel) +static void vertex_vgroup_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiLayoutSetActive(layout, RNA_enum_get(&ptr, "data_types_verts") & DT_TYPE_MDEFORMVERT); + uiLayoutSetActive(layout, RNA_enum_get(ptr, "data_types_verts") & DT_TYPE_MDEFORMVERT); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "layers_vgroup_select_src", 0, IFACE_("Layer Selection"), ICON_NONE); - uiItemR(layout, &ptr, "layers_vgroup_select_dst", 0, IFACE_("Layer Mapping"), ICON_NONE); + uiItemR(layout, ptr, "layers_vgroup_select_src", 0, IFACE_("Layer Selection"), ICON_NONE); + uiItemR(layout, ptr, "layers_vgroup_select_dst", 0, IFACE_("Layer Mapping"), ICON_NONE); } -static void edge_panel_draw_header(const bContext *C, Panel *panel) +static void edge_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_edge_data", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_edge_data", 0, NULL, ICON_NONE); } -static void edge_panel_draw(const bContext *C, Panel *panel) +static void edge_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiLayoutSetActive(layout, RNA_boolean_get(&ptr, "use_edge_data")); + uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_edge_data")); - uiItemR(layout, &ptr, "data_types_edges", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "data_types_edges", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "edge_mapping", 0, IFACE_("Mapping"), ICON_NONE); + uiItemR(layout, ptr, "edge_mapping", 0, IFACE_("Mapping"), ICON_NONE); } -static void face_corner_panel_draw_header(const bContext *C, Panel *panel) +static void face_corner_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_loop_data", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_loop_data", 0, NULL, ICON_NONE); } -static void face_corner_panel_draw(const bContext *C, Panel *panel) +static void face_corner_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiLayoutSetActive(layout, RNA_boolean_get(&ptr, "use_loop_data")); + uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_loop_data")); - uiItemR(layout, &ptr, "data_types_loops", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "data_types_loops", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "loop_mapping", 0, IFACE_("Mapping"), ICON_NONE); + uiItemR(layout, ptr, "loop_mapping", 0, IFACE_("Mapping"), ICON_NONE); } -static void face_corner_vcol_panel_draw(const bContext *C, Panel *panel) +static void face_corner_vcol_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - uiLayoutSetActive(layout, RNA_enum_get(&ptr, "data_types_loops") & DT_TYPE_VCOL); + uiLayoutSetActive(layout, RNA_enum_get(ptr, "data_types_loops") & DT_TYPE_VCOL); - uiItemR(layout, &ptr, "layers_vcol_select_src", 0, IFACE_("Layer Selection"), ICON_NONE); - uiItemR(layout, &ptr, "layers_vcol_select_dst", 0, IFACE_("Layer Mapping"), ICON_NONE); + uiItemR(layout, ptr, "layers_vcol_select_src", 0, IFACE_("Layer Selection"), ICON_NONE); + uiItemR(layout, ptr, "layers_vcol_select_dst", 0, IFACE_("Layer Mapping"), ICON_NONE); } -static void face_corner_uv_panel_draw(const bContext *C, Panel *panel) +static void face_corner_uv_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - uiLayoutSetActive(layout, RNA_enum_get(&ptr, "data_types_loops") & DT_TYPE_UV); + uiLayoutSetActive(layout, RNA_enum_get(ptr, "data_types_loops") & DT_TYPE_UV); - uiItemR(layout, &ptr, "layers_uv_select_src", 0, IFACE_("Layer Selection"), ICON_NONE); - uiItemR(layout, &ptr, "layers_uv_select_dst", 0, IFACE_("Layer Mapping"), ICON_NONE); - uiItemR(layout, &ptr, "islands_precision", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "layers_uv_select_src", 0, IFACE_("Layer Selection"), ICON_NONE); + uiItemR(layout, ptr, "layers_uv_select_dst", 0, IFACE_("Layer Mapping"), ICON_NONE); + uiItemR(layout, ptr, "islands_precision", 0, NULL, ICON_NONE); } -static void face_panel_draw_header(const bContext *C, Panel *panel) +static void face_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_poly_data", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_poly_data", 0, NULL, ICON_NONE); } -static void face_panel_draw(const bContext *C, Panel *panel) +static void face_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiLayoutSetActive(layout, RNA_boolean_get(&ptr, "use_poly_data")); + uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_poly_data")); - uiItemR(layout, &ptr, "data_types_polys", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "data_types_polys", 0, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "poly_mapping", 0, IFACE_("Mapping"), ICON_NONE); + uiItemR(layout, ptr, "poly_mapping", 0, IFACE_("Mapping"), ICON_NONE); } -static void advanced_panel_draw(const bContext *C, Panel *panel) +static void advanced_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); row = uiLayoutRowWithHeading(layout, true, IFACE_("Max Distance")); - uiItemR(row, &ptr, "use_max_distance", 0, "", ICON_NONE); + uiItemR(row, ptr, "use_max_distance", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_max_distance")); - uiItemR(sub, &ptr, "max_distance", 0, "", ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max_distance")); + uiItemR(sub, ptr, "max_distance", 0, "", ICON_NONE); - uiItemR(layout, &ptr, "ray_radius", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "ray_radius", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index 75fd558ae39..68c330452b3 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -226,50 +226,49 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub, *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - int decimate_type = RNA_enum_get(&ptr, "decimate_type"); + int decimate_type = RNA_enum_get(ptr, "decimate_type"); char count_info[32]; - snprintf(count_info, 32, "%s: %d", IFACE_("Face Count"), RNA_int_get(&ptr, "face_count")); + snprintf(count_info, 32, "%s: %d", IFACE_("Face Count"), RNA_int_get(ptr, "face_count")); - uiItemR(layout, &ptr, "decimate_type", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "decimate_type", 0, NULL, ICON_NONE); if (decimate_type == MOD_DECIM_MODE_COLLAPSE) { - uiItemR(layout, &ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(layout, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Symmetry")); uiLayoutSetPropDecorate(row, false); sub = uiLayoutRow(row, true); - uiItemR(sub, &ptr, "use_symmetry", 0, "", ICON_NONE); + uiItemR(sub, ptr, "use_symmetry", 0, "", ICON_NONE); sub = uiLayoutRow(sub, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_symmetry")); - uiItemR(sub, &ptr, "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - uiItemDecoratorR(row, &ptr, "symmetry_axis", 0); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_symmetry")); + uiItemR(sub, ptr, "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemDecoratorR(row, ptr, "symmetry_axis", 0); - uiItemR(layout, &ptr, "use_collapse_triangulate", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_collapse_triangulate", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); } else if (decimate_type == MOD_DECIM_MODE_UNSUBDIV) { - uiItemR(layout, &ptr, "iterations", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE); } else { /* decimate_type == MOD_DECIM_MODE_DISSOLVE. */ - uiItemR(layout, &ptr, "angle_limit", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "delimit", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_dissolve_boundaries", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "angle_limit", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "delimit", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_dissolve_boundaries", 0, NULL, ICON_NONE); } uiItemL(layout, count_info, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index 191623112bb..caee077c475 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -435,31 +435,30 @@ static void panel_draw(const bContext *C, Panel *panel) uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data"); - PointerRNA texture_ptr = RNA_pointer_get(&ptr, "texture"); + PointerRNA texture_ptr = RNA_pointer_get(ptr, "texture"); bool has_texture = !RNA_pointer_is_null(&texture_ptr); - int texture_coords = RNA_enum_get(&ptr, "texture_coords"); + int texture_coords = RNA_enum_get(ptr, "texture_coords"); uiLayoutSetPropSep(layout, true); - uiTemplateID(layout, C, &ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL); + uiTemplateID(layout, C, ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, has_texture); - uiItemR(col, &ptr, "texture_coords", 0, IFACE_("Coordinates"), ICON_NONE); + uiItemR(col, ptr, "texture_coords", 0, IFACE_("Coordinates"), ICON_NONE); if (texture_coords == MOD_DISP_MAP_OBJECT) { - uiItemR(col, &ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); - PointerRNA texture_coords_obj_ptr = RNA_pointer_get(&ptr, "texture_coords_object"); + uiItemR(col, ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); + PointerRNA texture_coords_obj_ptr = RNA_pointer_get(ptr, "texture_coords_object"); if (!RNA_pointer_is_null(&texture_coords_obj_ptr) && (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) { PointerRNA texture_coords_obj_data_ptr = RNA_pointer_get(&texture_coords_obj_ptr, "data"); uiItemPointerR(col, - &ptr, + ptr, "texture_coords_bone", &texture_coords_obj_data_ptr, "bones", @@ -468,30 +467,30 @@ static void panel_draw(const bContext *C, Panel *panel) } } else if (texture_coords == MOD_DISP_MAP_UV && RNA_enum_get(&ob_ptr, "type") == OB_MESH) { - uiItemPointerR(col, &ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); + uiItemPointerR(col, ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); } uiItemS(layout); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "direction", 0, 0, ICON_NONE); - if (ELEM(RNA_enum_get(&ptr, "direction"), + uiItemR(col, ptr, "direction", 0, 0, ICON_NONE); + if (ELEM(RNA_enum_get(ptr, "direction"), MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, MOD_DISP_DIR_RGB_XYZ)) { - uiItemR(col, &ptr, "space", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "space", 0, NULL, ICON_NONE); } uiItemS(layout); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "strength", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "mid_level", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "strength", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "mid_level", 0, NULL, ICON_NONE); - modifier_vgroup_ui(col, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(col, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index 0706d4259bd..440b4677411 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -183,16 +183,15 @@ static void foreachTexLink(ModifierData *UNUSED(md), // walk(userData, ob, md, ""); /* re-enable when possible */ } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiItemL(layout, IFACE_("Settings are inside the Physics tab"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index b166a140ddc..2699896ac67 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -138,25 +138,24 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx) return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); row = uiLayoutRowWithHeading(layout, true, IFACE_("Edge Angle")); - uiItemR(row, &ptr, "use_edge_angle", 0, "", ICON_NONE); + uiItemR(row, ptr, "use_edge_angle", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_edge_angle")); - uiItemR(sub, &ptr, "split_angle", 0, "", ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_edge_angle")); + uiItemR(sub, ptr, "split_angle", 0, "", ICON_NONE); - uiItemR(layout, &ptr, "use_edge_sharp", 0, IFACE_("Sharp Edges"), ICON_NONE); + uiItemR(layout, ptr, "use_edge_sharp", 0, IFACE_("Sharp Edges"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index d520cccf0a2..0858fe9510b 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -1186,43 +1186,42 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return mesh; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *col; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data"); - bool has_vertex_group = RNA_string_length(&ptr, "vertex_group") != 0; + bool has_vertex_group = RNA_string_length(ptr, "vertex_group") != 0; uiLayoutSetPropSep(layout, true); - uiItemPointerR(layout, &ptr, "particle_uv", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); + uiItemPointerR(layout, ptr, "particle_uv", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Show")); - uiItemR(row, &ptr, "show_alive", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "show_dead", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "show_unborn", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "show_alive", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "show_dead", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "show_unborn", toggles_flag, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "use_edge_cut", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_size", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_edge_cut", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_size", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, has_vertex_group); - uiItemR(row, &ptr, "protect", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "protect", 0, NULL, ICON_NONE); uiItemO(layout, IFACE_("Refresh"), ICON_NONE, "OBJECT_OT_explode_refresh"); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_fluid.c b/source/blender/modifiers/intern/MOD_fluid.c index e994b80ddea..d9bc78df527 100644 --- a/source/blender/modifiers/intern/MOD_fluid.c +++ b/source/blender/modifiers/intern/MOD_fluid.c @@ -205,16 +205,15 @@ static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *u } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiItemL(layout, IFACE_("Settings are inside the Physics tab"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 86592245368..98bbb328007 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -455,30 +455,29 @@ static void deformVertsEM(struct ModifierData *md, deformVerts_do(hmd, ctx, ctx->object, mesh, mesh ? NULL : editData, vertexCos, numVerts); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - PointerRNA hook_object_ptr = RNA_pointer_get(&ptr, "object"); + PointerRNA hook_object_ptr = RNA_pointer_get(ptr, "object"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "object", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "object", 0, NULL, ICON_NONE); if (!RNA_pointer_is_null(&hook_object_ptr) && RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) { PointerRNA hook_object_data_ptr = RNA_pointer_get(&hook_object_ptr, "data"); uiItemPointerR( - col, &ptr, "subtarget", &hook_object_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); + col, ptr, "subtarget", &hook_object_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); } - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - uiItemR(layout, &ptr, "strength", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(layout, ptr, "strength", UI_ITEM_R_SLIDER, NULL, ICON_NONE); if (RNA_enum_get(&ob_ptr, "mode") == OB_MODE_EDIT) { row = uiLayoutRow(layout, true); @@ -489,31 +488,30 @@ static void panel_draw(const bContext *C, Panel *panel) uiItemO(row, "Assign", ICON_NONE, "OBJECT_OT_hook_assign"); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void falloff_panel_draw(const bContext *C, Panel *panel) +static void falloff_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_falloff = RNA_enum_get(&ptr, "falloff_type") != eWarp_Falloff_None; + bool use_falloff = RNA_enum_get(ptr, "falloff_type") != eWarp_Falloff_None; uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); + uiItemR(layout, ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, use_falloff); - uiItemR(row, &ptr, "falloff_radius", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "falloff_radius", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_falloff_uniform", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_falloff_uniform", 0, NULL, ICON_NONE); - if (RNA_enum_get(&ptr, "falloff_type") == eWarp_Falloff_Curve) { - uiTemplateCurveMapping(layout, &ptr, "falloff_curve", 0, false, false, false, false); + if (RNA_enum_get(ptr, "falloff_type") == eWarp_Falloff_Curve) { + uiTemplateCurveMapping(layout, ptr, "falloff_curve", 0, false, false, false, false); } } diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c index e2646e77af9..8c297f11f7d 100644 --- a/source/blender/modifiers/intern/MOD_laplaciandeform.c +++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c @@ -822,23 +822,22 @@ static void freeData(ModifierData *md) lmd->total_verts = 0; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - bool is_bind = RNA_boolean_get(&ptr, "is_bind"); - bool has_vertex_group = RNA_string_length(&ptr, "vertex_group") != 0; + bool is_bind = RNA_boolean_get(ptr, "is_bind"); + bool has_vertex_group = RNA_string_length(ptr, "vertex_group") != 0; uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "iterations", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); uiItemS(layout); @@ -849,7 +848,7 @@ static void panel_draw(const bContext *C, Panel *panel) ICON_NONE, "OBJECT_OT_laplaciandeform_bind"); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c index a7c74664cd9..4c438256661 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c @@ -584,34 +584,33 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "iterations", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis")); - uiItemR(row, &ptr, "use_x", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_y", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_z", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_x", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_y", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_z", toggles_flag, NULL, ICON_NONE); - uiItemR(layout, &ptr, "lambda_factor", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "lambda_border", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "lambda_factor", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "lambda_border", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_volume_preserve", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_normalized", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_volume_preserve", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_normalized", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index bf891c4938b..75c34b3cc89 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -147,23 +147,22 @@ static void deformVertsEM(ModifierData *md, lmd->object, ctx->object, vertexCos, numVerts, lmd->flag, lmd->name, lmd->strength, em); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "object", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - uiItemR(layout, &ptr, "strength", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(layout, ptr, "strength", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index c173ab52ce8..52d2bd11748 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -398,35 +398,34 @@ static bool isDisabled(const struct Scene *UNUSED(scene), return mmd->ob_arm && mmd->ob_arm->type != OB_ARMATURE; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub, *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int mode = RNA_enum_get(&ptr, "mode"); + int mode = RNA_enum_get(ptr, "mode"); - uiItemR(layout, &ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); if (mode == MOD_MASK_MODE_ARM) { row = uiLayoutRow(layout, true); - uiItemR(row, &ptr, "armature", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "armature", 0, NULL, ICON_NONE); sub = uiLayoutRow(row, true); uiLayoutSetPropDecorate(sub, false); - uiItemR(sub, &ptr, "invert_vertex_group", 0, "", ICON_ARROW_LEFTRIGHT); + uiItemR(sub, ptr, "invert_vertex_group", 0, "", ICON_ARROW_LEFTRIGHT); } else if (mode == MOD_MASK_MODE_VGROUP) { - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", nullptr); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", nullptr); } - uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "threshold", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c index 2041b7a25db..456ece7704b 100644 --- a/source/blender/modifiers/intern/MOD_meshcache.c +++ b/source/blender/modifiers/intern/MOD_meshcache.c @@ -297,72 +297,69 @@ static void deformVertsEM(ModifierData *md, meshcache_do(mcmd, scene, ctx->object, vertexCos, numVerts); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "cache_format", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "filepath", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "cache_format", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "filepath", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "factor", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(layout, &ptr, "deform_mode", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "interpolation", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "factor", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(layout, ptr, "deform_mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "interpolation", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void time_remapping_panel_draw(const bContext *C, Panel *panel) +static void time_remapping_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "time_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "time_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "play_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "play_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - if (RNA_enum_get(&ptr, "play_mode") == MOD_MESHCACHE_PLAY_CFEA) { - uiItemR(layout, &ptr, "frame_start", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "frame_scale", 0, NULL, ICON_NONE); + if (RNA_enum_get(ptr, "play_mode") == MOD_MESHCACHE_PLAY_CFEA) { + uiItemR(layout, ptr, "frame_start", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "frame_scale", 0, NULL, ICON_NONE); } else { /* play_mode == MOD_MESHCACHE_PLAY_EVAL */ - int time_mode = RNA_enum_get(&ptr, "time_mode"); + int time_mode = RNA_enum_get(ptr, "time_mode"); if (time_mode == MOD_MESHCACHE_TIME_FRAME) { - uiItemR(layout, &ptr, "eval_frame", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "eval_frame", 0, NULL, ICON_NONE); } else if (time_mode == MOD_MESHCACHE_TIME_SECONDS) { - uiItemR(layout, &ptr, "eval_time", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "eval_time", 0, NULL, ICON_NONE); } else { /* time_mode == MOD_MESHCACHE_TIME_FACTOR */ - uiItemR(layout, &ptr, "eval_factor", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "eval_factor", 0, NULL, ICON_NONE); } } } -static void axis_mapping_panel_draw(const bContext *C, Panel *panel) +static void axis_mapping_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, true); - uiLayoutSetRedAlert(col, RNA_enum_get(&ptr, "forward_axis") == RNA_enum_get(&ptr, "up_axis")); - uiItemR(col, &ptr, "forward_axis", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "up_axis", 0, NULL, ICON_NONE); + uiLayoutSetRedAlert(col, RNA_enum_get(ptr, "forward_axis") == RNA_enum_get(ptr, "up_axis")); + uiItemR(col, ptr, "forward_axis", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "up_axis", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "flip_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "flip_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index 4dee70608f8..16b72bb358a 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -560,36 +560,35 @@ void BKE_modifier_mdef_compact_influences(ModifierData *md) mmd->bindweights = NULL; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - bool is_bound = RNA_boolean_get(&ptr, "is_bound"); + bool is_bound = RNA_boolean_get(ptr, "is_bound"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, true); uiLayoutSetEnabled(col, !is_bound); - uiItemR(col, &ptr, "object", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "object", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); col = uiLayoutColumn(layout, false); uiLayoutSetEnabled(col, !is_bound); - uiItemR(col, &ptr, "precision", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_dynamic_bind", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "precision", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_dynamic_bind", 0, NULL, ICON_NONE); uiItemO(layout, is_bound ? IFACE_("Unbind") : IFACE_("Bind"), ICON_NONE, "OBJECT_OT_meshdeform_bind"); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c index 5513e6b4971..dc465ee941c 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.c +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c @@ -222,28 +222,27 @@ static void panel_draw(const bContext *C, Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - PointerRNA cache_file_ptr = RNA_pointer_get(&ptr, "cache_file"); + PointerRNA cache_file_ptr = RNA_pointer_get(ptr, "cache_file"); bool has_cache_file = !RNA_pointer_is_null(&cache_file_ptr); uiLayoutSetPropSep(layout, true); - uiTemplateCacheFile(layout, C, &ptr, "cache_file"); + uiTemplateCacheFile(layout, C, ptr, "cache_file"); if (has_cache_file) { - uiItemPointerR(layout, &ptr, "object_path", &cache_file_ptr, "object_paths", NULL, ICON_NONE); + uiItemPointerR(layout, ptr, "object_path", &cache_file_ptr, "object_paths", NULL, ICON_NONE); } if (RNA_enum_get(&ob_ptr, "type") == OB_MESH) { - uiItemR(layout, &ptr, "read_data", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "read_data", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } - uiItemR(layout, &ptr, "velocity_scale", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "velocity_scale", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 5f67d591e60..75c92bfd815 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -124,60 +124,58 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *col, *sub; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; PropertyRNA *prop; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); col = uiLayoutColumn(layout, false); uiLayoutSetPropSep(col, true); - prop = RNA_struct_find_property(&ptr, "use_axis"); + prop = RNA_struct_find_property(ptr, "use_axis"); row = uiLayoutRowWithHeading(col, true, IFACE_("Axis")); - uiItemFullR(row, &ptr, prop, 0, 0, toggles_flag, IFACE_("X"), ICON_NONE); - uiItemFullR(row, &ptr, prop, 1, 0, toggles_flag, IFACE_("Y"), ICON_NONE); - uiItemFullR(row, &ptr, prop, 2, 0, toggles_flag, IFACE_("Z"), ICON_NONE); + uiItemFullR(row, ptr, prop, 0, 0, toggles_flag, IFACE_("X"), ICON_NONE); + uiItemFullR(row, ptr, prop, 1, 0, toggles_flag, IFACE_("Y"), ICON_NONE); + uiItemFullR(row, ptr, prop, 2, 0, toggles_flag, IFACE_("Z"), ICON_NONE); - prop = RNA_struct_find_property(&ptr, "use_bisect_axis"); + prop = RNA_struct_find_property(ptr, "use_bisect_axis"); row = uiLayoutRowWithHeading(col, true, IFACE_("Bisect")); - uiItemFullR(row, &ptr, prop, 0, 0, toggles_flag, IFACE_("X"), ICON_NONE); - uiItemFullR(row, &ptr, prop, 1, 0, toggles_flag, IFACE_("Y"), ICON_NONE); - uiItemFullR(row, &ptr, prop, 2, 0, toggles_flag, IFACE_("Z"), ICON_NONE); + uiItemFullR(row, ptr, prop, 0, 0, toggles_flag, IFACE_("X"), ICON_NONE); + uiItemFullR(row, ptr, prop, 1, 0, toggles_flag, IFACE_("Y"), ICON_NONE); + uiItemFullR(row, ptr, prop, 2, 0, toggles_flag, IFACE_("Z"), ICON_NONE); - prop = RNA_struct_find_property(&ptr, "use_bisect_flip_axis"); + prop = RNA_struct_find_property(ptr, "use_bisect_flip_axis"); row = uiLayoutRowWithHeading(col, true, IFACE_("Flip")); - uiItemFullR(row, &ptr, prop, 0, 0, toggles_flag, IFACE_("X"), ICON_NONE); - uiItemFullR(row, &ptr, prop, 1, 0, toggles_flag, IFACE_("Y"), ICON_NONE); - uiItemFullR(row, &ptr, prop, 2, 0, toggles_flag, IFACE_("Z"), ICON_NONE); + uiItemFullR(row, ptr, prop, 0, 0, toggles_flag, IFACE_("X"), ICON_NONE); + uiItemFullR(row, ptr, prop, 1, 0, toggles_flag, IFACE_("Y"), ICON_NONE); + uiItemFullR(row, ptr, prop, 2, 0, toggles_flag, IFACE_("Z"), ICON_NONE); uiItemS(col); - uiItemR(col, &ptr, "mirror_object", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "mirror_object", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_clip", 0, IFACE_("Clipping"), ICON_NONE); + uiItemR(col, ptr, "use_clip", 0, IFACE_("Clipping"), ICON_NONE); row = uiLayoutRowWithHeading(col, true, IFACE_("Merge")); - uiItemR(row, &ptr, "use_mirror_merge", 0, "", ICON_NONE); + uiItemR(row, ptr, "use_mirror_merge", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_mirror_merge")); - uiItemR(sub, &ptr, "merge_threshold", 0, "", ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_mirror_merge")); + uiItemR(sub, ptr, "merge_threshold", 0, "", ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void data_panel_draw(const bContext *C, Panel *panel) +static void data_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col, *row, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); @@ -185,27 +183,27 @@ static void data_panel_draw(const bContext *C, Panel *panel) row = uiLayoutRowWithHeading(col, true, IFACE_("Mirror U")); uiLayoutSetPropDecorate(row, false); sub = uiLayoutRow(row, true); - uiItemR(sub, &ptr, "use_mirror_u", 0, "", ICON_NONE); + uiItemR(sub, ptr, "use_mirror_u", 0, "", ICON_NONE); sub = uiLayoutRow(sub, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_mirror_u")); - uiItemR(sub, &ptr, "mirror_offset_u", UI_ITEM_R_SLIDER, "", ICON_NONE); - uiItemDecoratorR(row, &ptr, "mirror_offset_u", 0); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_mirror_u")); + uiItemR(sub, ptr, "mirror_offset_u", UI_ITEM_R_SLIDER, "", ICON_NONE); + uiItemDecoratorR(row, ptr, "mirror_offset_u", 0); row = uiLayoutRowWithHeading(col, true, IFACE_("V")); uiLayoutSetPropDecorate(row, false); sub = uiLayoutRow(row, true); - uiItemR(sub, &ptr, "use_mirror_v", 0, "", ICON_NONE); + uiItemR(sub, ptr, "use_mirror_v", 0, "", ICON_NONE); sub = uiLayoutRow(sub, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_mirror_v")); - uiItemR(sub, &ptr, "mirror_offset_v", UI_ITEM_R_SLIDER, "", ICON_NONE); - uiItemDecoratorR(row, &ptr, "mirror_offset_v", 0); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_mirror_v")); + uiItemR(sub, ptr, "mirror_offset_v", UI_ITEM_R_SLIDER, "", ICON_NONE); + uiItemDecoratorR(row, ptr, "mirror_offset_v", 0); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "offset_u", UI_ITEM_R_SLIDER, IFACE_("Offset U"), ICON_NONE); - uiItemR(col, &ptr, "offset_v", UI_ITEM_R_SLIDER, IFACE_("V"), ICON_NONE); + uiItemR(col, ptr, "offset_u", UI_ITEM_R_SLIDER, IFACE_("Offset U"), ICON_NONE); + uiItemR(col, ptr, "offset_v", UI_ITEM_R_SLIDER, IFACE_("V"), ICON_NONE); - uiItemR(layout, &ptr, "use_mirror_vertex_groups", 0, IFACE_("Vertex Groups"), ICON_NONE); - uiItemR(layout, &ptr, "use_mirror_udim", 0, IFACE_("Flip UDIM"), ICON_NONE); + uiItemR(layout, ptr, "use_mirror_vertex_groups", 0, IFACE_("Vertex Groups"), ICON_NONE); + uiItemR(layout, ptr, "use_mirror_udim", 0, IFACE_("Flip UDIM"), ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 9ced297bb48..7bdc1da33c2 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -333,39 +333,37 @@ static void panel_draw(const bContext *C, Panel *panel) uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "levels", 0, IFACE_("Level Viewport"), ICON_NONE); - uiItemR(col, &ptr, "sculpt_levels", 0, IFACE_("Sculpt"), ICON_NONE); - uiItemR(col, &ptr, "render_levels", 0, IFACE_("Render"), ICON_NONE); + uiItemR(col, ptr, "levels", 0, IFACE_("Level Viewport"), ICON_NONE); + uiItemR(col, ptr, "sculpt_levels", 0, IFACE_("Sculpt"), ICON_NONE); + uiItemR(col, ptr, "render_levels", 0, IFACE_("Render"), ICON_NONE); const bool is_sculpt_mode = CTX_data_active_object(C)->mode & OB_MODE_SCULPT; uiBlock *block = uiLayoutGetBlock(panel->layout); UI_block_lock_set(block, !is_sculpt_mode, IFACE_("Sculpt Base Mesh")); - uiItemR(col, &ptr, "use_sculpt_base_mesh", 0, IFACE_("Sculpt Base Mesh"), ICON_NONE); + uiItemR(col, ptr, "use_sculpt_base_mesh", 0, IFACE_("Sculpt Base Mesh"), ICON_NONE); UI_block_lock_clear(block); - uiItemR(layout, &ptr, "show_only_control_edges", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "show_only_control_edges", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void subdivisions_panel_draw(const bContext *C, Panel *panel) +static void subdivisions_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetEnabled(layout, RNA_enum_get(&ob_ptr, "mode") != OB_MODE_EDIT); - MultiresModifierData *mmd = (MultiresModifierData *)ptr.data; + MultiresModifierData *mmd = (MultiresModifierData *)ptr->data; /** * Changing some of the properties can not be done once there is an @@ -418,14 +416,13 @@ static void subdivisions_panel_draw(const bContext *C, Panel *panel) uiItemO(layout, IFACE_("Delete Higher"), ICON_NONE, "OBJECT_OT_multires_higher_levels_delete"); } -static void shape_panel_draw(const bContext *C, Panel *panel) +static void shape_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetEnabled(layout, RNA_enum_get(&ob_ptr, "mode") != OB_MODE_EDIT); @@ -434,16 +431,15 @@ static void shape_panel_draw(const bContext *C, Panel *panel) uiItemO(row, IFACE_("Apply Base"), ICON_NONE, "OBJECT_OT_multires_base_apply"); } -static void generate_panel_draw(const bContext *C, Panel *panel) +static void generate_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col, *row; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); - MultiresModifierData *mmd = (MultiresModifierData *)ptr.data; + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); + MultiresModifierData *mmd = (MultiresModifierData *)ptr->data; - bool is_external = RNA_boolean_get(&ptr, "is_external"); + bool is_external = RNA_boolean_get(ptr, "is_external"); if (mmd->totlvl == 0) { uiItemO( @@ -456,36 +452,35 @@ static void generate_panel_draw(const bContext *C, Panel *panel) uiItemO(row, IFACE_("Pack External"), ICON_NONE, "OBJECT_OT_multires_external_pack"); uiLayoutSetPropSep(col, true); row = uiLayoutRow(col, false); - uiItemR(row, &ptr, "filepath", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "filepath", 0, NULL, ICON_NONE); } else { uiItemO(col, IFACE_("Save External..."), ICON_NONE, "OBJECT_OT_multires_external_save"); } } -static void advanced_panel_draw(const bContext *C, Panel *panel) +static void advanced_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool has_displacement = RNA_int_get(&ptr, "total_levels") != 0; + bool has_displacement = RNA_int_get(ptr, "total_levels") != 0; uiLayoutSetPropSep(layout, true); uiLayoutSetEnabled(layout, !has_displacement); - uiItemR(layout, &ptr, "subdivision_type", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "quality", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "subdivision_type", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "quality", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); uiLayoutSetEnabled(col, true); - uiItemR(col, &ptr, "uv_smooth", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "uv_smooth", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_creases", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_custom_normals", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_creases", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_custom_normals", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c index f22ece11726..9962d3a55e0 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.c +++ b/source/blender/modifiers/intern/MOD_normal_edit.c @@ -702,75 +702,72 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return normalEditModifier_do((NormalEditModifierData *)md, ctx, ctx->object, mesh); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int mode = RNA_enum_get(&ptr, "mode"); + int mode = RNA_enum_get(ptr, "mode"); - uiItemR(layout, &ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "target", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "target", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, mode == MOD_NORMALEDIT_MODE_DIRECTIONAL); - uiItemR(col, &ptr, "use_direction_parallel", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_direction_parallel", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } /* This panel could be open by default, but it isn't currently. */ -static void mix_mode_panel_draw(const bContext *C, Panel *panel) +static void mix_mode_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "mix_mode", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "mix_factor", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "mix_mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "mix_factor", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); row = uiLayoutRow(layout, true); - uiItemR(row, &ptr, "mix_limit", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "mix_limit", 0, NULL, ICON_NONE); uiItemR(row, - &ptr, + ptr, "no_polynors_fix", 0, "", - (RNA_boolean_get(&ptr, "no_polynors_fix") ? ICON_LOCKED : ICON_UNLOCKED)); + (RNA_boolean_get(ptr, "no_polynors_fix") ? ICON_LOCKED : ICON_UNLOCKED)); } -static void offset_panel_draw(const bContext *C, Panel *panel) +static void offset_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - int mode = RNA_enum_get(&ptr, "mode"); - PointerRNA target_ptr = RNA_pointer_get(&ptr, "target"); + int mode = RNA_enum_get(ptr, "mode"); + PointerRNA target_ptr = RNA_pointer_get(ptr, "target"); bool needs_object_offset = (mode == MOD_NORMALEDIT_MODE_RADIAL && RNA_pointer_is_null(&target_ptr)) || (mode == MOD_NORMALEDIT_MODE_DIRECTIONAL && - RNA_boolean_get(&ptr, "use_direction_parallel")); + RNA_boolean_get(ptr, "use_direction_parallel")); uiLayoutSetPropSep(layout, true); uiLayoutSetActive(layout, needs_object_offset); - uiItemR(layout, &ptr, "offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 7b31886a220..ccd105f8f69 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -546,169 +546,160 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } // #define WITH_OCEANSIM -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; #ifdef WITH_OCEANSIM uiLayout *col, *sub; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "geometry_mode", 0, NULL, ICON_NONE); - if (RNA_enum_get(&ptr, "geometry_mode") == MOD_OCEAN_GEOM_GENERATE) { + uiItemR(col, ptr, "geometry_mode", 0, NULL, ICON_NONE); + if (RNA_enum_get(ptr, "geometry_mode") == MOD_OCEAN_GEOM_GENERATE) { sub = uiLayoutColumn(col, true); - uiItemR(sub, &ptr, "repeat_x", 0, IFACE_("Repeat X"), ICON_NONE); - uiItemR(sub, &ptr, "repeat_y", 0, IFACE_("Y"), ICON_NONE); + uiItemR(sub, ptr, "repeat_x", 0, IFACE_("Repeat X"), ICON_NONE); + uiItemR(sub, ptr, "repeat_y", 0, IFACE_("Y"), ICON_NONE); } sub = uiLayoutColumn(col, true); - uiItemR(sub, &ptr, "viewport_resolution", 0, IFACE_("Resolution Viewport"), ICON_NONE); - uiItemR(sub, &ptr, "resolution", 0, IFACE_("Render"), ICON_NONE); + uiItemR(sub, ptr, "viewport_resolution", 0, IFACE_("Resolution Viewport"), ICON_NONE); + uiItemR(sub, ptr, "resolution", 0, IFACE_("Render"), ICON_NONE); - uiItemR(col, &ptr, "time", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "time", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "depth", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "size", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "spatial_size", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "depth", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "size", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "spatial_size", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "random_seed", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "random_seed", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_normals", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_normals", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); #else /* WITH_OCEANSIM */ uiItemL(layout, IFACE_("Built without Ocean modifier"), ICON_NONE); - UNUSED_VARS(C); #endif /* WITH_OCEANSIM */ } #ifdef WITH_OCEANSIM -static void waves_panel_draw(const bContext *C, Panel *panel) +static void waves_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "wave_scale", 0, IFACE_("Scale"), ICON_NONE); - uiItemR(col, &ptr, "wave_scale_min", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "choppiness", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "wind_velocity", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "wave_scale", 0, IFACE_("Scale"), ICON_NONE); + uiItemR(col, ptr, "wave_scale_min", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "choppiness", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "wind_velocity", 0, NULL, ICON_NONE); uiItemS(layout); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "wave_alignment", UI_ITEM_R_SLIDER, IFACE_("Alignment"), ICON_NONE); + uiItemR(col, ptr, "wave_alignment", UI_ITEM_R_SLIDER, IFACE_("Alignment"), ICON_NONE); sub = uiLayoutColumn(col, false); - uiLayoutSetActive(sub, RNA_float_get(&ptr, "wave_alignment") > 0.0f); - uiItemR(sub, &ptr, "wave_direction", 0, IFACE_("Direction"), ICON_NONE); - uiItemR(sub, &ptr, "damping", 0, NULL, ICON_NONE); + uiLayoutSetActive(sub, RNA_float_get(ptr, "wave_alignment") > 0.0f); + uiItemR(sub, ptr, "wave_direction", 0, IFACE_("Direction"), ICON_NONE); + uiItemR(sub, ptr, "damping", 0, NULL, ICON_NONE); } -static void foam_panel_draw_header(const bContext *C, Panel *panel) +static void foam_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_foam", 0, IFACE_("Foam"), ICON_NONE); + uiItemR(layout, ptr, "use_foam", 0, IFACE_("Foam"), ICON_NONE); } -static void foam_panel_draw(const bContext *C, Panel *panel) +static void foam_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, use_foam); - uiItemR(col, &ptr, "foam_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); - uiItemR(col, &ptr, "foam_coverage", 0, IFACE_("Coverage"), ICON_NONE); + uiItemR(col, ptr, "foam_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); + uiItemR(col, ptr, "foam_coverage", 0, IFACE_("Coverage"), ICON_NONE); } -static void spray_panel_draw_header(const bContext *C, Panel *panel) +static void spray_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, use_foam); - uiItemR(row, &ptr, "use_spray", 0, IFACE_("Spray"), ICON_NONE); + uiItemR(row, ptr, "use_spray", 0, IFACE_("Spray"), ICON_NONE); } -static void spray_panel_draw(const bContext *C, Panel *panel) +static void spray_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); - bool use_spray = RNA_boolean_get(&ptr, "use_spray"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); + bool use_spray = RNA_boolean_get(ptr, "use_spray"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, use_foam && use_spray); - uiItemR(col, &ptr, "spray_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); - uiItemR(col, &ptr, "invert_spray", 0, IFACE_("Invert"), ICON_NONE); + uiItemR(col, ptr, "spray_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); + uiItemR(col, ptr, "invert_spray", 0, IFACE_("Invert"), ICON_NONE); } -static void spectrum_panel_draw(const bContext *C, Panel *panel) +static void spectrum_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - int spectrum = RNA_enum_get(&ptr, "spectrum"); + int spectrum = RNA_enum_get(ptr, "spectrum"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "spectrum", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "spectrum", 0, NULL, ICON_NONE); if (ELEM(spectrum, MOD_OCEAN_SPECTRUM_TEXEL_MARSEN_ARSLOE, MOD_OCEAN_SPECTRUM_JONSWAP)) { - uiItemR(col, &ptr, "sharpen_peak_jonswap", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, &ptr, "fetch_jonswap", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "sharpen_peak_jonswap", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "fetch_jonswap", 0, NULL, ICON_NONE); } } -static void bake_panel_draw(const bContext *C, Panel *panel) +static void bake_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - bool is_cached = RNA_boolean_get(&ptr, "is_cached"); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); + bool is_cached = RNA_boolean_get(ptr, "is_cached"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); if (is_cached) { PointerRNA op_ptr; @@ -726,16 +717,16 @@ static void bake_panel_draw(const bContext *C, Panel *panel) uiItemO(layout, NULL, ICON_NONE, "OBJECT_OT_ocean_bake"); } - uiItemR(layout, &ptr, "filepath", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "filepath", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, true); uiLayoutSetEnabled(col, !is_cached); - uiItemR(col, &ptr, "frame_start", 0, IFACE_("Frame Start"), ICON_NONE); - uiItemR(col, &ptr, "frame_end", 0, IFACE_("End"), ICON_NONE); + uiItemR(col, ptr, "frame_start", 0, IFACE_("Frame Start"), ICON_NONE); + uiItemR(col, ptr, "frame_end", 0, IFACE_("End"), ICON_NONE); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, use_foam); - uiItemR(col, &ptr, "bake_foam_fade", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "bake_foam_fade", 0, NULL, ICON_NONE); } #endif /* WITH_OCEANSIM */ diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index d3d2f891929..597a61c6c16 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -557,24 +557,23 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - PointerRNA particle_obj_ptr = RNA_pointer_get(&ptr, "object"); + PointerRNA particle_obj_ptr = RNA_pointer_get(ptr, "object"); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "object", 0, NULL, ICON_NONE); if (!RNA_pointer_is_null(&particle_obj_ptr)) { uiItemPointerR(layout, - &ptr, + ptr, "particle_system", &particle_obj_ptr, "particle_systems", @@ -582,74 +581,71 @@ static void panel_draw(const bContext *C, Panel *panel) ICON_NONE); } else { - uiItemR(layout, &ptr, "particle_system_index", 0, IFACE_("Particle System"), ICON_NONE); + uiItemR(layout, ptr, "particle_system_index", 0, IFACE_("Particle System"), ICON_NONE); } uiItemS(layout); row = uiLayoutRowWithHeading(layout, true, IFACE_("Create Instances")); - uiItemR(row, &ptr, "use_normal", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_children", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_size", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_normal", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_children", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_size", toggles_flag, NULL, ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Show")); - uiItemR(row, &ptr, "show_alive", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "show_dead", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "show_unborn", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "show_alive", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "show_dead", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "show_unborn", toggles_flag, NULL, ICON_NONE); - uiItemR(layout, &ptr, "particle_amount", 0, IFACE_("Amount"), ICON_NONE); - uiItemR(layout, &ptr, "particle_offset", 0, IFACE_("Offset"), ICON_NONE); + uiItemR(layout, ptr, "particle_amount", 0, IFACE_("Amount"), ICON_NONE); + uiItemR(layout, ptr, "particle_offset", 0, IFACE_("Offset"), ICON_NONE); uiItemS(layout); - uiItemR(layout, &ptr, "space", 0, IFACE_("Coordinate Space"), ICON_NONE); + uiItemR(layout, ptr, "space", 0, IFACE_("Coordinate Space"), ICON_NONE); row = uiLayoutRow(layout, true); - uiItemR(row, &ptr, "axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(row, ptr, "axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void path_panel_draw_header(const bContext *C, Panel *panel) +static void path_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_path", 0, IFACE_("Create Along Paths"), ICON_NONE); + uiItemR(layout, ptr, "use_path", 0, IFACE_("Create Along Paths"), ICON_NONE); } -static void path_panel_draw(const bContext *C, Panel *panel) +static void path_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiLayoutSetActive(layout, RNA_boolean_get(&ptr, "use_path")); + uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_path")); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "position", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, &ptr, "random_position", UI_ITEM_R_SLIDER, IFACE_("Random"), ICON_NONE); + uiItemR(col, ptr, "position", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "random_position", UI_ITEM_R_SLIDER, IFACE_("Random"), ICON_NONE); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "rotation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, &ptr, "random_rotation", UI_ITEM_R_SLIDER, IFACE_("Random"), ICON_NONE); + uiItemR(col, ptr, "rotation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "random_rotation", UI_ITEM_R_SLIDER, IFACE_("Random"), ICON_NONE); - uiItemR(layout, &ptr, "use_preserve_shape", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_preserve_shape", 0, NULL, ICON_NONE); } -static void layers_panel_draw(const bContext *C, Panel *panel) +static void layers_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data"); @@ -657,9 +653,9 @@ static void layers_panel_draw(const bContext *C, Panel *panel) col = uiLayoutColumn(layout, false); uiItemPointerR( - col, &ptr, "index_layer_name", &obj_data_ptr, "vertex_colors", IFACE_("Index"), ICON_NONE); + col, ptr, "index_layer_name", &obj_data_ptr, "vertex_colors", IFACE_("Index"), ICON_NONE); uiItemPointerR( - col, &ptr, "value_layer_name", &obj_data_ptr, "vertex_colors", IFACE_("Value"), ICON_NONE); + col, ptr, "value_layer_name", &obj_data_ptr, "vertex_colors", IFACE_("Value"), ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c index 4ef1b19dc64..c2f411f5247 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.c +++ b/source/blender/modifiers/intern/MOD_particlesystem.c @@ -260,16 +260,15 @@ static void deformVertsEM(ModifierData *md, } #endif -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); Object *ob = ob_ptr.data; - ModifierData *md = (ModifierData *)ptr.data; + ModifierData *md = (ModifierData *)ptr->data; ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys; uiItemL(layout, IFACE_("Settings are in the particle tab"), ICON_NONE); @@ -289,7 +288,7 @@ static void panel_draw(const bContext *C, Panel *panel) } } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c index 197d759c352..2c554a6b1a0 100644 --- a/source/blender/modifiers/intern/MOD_remesh.c +++ b/source/blender/modifiers/intern/MOD_remesh.c @@ -237,47 +237,45 @@ static Mesh *modifyMesh(ModifierData *UNUSED(md), #endif /* !WITH_MOD_REMESH */ -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; #ifdef WITH_MOD_REMESH uiLayout *row, *col; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int mode = RNA_enum_get(&ptr, "mode"); + int mode = RNA_enum_get(ptr, "mode"); - uiItemR(layout, &ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); if (mode == MOD_REMESH_VOXEL) { - uiItemR(col, &ptr, "voxel_size", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "adaptivity", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "voxel_size", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "adaptivity", 0, NULL, ICON_NONE); } else { - uiItemR(col, &ptr, "octree_depth", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "scale", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "octree_depth", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "scale", 0, NULL, ICON_NONE); if (mode == MOD_REMESH_SHARP_FEATURES) { - uiItemR(col, &ptr, "sharpness", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "sharpness", 0, NULL, ICON_NONE); } - uiItemR(layout, &ptr, "use_remove_disconnected", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_remove_disconnected", 0, NULL, ICON_NONE); row = uiLayoutRow(layout, false); - uiLayoutSetActive(row, RNA_boolean_get(&ptr, "use_remove_disconnected")); - uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE); + uiLayoutSetActive(row, RNA_boolean_get(ptr, "use_remove_disconnected")); + uiItemR(layout, ptr, "threshold", 0, NULL, ICON_NONE); } - uiItemR(layout, &ptr, "use_smooth_shade", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_smooth_shade", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); #else /* WITH_MOD_REMESH */ uiItemL(layout, IFACE_("Built without Remesh modifier"), ICON_NONE); - UNUSED_VARS(C); #endif /* WITH_MOD_REMESH */ } diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 3bb7ecd43f4..5842d05da09 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -1168,74 +1168,72 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, walk(userData, ob, <md->ob_axis, IDWALK_CB_NOP); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub, *row, *col; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - PointerRNA screw_obj_ptr = RNA_pointer_get(&ptr, "object"); + PointerRNA screw_obj_ptr = RNA_pointer_get(ptr, "object"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "angle", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "angle", 0, NULL, ICON_NONE); row = uiLayoutRow(col, false); uiLayoutSetActive(row, RNA_pointer_is_null(&screw_obj_ptr) || - !RNA_boolean_get(&ptr, "use_object_screw_offset")); - uiItemR(row, &ptr, "screw_offset", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "iterations", 0, NULL, ICON_NONE); + !RNA_boolean_get(ptr, "use_object_screw_offset")); + uiItemR(row, ptr, "screw_offset", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "iterations", 0, NULL, ICON_NONE); uiItemS(layout); col = uiLayoutColumn(layout, false); row = uiLayoutRow(col, false); - uiItemR(row, &ptr, "axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - uiItemR(col, &ptr, "object", 0, IFACE_("Axis Object"), ICON_NONE); + uiItemR(row, ptr, "axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(col, ptr, "object", 0, IFACE_("Axis Object"), ICON_NONE); sub = uiLayoutColumn(col, false); uiLayoutSetActive(sub, !RNA_pointer_is_null(&screw_obj_ptr)); - uiItemR(sub, &ptr, "use_object_screw_offset", 0, NULL, ICON_NONE); + uiItemR(sub, ptr, "use_object_screw_offset", 0, NULL, ICON_NONE); uiItemS(layout); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "steps", 0, IFACE_("Steps Viewport"), ICON_NONE); - uiItemR(col, &ptr, "render_steps", 0, IFACE_("Render"), ICON_NONE); + uiItemR(col, ptr, "steps", 0, IFACE_("Steps Viewport"), ICON_NONE); + uiItemR(col, ptr, "render_steps", 0, IFACE_("Render"), ICON_NONE); uiItemS(layout); row = uiLayoutRowWithHeading(layout, true, IFACE_("Merge")); - uiItemR(row, &ptr, "use_merge_vertices", 0, "", ICON_NONE); + uiItemR(row, ptr, "use_merge_vertices", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_merge_vertices")); - uiItemR(sub, &ptr, "merge_threshold", 0, "", ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_merge_vertices")); + uiItemR(sub, ptr, "merge_threshold", 0, "", ICON_NONE); uiItemS(layout); row = uiLayoutRowWithHeading(layout, true, IFACE_("Stretch UVs")); - uiItemR(row, &ptr, "use_stretch_u", toggles_flag, IFACE_("U"), ICON_NONE); - uiItemR(row, &ptr, "use_stretch_v", toggles_flag, IFACE_("V"), ICON_NONE); + uiItemR(row, ptr, "use_stretch_u", toggles_flag, IFACE_("U"), ICON_NONE); + uiItemR(row, ptr, "use_stretch_v", toggles_flag, IFACE_("V"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void normals_panel_draw(const bContext *C, Panel *panel) +static void normals_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "use_smooth_shade", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_normal_calculate", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_normal_flip", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_smooth_shade", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_normal_calculate", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_normal_flip", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index c40fbffc506..fb045cf8923 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -215,59 +215,58 @@ static bool dependsOnNormals(ModifierData *md) return false; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *col; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - int wrap_method = RNA_enum_get(&ptr, "wrap_method"); + int wrap_method = RNA_enum_get(ptr, "wrap_method"); - uiItemR(layout, &ptr, "wrap_method", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "wrap_method", 0, NULL, ICON_NONE); if (ELEM(wrap_method, MOD_SHRINKWRAP_PROJECT, MOD_SHRINKWRAP_NEAREST_SURFACE, MOD_SHRINKWRAP_TARGET_PROJECT)) { - uiItemR(layout, &ptr, "wrap_mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "wrap_mode", 0, NULL, ICON_NONE); } if (wrap_method == MOD_SHRINKWRAP_PROJECT) { - uiItemR(layout, &ptr, "project_limit", 0, IFACE_("Limit"), ICON_NONE); - uiItemR(layout, &ptr, "subsurf_levels", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "project_limit", 0, IFACE_("Limit"), ICON_NONE); + uiItemR(layout, ptr, "subsurf_levels", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); row = uiLayoutRowWithHeading(col, true, IFACE_("Axis")); - uiItemR(row, &ptr, "use_project_x", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_project_y", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_project_z", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_project_x", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_project_y", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_project_z", toggles_flag, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_negative_direction", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_positive_direction", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_negative_direction", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_positive_direction", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "cull_face", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "cull_face", UI_ITEM_R_EXPAND, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, - RNA_boolean_get(&ptr, "use_negative_direction") && - RNA_enum_get(&ptr, "cull_face") != 0); - uiItemR(col, &ptr, "use_invert_cull", 0, NULL, ICON_NONE); + RNA_boolean_get(ptr, "use_negative_direction") && + RNA_enum_get(ptr, "cull_face") != 0); + uiItemR(col, ptr, "use_invert_cull", 0, NULL, ICON_NONE); } - uiItemR(layout, &ptr, "target", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "target", 0, NULL, ICON_NONE); if (wrap_method == MOD_SHRINKWRAP_PROJECT) { - uiItemR(layout, &ptr, "auxiliary_target", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "auxiliary_target", 0, NULL, ICON_NONE); } - uiItemR(layout, &ptr, "offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 811524fc474..a0bd4e2f20f 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -464,70 +464,68 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int deform_method = RNA_enum_get(&ptr, "deform_method"); + int deform_method = RNA_enum_get(ptr, "deform_method"); row = uiLayoutRow(layout, false); - uiItemR(row, &ptr, "deform_method", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(row, ptr, "deform_method", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); if (ELEM(deform_method, MOD_SIMPLEDEFORM_MODE_TAPER, MOD_SIMPLEDEFORM_MODE_STRETCH)) { - uiItemR(layout, &ptr, "factor", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "factor", 0, NULL, ICON_NONE); } else { - uiItemR(layout, &ptr, "angle", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "angle", 0, NULL, ICON_NONE); } - uiItemR(layout, &ptr, "origin", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "deform_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "origin", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "deform_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void restrictions_panel_draw(const bContext *C, Panel *panel) +static void restrictions_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int deform_method = RNA_enum_get(&ptr, "deform_method"); + int deform_method = RNA_enum_get(ptr, "deform_method"); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "limits", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(layout, ptr, "limits", UI_ITEM_R_SLIDER, NULL, ICON_NONE); if (ELEM(deform_method, MOD_SIMPLEDEFORM_MODE_TAPER, MOD_SIMPLEDEFORM_MODE_STRETCH, MOD_SIMPLEDEFORM_MODE_TWIST)) { - int deform_axis = RNA_enum_get(&ptr, "deform_axis"); + int deform_axis = RNA_enum_get(ptr, "deform_axis"); row = uiLayoutRowWithHeading(layout, true, IFACE_("Lock")); if (deform_axis != 0) { - uiItemR(row, &ptr, "lock_x", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "lock_x", toggles_flag, NULL, ICON_NONE); } if (deform_axis != 1) { - uiItemR(row, &ptr, "lock_y", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "lock_y", toggles_flag, NULL, ICON_NONE); } if (deform_axis != 2) { - uiItemR(row, &ptr, "lock_z", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "lock_z", toggles_flag, NULL, ICON_NONE); } } - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_simulation.cc b/source/blender/modifiers/intern/MOD_simulation.cc index 99cd582f37d..d009eef00e6 100644 --- a/source/blender/modifiers/intern/MOD_simulation.cc +++ b/source/blender/modifiers/intern/MOD_simulation.cc @@ -121,21 +121,20 @@ static PointCloud *modifyPointCloud(ModifierData *md, return pointcloud; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); uiLayoutSetPropDecorate(layout, false); - uiItemR(layout, &ptr, "simulation", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "data_path", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "simulation", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "data_path", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 797d9e9e251..f9d9e206914 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -1950,28 +1950,27 @@ static void requiredDataMask(Object *UNUSED(ob), r_cddata_masks->vmask |= CD_MASK_MVERT_SKIN | CD_MASK_MDEFORMVERT; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); PointerRNA op_ptr; uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "branch_smoothing", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "branch_smoothing", 0, NULL, ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Symmetry")); - uiItemR(row, &ptr, "use_x_symmetry", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_y_symmetry", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_z_symmetry", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_x_symmetry", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_y_symmetry", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_z_symmetry", toggles_flag, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_smooth_shade", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_smooth_shade", 0, NULL, ICON_NONE); row = uiLayoutRow(layout, false); uiItemO(row, IFACE_("Create Armature"), ICON_NONE, "OBJECT_OT_skin_armature_create"); @@ -2000,7 +1999,7 @@ static void panel_draw(const bContext *C, Panel *panel) uiItemO(layout, IFACE_("Mark Root"), ICON_NONE, "OBJECT_OT_skin_root_mark"); uiItemO(layout, IFACE_("Equalize Radii"), ICON_NONE, "OBJECT_OT_skin_radii_equalize"); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index deece2b999b..1939437d717 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -238,30 +238,29 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *col; uiLayout *layout = panel->layout; int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis")); - uiItemR(row, &ptr, "use_x", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_y", toggles_flag, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_z", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_x", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_y", toggles_flag, NULL, ICON_NONE); + uiItemR(row, ptr, "use_z", toggles_flag, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "factor", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "iterations", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "factor", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "iterations", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c index 965d270829e..e688ec8470c 100644 --- a/source/blender/modifiers/intern/MOD_softbody.c +++ b/source/blender/modifiers/intern/MOD_softbody.c @@ -84,16 +84,15 @@ static void updateDepsgraph(ModifierData *UNUSED(md), const ModifierUpdateDepsgr DEG_add_modifier_to_transform_relation(ctx->node, "SoftBody Modifier"); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiItemL(layout, IFACE_("Settings are inside the Physics tab"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index df9cdee1893..2c84def73b0 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -97,150 +97,144 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return mesh; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub, *row, *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int solidify_mode = RNA_enum_get(&ptr, "solidify_mode"); - bool has_vertex_group = RNA_string_length(&ptr, "vertex_group") != 0; + int solidify_mode = RNA_enum_get(ptr, "solidify_mode"); + bool has_vertex_group = RNA_string_length(ptr, "vertex_group") != 0; uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "solidify_mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "solidify_mode", 0, NULL, ICON_NONE); if (solidify_mode == MOD_SOLIDIFY_MODE_NONMANIFOLD) { - uiItemR(layout, &ptr, "nonmanifold_thickness_mode", 0, IFACE_("Thickness Mode"), ICON_NONE); - uiItemR(layout, &ptr, "nonmanifold_boundary_mode", 0, IFACE_("Boundary"), ICON_NONE); + uiItemR(layout, ptr, "nonmanifold_thickness_mode", 0, IFACE_("Thickness Mode"), ICON_NONE); + uiItemR(layout, ptr, "nonmanifold_boundary_mode", 0, IFACE_("Boundary"), ICON_NONE); } - uiItemR(layout, &ptr, "thickness", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "thickness", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE); if (solidify_mode == MOD_SOLIDIFY_MODE_NONMANIFOLD) { - uiItemR(layout, &ptr, "nonmanifold_merge_threshold", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "nonmanifold_merge_threshold", 0, NULL, ICON_NONE); } else { - uiItemR(layout, &ptr, "use_even_offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_even_offset", 0, NULL, ICON_NONE); } col = uiLayoutColumnWithHeading(layout, false, IFACE_("Rim")); - uiItemR(col, &ptr, "use_rim", 0, IFACE_("Fill"), ICON_NONE); + uiItemR(col, ptr, "use_rim", 0, IFACE_("Fill"), ICON_NONE); sub = uiLayoutColumn(col, false); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_rim")); - uiItemR(sub, &ptr, "use_rim_only", 0, NULL, ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_rim")); + uiItemR(sub, ptr, "use_rim_only", 0, NULL, ICON_NONE); uiItemS(layout); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, has_vertex_group); - uiItemR(row, &ptr, "thickness_vertex_group", 0, IFACE_("Factor"), ICON_NONE); + uiItemR(row, ptr, "thickness_vertex_group", 0, IFACE_("Factor"), ICON_NONE); if (solidify_mode == MOD_SOLIDIFY_MODE_NONMANIFOLD) { row = uiLayoutRow(layout, false); uiLayoutSetActive(row, has_vertex_group); - uiItemR(row, &ptr, "use_flat_faces", 0, NULL, ICON_NONE); + uiItemR(row, ptr, "use_flat_faces", 0, NULL, ICON_NONE); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void normals_panel_draw(const bContext *C, Panel *panel) +static void normals_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int solidify_mode = RNA_enum_get(&ptr, "solidify_mode"); + int solidify_mode = RNA_enum_get(ptr, "solidify_mode"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "use_flip_normals", 0, IFACE_("Flip"), ICON_NONE); + uiItemR(col, ptr, "use_flip_normals", 0, IFACE_("Flip"), ICON_NONE); if (solidify_mode == MOD_SOLIDIFY_MODE_EXTRUDE) { - uiItemR(col, &ptr, "use_quality_normals", 0, IFACE_("High Quality"), ICON_NONE); + uiItemR(col, ptr, "use_quality_normals", 0, IFACE_("High Quality"), ICON_NONE); } } -static void materials_panel_draw(const bContext *C, Panel *panel) +static void materials_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "material_offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "material_offset", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, true); - uiLayoutSetActive(col, RNA_boolean_get(&ptr, "use_rim")); - uiItemR(col, &ptr, "material_offset_rim", 0, IFACE_("Rim"), ICON_NONE); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_rim")); + uiItemR(col, ptr, "material_offset_rim", 0, IFACE_("Rim"), ICON_NONE); } -static void edge_data_panel_draw(const bContext *C, Panel *panel) +static void edge_data_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int solidify_mode = RNA_enum_get(&ptr, "solidify_mode"); + int solidify_mode = RNA_enum_get(ptr, "solidify_mode"); uiLayoutSetPropSep(layout, true); if (solidify_mode == MOD_SOLIDIFY_MODE_EXTRUDE) { uiLayout *col; col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "edge_crease_inner", 0, IFACE_("Crease Inner"), ICON_NONE); - uiItemR(col, &ptr, "edge_crease_outer", 0, IFACE_("Outer"), ICON_NONE); - uiItemR(col, &ptr, "edge_crease_rim", 0, IFACE_("Rim"), ICON_NONE); + uiItemR(col, ptr, "edge_crease_inner", 0, IFACE_("Crease Inner"), ICON_NONE); + uiItemR(col, ptr, "edge_crease_outer", 0, IFACE_("Outer"), ICON_NONE); + uiItemR(col, ptr, "edge_crease_rim", 0, IFACE_("Rim"), ICON_NONE); } - uiItemR(layout, &ptr, "bevel_convex", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(layout, ptr, "bevel_convex", UI_ITEM_R_SLIDER, NULL, ICON_NONE); } -static void clamp_panel_draw(const bContext *C, Panel *panel) +static void clamp_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "thickness_clamp", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "thickness_clamp", 0, NULL, ICON_NONE); row = uiLayoutRow(col, false); - uiLayoutSetActive(row, RNA_float_get(&ptr, "thickness_clamp") > 0.0f); - uiItemR(row, &ptr, "use_thickness_angle_clamp", 0, NULL, ICON_NONE); + uiLayoutSetActive(row, RNA_float_get(ptr, "thickness_clamp") > 0.0f); + uiItemR(row, ptr, "use_thickness_angle_clamp", 0, NULL, ICON_NONE); } -static void vertex_group_panel_draw(const bContext *C, Panel *panel) +static void vertex_group_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemPointerR(col, &ptr, "shell_vertex_group", &ob_ptr, "vertex_groups", "Shell", ICON_NONE); - uiItemPointerR(col, &ptr, "rim_vertex_group", &ob_ptr, "vertex_groups", "Rim", ICON_NONE); + uiItemPointerR(col, ptr, "shell_vertex_group", &ob_ptr, "vertex_groups", "Shell", ICON_NONE); + uiItemPointerR(col, ptr, "rim_vertex_group", &ob_ptr, "vertex_groups", "Rim", ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 8424b549f85..1972f857877 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -339,9 +339,8 @@ static bool get_show_adaptive_options(const bContext *C, Panel *panel) } /* Only show adaptive options if this is the last modifier. */ - PointerRNA md_ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &md_ptr); - ModifierData *md = md_ptr.data; + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); + ModifierData *md = ptr->data; if (md->next != NULL) { return false; } @@ -365,9 +364,8 @@ static void panel_draw(const bContext *C, Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); /* Only test for adaptive subdivision if built with cycles. */ bool show_adaptive_options = false; @@ -386,9 +384,11 @@ static void panel_draw(const bContext *C, Panel *panel) show_adaptive_options = get_show_adaptive_options(C, panel); } } +#else + UNUSED_VARS(C); #endif - uiItemR(layout, &ptr, "subdivision_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "subdivision_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetPropSep(layout, true); @@ -414,26 +414,25 @@ static void panel_draw(const bContext *C, Panel *panel) uiItemS(layout); - uiItemR(layout, &ptr, "levels", 0, IFACE_("Levels Viewport"), ICON_NONE); + uiItemR(layout, ptr, "levels", 0, IFACE_("Levels Viewport"), ICON_NONE); } else { uiLayout *col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "levels", 0, IFACE_("Levels Viewport"), ICON_NONE); - uiItemR(col, &ptr, "render_levels", 0, IFACE_("Render"), ICON_NONE); + uiItemR(col, ptr, "levels", 0, IFACE_("Levels Viewport"), ICON_NONE); + uiItemR(col, ptr, "render_levels", 0, IFACE_("Render"), ICON_NONE); } - uiItemR(layout, &ptr, "show_only_control_edges", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "show_only_control_edges", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void advanced_panel_draw(const bContext *C, Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); bool ob_use_adaptive_subdivision = false; bool show_adaptive_options = false; @@ -446,15 +445,17 @@ static void advanced_panel_draw(const bContext *C, Panel *panel) show_adaptive_options = get_show_adaptive_options(C, panel); } } +#else + UNUSED_VARS(C); #endif uiLayoutSetPropSep(layout, true); uiLayoutSetActive(layout, !(show_adaptive_options && ob_use_adaptive_subdivision)); - uiItemR(layout, &ptr, "quality", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "uv_smooth", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_creases", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_custom_normals", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "quality", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "uv_smooth", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_creases", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_custom_normals", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index e476e01a9f2..a20ba3f899e 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -195,16 +195,15 @@ static void deformVerts(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiItemL(layout, IFACE_("Settings are inside the Physics tab"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c index 962e93be215..6fc2bd29add 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.c +++ b/source/blender/modifiers/intern/MOD_surfacedeform.c @@ -1397,29 +1397,28 @@ static bool isDisabled(const Scene *UNUSED(scene), ModifierData *md, bool UNUSED !(smd->verts != NULL && !(smd->flags & MOD_SDEF_BIND)); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - PointerRNA target_ptr = RNA_pointer_get(&ptr, "target"); + PointerRNA target_ptr = RNA_pointer_get(ptr, "target"); - bool is_bound = RNA_boolean_get(&ptr, "is_bound"); + bool is_bound = RNA_boolean_get(ptr, "is_bound"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, !is_bound); - uiItemR(col, &ptr, "target", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "target", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "falloff", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "strength", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "falloff", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "strength", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); uiItemS(layout); @@ -1431,7 +1430,7 @@ static void panel_draw(const bContext *C, Panel *panel) uiLayoutSetActive(col, !RNA_pointer_is_null(&target_ptr)); uiItemO(col, IFACE_("Bind"), ICON_NONE, "OBJECT_OT_surfacedeform_bind"); } - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_triangulate.c b/source/blender/modifiers/intern/MOD_triangulate.c index 65c972b5fb4..87ca067fba9 100644 --- a/source/blender/modifiers/intern/MOD_triangulate.c +++ b/source/blender/modifiers/intern/MOD_triangulate.c @@ -126,22 +126,21 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx) return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "quad_method", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "ngon_method", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "min_vertices", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "keep_custom_normals", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "quad_method", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "ngon_method", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "min_vertices", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "keep_custom_normals", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c index 8de4b042eb3..a79e270af93 100644 --- a/source/blender/modifiers/intern/MOD_ui_common.c +++ b/source/blender/modifiers/intern/MOD_ui_common.c @@ -69,9 +69,9 @@ static bool modifier_ui_poll(const bContext *C, PanelType *UNUSED(pt)) */ static void modifier_reorder(bContext *C, Panel *panel, int new_index) { - Object *ob = ED_object_active_context(C); + PointerRNA *md_ptr = UI_panel_custom_data_get(panel); + ModifierData *md = (ModifierData *)md_ptr->data; - ModifierData *md = BLI_findlink(&ob->modifiers, panel->runtime.list_index); PointerRNA props_ptr; wmOperatorType *ot = WM_operatortype_find("OBJECT_OT_modifier_move_to_index", false); WM_operator_properties_create_ptr(&props_ptr, ot); @@ -81,17 +81,17 @@ static void modifier_reorder(bContext *C, Panel *panel, int new_index) WM_operator_properties_free(&props_ptr); } -static short get_modifier_expand_flag(const bContext *C, Panel *panel) +static short get_modifier_expand_flag(const bContext *UNUSED(C), Panel *panel) { - Object *ob = ED_object_active_context(C); - ModifierData *md = BLI_findlink(&ob->modifiers, panel->runtime.list_index); + PointerRNA *md_ptr = UI_panel_custom_data_get(panel); + ModifierData *md = (ModifierData *)md_ptr->data; return md->ui_expand_flag; } -static void set_modifier_expand_flag(const bContext *C, Panel *panel, short expand_flag) +static void set_modifier_expand_flag(const bContext *UNUSED(C), Panel *panel, short expand_flag) { - Object *ob = ED_object_active_context(C); - ModifierData *md = BLI_findlink(&ob->modifiers, panel->runtime.list_index); + PointerRNA *md_ptr = UI_panel_custom_data_get(panel); + ModifierData *md = (ModifierData *)md_ptr->data; md->ui_expand_flag = expand_flag; } @@ -116,27 +116,26 @@ void modifier_panel_end(uiLayout *layout, PointerRNA *ptr) /** * Gets RNA pointers for the active object and the panel's modifier data. Also locks * the layout if the modifier is from a linked object, and sets the context pointer. + * + * \note The modifier #PointerRNA is owned by the panel so we only need a pointer to it. */ #define ERROR_LIBDATA_MESSAGE TIP_("External library data") -void modifier_panel_get_property_pointers(const bContext *C, - Panel *panel, - PointerRNA *r_ob_ptr, - PointerRNA *r_md_ptr) +PointerRNA *modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr) { - Object *ob = ED_object_active_context(C); - - ModifierData *md = BLI_findlink(&ob->modifiers, panel->runtime.list_index); - - RNA_pointer_create(&ob->id, &RNA_Modifier, md, r_md_ptr); + PointerRNA *ptr = UI_panel_custom_data_get(panel); + BLI_assert(!RNA_pointer_is_null(ptr)); + BLI_assert(RNA_struct_is_a(ptr->type, &RNA_Modifier)); if (r_ob_ptr != NULL) { - RNA_pointer_create(&ob->id, &RNA_Object, ob, r_ob_ptr); + RNA_pointer_create(ptr->owner_id, &RNA_Object, ptr->owner_id, r_ob_ptr); } uiBlock *block = uiLayoutGetBlock(panel->layout); - UI_block_lock_set(block, ID_IS_LINKED(ob), ERROR_LIBDATA_MESSAGE); + UI_block_lock_set(block, ID_IS_LINKED((Object *)ptr->owner_id), ERROR_LIBDATA_MESSAGE); - uiLayoutSetContextPointer(panel->layout, "modifier", r_md_ptr); + uiLayoutSetContextPointer(panel->layout, "modifier", ptr); + + return ptr; } /** @@ -296,24 +295,23 @@ static void modifier_panel_header(const bContext *C, Panel *panel) uiLayout *row, *sub, *name_row; uiLayout *layout = panel->layout; - PointerRNA ptr; - Object *ob = ED_object_active_context(C); - /* Don't use #modifier_panel_get_property_pointers, we don't want to lock the header. */ - ModifierData *md = BLI_findlink(&ob->modifiers, panel->runtime.list_index); - RNA_pointer_create(&ob->id, &RNA_Modifier, md, &ptr); - uiLayoutSetContextPointer(panel->layout, "modifier", &ptr); + PointerRNA *ptr = UI_panel_custom_data_get(panel); + ModifierData *md = (ModifierData *)ptr->data; + Object *ob = (Object *)ptr->owner_id; + + uiLayoutSetContextPointer(panel->layout, "modifier", ptr); const ModifierTypeInfo *mti = BKE_modifier_get_info(md->type); Scene *scene = CTX_data_scene(C); - int index = panel->runtime.list_index; + int index = BLI_findindex(&ob->modifiers, md); /* Modifier Icon. */ sub = uiLayoutRow(layout, true); if (mti->isDisabled && mti->isDisabled(scene, md, 0)) { uiLayoutSetRedAlert(sub, true); } - uiItemL(sub, "", RNA_struct_ui_icon(ptr.type)); + uiItemL(sub, "", RNA_struct_ui_icon(ptr->type)); row = uiLayoutRow(layout, true); @@ -331,14 +329,14 @@ static void modifier_panel_header(const bContext *C, Panel *panel) if (index < cage_index || !BKE_modifier_couldbe_cage(scene, md)) { uiLayoutSetActive(sub, false); } - uiItemR(sub, &ptr, "show_on_cage", 0, "", ICON_NONE); + uiItemR(sub, ptr, "show_on_cage", 0, "", ICON_NONE); buttons_number++; } } /* Tessellation point for curve-typed objects. */ else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { if (mti->type != eModifierTypeType_Constructive) { /* Constructive modifiers tessellates curve before applying. */ - uiItemR(row, &ptr, "use_apply_on_spline", 0, "", ICON_NONE); + uiItemR(row, ptr, "use_apply_on_spline", 0, "", ICON_NONE); buttons_number++; } } @@ -348,11 +346,11 @@ static void modifier_panel_header(const bContext *C, Panel *panel) if (mti->flags & eModifierTypeFlag_SupportsEditmode) { sub = uiLayoutRow(row, true); uiLayoutSetActive(sub, (md->mode & eModifierMode_Realtime)); - uiItemR(sub, &ptr, "show_in_editmode", 0, "", ICON_NONE); + uiItemR(sub, ptr, "show_in_editmode", 0, "", ICON_NONE); buttons_number++; } - uiItemR(row, &ptr, "show_viewport", 0, "", ICON_NONE); - uiItemR(row, &ptr, "show_render", 0, "", ICON_NONE); + uiItemR(row, ptr, "show_viewport", 0, "", ICON_NONE); + uiItemR(row, ptr, "show_render", 0, "", ICON_NONE); buttons_number += 2; } @@ -381,7 +379,7 @@ static void modifier_panel_header(const bContext *C, Panel *panel) bool display_name = (panel->sizex / UI_UNIT_X - buttons_number > 5) || (panel->sizex == 0); if (display_name) { - uiItemR(name_row, &ptr, "name", 0, "", ICON_NONE); + uiItemR(name_row, ptr, "name", 0, "", ICON_NONE); } else { uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_RIGHT); diff --git a/source/blender/modifiers/intern/MOD_ui_common.h b/source/blender/modifiers/intern/MOD_ui_common.h index cac8806a2bf..24ada426635 100644 --- a/source/blender/modifiers/intern/MOD_ui_common.h +++ b/source/blender/modifiers/intern/MOD_ui_common.h @@ -46,10 +46,8 @@ void modifier_vgroup_ui(struct uiLayout *layout, void modifier_panel_end(struct uiLayout *layout, PointerRNA *ptr); -void modifier_panel_get_property_pointers(const bContext *C, - struct Panel *panel, - struct PointerRNA *r_ob_ptr, - struct PointerRNA *r_ptr); +struct PointerRNA *modifier_panel_get_property_pointers(struct Panel *panel, + struct PointerRNA *r_ob_ptr); struct PanelType *modifier_panel_register(struct ARegionType *region_type, ModifierType type, diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 361c778bb95..426ba640f2f 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -326,36 +326,35 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data"); uiLayoutSetPropSep(layout, true); - uiItemPointerR(layout, &ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); + uiItemPointerR(layout, ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); sub = uiLayoutColumn(layout, true); - uiItemR(sub, &ptr, "aspect_x", 0, IFACE_("Aspect X"), ICON_NONE); - uiItemR(sub, &ptr, "aspect_y", 0, IFACE_("Y"), ICON_NONE); + uiItemR(sub, ptr, "aspect_x", 0, IFACE_("Aspect X"), ICON_NONE); + uiItemR(sub, ptr, "aspect_y", 0, IFACE_("Y"), ICON_NONE); sub = uiLayoutColumn(layout, true); - uiItemR(sub, &ptr, "scale_x", 0, IFACE_("Scale X"), ICON_NONE); - uiItemR(sub, &ptr, "scale_y", 0, IFACE_("Y"), ICON_NONE); + uiItemR(sub, ptr, "scale_x", 0, IFACE_("Scale X"), ICON_NONE); + uiItemR(sub, ptr, "scale_y", 0, IFACE_("Y"), ICON_NONE); - uiItemR(layout, &ptr, "projector_count", 0, IFACE_("Projectors"), ICON_NONE); - RNA_BEGIN (&ptr, projector_ptr, "projectors") { + uiItemR(layout, ptr, "projector_count", 0, IFACE_("Projectors"), ICON_NONE); + RNA_BEGIN (ptr, projector_ptr, "projectors") { uiItemR(layout, &projector_ptr, "object", 0, NULL, ICON_NONE); } RNA_END; - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c index 05224e1ffaa..f583709f311 100644 --- a/source/blender/modifiers/intern/MOD_uvwarp.c +++ b/source/blender/modifiers/intern/MOD_uvwarp.c @@ -260,61 +260,59 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte DEG_add_modifier_to_transform_relation(ctx->node, "UVWarp Modifier"); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); PointerRNA warp_obj_ptr; PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data"); uiLayoutSetPropSep(layout, true); - uiItemPointerR(layout, &ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); + uiItemPointerR(layout, ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "center", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "center", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "axis_u", 0, IFACE_("Axis U"), ICON_NONE); - uiItemR(col, &ptr, "axis_v", 0, IFACE_("V"), ICON_NONE); + uiItemR(col, ptr, "axis_u", 0, IFACE_("Axis U"), ICON_NONE); + uiItemR(col, ptr, "axis_v", 0, IFACE_("V"), ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "object_from", 0, NULL, ICON_NONE); - warp_obj_ptr = RNA_pointer_get(&ptr, "object_from"); + uiItemR(col, ptr, "object_from", 0, NULL, ICON_NONE); + warp_obj_ptr = RNA_pointer_get(ptr, "object_from"); if (!RNA_pointer_is_null(&warp_obj_ptr) && RNA_enum_get(&warp_obj_ptr, "type") == OB_ARMATURE) { PointerRNA warp_obj_data_ptr = RNA_pointer_get(&warp_obj_ptr, "data"); - uiItemPointerR(col, &ptr, "bone_from", &warp_obj_data_ptr, "bones", NULL, ICON_NONE); + uiItemPointerR(col, ptr, "bone_from", &warp_obj_data_ptr, "bones", NULL, ICON_NONE); } - uiItemR(col, &ptr, "object_to", 0, IFACE_("To"), ICON_NONE); - warp_obj_ptr = RNA_pointer_get(&ptr, "object_to"); + uiItemR(col, ptr, "object_to", 0, IFACE_("To"), ICON_NONE); + warp_obj_ptr = RNA_pointer_get(ptr, "object_to"); if (!RNA_pointer_is_null(&warp_obj_ptr) && RNA_enum_get(&warp_obj_ptr, "type") == OB_ARMATURE) { PointerRNA warp_obj_data_ptr = RNA_pointer_get(&warp_obj_ptr, "data"); - uiItemPointerR(col, &ptr, "bone_to", &warp_obj_data_ptr, "bones", NULL, ICON_NONE); + uiItemPointerR(col, ptr, "bone_to", &warp_obj_data_ptr, "bones", NULL, ICON_NONE); } - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void transform_panel_draw(const bContext *C, Panel *panel) +static void transform_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "offset", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "scale", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "rotation", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "scale", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "rotation", 0, NULL, ICON_NONE); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index 45252fed031..bb0896994b1 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -406,62 +406,60 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "object_from", 0, NULL, ICON_NONE); - PointerRNA from_obj_ptr = RNA_pointer_get(&ptr, "object_from"); + uiItemR(col, ptr, "object_from", 0, NULL, ICON_NONE); + PointerRNA from_obj_ptr = RNA_pointer_get(ptr, "object_from"); if (!RNA_pointer_is_null(&from_obj_ptr) && RNA_enum_get(&from_obj_ptr, "type") == OB_ARMATURE) { PointerRNA from_obj_data_ptr = RNA_pointer_get(&from_obj_ptr, "data"); - uiItemPointerR(col, &ptr, "bone_from", &from_obj_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); + uiItemPointerR(col, ptr, "bone_from", &from_obj_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); } col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "object_to", 0, NULL, ICON_NONE); - PointerRNA to_obj_ptr = RNA_pointer_get(&ptr, "object_to"); + uiItemR(col, ptr, "object_to", 0, NULL, ICON_NONE); + PointerRNA to_obj_ptr = RNA_pointer_get(ptr, "object_to"); if (!RNA_pointer_is_null(&to_obj_ptr) && RNA_enum_get(&to_obj_ptr, "type") == OB_ARMATURE) { PointerRNA to_obj_data_ptr = RNA_pointer_get(&to_obj_ptr, "data"); - uiItemPointerR(col, &ptr, "bone_to", &to_obj_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); + uiItemPointerR(col, ptr, "bone_to", &to_obj_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); } - uiItemR(layout, &ptr, "use_volume_preserve", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_volume_preserve", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "strength", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "strength", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void falloff_panel_draw(const bContext *C, Panel *panel) +static void falloff_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_falloff = (RNA_enum_get(&ptr, "falloff_type") != eWarp_Falloff_None); + bool use_falloff = (RNA_enum_get(ptr, "falloff_type") != eWarp_Falloff_None); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "falloff_type", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "falloff_type", 0, NULL, ICON_NONE); if (use_falloff) { - uiItemR(layout, &ptr, "falloff_radius", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "falloff_radius", 0, NULL, ICON_NONE); } - if (use_falloff && RNA_enum_get(&ptr, "falloff_type") == eWarp_Falloff_Curve) { - uiTemplateCurveMapping(layout, &ptr, "falloff_curve", 0, false, false, false, false); + if (use_falloff && RNA_enum_get(ptr, "falloff_type") == eWarp_Falloff_Curve) { + uiTemplateCurveMapping(layout, ptr, "falloff_curve", 0, false, false, false, false); } } @@ -470,26 +468,25 @@ static void texture_panel_draw(const bContext *C, Panel *panel) uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int texture_coords = RNA_enum_get(&ptr, "texture_coords"); + int texture_coords = RNA_enum_get(ptr, "texture_coords"); - uiTemplateID(layout, C, &ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL); + uiTemplateID(layout, C, ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "texture_coords", 0, IFACE_("Coordinates"), ICON_NONE); + uiItemR(col, ptr, "texture_coords", 0, IFACE_("Coordinates"), ICON_NONE); if (texture_coords == MOD_DISP_MAP_OBJECT) { - uiItemR(col, &ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); - PointerRNA texture_coords_obj_ptr = RNA_pointer_get(&ptr, "texture_coords_object"); + uiItemR(col, ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); + PointerRNA texture_coords_obj_ptr = RNA_pointer_get(ptr, "texture_coords_object"); if (!RNA_pointer_is_null(&texture_coords_obj_ptr) && (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) { PointerRNA texture_coords_obj_data_ptr = RNA_pointer_get(&texture_coords_obj_ptr, "data"); uiItemPointerR(col, - &ptr, + ptr, "texture_coords_bone", &texture_coords_obj_data_ptr, "bones", @@ -499,7 +496,7 @@ static void texture_panel_draw(const bContext *C, Panel *panel) } else if (texture_coords == MOD_DISP_MAP_UV && RNA_enum_get(&ob_ptr, "type") == OB_MESH) { PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data"); - uiItemPointerR(col, &ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); + uiItemPointerR(col, ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); } } diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 26f1bf2d69a..ae0c59ed9ef 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -377,74 +377,71 @@ static void deformVertsEM(ModifierData *md, } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub, *row, *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); row = uiLayoutRowWithHeading(layout, true, IFACE_("Motion")); - uiItemR(row, &ptr, "use_x", UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE, NULL, ICON_NONE); - uiItemR(row, &ptr, "use_y", UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE, NULL, ICON_NONE); + uiItemR(row, ptr, "use_x", UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE, NULL, ICON_NONE); + uiItemR(row, ptr, "use_y", UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE, NULL, ICON_NONE); - uiItemR(layout, &ptr, "use_cyclic", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_cyclic", 0, NULL, ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Along Normals")); - uiItemR(row, &ptr, "use_normal", 0, "", ICON_NONE); + uiItemR(row, ptr, "use_normal", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_normal")); - uiItemR(sub, &ptr, "use_normal_x", UI_ITEM_R_TOGGLE, "X", ICON_NONE); - uiItemR(sub, &ptr, "use_normal_y", UI_ITEM_R_TOGGLE, "Y", ICON_NONE); - uiItemR(sub, &ptr, "use_normal_z", UI_ITEM_R_TOGGLE, "Z", ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_normal")); + uiItemR(sub, ptr, "use_normal_x", UI_ITEM_R_TOGGLE, "X", ICON_NONE); + uiItemR(sub, ptr, "use_normal_y", UI_ITEM_R_TOGGLE, "Y", ICON_NONE); + uiItemR(sub, ptr, "use_normal_z", UI_ITEM_R_TOGGLE, "Z", ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "falloff_radius", 0, "Falloff", ICON_NONE); - uiItemR(col, &ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, &ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, &ptr, "narrowness", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "falloff_radius", 0, "Falloff", ICON_NONE); + uiItemR(col, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "narrowness", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void position_panel_draw(const bContext *C, Panel *panel) +static void position_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "start_position_object", 0, IFACE_("Object"), ICON_NONE); + uiItemR(layout, ptr, "start_position_object", 0, IFACE_("Object"), ICON_NONE); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "start_position_x", 0, "Start Position X", ICON_NONE); - uiItemR(col, &ptr, "start_position_y", 0, "Y", ICON_NONE); + uiItemR(col, ptr, "start_position_x", 0, "Start Position X", ICON_NONE); + uiItemR(col, ptr, "start_position_y", 0, "Y", ICON_NONE); } -static void time_panel_draw(const bContext *C, Panel *panel) +static void time_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "time_offset", 0, "Offset", ICON_NONE); - uiItemR(col, &ptr, "lifetime", 0, "Life", ICON_NONE); - uiItemR(col, &ptr, "damping_time", 0, "Damping", ICON_NONE); - uiItemR(col, &ptr, "speed", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "time_offset", 0, "Offset", ICON_NONE); + uiItemR(col, ptr, "lifetime", 0, "Life", ICON_NONE); + uiItemR(col, ptr, "damping_time", 0, "Damping", ICON_NONE); + uiItemR(col, ptr, "speed", UI_ITEM_R_SLIDER, NULL, ICON_NONE); } static void texture_panel_draw(const bContext *C, Panel *panel) @@ -452,26 +449,25 @@ static void texture_panel_draw(const bContext *C, Panel *panel) uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - int texture_coords = RNA_enum_get(&ptr, "texture_coords"); + int texture_coords = RNA_enum_get(ptr, "texture_coords"); - uiTemplateID(layout, C, &ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL); + uiTemplateID(layout, C, ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "texture_coords", 0, IFACE_("Coordinates"), ICON_NONE); + uiItemR(col, ptr, "texture_coords", 0, IFACE_("Coordinates"), ICON_NONE); if (texture_coords == MOD_DISP_MAP_OBJECT) { - uiItemR(col, &ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); - PointerRNA texture_coords_obj_ptr = RNA_pointer_get(&ptr, "texture_coords_object"); + uiItemR(col, ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); + PointerRNA texture_coords_obj_ptr = RNA_pointer_get(ptr, "texture_coords_object"); if (!RNA_pointer_is_null(&texture_coords_obj_ptr) && (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) { PointerRNA texture_coords_obj_data_ptr = RNA_pointer_get(&texture_coords_obj_ptr, "data"); uiItemPointerR(col, - &ptr, + ptr, "texture_coords_bone", &texture_coords_obj_data_ptr, "bones", @@ -481,7 +477,7 @@ static void texture_panel_draw(const bContext *C, Panel *panel) } else if (texture_coords == MOD_DISP_MAP_UV && RNA_enum_get(&ob_ptr, "type") == OB_MESH) { PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data"); - uiItemPointerR(col, &ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); + uiItemPointerR(col, ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE); } } diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c index 744bab02c56..fc7ac822874 100644 --- a/source/blender/modifiers/intern/MOD_weighted_normal.c +++ b/source/blender/modifiers/intern/MOD_weighted_normal.c @@ -714,29 +714,28 @@ static bool dependsOnNormals(ModifierData *UNUSED(md)) return true; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "weight", 0, IFACE_("Weight"), ICON_NONE); - uiItemR(layout, &ptr, "thresh", 0, IFACE_("Threshold"), ICON_NONE); + uiItemR(layout, ptr, "weight", 0, IFACE_("Weight"), ICON_NONE); + uiItemR(layout, ptr, "thresh", 0, IFACE_("Threshold"), ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "keep_sharp", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "face_influence", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "keep_sharp", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "face_influence", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 4f67fd88d4e..4cc19ab895e 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -318,67 +318,65 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return mesh; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *sub, *col, *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, true); - uiItemPointerR(col, &ptr, "vertex_group", &ob_ptr, "vertex_groups", NULL, ICON_NONE); + uiItemPointerR(col, ptr, "vertex_group", &ob_ptr, "vertex_groups", NULL, ICON_NONE); - uiItemR(layout, &ptr, "default_weight", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(layout, ptr, "default_weight", UI_ITEM_R_SLIDER, NULL, ICON_NONE); col = uiLayoutColumnWithHeading(layout, false, IFACE_("Group Add")); row = uiLayoutRow(col, true); uiLayoutSetPropDecorate(row, false); sub = uiLayoutRow(row, true); - uiItemR(sub, &ptr, "use_add", 0, "", ICON_NONE); + uiItemR(sub, ptr, "use_add", 0, "", ICON_NONE); sub = uiLayoutRow(sub, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_add")); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_add")); uiLayoutSetPropSep(sub, false); - uiItemR(sub, &ptr, "add_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); - uiItemDecoratorR(row, &ptr, "add_threshold", 0); + uiItemR(sub, ptr, "add_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); + uiItemDecoratorR(row, ptr, "add_threshold", 0); col = uiLayoutColumnWithHeading(layout, false, IFACE_("Group Remove")); row = uiLayoutRow(col, true); uiLayoutSetPropDecorate(row, false); sub = uiLayoutRow(row, true); - uiItemR(sub, &ptr, "use_remove", 0, "", ICON_NONE); + uiItemR(sub, ptr, "use_remove", 0, "", ICON_NONE); sub = uiLayoutRow(sub, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_remove")); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_remove")); uiLayoutSetPropSep(sub, false); - uiItemR(sub, &ptr, "remove_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); - uiItemDecoratorR(row, &ptr, "remove_threshold", 0); + uiItemR(sub, ptr, "remove_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); + uiItemDecoratorR(row, ptr, "remove_threshold", 0); - uiItemR(layout, &ptr, "normalize", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "normalize", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void falloff_panel_draw(const bContext *C, Panel *panel) +static void falloff_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); row = uiLayoutRow(layout, true); - uiItemR(row, &ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); + uiItemR(row, ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); sub = uiLayoutRow(row, true); uiLayoutSetPropSep(sub, false); - uiItemR(row, &ptr, "invert_falloff", 0, "", ICON_ARROW_LEFTRIGHT); - if (RNA_enum_get(&ptr, "falloff_type") == MOD_WVG_MAPPING_CURVE) { - uiTemplateCurveMapping(layout, &ptr, "map_curve", 0, false, false, false, false); + uiItemR(row, ptr, "invert_falloff", 0, "", ICON_ARROW_LEFTRIGHT); + if (RNA_enum_get(ptr, "falloff_type") == MOD_WVG_MAPPING_CURVE) { + uiTemplateCurveMapping(layout, ptr, "map_curve", 0, false, false, false, false); } } @@ -386,11 +384,10 @@ static void influence_panel_draw(const bContext *C, Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - weightvg_ui_common(C, &ob_ptr, &ptr, layout); + weightvg_ui_common(C, &ob_ptr, ptr, layout); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index 649481a7023..81d4a04fa78 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -461,44 +461,41 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return mesh; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group_a", "invert_vertex_group_a", NULL); - modifier_vgroup_ui( - layout, &ptr, &ob_ptr, "vertex_group_b", "invert_vertex_group_b", IFACE_("B")); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group_a", "invert_vertex_group_a", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group_b", "invert_vertex_group_b", IFACE_("B")); uiItemS(layout); - uiItemR(layout, &ptr, "default_weight_a", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "default_weight_b", 0, IFACE_("B"), ICON_NONE); + uiItemR(layout, ptr, "default_weight_a", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "default_weight_b", 0, IFACE_("B"), ICON_NONE); uiItemS(layout); - uiItemR(layout, &ptr, "mix_set", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "mix_mode", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "mix_set", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "mix_mode", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "normalize", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "normalize", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void influence_panel_draw(const bContext *C, Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - weightvg_ui_common(C, &ob_ptr, &ptr, layout); + weightvg_ui_common(C, &ob_ptr, ptr, layout); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 71c56255e3c..994f2c04921 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -643,63 +643,60 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return mesh; } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemPointerR(layout, &ptr, "vertex_group", &ob_ptr, "vertex_groups", NULL, ICON_NONE); + uiItemPointerR(layout, ptr, "vertex_group", &ob_ptr, "vertex_groups", NULL, ICON_NONE); - uiItemR(layout, &ptr, "target", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "target", 0, NULL, ICON_NONE); uiItemS(layout); - uiItemR(layout, &ptr, "proximity_mode", 0, NULL, ICON_NONE); - if (RNA_enum_get(&ptr, "proximity_mode") == MOD_WVG_PROXIMITY_GEOMETRY) { - uiItemR(layout, &ptr, "proximity_geometry", UI_ITEM_R_EXPAND, IFACE_("Geometry"), ICON_NONE); + uiItemR(layout, ptr, "proximity_mode", 0, NULL, ICON_NONE); + if (RNA_enum_get(ptr, "proximity_mode") == MOD_WVG_PROXIMITY_GEOMETRY) { + uiItemR(layout, ptr, "proximity_geometry", UI_ITEM_R_EXPAND, IFACE_("Geometry"), ICON_NONE); } col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "min_dist", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "max_dist", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "min_dist", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "max_dist", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "normalize", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "normalize", 0, NULL, ICON_NONE); } -static void falloff_panel_draw(const bContext *C, Panel *panel) +static void falloff_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); row = uiLayoutRow(layout, true); - uiItemR(row, &ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); + uiItemR(row, ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); sub = uiLayoutRow(row, true); uiLayoutSetPropSep(sub, false); - uiItemR(row, &ptr, "invert_falloff", 0, "", ICON_ARROW_LEFTRIGHT); - modifier_panel_end(layout, &ptr); + uiItemR(row, ptr, "invert_falloff", 0, "", ICON_ARROW_LEFTRIGHT); + modifier_panel_end(layout, ptr); } static void influence_panel_draw(const bContext *C, Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - weightvg_ui_common(C, &ob_ptr, &ptr, layout); + weightvg_ui_common(C, &ob_ptr, ptr, layout); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index a89209f5dbb..855f96df82f 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -1949,21 +1949,20 @@ static void requiredDataMask(Object *UNUSED(ob), } } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "merge_threshold", 0, IFACE_("Distance"), ICON_NONE); - uiItemR(layout, &ptr, "max_interactions", 0, NULL, ICON_NONE); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + uiItemR(layout, ptr, "merge_threshold", 0, IFACE_("Distance"), ICON_NONE); + uiItemR(layout, ptr, "max_interactions", 0, NULL, ICON_NONE); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } static void panelRegister(ARegionType *region_type) diff --git a/source/blender/modifiers/intern/MOD_wireframe.c b/source/blender/modifiers/intern/MOD_wireframe.c index ef3d16c1b32..602e0bf3eda 100644 --- a/source/blender/modifiers/intern/MOD_wireframe.c +++ b/source/blender/modifiers/intern/MOD_wireframe.c @@ -117,57 +117,55 @@ static Mesh *modifyMesh(ModifierData *md, const struct ModifierEvalContext *ctx, return WireframeModifier_do((WireframeModifierData *)md, ctx->object, mesh); } -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col, *row, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); - uiItemR(layout, &ptr, "thickness", 0, IFACE_("Thickness"), ICON_NONE); - uiItemR(layout, &ptr, "offset", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "thickness", 0, IFACE_("Thickness"), ICON_NONE); + uiItemR(layout, ptr, "offset", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, true); - uiItemR(col, &ptr, "use_boundary", 0, IFACE_("Boundary"), ICON_NONE); - uiItemR(col, &ptr, "use_replace", 0, IFACE_("Replace Original"), ICON_NONE); + uiItemR(col, ptr, "use_boundary", 0, IFACE_("Boundary"), ICON_NONE); + uiItemR(col, ptr, "use_replace", 0, IFACE_("Replace Original"), ICON_NONE); col = uiLayoutColumnWithHeading(layout, true, IFACE_("Thickness")); - uiItemR(col, &ptr, "use_even_offset", 0, IFACE_("Even"), ICON_NONE); - uiItemR(col, &ptr, "use_relative_offset", 0, IFACE_("Relative"), ICON_NONE); + uiItemR(col, ptr, "use_even_offset", 0, IFACE_("Even"), ICON_NONE); + uiItemR(col, ptr, "use_relative_offset", 0, IFACE_("Relative"), ICON_NONE); row = uiLayoutRowWithHeading(layout, true, IFACE_("Crease Edges")); - uiItemR(row, &ptr, "use_crease", 0, "", ICON_NONE); + uiItemR(row, ptr, "use_crease", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_crease")); - uiItemR(sub, &ptr, "crease_weight", UI_ITEM_R_SLIDER, "", ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_crease")); + uiItemR(sub, ptr, "crease_weight", UI_ITEM_R_SLIDER, "", ICON_NONE); - uiItemR(layout, &ptr, "material_offset", 0, IFACE_("Material Offset"), ICON_NONE); + uiItemR(layout, ptr, "material_offset", 0, IFACE_("Material Offset"), ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); } -static void vertex_group_panel_draw(const bContext *C, Panel *panel) +static void vertex_group_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); - bool has_vertex_group = RNA_string_length(&ptr, "vertex_group") != 0; + bool has_vertex_group = RNA_string_length(ptr, "vertex_group") != 0; uiLayoutSetPropSep(layout, true); - modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); row = uiLayoutRow(layout, true); uiLayoutSetActive(row, has_vertex_group); - uiItemR(row, &ptr, "thickness_vertex_group", 0, IFACE_("Factor"), ICON_NONE); + uiItemR(row, ptr, "thickness_vertex_group", 0, IFACE_("Factor"), ICON_NONE); } static void panelRegister(ARegionType *region_type) |