diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 503c4a1a1f8..5c9c7b50339 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -190,16 +190,6 @@ const EnumPropertyItem rna_enum_snap_node_element_items[] = { {0, NULL, 0, NULL, NULL}, }; -const EnumPropertyItem rna_enum_snap_seq_element_items[] = { - {SEQ_SNAP_TO_CURRENT_FRAME, - "CURRENT_FRAME", - ICON_NONE, - "Current Frame", - "Snap to current frame"}, - {SEQ_SNAP_TO_STRIP_HOLD, "STRIP_HOLD", ICON_NONE, "Hold Offset", "Snap to strip hold offset"}, - {0, NULL, 0, NULL, NULL}, -}; - #ifndef RNA_RUNTIME static const EnumPropertyItem snap_uv_element_items[] = { {SCE_SNAP_MODE_INCREMENT, @@ -1282,10 +1272,10 @@ static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext ID *id = ptr->owner_id; const bool is_render = (id && GS(id->name) == ID_SCE); - /* note, we need to act differently for render + /* NOTE(campbell): we need to act differently for render * where 'BW' will force grayscale even if the output format writes * as RGBA, this is age old blender convention and not sure how useful - * it really is but keep it for now - campbell */ + * it really is but keep it for now. */ char chan_flag = BKE_imtype_valid_channels(imf->imtype, true) | (is_render ? IMA_CHAN_FLAG_BW : 0); @@ -2176,7 +2166,7 @@ static char *rna_MeshStatVis_path(PointerRNA *UNUSED(ptr)) return BLI_strdup("tool_settings.statvis"); } -/* note: without this, when Multi-Paint is activated/deactivated, the colors +/* NOTE: without this, when Multi-Paint is activated/deactivated, the colors * will not change right away when multiple bones are selected, this function * is not for general use and only for the few cases where changing scene * settings and NOT for general purpose updates, possibly this should be @@ -3126,6 +3116,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Use Snapping", "Snap to strip edges or current frame"); RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1); RNA_def_property_boolean_default(prop, true); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* Publish message-bus. */ prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "snap_mode"); @@ -3527,25 +3518,29 @@ static void rna_def_sequencer_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fit Method", "Scale fit method"); /* Transform snapping. */ + prop = RNA_def_property(srna, "snap_to_current_frame", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "snap_mode", SEQ_SNAP_TO_CURRENT_FRAME); + RNA_def_property_ui_text(prop, "Current Frame", "Snap to current frame"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ - /* Sequencer editor uses own set of snap modes */ - prop = RNA_def_property(srna, "snap_seq_element", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "snap_mode"); - RNA_def_property_enum_items(prop, rna_enum_snap_seq_element_items); - RNA_def_property_ui_text(prop, "Snap To", "Type of element to snap to"); - RNA_def_property_flag(prop, PROP_ENUM_FLAG); + prop = RNA_def_property(srna, "snap_to_hold_offset", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "snap_mode", SEQ_SNAP_TO_STRIP_HOLD); + RNA_def_property_ui_text(prop, "Hold Offset", "Snap to strip hold offsets"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ prop = RNA_def_property(srna, "snap_ignore_muted", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SEQ_SNAP_IGNORE_MUTED); - RNA_def_property_boolean_default(prop, true); RNA_def_property_ui_text(prop, "Ignore Muted Strips", "Don't snap to hidden strips"); prop = RNA_def_property(srna, "snap_ignore_sound", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SEQ_SNAP_IGNORE_SOUND); - RNA_def_property_boolean_default(prop, true); RNA_def_property_ui_text(prop, "Ignore Sound Strips", "Don't snap to sound strips"); + prop = RNA_def_property(srna, "use_snap_current_frame_to_strips", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SEQ_SNAP_CURRENT_FRAME_TO_STRIPS); + RNA_def_property_ui_text( + prop, "Snap Current Frame to Strips", "Snap current frame to strip start or end"); + prop = RNA_def_property(srna, "snap_distance", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "snap_distance"); RNA_def_property_int_default(prop, 15); @@ -5397,7 +5392,7 @@ static void rna_def_image_format_stereo3d_format(BlenderRNA *brna) } /* use for render output and image save operator, - * note: there are some cases where the members act differently when this is + * NOTE: there are some cases where the members act differently when this is * used from a scene, video formats can only be selected for render output * for example, this is checked by seeing if the ptr->owner_id is a Scene id */ @@ -7973,10 +7968,10 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "master_collection"); RNA_def_property_struct_type(prop, "Collection"); RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); - RNA_def_property_ui_text( - prop, - "Collection", - "Scene master collection that objects and other collections in the scene"); + RNA_def_property_ui_text(prop, + "Collection", + "Scene root collection that owns all the objects and other collections " + "instantiated in the scene"); /* Scene Display */ prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE); |