diff options
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 15 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 19 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 72 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 4 |
5 files changed, 91 insertions, 29 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 94814003e99..4a20df048bd 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -716,10 +716,13 @@ static bGPDstroke *rna_GPencil_stroke_new(bGPDframe *frame) return stroke; } -static void rna_GPencil_stroke_remove(bGPDframe *frame, +static void rna_GPencil_stroke_remove(ID *id, + bGPDframe *frame, ReportList *reports, PointerRNA *stroke_ptr) { + bGPdata *gpd = (bGPdata *)id; + bGPDstroke *stroke = stroke_ptr->data; if (BLI_findindex(&frame->strokes, stroke) == -1) { BKE_report(reports, RPT_ERROR, "Stroke not found in grease pencil frame"); @@ -729,7 +732,8 @@ static void rna_GPencil_stroke_remove(bGPDframe *frame, BLI_freelinkN(&frame->strokes, stroke); RNA_POINTER_INVALIDATE(stroke_ptr); - WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); + DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE); + WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); } static void rna_GPencil_stroke_close(ID *id, @@ -1282,7 +1286,7 @@ static void rna_def_gpencil_strokes_api(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "remove", "rna_GPencil_stroke_remove"); RNA_def_function_ui_description(func, "Remove a grease pencil stroke"); - RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to remove"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index 46a32256114..b99457056fe 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -299,19 +299,6 @@ static void rna_LayerCollection_hide_viewport_set(PointerRNA *ptr, bool value) rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_HIDE); } -static void rna_LayerCollection_exclude_update_recursive(ListBase *lb, const bool exclude) -{ - LISTBASE_FOREACH (LayerCollection *, lc, lb) { - if (exclude) { - lc->flag |= LAYER_COLLECTION_EXCLUDE; - } - else { - lc->flag &= ~LAYER_COLLECTION_EXCLUDE; - } - rna_LayerCollection_exclude_update_recursive(&lc->layer_collections, exclude); - } -} - static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; @@ -320,7 +307,7 @@ static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene) /* Set/Unset it recursively to match the behavior of excluding via the menu or shortcuts. */ const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0; - rna_LayerCollection_exclude_update_recursive(&lc->layer_collections, exclude); + BKE_layer_collection_set_flag(lc, LAYER_COLLECTION_EXCLUDE, exclude); BKE_layer_collection_sync(scene, view_layer); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index a951c0731a6..1130b822f75 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1797,6 +1797,11 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop = RNA_def_property(srna, "texture_coords_bone", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "map_bone"); + RNA_def_property_ui_text(prop, "Texture Coordinate Bone", "Bone to set the texture coordinates"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_warp(BlenderRNA *brna) @@ -4530,6 +4535,14 @@ static void rna_def_modifier_solidify(BlenderRNA *brna) RNA_def_property_enum_items(prop, nonmanifold_boundary_mode_items); RNA_def_property_ui_text(prop, "Boundary Shape", "Selects the boundary adjustment algorithm"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "nonmanifold_merge_threshold", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "merge_tolerance"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4); + RNA_def_property_ui_text( + prop, "Merge Threshold", "Distance within which degenerated geometry is merged"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_screw(BlenderRNA *brna) @@ -4804,6 +4817,12 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *UNUSED(brna), RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop = RNA_def_property(srna, "mask_tex_map_bone", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "mask_tex_map_bone"); + RNA_def_property_ui_text( + prop, "Texture Coordinate Bone", "Which bone to take texture coordinates from"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_weightvgedit(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 04729f87cab..d3eae4562ec 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -287,11 +287,12 @@ static void do_sequence_frame_change_update(Scene *scene, Sequence *seq) /* A simple wrapper around above func, directly usable as prop update func. * Also invalidate cache if needed. */ -static void rna_Sequence_frame_change_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Sequence_frame_change_update(Main *UNUSED(bmain), + Scene *UNUSED(scene), + PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; do_sequence_frame_change_update(scene, (Sequence *)ptr->data); - rna_Sequence_invalidate_preprocessed_update(bmain, scene, ptr); } static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) @@ -299,8 +300,10 @@ static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_translate(scene, seq, value - seq->start); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); } static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value) @@ -308,9 +311,11 @@ static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_tx_set_final_left(seq, value); BKE_sequence_single_fix(seq); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); } static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value) @@ -318,9 +323,47 @@ static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_tx_set_final_right(seq, value); BKE_sequence_single_fix(seq); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); +} + +static void rna_Sequence_frame_offset_start_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->startofs = value; +} + +static void rna_Sequence_frame_offset_end_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->endofs = value; +} + +static void rna_Sequence_frame_still_start_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->startstill = value; +} + +static void rna_Sequence_frame_still_end_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->endstill = value; } static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value) @@ -350,8 +393,10 @@ static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_tx_set_final_right(seq, BKE_sequence_tx_get_final_left(seq, false) + value); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); } static int rna_Sequence_frame_length_get(PointerRNA *ptr) @@ -374,6 +419,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value) Editing *ed = BKE_sequencer_editing_get(scene, false); ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); /* check channel increment or decrement */ const int channel_delta = (value >= seq->machine) ? 1 : -1; seq->machine = value; @@ -383,6 +429,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value) BKE_sequence_base_shuffle_ex(seqbase, seq, scene, channel_delta); } BKE_sequencer_sort(scene); + BKE_sequence_invalidate_cache_composite(scene, seq); } static void rna_Sequence_frame_offset_range( @@ -1627,6 +1674,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL); /* strip positioning */ + /* Cache has to be invalidated before and after transformation. */ prop = RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME); RNA_def_property_range(prop, 1, MAXFRAME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -1684,14 +1732,16 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "startofs"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_ui_text(prop, "Start Offset", ""); - RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Sequence_frame_offset_range"); + RNA_def_property_int_funcs( + prop, NULL, "rna_Sequence_frame_offset_start_set", "rna_Sequence_frame_offset_range"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "endofs"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_ui_text(prop, "End Offset", ""); - RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Sequence_frame_offset_range"); + RNA_def_property_int_funcs( + prop, NULL, "rna_Sequence_frame_offset_end_set", "rna_Sequence_frame_offset_range"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME); @@ -1699,6 +1749,7 @@ static void rna_def_sequence(BlenderRNA *brna) // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "Start Still", ""); + RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_frame_still_start_set", NULL); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME); @@ -1706,6 +1757,7 @@ static void rna_def_sequence(BlenderRNA *brna) // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "End Still", ""); + RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_frame_still_end_set", NULL); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); @@ -2467,12 +2519,12 @@ static void rna_def_wipe(StructRNA *srna) PropertyRNA *prop; static const EnumPropertyItem wipe_type_items[] = { - {0, "SINGLE", 0, "Single", ""}, - {1, "DOUBLE", 0, "Double", ""}, - /* not used yet {2, "BOX", 0, "Box", ""}, */ - /* not used yet {3, "CROSS", 0, "Cross", ""}, */ - {4, "IRIS", 0, "Iris", ""}, - {5, "CLOCK", 0, "Clock", ""}, + {DO_SINGLE_WIPE, "SINGLE", 0, "Single", ""}, + {DO_DOUBLE_WIPE, "DOUBLE", 0, "Double", ""}, + /* not used yet {DO_BOX_WIPE, "BOX", 0, "Box", ""}, */ + /* not used yet {DO_CROSS_WIPE, "CROSS", 0, "Cross", ""}, */ + {DO_IRIS_WIPE, "IRIS", 0, "Iris", ""}, + {DO_CLOCK_WIPE, "CLOCK", 0, "Clock", ""}, {0, NULL, 0, NULL, NULL}, }; diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index d49a2ed1ea0..6c8f51f97a1 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -193,7 +193,7 @@ static Sequence *rna_Sequences_new_image(ID *id, if (seq->strip->stripdata->name[0] == '\0') { BKE_report(reports, RPT_ERROR, "Sequences.new_image: unable to open image file"); BLI_remlink(&ed->seqbase, seq); - BKE_sequence_free(scene, seq); + BKE_sequence_free(scene, seq, true); return NULL; } @@ -382,7 +382,7 @@ static void rna_Sequences_remove( return; } - BKE_sequence_free(scene, seq); + BKE_sequence_free(scene, seq, true); RNA_POINTER_INVALIDATE(seq_ptr); DEG_relations_tag_update(bmain); |