diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-05-26 13:43:49 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-05-26 13:43:49 +0300 |
commit | 786aa4b5181e53151180df5158e722dd4a45e901 (patch) | |
tree | 40203ae5171e0cd393a55f331e207de90c151ef1 /source/blender/makesrna | |
parent | 0330805ec7a8d79a0b7d0b1f49b06e0abf2065bc (diff) | |
parent | afec66c024dc2b75447537d45406c06342ec201e (diff) |
Merge branch 'master' into eevee-gpencil
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 21 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 1 |
5 files changed, 15 insertions, 30 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 5c0691f0320..2818f251085 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -1137,7 +1137,7 @@ static void rna_ImagePreview_icon_reload(PreviewImage *prv) static PointerRNA rna_IDPreview_get(PointerRNA *ptr) { ID *id = (ID *)ptr->data; - PreviewImage *prv_img = BKE_previewimg_id_ensure(id); + PreviewImage *prv_img = BKE_previewimg_id_get(id); return rna_pointer_inherit_refine(ptr, &RNA_ImagePreview, prv_img); } @@ -1707,12 +1707,12 @@ static void rna_def_ID(BlenderRNA *brna) srna, "override_library", "IDOverrideLibrary", "Library Override", "Library override data"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - prop = RNA_def_pointer( - srna, - "preview", - "ImagePreview", - "Preview", - "Preview image and icon of this data-block (None if not supported for this type of data)"); + prop = RNA_def_pointer(srna, + "preview", + "ImagePreview", + "Preview", + "Preview image and icon of this data-block (always None if not supported " + "for this type of data)"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); RNA_def_property_pointer_funcs(prop, "rna_IDPreview_get", NULL, NULL, NULL); @@ -1826,6 +1826,13 @@ static void rna_def_ID(BlenderRNA *brna) "e.g. when calling :class:`bpy.types.Scene.update`"); RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform"); + func = RNA_def_function(srna, "preview_ensure", "BKE_previewimg_id_ensure"); + RNA_def_function_ui_description(func, + "Ensure that this ID has preview data (if ID type supports it)"); + parm = RNA_def_pointer( + func, "preview_image", "ImagePreview", "", "The existing or created preview"); + RNA_def_function_return(func, parm); + # ifdef WITH_PYTHON RNA_def_struct_register_funcs(srna, NULL, NULL, "rna_ID_instance"); # endif diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index c2512ea33ae..11f5ff0441a 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1423,6 +1423,7 @@ static void rna_NodeTree_socket_remove(bNodeTree *ntree, ntreeRemoveSocketInterface(ntree, sock); ntreeUpdateTree(bmain, ntree); + DEG_id_tag_update(&ntree->id, 0); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 1dc7519258b..b339682222c 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1502,11 +1502,6 @@ static PointerRNA rna_Object_field_get(PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; - /* weak */ - if (!ob->pd) { - ob->pd = BKE_partdeflect_new(0); - } - return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd); } @@ -1518,11 +1513,6 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr) return PointerRNA_NULL; } - /* weak */ - if (!ob->pd) { - ob->pd = BKE_partdeflect_new(0); - } - return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd); } diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index d94e68a6808..7ff2a82a465 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1413,24 +1413,12 @@ static const EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), static PointerRNA rna_Particle_field1_get(PointerRNA *ptr) { ParticleSettings *part = (ParticleSettings *)ptr->owner_id; - - /* weak */ - if (!part->pd) { - part->pd = BKE_partdeflect_new(0); - } - return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd); } static PointerRNA rna_Particle_field2_get(PointerRNA *ptr) { ParticleSettings *part = (ParticleSettings *)ptr->owner_id; - - /* weak */ - if (!part->pd2) { - part->pd2 = BKE_partdeflect_new(0); - } - return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd2); } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index aa07ff4006a..d744f67c6f6 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -4492,7 +4492,6 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) prop = RNA_def_property(srna, "gpencil_vertex_paint_opacity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "overlay.gpencil_vertex_paint_opacity"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Opacity", "Vertex Paint mix factor"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); } |