diff options
Diffstat (limited to 'source/blender/makesrna')
26 files changed, 177 insertions, 106 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index c6f1fd337ed..39889f77a96 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -253,8 +253,13 @@ typedef enum PropertyFlag { PROP_REGISTER_OPTIONAL = PROP_REGISTER | (1 << 5), /** - * Use for arrays or for any data that should not have a reference kept - * most common case is functions that return arrays where the array. + * Use for allocated function return values of arrays or strings + * for any data that should not have a reference kept. + * + * It can be used for properties which are dynamically allocated too. + * + * \note Currently dynamic sized thick wrapped data isn't supported. + * This would be a useful addition and avoid a fixed maximum sized as in done at the moment. */ PROP_THICK_WRAP = (1 << 23), diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index fb60f092d16..713ddfa0067 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1565,6 +1565,25 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem color_gradient_items[] = { + {0, "COLOR", 0, "Color", "Paint with a single color"}, + {BRUSH_USE_GRADIENT, "GRADIENT", 0, "Gradient", "Paint with a gradient"}, + {0, NULL, 0, NULL, NULL}, + }; + + static const EnumPropertyItem brush_curve_preset_items[] = { + {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""}, + {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, + {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, + {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""}, + {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, + {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""}, + {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""}, + {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse square", ""}, + {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""}, + {0, NULL, 0, NULL, NULL}, + }; + srna = RNA_def_struct(brna, "Brush", "ID"); RNA_def_struct_ui_text( srna, "Brush", "Brush data-block for storing brush settings for painting and sculpting"); @@ -1640,6 +1659,11 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mask Tool", ""); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, brush_curve_preset_items); + RNA_def_property_ui_text(prop, "Curve Preset", ""); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + /* number values */ prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL); RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); @@ -1916,12 +1940,6 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop = RNA_def_property(srna, "use_gradient", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_USE_GRADIENT); - RNA_def_property_boolean_funcs(prop, NULL, "rna_Brush_use_gradient_set"); - RNA_def_property_ui_text(prop, "Use Gradient", "Use Gradient by utilizing a sampling method"); - RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); @@ -2037,6 +2055,13 @@ static void rna_def_brush(BlenderRNA *brna) prop, "Radius Unit", "Measure brush size relative to the view or the scene"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); /* as an enum */ + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, color_gradient_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_Brush_use_gradient_set", NULL); + RNA_def_property_ui_text(prop, "Color Type", "Use single color or gradient when painting"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE); RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge"); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 43df1d8e1aa..6bfd2b9f63b 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -94,7 +94,7 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, bool value) cumap->flag &= ~CUMA_DO_CLIP; } - curvemapping_changed(cumap, false); + BKE_curvemapping_changed(cumap, false); } static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values) @@ -103,7 +103,7 @@ static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *value cumap->black[0] = values[0]; cumap->black[1] = values[1]; cumap->black[2] = values[2]; - curvemapping_set_black_white(cumap, NULL, NULL); + BKE_curvemapping_set_black_white(cumap, NULL, NULL); } static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *values) @@ -112,7 +112,7 @@ static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *value cumap->white[0] = values[0]; cumap->white[1] = values[1]; cumap->white[2] = values[2]; - curvemapping_set_black_white(cumap, NULL, NULL); + BKE_curvemapping_set_black_white(cumap, NULL, NULL); } static void rna_CurveMapping_tone_update(Main *UNUSED(bmain), @@ -368,7 +368,7 @@ static void rna_ColorRampElement_remove(struct ColorBand *coba, static void rna_CurveMap_remove_point(CurveMap *cuma, ReportList *reports, PointerRNA *point_ptr) { CurveMapPoint *point = point_ptr->data; - if (curvemap_remove_point(cuma, point) == false) { + if (BKE_curvemap_remove_point(cuma, point) == false) { BKE_report(reports, RPT_ERROR, "Unable to remove curve point"); return; } @@ -518,7 +518,7 @@ static void rna_ColorManagedViewSettings_use_curves_set(PointerRNA *ptr, bool va view_settings->flag |= COLORMANAGE_VIEW_USE_CURVES; if (view_settings->curve_mapping == NULL) { - view_settings->curve_mapping = curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); + view_settings->curve_mapping = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); } } else { @@ -597,7 +597,7 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, else if (GS(id->name) == ID_MC) { MovieClip *clip = (MovieClip *)id; - BKE_movieclip_reload(bmain, clip); + DEG_id_tag_update(&clip->id, ID_RECALC_SOURCE); BKE_sequence_invalidate_movieclip_strips(bmain, clip); WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, &clip->id); @@ -669,7 +669,7 @@ static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene) } } -/* this function only exists because #curvemap_evaluateF uses a 'const' qualifier */ +/* this function only exists because #BKE_curvemap_evaluateF uses a 'const' qualifier */ static float rna_CurveMap_evaluateF(struct CurveMap *cuma, ReportList *reports, float value) { if (!cuma->table) { @@ -679,12 +679,12 @@ static float rna_CurveMap_evaluateF(struct CurveMap *cuma, ReportList *reports, "CurveMap table not initialized, call initialize() on CurveMapping owner of the CurveMap"); return 0.0f; } - return curvemap_evaluateF(cuma, value); + return BKE_curvemap_evaluateF(cuma, value); } static void rna_CurveMap_initialize(struct CurveMapping *cumap) { - curvemapping_initialize(cumap); + BKE_curvemapping_initialize(cumap); } #else @@ -729,7 +729,7 @@ static void rna_def_curvemap_points_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "CurveMap"); RNA_def_struct_ui_text(srna, "Curve Map Point", "Collection of Curve Map Points"); - func = RNA_def_function(srna, "new", "curvemap_insert"); + func = RNA_def_function(srna, "new", "BKE_curvemap_insert"); RNA_def_function_ui_description(func, "Add point to CurveMap"); parm = RNA_def_float(func, "position", @@ -889,7 +889,7 @@ static void rna_def_curvemapping(BlenderRNA *brna) prop, "White Level", "For RGB curves, the color that white is mapped to"); RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL); - func = RNA_def_function(srna, "update", "curvemapping_changed_all"); + func = RNA_def_function(srna, "update", "BKE_curvemapping_changed_all"); RNA_def_function_ui_description(func, "Update curve mapping after making changes"); func = RNA_def_function(srna, "initialize", "rna_CurveMap_initialize"); diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 9986b4c1674..735cd1fd923 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -211,7 +211,7 @@ static struct Depsgraph *rna_Context_evaluated_depsgraph_get(bContext *C) BPy_BEGIN_ALLOW_THREADS; # endif - depsgraph = CTX_data_evaluated_depsgraph(C); + depsgraph = CTX_data_ensure_evaluated_depsgraph(C); # ifdef WITH_PYTHON BPy_END_ALLOW_THREADS; diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index df1727ff87c..ebd9bd8e925 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -346,7 +346,7 @@ static void rna_Depsgraph_object_instances_next(CollectionPropertyIterator *iter RNA_Depsgraph_Instances_Iterator *di_it = (RNA_Depsgraph_Instances_Iterator *) iter->internal.custom; - /* We need to copy current iterator status to next one beeing worked on. */ + /* We need to copy current iterator status to next one being worked on. */ di_it->iterators[(di_it->counter + 1) % 2] = di_it->iterators[di_it->counter % 2]; di_it->deg_data[(di_it->counter + 1) % 2] = di_it->deg_data[di_it->counter % 2]; di_it->counter++; diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 2b89225d34d..dfe9e018e94 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -377,6 +377,10 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Random", "Use random values"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED); + RNA_def_property_ui_text(prop, "Seed", "Random seed"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_LOCATION); RNA_def_property_ui_text( @@ -613,6 +617,16 @@ static void rna_def_modifier_gpencilsimplify(BlenderRNA *brna) ICON_IPO_EASE_IN_OUT, "Adaptive", "Use a RDP algorithm to simplify"}, + {GP_SIMPLIFY_SAMPLE, + "SAMPLE", + ICON_IPO_EASE_IN_OUT, + "Sample", + "Sample a curve using a fixed length"}, + {GP_SIMPLIFY_MERGE, + "MERGE", + ICON_IPO_EASE_IN_OUT, + "Merge", + "Sample a curve using doing merge of vertex"}, {0, NULL, 0, NULL, NULL}, }; @@ -671,6 +685,13 @@ static void rna_def_modifier_gpencilsimplify(BlenderRNA *brna) RNA_def_property_range(prop, 1, 50); RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply simplify"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + + /* Sample */ + prop = RNA_def_property(srna, "length", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "length"); + RNA_def_property_range(prop, 0, 10); + RNA_def_property_ui_text(prop, "Length", "Length of each segment"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); } static void rna_def_modifier_gpencilthick(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index d6f4d82c298..75867b2fe13 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -700,7 +700,7 @@ static void rna_def_image(BlenderRNA *brna) "PREMUL", 0, "Premultiplied", - "Store RGB channels with alpha multipled in, also known as associated alpha. The natural " + "Store RGB channels with alpha multiplied in, also known as associated alpha. The natural " "format for renders and used by file formats like OpenEXR"}, {IMA_ALPHA_CHANNEL_PACKED, "CHANNEL_PACKED", diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index 1c0ced060d5..c9b51707759 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -178,8 +178,8 @@ static void rna_ViewLayer_update_tagged(ID *id_ptr, ViewLayer *view_layer, Main Scene *scene = (Scene *)id_ptr; Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); - /* NOTE: This is similar to CTX_data_depsgraph(). Ideally such access would be de-duplicated - * across all possible cases, but for now this is safest and easiest way to go. + /* NOTE: This is similar to CTX_data_depsgraph_pointer(). Ideally such access would be + * de-duplicated across all possible cases, but for now this is safest and easiest way to go. * * The reason for this is that it's possible to have Python operator which asks view layer to * be updated. After re-do of such operator view layer's dependency graph will not be marked diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 28989d1dd5f..6378ee15279 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -147,16 +147,8 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain, Material *ma = ptr->id.data; if (ma->use_nodes && ma->nodetree) { - struct bNode *node; - int index = 0; - for (node = ma->nodetree->nodes.first; node; node = node->next) { - if (node->typeinfo->nclass == NODE_CLASS_TEXTURE && - node->typeinfo->type == SH_NODE_TEX_IMAGE && node->id) { - if (index++ == ma->paint_active_slot) { - break; - } - } - } + struct bNode *node = BKE_texpaint_slot_material_find_node(ma, ma->paint_active_slot); + if (node) { nodeSetActive(ma->nodetree, node); } @@ -620,6 +612,12 @@ static void rna_def_material_greasepencil(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pattern", "Use Fill Texture as a pattern to apply color"); RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update"); + prop = RNA_def_property(srna, "use_overlap_strokes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_DISABLE_STENCIL); + RNA_def_property_ui_text( + prop, "Self Overlap", "Disable stencil and overlap self intersections with alpha materials"); + RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update"); + prop = RNA_def_property(srna, "show_stroke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_STROKE_SHOW); RNA_def_property_ui_text(prop, "Show Stroke", "Show stroke lines of this material"); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index d647c647136..283590fc529 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -202,6 +202,14 @@ static void rna_Mesh_count_selected_items(Mesh *mesh, int r_count[3]) BKE_mesh_count_selected_items(mesh, r_count); } +static void rna_Mesh_clear_geometry(Mesh *mesh) +{ + BKE_mesh_clear_geometry(mesh); + + DEG_id_tag_update(&mesh->id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_GEOM | ND_DATA, mesh); +} + #else void RNA_api_mesh(StructRNA *srna) @@ -319,6 +327,11 @@ void RNA_api_mesh(StructRNA *srna) func, "result", "nothing", 64, "Return value", "String description of result of comparison"); RNA_def_function_return(func, parm); + func = RNA_def_function(srna, "clear_geometry", "rna_Mesh_clear_geometry"); + RNA_def_function_ui_description( + func, + "Remove all geometry from the mesh. Note that this does not free shape keys or materials"); + func = RNA_def_function(srna, "validate", "BKE_mesh_validate"); RNA_def_function_ui_description(func, "Validate geometry, return True when the mesh has had " diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 92a32ec8ab5..743bac2b709 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -332,6 +332,7 @@ static void rna_def_metaball(BlenderRNA *brna) /* number values */ prop = RNA_def_property(srna, "resolution", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "wiresize"); + RNA_def_property_float_default(prop, 0.4f); RNA_def_property_range(prop, 0.005f, 10000.0f); RNA_def_property_ui_range(prop, 0.05f, 1000.0f, 2.5f, 3); RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport"); @@ -339,6 +340,7 @@ static void rna_def_metaball(BlenderRNA *brna) prop = RNA_def_property(srna, "render_resolution", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "rendersize"); + RNA_def_property_float_default(prop, 0.2f); RNA_def_property_range(prop, 0.005f, 10000.0f); RNA_def_property_ui_range(prop, 0.025f, 1000.0f, 2.5f, 3); RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering"); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 6cd4be81a56..7e1ff01a7c3 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1114,8 +1114,6 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf( return rna_enum_dt_layers_select_src_items; } - Depsgraph *depsgraph = CTX_data_depsgraph(C); - /* No active here! */ RNA_enum_items_add_value( &item, &totitem, rna_enum_dt_layers_select_src_items, DT_LAYERS_ALL_SRC); @@ -1155,6 +1153,7 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf( Mesh *me_eval; int num_data, i; + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src); @@ -1180,6 +1179,7 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf( Mesh *me_eval; int num_data, i; + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src); @@ -5668,7 +5668,8 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna) 0.0f, 1.0f, "Mix Factor", - "Factor to use when applying data to destination (exact behavior depends on mix mode)", + "Factor to use when applying data to destination (exact behavior depends on mix mode, " + "multiplied with weights from vertex group when defined)", 0.0f, 1.0f); RNA_def_property_update(prop, 0, "rna_Modifier_update"); diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 247c4c69019..10e19b92dda 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -51,12 +51,11 @@ # include "DNA_screen_types.h" # include "DNA_space_types.h" -static void rna_MovieClip_reload_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { MovieClip *clip = (MovieClip *)ptr->id.data; - BKE_movieclip_reload(bmain, clip); - DEG_id_tag_update(&clip->id, 0); + DEG_id_tag_update(&clip->id, ID_RECALC_SOURCE); } static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index eec280a5f3e..b28403bf28c 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -89,12 +89,12 @@ static const EnumPropertyItem node_quality_items[] = { }; static const EnumPropertyItem node_chunksize_items[] = { - {NTREE_CHUNCKSIZE_32, "32", 0, "32x32", "Chunksize of 32x32"}, - {NTREE_CHUNCKSIZE_64, "64", 0, "64x64", "Chunksize of 64x64"}, - {NTREE_CHUNCKSIZE_128, "128", 0, "128x128", "Chunksize of 128x128"}, - {NTREE_CHUNCKSIZE_256, "256", 0, "256x256", "Chunksize of 256x256"}, - {NTREE_CHUNCKSIZE_512, "512", 0, "512x512", "Chunksize of 512x512"}, - {NTREE_CHUNCKSIZE_1024, "1024", 0, "1024x1024", "Chunksize of 1024x1024"}, + {NTREE_CHUNKSIZE_32, "32", 0, "32x32", "Chunksize of 32x32"}, + {NTREE_CHUNKSIZE_64, "64", 0, "64x64", "Chunksize of 64x64"}, + {NTREE_CHUNKSIZE_128, "128", 0, "128x128", "Chunksize of 128x128"}, + {NTREE_CHUNKSIZE_256, "256", 0, "256x256", "Chunksize of 256x256"}, + {NTREE_CHUNKSIZE_512, "512", 0, "512x512", "Chunksize of 512x512"}, + {NTREE_CHUNKSIZE_1024, "1024", 0, "1024x1024", "Chunksize of 1024x1024"}, {0, NULL, 0, NULL, NULL}, }; #endif diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index d3b532dd11d..6069e78d874 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -441,7 +441,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value, struct Report return; } - if ((id->tag & LIB_TAG_NO_MAIN) != (ob->id.tag & LIB_TAG_NO_MAIN)) { + if (id && ((id->tag & LIB_TAG_NO_MAIN) != (ob->id.tag & LIB_TAG_NO_MAIN))) { BKE_report(reports, RPT_ERROR, "Can only assign evaluated data to evaluated object, or original data to " @@ -2537,7 +2537,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH); RNA_def_property_array(prop, 3); - /* Only as convinient helper for py API, and conflicts with animating scale. */ + /* Only as convenient helper for py API, and conflicts with animating scale. */ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_float_funcs( prop, "rna_Object_dimensions_get", "rna_Object_dimensions_set", NULL); @@ -2546,7 +2546,7 @@ static void rna_def_object(BlenderRNA *brna) prop, "Dimensions", "Absolute bounding box dimensions of the object (WARNING: assigning to it or " - "its members mutiple consecutive times will not work correctly, " + "its members multiple consecutive times will not work correctly, " "as this needs up-to-date evaluated data)"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index c91481931a2..9a76885a19d 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -465,6 +465,8 @@ static int mesh_looptri_to_poly_index(Mesh *me_eval, const MLoopTri *lt) return index_mp_to_orig ? index_mp_to_orig[lt->poly] : lt->poly; } +/* TOOD(sergey): Make the Python API more clear that evaluation might happen, or requite passing + * fully evaluated depsgraph. */ static Object *eval_object_ensure(Object *ob, bContext *C, ReportList *reports, @@ -474,7 +476,7 @@ static Object *eval_object_ensure(Object *ob, Object *ob_orig = ob; Depsgraph *depsgraph = rnaptr_depsgraph != NULL ? rnaptr_depsgraph->data : NULL; if (depsgraph == NULL) { - depsgraph = CTX_data_depsgraph(C); + depsgraph = CTX_data_ensure_evaluated_depsgraph(C); } if (depsgraph != NULL) { ob = DEG_get_evaluated_object(depsgraph, ob); @@ -502,6 +504,8 @@ static void rna_Object_ray_cast(Object *ob, { bool success = false; + /* TODO(sergey): This isn't very reliable check. It is possible to have non-NULL pointer but + * which is out of date, and possibly dangling one. */ if (ob->runtime.mesh_eval == NULL && (ob = eval_object_ensure(ob, C, reports, rnaptr_depsgraph)) == NULL) { return; @@ -972,7 +976,7 @@ void RNA_api_object(StructRNA *srna) RNA_def_parameter_flags(parm, 0, PARM_RNAPTR); /* return location and normal */ - parm = RNA_def_boolean(func, "result", 0, "", "Wheter the ray successfully hit the geometry"); + parm = RNA_def_boolean(func, "result", 0, "", "Whether the ray successfully hit the geometry"); RNA_def_function_output(func, parm); parm = RNA_def_float_vector(func, "location", @@ -1035,7 +1039,7 @@ void RNA_api_object(StructRNA *srna) RNA_def_parameter_flags(parm, 0, PARM_RNAPTR); /* return location and normal */ - parm = RNA_def_boolean(func, "result", 0, "", "Wheter closest point on geometry was found"); + parm = RNA_def_boolean(func, "result", 0, "", "Whether closest point on geometry was found"); RNA_def_function_output(func, parm); parm = RNA_def_float_vector(func, "location", @@ -1109,7 +1113,7 @@ void RNA_api_object(StructRNA *srna) "(only needed if current Context's depsgraph is not suitable)"); RNA_def_parameter_flags(parm, 0, PARM_RNAPTR); /* weak!, no way to return dynamic string type */ - parm = RNA_def_string(func, "result", NULL, 16384, "", "Requested informations"); + parm = RNA_def_string(func, "result", NULL, 16384, "", "Requested information"); RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); /* needed for string return value */ RNA_def_function_output(func, parm); # endif /* NDEBUG */ diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index a96e85473a2..4c50e0c19ae 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -3050,7 +3050,8 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "childrad"); - RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_range(prop, 0.0f, 100000.0f); + RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 8546702c377..d359726b3bd 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -623,7 +623,7 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain), bPoseChannel *pchan_src = (bPoseChannel *)ptr_src->data; /* Remember that insertion operations are defined and stored in correct order, which means that - * even if we insert several items in a row, we alays insert first one, then second one, etc. + * even if we insert several items in a row, we always insert first one, then second one, etc. * So we should always find 'anchor' constraint in both _src *and* _dst> */ bConstraint *con_anchor = NULL; if (opop->subitem_local_name && opop->subitem_local_name[0]) { diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 9834520f952..f17e9ce28fe 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -3076,8 +3076,9 @@ void RNA_def_rna(BlenderRNA *brna) /* FloatProperty */ srna = RNA_def_struct(brna, "FloatProperty", "Property"); - RNA_def_struct_ui_text( - srna, "Float Definition", "RNA floating pointer number property definition"); + RNA_def_struct_ui_text(srna, + "Float Definition", + "RNA floating point number (single precision) property definition"); rna_def_number_property(srna, PROP_FLOAT); /* StringProperty */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index dcbbdd67d7b..531ff27798d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -735,7 +735,7 @@ static void rna_GPencilInterpolateSettings_type_set(PointerRNA *ptr, int value) /* init custom interpolation curve here now the first time it's used */ if ((settings->type == GP_IPO_CURVEMAP) && (settings->custom_ipo == NULL)) { - settings->custom_ipo = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + settings->custom_ipo = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } } @@ -877,7 +877,7 @@ static float rna_Scene_frame_current_final_get(PointerRNA *ptr) { Scene *scene = (Scene *)ptr->data; - return BKE_scene_frame_get_from_ctime(scene, (float)scene->r.cfra); + return BKE_scene_frame_to_ctime(scene, (float)scene->r.cfra); } static void rna_Scene_start_frame_set(PointerRNA *ptr, int value) @@ -5171,6 +5171,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna) {FFMPEG_OGG, "OGG", 0, "Ogg", ""}, {FFMPEG_MKV, "MKV", 0, "Matroska", ""}, {FFMPEG_FLV, "FLASH", 0, "Flash", ""}, + {FFMPEG_WEBM, "WEBM", 0, "WebM", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -5229,6 +5230,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna) {AV_CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""}, {AV_CODEC_ID_MP2, "MP2", 0, "MP2", ""}, {AV_CODEC_ID_MP3, "MP3", 0, "MP3", ""}, + {AV_CODEC_ID_OPUS, "OPUS", 0, "Opus", ""}, {AV_CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""}, {AV_CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""}, {0, NULL, 0, NULL, NULL}, @@ -6274,7 +6276,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "SceneObjects"); srna = RNA_def_struct(brna, "SceneObjects", NULL); RNA_def_struct_sdna(srna, "Scene"); - RNA_def_struct_ui_text(srna, "Scene Objects", "All the of scene objects"); + RNA_def_struct_ui_text(srna, "Scene Objects", "All of the scene objects"); } /* scene.timeline_markers */ diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index ac41736451a..84f2cb7c1be 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -414,25 +414,6 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) } } -static void rna_Sculpt_ShowDiffuseColor_update(bContext *C, PointerRNA *UNUSED(ptr)) -{ - ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); - - if (ob && ob->sculpt) { - Scene *scene = CTX_data_scene(C); - Sculpt *sd = scene->toolsettings->sculpt; - ob->sculpt->show_diffuse_color = ((sd->flags & SCULPT_SHOW_DIFFUSE) != 0); - - if (ob->sculpt->pbvh) { - pbvh_show_diffuse_color_set(ob->sculpt->pbvh, ob->sculpt->show_diffuse_color); - } - - DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); - } -} - static void rna_Sculpt_ShowMask_update(bContext *C, PointerRNA *UNUSED(ptr)) { ViewLayer *view_layer = CTX_data_view_layer(C); @@ -827,14 +808,6 @@ static void rna_def_sculpt(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update"); - prop = RNA_def_property(srna, "show_diffuse_color", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SHOW_DIFFUSE); - RNA_def_property_ui_text(prop, - "Show Diffuse Color", - "Show diffuse color of object and overlay sculpt mask on top of it"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowDiffuseColor_update"); - prop = RNA_def_property(srna, "show_mask", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", SCULPT_HIDE_MASK); RNA_def_property_ui_text(prop, "Show Mask", "Show mask as overlay on object"); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 241764ff9a6..80a4defba00 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -161,7 +161,7 @@ static void rna_Sequence_use_sequence(Main *bmain, Scene *scene, PointerRNA *ptr { /* General update callback. */ rna_Sequence_invalidate_raw_update(bmain, scene, ptr); - /* Chaning recursion changes set of IDs which needs to be remapped by the copy-on-write. + /* Changing recursion changes set of IDs which needs to be remapped by the copy-on-write. * the only way for this currently is to tag the ID for ID_RECALC_COPY_ON_WRITE. */ Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed) { @@ -1853,7 +1853,8 @@ static void rna_def_editor(BlenderRNA *brna) prop = RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW); - RNA_def_property_ui_text(prop, "Draw Axes", "Partial overlay on top of the sequencer"); + RNA_def_property_ui_text( + prop, "Show Overlay", "Partial overlay on top of the sequencer with a frame offset"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); prop = RNA_def_property(srna, "use_overlay_lock", PROP_BOOLEAN, PROP_NONE); @@ -1864,7 +1865,7 @@ static void rna_def_editor(BlenderRNA *brna) /* access to fixed and relative frame */ prop = RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Overlay Offset", ""); + RNA_def_property_ui_text(prop, "Overlay Offset", "Number of frames to offset"); RNA_def_property_int_funcs( prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); @@ -3066,7 +3067,7 @@ static void rna_def_brightcontrast_modifier(BlenderRNA *brna) prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "contrast"); - RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_range(prop, -100.0f, 100.0f); RNA_def_property_ui_text(prop, "Contrast", "Adjust the difference in luminosity between pixels"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update"); } diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index 454367b5233..b09b5327f57 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -146,6 +146,13 @@ static void rna_def_text_line(BlenderRNA *brna) static void rna_def_text(BlenderRNA *brna) { + + static const EnumPropertyItem indentation_items[] = { + {0, "TABS", 0, "Tabs", "Indent using tabs"}, + {TXT_TABSTOSPACES, "SPACES", 0, "Spaces", "Indent using spaces"}, + {0, NULL, 0, NULL, NULL}, + }; + StructRNA *srna; PropertyRNA *prop; @@ -182,10 +189,10 @@ static void rna_def_text(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Register", "Run this text as a script on loading, Text name must end with \".py\""); - prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES); - RNA_def_property_ui_text( - prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces"); + prop = RNA_def_property(srna, "indentation", PROP_ENUM, PROP_NONE); /* as an enum */ + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags"); + RNA_def_property_enum_items(prop, indentation_items); + RNA_def_property_ui_text(prop, "Indentation", "Use tabs or spaces for indentation"); prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "TextLine"); diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 83e4766c57d..84bde91e654 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -1066,7 +1066,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna) prop, "Normalize", "Normalize light intensities while tracking (slower)"); RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL); - /* default minmal correlation */ + /* default minimal correlation */ prop = RNA_def_property(srna, "default_correlation_min", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 8a9b8a14563..48eee713fc9 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -30,6 +30,7 @@ #include "BLI_utildefines.h" #include "BLI_math_base.h" +#include "BLI_math_rotation.h" #include "BLT_translation.h" @@ -4589,10 +4590,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke to include"); - prop = RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY); - RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke"); - prop = RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "gp_eraser"); RNA_def_property_range(prop, 1, 500); @@ -5112,13 +5109,18 @@ static void rna_def_userdef_input(BlenderRNA *brna) "CONTINUE", 0, "Continue", - "Old style zoom, continues while moving mouse up or down"}, - {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"}, + "Continuous zooming. The zoom direction and speed depends on how far along the set Zoom " + "Axis the mouse has moved"}, + {USER_ZOOM_DOLLY, + "DOLLY", + 0, + "Dolly", + "Zoom in and out based on mouse movement along the set Zoom Axis"}, {USER_ZOOM_SCALE, "SCALE", 0, "Scale", - "Zoom in and out like scaling the view, mouse movements relative to center"}, + "Zoom in and out as if you are scaling the view, mouse movements relative to center"}, {0, NULL, 0, NULL, NULL}, }; @@ -5225,6 +5227,20 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_struct_type(prop, "WalkNavigation"); RNA_def_property_ui_text(prop, "Walk Navigation", "Settings for walk navigation mode"); + prop = RNA_def_property(srna, "view_rotate_sensitivity_turntable", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_range(prop, DEG2RADF(0.001f), DEG2RADF(15.0f)); + RNA_def_property_float_default(prop, DEG2RADF(0.4f)); + RNA_def_property_ui_range(prop, DEG2RADF(0.001f), DEG2RADF(15.0f), 1.0f, 2); + RNA_def_property_ui_text(prop, + "Orbit Sensitivity", + "Rotation amount per-pixel to control how fast the viewport orbits"); + + prop = RNA_def_property(srna, "view_rotate_sensitivity_trackball", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_range(prop, 0.1f, 10.0f); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_ui_range(prop, 0.1f, 2.0f, 0.01f, 2); + RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Scale trackball orbit sensitivity"); + /* tweak tablet & mouse preset */ prop = RNA_def_property(srna, "drag_threshold_mouse", PROP_INT, PROP_PIXEL); RNA_def_property_range(prop, 1, 255); @@ -5804,7 +5820,7 @@ void RNA_def_userdef(BlenderRNA *brna) /* Preferences Flags */ prop = RNA_def_property(srna, "use_preferences_save", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "pref_flag", USER_PREF_FLAG_SAVE); - RNA_def_property_ui_text(prop, "Save on Exit", "Save modified preferences on exit"); + RNA_def_property_ui_text(prop, "Save on Exit", "Save preferences on exit when modified"); prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "runtime.is_dirty", 0); diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 1fea87df10c..d9306ba7a65 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -471,12 +471,12 @@ static void rna_PopMenuEnd(bContext *C, PointerRNA *handle) } /* popover wrapper */ -static PointerRNA rna_PopoverBegin(bContext *C, int ui_units_x) +static PointerRNA rna_PopoverBegin(bContext *C, int ui_units_x, bool from_active_button) { PointerRNA r_ptr; void *data; - data = (void *)UI_popover_begin(C, U.widget_unit * ui_units_x); + data = (void *)UI_popover_begin(C, U.widget_unit * ui_units_x, from_active_button); RNA_pointer_create(NULL, &RNA_UIPopover, data, &r_ptr); @@ -821,6 +821,8 @@ void RNA_api_wm(StructRNA *srna) parm = RNA_def_pointer(func, "menu", "UIPopover", "", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_RNAPTR); RNA_def_function_return(func, parm); + RNA_def_boolean( + func, "from_active_button", 0, "Use Button", "Use the active button for positioning"); /* wrap UI_popover_end */ func = RNA_def_function(srna, "popover_end__internal", "rna_PopoverEnd"); |