This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/makesrna/intern/rna_sequencer.c

2609 lines
100 KiB
C
Raw Normal View History

/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
2010-02-12 13:34:04 +00:00
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Blender Foundation (2008)
*
* ***** END GPL LICENSE BLOCK *****
*/
2011-02-27 20:20:01 +00:00
/** \file blender/makesrna/intern/rna_sequencer.c
* \ingroup RNA
*/
#include <stdlib.h>
#include <limits.h>
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_movieclip_types.h"
#include "BLI_math.h"
#include "BLT_translation.h"
2013-03-18 18:43:22 +00:00
#include "BKE_animsys.h"
2010-08-13 14:23:44 +00:00
#include "BKE_global.h"
#include "BKE_sequencer.h"
#include "BKE_sound.h"
2009-06-13 01:30:47 +00:00
#include "MEM_guardedalloc.h"
2013-03-07 02:44:55 +00:00
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
#include "WM_types.h"
2012-05-10 15:22:29 +00:00
typedef struct EffectInfo {
const char *struct_name;
const char *ui_name;
const char *ui_desc;
2012-05-10 15:22:29 +00:00
void (*func)(StructRNA *);
int inputs;
} EffectInfo;
EnumPropertyItem rna_enum_sequence_modifier_type_items[] = {
{seqModifierType_ColorBalance, "COLOR_BALANCE", ICON_NONE, "Color Balance", ""},
{seqModifierType_Curves, "CURVES", ICON_NONE, "Curves", ""},
2012-08-22 16:44:32 +00:00
{seqModifierType_HueCorrect, "HUE_CORRECT", ICON_NONE, "Hue Correct", ""},
{seqModifierType_BrightContrast, "BRIGHT_CONTRAST", ICON_NONE, "Bright/Contrast", ""},
{seqModifierType_Mask, "MASK", ICON_NONE, "Mask", ""},
{seqModifierType_WhiteBalance, "WHITE_BALANCE", ICON_NONE, "White Balance", ""},
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#include "BKE_report.h"
#include "BKE_idprop.h"
#include "WM_api.h"
#include "IMB_imbuf.h"
typedef struct SequenceSearchData {
Sequence *seq;
void *data;
SequenceModifierData *smd;
} SequenceSearchData;
2012-07-16 23:23:33 +00:00
/* build a temp reference to the parent */
2009-12-09 18:47:52 +00:00
static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
{
for (; seq; seq = seq->next) {
seq->tmp = seq_par;
if (seq->type == SEQ_TYPE_META) {
meta_tmp_ref(seq, seq->seqbase.first);
}
}
}
static void rna_SequenceElement_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed) {
StripElem *se = (StripElem *)ptr->data;
Sequence *seq;
/* slow but we can't avoid! */
seq = BKE_sequencer_from_elem(&ed->seqbase, se);
if (seq) {
BKE_sequence_invalidate_cache(scene, seq);
}
}
}
static void rna_Sequence_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed) {
Sequence *seq = (Sequence *) ptr->data;
BKE_sequence_invalidate_cache(scene, seq);
}
}
static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Scene *scene = (Scene *)ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
meta_tmp_ref(NULL, ed->seqbase.first);
rna_iterator_listbase_begin(iter, &ed->seqbase, NULL);
}
static void rna_SequenceEditor_update_cache(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
Editing *ed = scene->ed;
BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
}
static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal = &iter->internal.listbase;
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)internal->link;
if (seq->seqbase.first)
2012-05-10 15:22:29 +00:00
internal->link = (Link *)seq->seqbase.first;
else if (seq->next)
2012-05-10 15:22:29 +00:00
internal->link = (Link *)seq->next;
else {
internal->link = NULL;
do {
2012-03-18 07:38:51 +00:00
seq = seq->tmp; /* XXX - seq's don't reference their parents! */
if (seq && seq->next) {
2012-05-10 15:22:29 +00:00
internal->link = (Link *)seq->next;
break;
}
} while (seq);
}
iter->valid = (internal->link != NULL);
}
/* internal use */
static int rna_SequenceEditor_elements_length(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
/* Hack? copied from sequencer.c::reload_sequence_new_file() */
2012-05-10 15:22:29 +00:00
size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(struct StripElem);
/* the problem with seq->strip->len and seq->len is that it's discounted from the offset (hard cut trim) */
return (int) olen;
}
static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
rna_iterator_array_begin(iter, (void *)seq->strip->stripdata, sizeof(StripElem),
rna_SequenceEditor_elements_length(ptr), 0, NULL);
}
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
static void rna_Sequence_views_format_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
rna_Sequence_update(bmain, scene, ptr);
}
static void do_sequence_frame_change_update(Scene *scene, Sequence *seq)
{
Editing *ed = BKE_sequencer_editing_get(scene, false);
ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq);
Sequence *tseq;
BKE_sequence_calc_disp(scene, seq);
/* ensure effects are always fit in length to their input */
/* TODO(sergey): probably could be optimized.
* in terms skipping update of non-changing strips
*/
for (tseq = seqbase->first; tseq; tseq = tseq->next) {
if (tseq->seq1 || tseq->seq2 || tseq->seq3) {
BKE_sequence_calc(scene, tseq);
}
}
if (BKE_sequence_test_overlap(seqbase, seq)) {
BKE_sequence_base_shuffle(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
}
BKE_sequencer_sort(scene);
}
/* 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)
{
Scene *scene = (Scene *)ptr->id.data;
do_sequence_frame_change_update(scene, (Sequence *)ptr->data);
rna_Sequence_update(bmain, scene, ptr);
}
static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
BKE_sequence_translate(scene, seq, value - seq->start);
do_sequence_frame_change_update(scene, seq);
}
static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
BKE_sequence_tx_set_final_left(seq, value);
BKE_sequence_single_fix(seq);
do_sequence_frame_change_update(scene, seq);
}
static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
BKE_sequence_tx_set_final_right(seq, value);
BKE_sequence_single_fix(seq);
do_sequence_frame_change_update(scene, seq);
}
static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs);
BKE_sequence_reload_new_file(scene, seq, false);
do_sequence_frame_change_update(scene, seq);
}
static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs);
BKE_sequence_reload_new_file(scene, seq, false);
do_sequence_frame_change_update(scene, seq);
}
static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
BKE_sequence_tx_set_final_right(seq, seq->start + value);
do_sequence_frame_change_update(scene, seq);
}
static int rna_Sequence_frame_length_get(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
return BKE_sequence_tx_get_final_right(seq, false) - BKE_sequence_tx_get_final_left(seq, false);
}
static int rna_Sequence_frame_editable(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
/* Effect sequences' start frame and length must be readonly! */
return (BKE_sequence_effect_get_num_inputs(seq->type)) ? 0 : PROP_EDITABLE;
}
static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq);
/* check channel increment or decrement */
const int channel_delta = (value >= seq->machine) ? 1 : -1;
seq->machine = value;
if (BKE_sequence_test_overlap(seqbase, seq)) {
/* XXX - BROKEN!, uses context seqbasep */
BKE_sequence_base_shuffle_ex(seqbase, seq, scene, channel_delta);
}
BKE_sequencer_sort(scene);
}
static void rna_Sequence_frame_offset_range(PointerRNA *ptr, int *min, int *max,
int *UNUSED(softmin), int *UNUSED(softmax))
{
Sequence *seq = (Sequence *)ptr->data;
*min = ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD) ? 0 : INT_MIN;
*max = INT_MAX;
}
static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
BKE_sequencer_proxy_set(seq, value != 0);
}
static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
if (value) {
seq->flag |= SEQ_USE_TRANSFORM;
if (seq->strip->transform == NULL) {
seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
}
}
else {
seq->flag ^= SEQ_USE_TRANSFORM;
}
}
static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
if (value) {
seq->flag |= SEQ_USE_CROP;
if (seq->strip->crop == NULL) {
seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
}
}
else {
seq->flag ^= SEQ_USE_CROP;
}
}
static int transform_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->strip && seq->strip->transform == data->data) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_transform(Editing *ed, StripTransform *transform)
{
SequenceSearchData data;
data.seq = NULL;
data.data = transform;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, transform_seq_cmp_cb, &data);
return data.seq;
}
static char *rna_SequenceTransform_path(PointerRNA *ptr)
{
Scene *scene = ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_transform(ed, ptr->data);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform", name_esc);
}
else {
return BLI_strdup("");
}
}
static void rna_SequenceTransform_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_transform(ed, ptr->data);
BKE_sequence_invalidate_cache(scene, seq);
}
static int crop_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->strip && seq->strip->crop == data->data) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_crop(Editing *ed, StripCrop *crop)
{
SequenceSearchData data;
data.seq = NULL;
data.data = crop;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, crop_seq_cmp_cb, &data);
return data.seq;
}
static char *rna_SequenceCrop_path(PointerRNA *ptr)
{
Scene *scene = ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_crop(ed, ptr->data);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop", name_esc);
}
else {
return BLI_strdup("");
}
}
static void rna_SequenceCrop_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_crop(ed, ptr->data);
BKE_sequence_invalidate_cache(scene, seq);
}
/* name functions that ignore the first two characters */
static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
BLI_strncpy(value, seq->name + 2, sizeof(seq->name) - 2);
}
static int rna_Sequence_name_length(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
return strlen(seq->name + 2);
}
static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
{
2012-05-10 15:22:29 +00:00
Scene *scene = (Scene *)ptr->id.data;
Sequence *seq = (Sequence *)ptr->data;
char oldname[sizeof(seq->name)];
AnimData *adt;
/* make a copy of the old name first */
2012-05-10 15:22:29 +00:00
BLI_strncpy(oldname, seq->name + 2, sizeof(seq->name) - 2);
/* copy the new name into the name slot */
2012-05-10 15:22:29 +00:00
BLI_strncpy_utf8(seq->name + 2, value, sizeof(seq->name) - 2);
/* make sure the name is unique */
BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq);
/* fix all the animation data which may link to this */
2012-03-18 07:38:51 +00:00
/* don't rename everywhere because these are per scene */
2015-04-04 15:13:56 +11:00
/* BKE_animdata_fix_paths_rename_all(NULL, "sequence_editor.sequences_all", oldname, seq->name + 2); */
adt = BKE_animdata_from_id(&scene->id);
if (adt)
2012-05-10 15:22:29 +00:00
BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, "sequence_editor.sequences_all", oldname, seq->name + 2, 0, 0, 1);
}
2012-05-10 15:22:29 +00:00
static StructRNA *rna_Sequence_refine(struct PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
switch (seq->type) {
case SEQ_TYPE_IMAGE:
return &RNA_ImageSequence;
case SEQ_TYPE_META:
return &RNA_MetaSequence;
case SEQ_TYPE_SCENE:
return &RNA_SceneSequence;
case SEQ_TYPE_MOVIE:
return &RNA_MovieSequence;
case SEQ_TYPE_MOVIECLIP:
return &RNA_MovieClipSequence;
2012-06-07 18:24:36 +00:00
case SEQ_TYPE_MASK:
return &RNA_MaskSequence;
case SEQ_TYPE_SOUND_RAM:
return &RNA_SoundSequence;
case SEQ_TYPE_CROSS:
return &RNA_CrossSequence;
case SEQ_TYPE_ADD:
return &RNA_AddSequence;
case SEQ_TYPE_SUB:
return &RNA_SubtractSequence;
case SEQ_TYPE_ALPHAOVER:
return &RNA_AlphaOverSequence;
case SEQ_TYPE_ALPHAUNDER:
return &RNA_AlphaUnderSequence;
case SEQ_TYPE_GAMCROSS:
return &RNA_GammaCrossSequence;
case SEQ_TYPE_MUL:
return &RNA_MultiplySequence;
case SEQ_TYPE_OVERDROP:
return &RNA_OverDropSequence;
case SEQ_TYPE_MULTICAM:
return &RNA_MulticamSequence;
case SEQ_TYPE_ADJUSTMENT:
return &RNA_AdjustmentSequence;
case SEQ_TYPE_WIPE:
return &RNA_WipeSequence;
case SEQ_TYPE_GLOW:
return &RNA_GlowSequence;
case SEQ_TYPE_TRANSFORM:
return &RNA_TransformSequence;
case SEQ_TYPE_COLOR:
return &RNA_ColorSequence;
case SEQ_TYPE_SPEED:
return &RNA_SpeedControlSequence;
case SEQ_TYPE_GAUSSIAN_BLUR:
return &RNA_GaussianBlurSequence;
case SEQ_TYPE_TEXT:
return &RNA_TextSequence;
default:
return &RNA_Sequence;
}
}
static char *rna_Sequence_path(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)ptr->data;
/* sequencer data comes from scene...
* TODO: would be nice to make SequenceEditor data a data-block of its own (for shorter paths)
*/
if (seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", name_esc);
}
else {
return BLI_strdup("");
}
}
static IDProperty *rna_Sequence_idprops(PointerRNA *ptr, bool create)
{
Sequence *seq = ptr->data;
if (create && !seq->prop) {
IDPropertyTemplate val = {0};
seq->prop = IDP_New(IDP_GROUP, &val, "Sequence ID properties");
}
return seq->prop;
}
static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal = &iter->internal.listbase;
2012-05-10 15:22:29 +00:00
MetaStack *ms = (MetaStack *)internal->link;
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
/* TODO, expose seq path setting as a higher level sequencer BKE function */
static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
if (seq->type == SEQ_TYPE_SOUND_RAM && seq->sound) {
/* for sound strips we need to update the sound as well.
* arguably, this could load in a new sound rather than modify an existing one.
* but while using the sequencer its most likely your not using the sound in the game engine too.
*/
PointerRNA id_ptr;
RNA_id_pointer_create((ID *)seq->sound, &id_ptr);
RNA_string_set(&id_ptr, "filepath", value);
BKE_sound_load(G.main, seq->sound);
BKE_sound_update_scene_sound(seq->scene_sound, seq->sound);
}
BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
sizeof(seq->strip->stripdata->name));
}
static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
BLI_join_dirfile(value, FILE_MAX, seq->strip->dir, seq->strip->stripdata->name);
}
static int rna_Sequence_filepath_length(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
return strlen(path);
}
static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
{
2012-05-10 15:22:29 +00:00
StripProxy *proxy = (StripProxy *)(ptr->data);
BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file));
if (proxy->anim) {
IMB_free_anim(proxy->anim);
proxy->anim = NULL;
}
}
static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
{
2012-05-10 15:22:29 +00:00
StripProxy *proxy = (StripProxy *)(ptr->data);
BLI_join_dirfile(value, FILE_MAX, proxy->dir, proxy->file);
}
static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
StripProxy *proxy = (StripProxy *)(ptr->data);
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file);
return strlen(path);
}
static void rna_Sequence_volume_set(PointerRNA *ptr, float value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
seq->volume = value;
if (seq->scene_sound)
BKE_sound_set_scene_sound_volume(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0);
}
static void rna_Sequence_pitch_set(PointerRNA *ptr, float value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
seq->pitch = value;
if (seq->scene_sound)
BKE_sound_set_scene_sound_pitch(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0);
}
static void rna_Sequence_pan_set(PointerRNA *ptr, float value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
seq->pan = value;
if (seq->scene_sound)
BKE_sound_set_scene_sound_pan(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0);
}
static int rna_Sequence_input_count_get(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
return BKE_sequence_effect_get_num_inputs(seq->type);
}
2012-05-10 15:22:29 +00:00
#if 0
static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
Sequence *seq = (Sequence *)(ptr->data);
BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
sizeof(seq->strip->stripdata->name));
}
static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
{
StripElem *elem = (StripElem *)(ptr->data);
BLI_split_file_part(value, elem->name, sizeof(elem->name));
2012-05-10 15:22:29 +00:00
}
#endif
static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
if (RNA_struct_is_a(ptr->type, &RNA_SoundSequence))
BKE_sequencer_update_sound_bounds(scene, ptr->data);
}
static void rna_Sequence_mute_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
BKE_sequencer_update_muting(ed);
rna_Sequence_update(bmain, scene, ptr);
}
static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
BKE_sequence_reload_new_file(scene, seq, true);
BKE_sequence_calc(scene, seq);
rna_Sequence_update(bmain, scene, ptr);
}
static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->strip && seq->strip->proxy == data->data) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_proxy(Editing *ed, StripProxy *proxy)
{
SequenceSearchData data;
data.seq = NULL;
data.data = proxy;
BKE_sequencer_base_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data);
return data.seq;
}
static void rna_Sequence_tcindex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_proxy(ed, ptr->data);
BKE_sequence_reload_new_file(scene, seq, false);
do_sequence_frame_change_update(scene, seq);
}
static void rna_SequenceProxy_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_proxy(ed, ptr->data);
BKE_sequence_invalidate_cache(scene, seq);
}
/* do_versions? */
static float rna_Sequence_opacity_get(PointerRNA *ptr)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
return seq->blend_opacity / 100.0f;
}
static void rna_Sequence_opacity_set(PointerRNA *ptr, float value)
{
2012-05-10 15:22:29 +00:00
Sequence *seq = (Sequence *)(ptr->data);
CLAMP(value, 0.0f, 1.0f);
seq->blend_opacity = value * 100.0f;
}
static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->modifiers.first) {
SequenceModifierData *smd = seq->modifiers.first;
for (smd = seq->modifiers.first; smd; smd = smd->next) {
if (smd->type == seqModifierType_ColorBalance) {
ColorBalanceModifierData *cbmd = (ColorBalanceModifierData *) smd;
if (&cbmd->color_balance == data->data) {
data->seq = seq;
data->smd = smd;
return -1; /* done so bail out */
}
}
}
}
return 1;
}
static Sequence *sequence_get_by_colorbalance(Editing *ed, StripColorBalance *cb, SequenceModifierData **r_smd)
{
SequenceSearchData data;
data.seq = NULL;
data.smd = NULL;
data.data = cb;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, colbalance_seq_cmp_cb, &data);
*r_smd = data.smd;
return data.seq;
}
static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
{
Scene *scene = ptr->id.data;
SequenceModifierData *smd;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
if (!smd) {
/* path to old filter color balance */
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", name_esc);
}
else {
/* path to modifier */
char name_esc_smd[sizeof(smd->name) * 2];
BLI_strescape(name_esc_smd, smd->name, sizeof(name_esc_smd));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].modifiers[\"%s\"].color_balance",
name_esc, name_esc_smd);
}
}
else
return BLI_strdup("");
}
static void rna_SequenceColorBalance_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
SequenceModifierData *smd;
Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
if (smd == NULL)
BKE_sequence_invalidate_cache(scene, seq);
else
BKE_sequence_invalidate_cache_for_modifier(scene, seq);
}
static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value)
{
Scene *scene = ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed == NULL)
return;
/* convert from abs to relative and back */
if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) == 0 && value) {
ed->over_cfra = scene->r.cfra + ed->over_ofs;
ed->over_flag |= SEQ_EDIT_OVERLAY_ABS;
}
else if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) {
ed->over_ofs = ed->over_cfra - scene->r.cfra;
ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS;
}
}
static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed == NULL)
return scene->r.cfra;
if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
return ed->over_cfra - scene->r.cfra;
else
return ed->over_ofs;
}
static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
{
Scene *scene = (Scene *)ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed == NULL)
return;
if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
ed->over_cfra = (scene->r.cfra + value);
else
ed->over_ofs = value;
}
static int modifier_seq_cmp_cb(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (BLI_findindex(&seq->modifiers, data->data) != -1) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_modifier(Editing *ed, SequenceModifierData *smd)
{
SequenceSearchData data;
data.seq = NULL;
data.data = smd;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, modifier_seq_cmp_cb, &data);
return data.seq;
}
static StructRNA *rna_SequenceModifier_refine(struct PointerRNA *ptr)
{
SequenceModifierData *smd = (SequenceModifierData *) ptr->data;
switch (smd->type) {
case seqModifierType_ColorBalance:
return &RNA_ColorBalanceModifier;
case seqModifierType_Curves:
return &RNA_CurvesModifier;
case seqModifierType_HueCorrect:
return &RNA_HueCorrectModifier;
case seqModifierType_BrightContrast:
return &RNA_BrightContrastModifier;
case seqModifierType_WhiteBalance:
return &RNA_WhiteBalanceModifier;
default:
return &RNA_SequenceModifier;
}
}
static char *rna_SequenceModifier_path(PointerRNA *ptr)
{
Scene *scene = ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
SequenceModifierData *smd = ptr->data;
Sequence *seq = sequence_get_by_modifier(ed, smd);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
char name_esc_smd[sizeof(smd->name) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
BLI_strescape(name_esc_smd, smd->name, sizeof(name_esc_smd));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].modifiers[\"%s\"]",
name_esc, name_esc_smd);
}
else {
return BLI_strdup("");
}
}
static void rna_SequenceModifier_name_set(PointerRNA *ptr, const char *value)
{
SequenceModifierData *smd = ptr->data;
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_modifier(ed, smd);
AnimData *adt;
char oldname[sizeof(smd->name)];
/* make a copy of the old name first */
BLI_strncpy(oldname, smd->name, sizeof(smd->name));
/* copy the new name into the name slot */
BLI_strncpy_utf8(smd->name, value, sizeof(smd->name));
/* make sure the name is truly unique */
BKE_sequence_modifier_unique_name(seq, smd);
/* fix all the animation data which may link to this */
adt = BKE_animdata_from_id(&scene->id);
if (adt) {
char path[1024];
BLI_snprintf(path, sizeof(path), "sequence_editor.sequences_all[\"%s\"].modifiers", seq->name + 2);
BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, path, oldname, smd->name, 0, 0, 1);
}
}
static void rna_SequenceModifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
/* strip from other scenes could be modified, so using active scene is not reliable */
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_modifier(ed, ptr->data);
BKE_sequence_invalidate_cache_for_modifier(scene, seq);
}
static int rna_SequenceModifier_otherSequence_poll(PointerRNA *ptr, PointerRNA value)
{
Scene *scene = (Scene *) ptr->id.data;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_modifier(ed, ptr->data);
Sequence *cur = (Sequence *) value.data;
if (seq == cur)
return false;
return true;
}
static SequenceModifierData *rna_Sequence_modifier_new(Sequence *seq, bContext *C, ReportList *reports, const char *name, int type)
{
if (!BKE_sequence_supports_modifiers(seq)) {
BKE_report(reports, RPT_ERROR, "Sequence type does not support modifiers");
return NULL;
}
else {
Scene *scene = CTX_data_scene(C);
SequenceModifierData *smd;
smd = BKE_sequence_modifier_new(seq, name, type, scene);
BKE_sequence_invalidate_cache_for_modifier(scene, seq);
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
return smd;
}
}
static void rna_Sequence_modifier_remove(Sequence *seq, bContext *C, ReportList *reports, PointerRNA *smd_ptr)
{
SequenceModifierData *smd = smd_ptr->data;
Scene *scene = CTX_data_scene(C);
if (BKE_sequence_modifier_remove(seq, smd) == false) {
BKE_report(reports, RPT_ERROR, "Modifier was not found in the stack");
return;
}
RNA_POINTER_INVALIDATE(smd_ptr);
BKE_sequence_invalidate_cache_for_modifier(scene, seq);
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
}
static void rna_Sequence_modifier_clear(Sequence *seq, bContext *C)
{
Scene *scene = CTX_data_scene(C);
BKE_sequence_modifier_clear(seq);
BKE_sequence_invalidate_cache_for_modifier(scene, seq);
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
}
#else
static void rna_def_strip_element(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceElement", NULL);
RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame");
RNA_def_struct_sdna(srna, "StripElem");
prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceElement_update");
prop = RNA_def_property(srna, "orig_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orig_width");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Orig Width", "Original image width");
prop = RNA_def_property(srna, "orig_height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orig_height");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Orig Height", "Original image height");
}
static void rna_def_strip_crop(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceCrop", NULL);
RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripCrop");
prop = RNA_def_property(srna, "max_y", PROP_INT, PROP_UNSIGNED);
2010-08-21 04:51:00 +00:00
RNA_def_property_int_sdna(prop, NULL, "top");
RNA_def_property_ui_text(prop, "Top", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
prop = RNA_def_property(srna, "min_y", PROP_INT, PROP_UNSIGNED);
2010-08-21 04:51:00 +00:00
RNA_def_property_int_sdna(prop, NULL, "bottom");
RNA_def_property_ui_text(prop, "Bottom", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_UNSIGNED);
2010-08-21 04:51:00 +00:00
RNA_def_property_int_sdna(prop, NULL, "left");
RNA_def_property_ui_text(prop, "Left", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
prop = RNA_def_property(srna, "max_x", PROP_INT, PROP_UNSIGNED);
2010-08-21 04:51:00 +00:00
RNA_def_property_int_sdna(prop, NULL, "right");
RNA_def_property_ui_text(prop, "Right", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
RNA_def_struct_path_func(srna, "rna_SequenceCrop_path");
}
static void rna_def_strip_transform(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceTransform", NULL);
RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripTransform");
prop = RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xofs");
2010-03-21 14:46:43 +00:00
RNA_def_property_ui_text(prop, "Offset X", "");
RNA_def_property_ui_range(prop, -4096, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
prop = RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yofs");
RNA_def_property_ui_text(prop, "Offset Y", "");
RNA_def_property_ui_range(prop, -4096, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
RNA_def_struct_path_func(srna, "rna_SequenceTransform_path");
}
static void rna_def_strip_proxy(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem seq_tc_items[] = {
{SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""},
{SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run",
"Use images in the order as they are recorded"},
{SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run",
"Use global timestamp written by recording device"},
{SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)",
"Interpolate a global timestamp using the "
"record date and time written by recording device"},
{SEQ_PROXY_TC_RECORD_RUN_NO_GAPS, "RECORD_RUN_NO_GAPS", 0, "Record Run No Gaps",
"Like record run, but ignore timecode, "
"changes in framerate or dropouts"},
2012-05-10 15:22:29 +00:00
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "SequenceProxy", NULL);
RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripProxy");
prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir");
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file");
RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length",
"rna_Sequence_proxy_filepath_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "build_flags", SEQ_PROXY_SKIP_EXISTING);
2015-02-03 20:25:14 +01:00
RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing proxy files when building");
prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25);
RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution");
prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50);
RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution");
prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75);
RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution");
prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100);
RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution");
prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN);
RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
prop = RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN);
RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
prop = RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN);
RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "quality");
RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build");
RNA_def_property_ui_range(prop, 1, 100, 1, -1);
prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tc");
RNA_def_property_enum_items(prop, seq_tc_items);
RNA_def_property_ui_text(prop, "Timecode", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_tcindex_update");
prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_DIR);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_FILE);
RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_color_balance(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceColorBalanceData", NULL);
RNA_def_struct_ui_text(srna, "Sequence Color Balance Data", "Color balance parameters for a sequence strip and it's modifiers");
RNA_def_struct_sdna(srna, "StripColorBalance");
Fix T39228 Gamma/lift/gain are burned out in the circular color pickers and value/lightness slider stops midway. Issue here is manyfold: Color wheel does not support properties with different soft min/max values than 1.0 (which after experimenting a little I left as is), and also color management is completely destroying the mapping between the value slider and the RNA property value range. To solve this I have disabled color management by setting the property to gamma corrected (only in RNA, Sequence editor coders please check!), otherwise it will just become a big mess of tracking where color comes from and what kind of color transforms it needs in different color pickers (if property has non normalized range etc). HSL is not really meant to represent colors outside a normalized space so I have disabled setting lightness above 1.0 in this model. This will work, however it is hacking a color picker to do something other than what it is supposed to do: pick a color from the screen accurately. Which means normalized values always. The non normalized colors picked for lift/gain/gamma through the pickers do not correspond to any accurate colors; they are rather a user friendly way to 'sort of' choose a color and a gamma with an indication of maximum value. I think that lift/gamma/gain nodes need a dedicated widget for this (besides it is quite clear that some options are written for that use case) -or- a separate gamma multiplier for the picked color (which should itself be in a normalized space)
2014-03-18 01:08:24 +02:00
prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
Fix T39228 Gamma/lift/gain are burned out in the circular color pickers and value/lightness slider stops midway. Issue here is manyfold: Color wheel does not support properties with different soft min/max values than 1.0 (which after experimenting a little I left as is), and also color management is completely destroying the mapping between the value slider and the RNA property value range. To solve this I have disabled color management by setting the property to gamma corrected (only in RNA, Sequence editor coders please check!), otherwise it will just become a big mess of tracking where color comes from and what kind of color transforms it needs in different color pickers (if property has non normalized range etc). HSL is not really meant to represent colors outside a normalized space so I have disabled setting lightness above 1.0 in this model. This will work, however it is hacking a color picker to do something other than what it is supposed to do: pick a color from the screen accurately. Which means normalized values always. The non normalized colors picked for lift/gain/gamma through the pickers do not correspond to any accurate colors; they are rather a user friendly way to 'sort of' choose a color and a gamma with an indication of maximum value. I think that lift/gamma/gain nodes need a dedicated widget for this (besides it is quite clear that some options are written for that use case) -or- a separate gamma multiplier for the picked color (which should itself be in a normalized space)
2014-03-18 01:08:24 +02:00
prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
Fix T39228 Gamma/lift/gain are burned out in the circular color pickers and value/lightness slider stops midway. Issue here is manyfold: Color wheel does not support properties with different soft min/max values than 1.0 (which after experimenting a little I left as is), and also color management is completely destroying the mapping between the value slider and the RNA property value range. To solve this I have disabled color management by setting the property to gamma corrected (only in RNA, Sequence editor coders please check!), otherwise it will just become a big mess of tracking where color comes from and what kind of color transforms it needs in different color pickers (if property has non normalized range etc). HSL is not really meant to represent colors outside a normalized space so I have disabled setting lightness above 1.0 in this model. This will work, however it is hacking a color picker to do something other than what it is supposed to do: pick a color from the screen accurately. Which means normalized values always. The non normalized colors picked for lift/gain/gamma through the pickers do not correspond to any accurate colors; they are rather a user friendly way to 'sort of' choose a color and a gamma with an indication of maximum value. I think that lift/gamma/gain nodes need a dedicated widget for this (besides it is quite clear that some options are written for that use case) -or- a separate gamma multiplier for the picked color (which should itself be in a normalized space)
2014-03-18 01:08:24 +02:00
prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
RNA_def_property_ui_text(prop, "Inverse Gain", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
RNA_def_property_ui_text(prop, "Inverse Gamma", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
RNA_def_property_ui_text(prop, "Inverse Lift", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
2012-05-10 15:22:29 +00:00
/* not yet used */
#if 0
prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Exposure", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Saturation", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
2012-05-10 15:22:29 +00:00
#endif
RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path");
}
static void rna_def_strip_color_balance(BlenderRNA *brna)
{
StructRNA *srna;
srna = RNA_def_struct(brna, "SequenceColorBalance", "SequenceColorBalanceData");
RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripColorBalance");
}
static EnumPropertyItem blend_mode_items[] = {
{SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
{SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
{SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
{SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
{SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
{SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
{SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
{SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
{SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
{0, NULL, 0, NULL, NULL}
};
static void rna_def_sequence_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "SequenceModifiers");
srna = RNA_def_struct(brna, "SequenceModifiers", NULL);
RNA_def_struct_sdna(srna, "Sequence");
RNA_def_struct_ui_text(srna, "Strip Modifiers", "Collection of strip modifiers");
/* add modifier */
func = RNA_def_function(srna, "new", "rna_Sequence_modifier_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new modifier");
parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the modifier");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* modifier to add */
parm = RNA_def_enum(func, "type", rna_enum_sequence_modifier_type_items, seqModifierType_ColorBalance, "", "Modifier type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Newly created modifier");
RNA_def_function_return(func, parm);
/* remove modifier */
func = RNA_def_function(srna, "remove", "rna_Sequence_modifier_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an existing modifier from the sequence");
/* modifier to remove */
parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Modifier to remove");
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
/* clear all modifiers */
func = RNA_def_function(srna, "clear", "rna_Sequence_modifier_clear");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Remove all modifiers from the sequence");
}
static void rna_def_sequence(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem seq_type_items[] = {
{SEQ_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
{SEQ_TYPE_META, "META", 0, "Meta", ""},
{SEQ_TYPE_SCENE, "SCENE", 0, "Scene", ""},
{SEQ_TYPE_MOVIE, "MOVIE", 0, "Movie", ""},
{SEQ_TYPE_MOVIECLIP, "MOVIECLIP", 0, "Clip", ""},
2012-06-07 18:24:36 +00:00
{SEQ_TYPE_MASK, "MASK", 0, "Mask", ""},
{SEQ_TYPE_SOUND_RAM, "SOUND", 0, "Sound", ""},
{SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
{SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
{SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
{SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
{SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
{SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
{SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
{SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
{SEQ_TYPE_WIPE, "WIPE", 0, "Wipe", ""},
{SEQ_TYPE_GLOW, "GLOW", 0, "Glow", ""},
{SEQ_TYPE_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
{SEQ_TYPE_COLOR, "COLOR", 0, "Color", ""},
{SEQ_TYPE_SPEED, "SPEED", 0, "Speed", ""},
{SEQ_TYPE_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
{SEQ_TYPE_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
{SEQ_TYPE_GAUSSIAN_BLUR, "GAUSSIAN_BLUR", 0, "Gaussian Blur", ""},
{SEQ_TYPE_TEXT, "TEXT", 0, "Text", ""},
2012-05-10 15:22:29 +00:00
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Sequence", NULL);
RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor");
RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
RNA_def_struct_path_func(srna, "rna_Sequence_path");
RNA_def_struct_idprops_func(srna, "rna_Sequence_idprops");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
2012-05-10 15:22:29 +00:00
RNA_def_property_string_maxlength(prop, sizeof(((Sequence *)NULL)->name) - 2);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, seq_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
/* flags */
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
Apply first pass of edits to rna values from rna_booleans.txt. These are not animated and are best not change names like this too late in the release. ActionGroup.selected -> select: boolean Action Group is selected BezierSplinePoint.hidden -> hide: boolean Visibility status BezierSplinePoint.selected_control_point -> select_control_point: boolean Control point selection status BezierSplinePoint.selected_handle1 -> select_left_handle: boolean Handle 1 selection status BezierSplinePoint.selected_handle2 -> select_right_handle: boolean Handle 2 selection status Bone.restrict_select -> hide_select: boolean Bone is able to be selected Bone.selected -> select: boolean CurveMapPoint.selected -> select: boolean Selection state of the curve point EditBone.restrict_select -> hide_select: boolean Bone is able to be selected EditBone.selected -> select: boolean EditBone.selected_head -> select_head: boolean EditBone.selected_tail -> select_tail: boolean EditBone.locked -> lock: boolean Bone is not able to be transformed when in Edit Mode EditBone.hidden -> hide: boolean Bone is not visible when in Edit Mode NEGATE * FCurve.disabled -> enabled: boolean F-Curve could not be evaluated in past, so should be skipped when evaluating FCurve.locked -> lock: boolean F-Curve's settings cannot be edited FCurve.muted -> mute: boolean F-Curve is not evaluated FCurve.selected -> select: boolean F-Curve is selected for editing NEGATE * FCurve.visible -> hide: boolean F-Curve and its keyframes are shown in the Graph Editor graphs FCurveSample.selected -> select: boolean Selection status GPencilFrame.selected -> select: boolean Frame is selected for editing in the DopeSheet GPencilLayer.locked -> lock: boolean Protect layer from further editing and/or frame changes GPencilLayer.selected -> select: boolean Layer is selected for editing in the DopeSheet Keyframe.selected -> select: boolean Control point selection status Keyframe.selected_handle1 -> select_left_handle: boolean Handle 1 selection status Keyframe.selected_handle2 -> select_right_handle: boolean Handle 2 selection status MeshEdge.selected -> select: boolean MeshEdge.hidden -> hide: boolean MeshFace.hidden -> hide: boolean MeshFace.selected -> select: boolean MeshVertex.hidden -> hide: boolean MeshVertex.selected -> select: boolean MotionPathVert.selected -> select: boolean Path point is selected for editing NlaStrip.selected -> select: boolean NLA Strip is selected NlaTrack.locked -> lock: boolean NLA Track is locked NlaTrack.muted -> mute: boolean NLA Track is not evaluated NlaTrack.selected -> select: boolean NLA Track is selected Object.restrict_render -> hide_render: boolean Restrict renderability Object.restrict_select -> hide_select: boolean Restrict selection in the viewport Object.restrict_view -> hide: boolean Restrict visibility in the viewport Object.selected -> select: boolean Object selection state ObjectBase.selected -> select: boolean Object base selection state PoseBone.selected -> select: boolean Sequence.right_handle_selected -> select_right_handle: boolean Sequence.selected -> select: boolean SplinePoint.selected -> select_control_point: boolean Selection status TimelineMarker.selected -> select: boolean Marker selection state Sequence.left_handle_selected -> select_left_handle: boolean ActionGroup.locked -> lock: boolean Action Group is locked Bone.hidden -> hide: boolean Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes) SplinePoint.hidden -> hide: boolean Visibility status FModifier.muted -> mute: boolean F-Curve Modifier will not be evaluated note: rebaned uv_select to select_uv
2010-07-15 16:56:04 +00:00
RNA_def_property_ui_text(prop, "Select", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
RNA_def_property_ui_text(prop, "Left Handle Selected", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
RNA_def_property_ui_text(prop, "Right Handle Selected", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, true);
RNA_def_property_ui_text(prop, "Mute", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_mute_update");
prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
/* strip positioning */
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);
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied");
2012-04-29 15:47:02 +00:00
RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set", NULL);
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "len");
2012-05-10 15:22:29 +00:00
RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(prop, "Length",
"The length of the contents of this strip before the handles are applied");
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "");
2012-04-29 15:47:02 +00:00
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set", NULL); /* overlap tests and calc_seq_disp */
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startdisp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame",
"Start frame displayed in the sequence editor after offsets are applied, setting this is "
"equivalent to moving the handle, not the actual start frame");
2012-05-10 15:22:29 +00:00
/* overlap tests and calc_seq_disp */
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL);
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "enddisp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "End Frame",
"End frame displayed in the sequence editor after offsets are applied");
2012-05-10 15:22:29 +00:00
/* overlap tests and calc_seq_disp */
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL);
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
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_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_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startstill");
// 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_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endstill");
// 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_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "machine");
RNA_def_property_range(prop, 1, MAXSEQ);
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip");
2012-04-29 15:47:02 +00:00
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set", NULL); /* overlap test */
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
Color Management, Stage 2: Switch color pipeline to use OpenColorIO Replace old color pipeline which was supporting linear/sRGB color spaces only with OpenColorIO-based pipeline. This introduces two configurable color spaces: - Input color space for images and movie clips. This space is used to convert images/movies from color space in which file is saved to Blender's linear space (for float images, byte images are not internally converted, only input space is stored for such images and used later). This setting could be found in image/clip data block settings. - Display color space which defines space in which particular display is working. This settings could be found in scene's Color Management panel. When render result is being displayed on the screen, apart from converting image to display space, some additional conversions could happen. This conversions are: - View, which defines tone curve applying before display transformation. These are different ways to view the image on the same display device. For example it could be used to emulate film view on sRGB display. - Exposure affects on image exposure before tone map is applied. - Gamma is post-display gamma correction, could be used to match particular display gamma. - RGB curves are user-defined curves which are applying before display transformation, could be used for different purposes. All this settings by default are only applying on render result and does not affect on other images. If some particular image needs to be affected by this transformation, "View as Render" setting of image data block should be set to truth. Movie clips are always affected by all display transformations. This commit also introduces configurable color space in which sequencer is working. This setting could be found in scene's Color Management panel and it should be used if such stuff as grading needs to be done in color space different from sRGB (i.e. when Film view on sRGB display is use, using VD16 space as sequencer's internal space would make grading working in space which is close to the space using for display). Some technical notes: - Image buffer's float buffer is now always in linear space, even if it was created from 16bit byte images. - Space of byte buffer is stored in image buffer's rect_colorspace property. - Profile of image buffer was removed since it's not longer meaningful. - OpenGL and GLSL is supposed to always work in sRGB space. It is possible to support other spaces, but it's quite large project which isn't so much important. - Legacy Color Management option disabled is emulated by using None display. It could have some regressions, but there's no clear way to avoid them. - If OpenColorIO is disabled on build time, it should make blender behaving in the same way as previous release with color management enabled. More details could be found at this page (more details would be added soon): http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management -- Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO integration and to Brecht van Lommel for some further development and code/ usecase review!
2012-09-15 10:05:07 +00:00
prop = RNA_def_property(srna, "use_linear_modifiers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_LINEAR_MODIFIERS);
RNA_def_property_ui_text(prop, "Use Linear Modifiers", "Calculate modifiers in linear space instead of sequencer's space");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
/* blending */
prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blend_mode");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Blend Opacity", "");
2012-05-10 15:22:29 +00:00
/* stupid 0-100 -> 0-1 */
RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_float_sdna(prop, NULL, "effect_fader");
RNA_def_property_ui_text(prop, "Effect fader position", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
RNA_def_property_ui_text(prop, "Use Default Fade",
"Fade effect using the built-in default (usually make transition as long as "
"effect strip)");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_fader");
RNA_def_property_ui_text(prop, "Speed factor",
"Multiply the current speed of the sequence with this number or remap current frame "
"to this frame");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
/* modifiers */
prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "SequenceModifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting this strip");
rna_def_sequence_modifiers(brna, prop);
2010-06-21 22:05:34 +00:00
RNA_api_sequence_strip(srna);
}
static void rna_def_editor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem editing_storage_items[] = {
{0, "PER_STRIP", 0, "Per Strip", "Store proxies using per strip settings"},
{SEQ_EDIT_PROXY_DIR_STORAGE, "PROJECT", 0, "Project", "Store proxies using project directory"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "SequenceEditor", NULL);
RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene data-block");
RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
RNA_def_struct_sdna(srna, "Editing");
prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Sequences", "Top-level strips only");
RNA_api_sequences(brna, prop);
prop = RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "All Sequences", "All strips, recursively including those inside metastrips");
RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin",
"rna_SequenceEditor_sequences_all_next", NULL, NULL, NULL, NULL, NULL, NULL);
prop = RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip");
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get",
NULL, NULL, NULL, NULL);
prop = RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip");
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");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
prop = RNA_def_property(srna, "use_overlay_lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS);
RNA_def_property_ui_text(prop, "Overlay Lock", "");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
/* 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_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get",
"rna_SequenceEditor_overlay_frame_set", NULL);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
prop = RNA_def_property(srna, "proxy_storage", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, editing_storage_items);
RNA_def_property_ui_text(prop, "Proxy Storage", "How to store proxies for this project");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
prop = RNA_def_property(srna, "proxy_dir", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "proxy_dir");
RNA_def_property_ui_text(prop, "Proxy Directory", "");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
}
static void rna_def_filter_video(StructRNA *srna)
{
PropertyRNA *prop;
Alpha premul pipeline cleanup This assumptions are now made: - Internally float buffers are always linear alpha-premul colors - Readers should worry about delivering float buffers with that assumptions. - There's an input image setting to say whether it's stored with straight/premul alpha on the disk. - Byte buffers are now assumed have straight alpha, readers should deliver straight alpha. Some implementation details: - Removed scene's color unpremultiply setting, which was very much confusing and was wrong for default settings. Now all renderers assumes to deliver premultiplied alpha. - IMB_buffer_byte_from_float will now linearize alpha when converting from buffer. - Sequencer's effects were changed to assume bytes have got straight alpha. Most of effects will work with bytes still, however for glow it was more tricky to avoid data loss, so there's a commented out glow implementation which converts byte buffer to floats first, operates on floats and returns bytes back. It's slower and not sure if it should actually be used -- who're using glow on alpha anyway? - Sequencer modifiers should also be working nice with straight bytes now. - GLSL preview will predivide float textures to make nice shading, shading with byte textures worked nice (GLSL was assuming straight alpha). - Blender Internal will set alpha=1 to the whole sky. The same happens in Cycles and there's no way to avoid this -- sky is neither straight nor premul and doesn't fit color pipeline well. - Straight alpha mode for render result was also eliminated. - Conversion to correct alpha need to be done before linearizing float buffer. - TIFF will now load and save files with proper alpha mode setting in file meta data header. - Remove Use Alpha from texture mapping and replaced with image datablock setting. Behaves much more predictable and clear from code point of view and solves possible regressions when non-premultiplied images were used as textures with ignoring alpha channel.
2012-12-31 13:52:13 +00:00
static const EnumPropertyItem alpha_mode_items[] = {
{SEQ_ALPHA_STRAIGHT, "STRAIGHT", 0, "Straight", "RGB channels in transparent pixels are unaffected by the alpha channel"},
{SEQ_ALPHA_PREMUL, "PREMUL", 0, "Premultiplied", "RGB channels in transparent pixels are multiplied by the alpha channel"},
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update_reopen_files");
Alpha premul pipeline cleanup This assumptions are now made: - Internally float buffers are always linear alpha-premul colors - Readers should worry about delivering float buffers with that assumptions. - There's an input image setting to say whether it's stored with straight/premul alpha on the disk. - Byte buffers are now assumed have straight alpha, readers should deliver straight alpha. Some implementation details: - Removed scene's color unpremultiply setting, which was very much confusing and was wrong for default settings. Now all renderers assumes to deliver premultiplied alpha. - IMB_buffer_byte_from_float will now linearize alpha when converting from buffer. - Sequencer's effects were changed to assume bytes have got straight alpha. Most of effects will work with bytes still, however for glow it was more tricky to avoid data loss, so there's a commented out glow implementation which converts byte buffer to floats first, operates on floats and returns bytes back. It's slower and not sure if it should actually be used -- who're using glow on alpha anyway? - Sequencer modifiers should also be working nice with straight bytes now. - GLSL preview will predivide float textures to make nice shading, shading with byte textures worked nice (GLSL was assuming straight alpha). - Blender Internal will set alpha=1 to the whole sky. The same happens in Cycles and there's no way to avoid this -- sky is neither straight nor premul and doesn't fit color pipeline well. - Straight alpha mode for render result was also eliminated. - Conversion to correct alpha need to be done before linearizing float buffer. - TIFF will now load and save files with proper alpha mode setting in file meta data header. - Remove Use Alpha from texture mapping and replaced with image datablock setting. Behaves much more predictable and clear from code point of view and solves possible regressions when non-premultiplied images were used as textures with ignoring alpha channel.
2012-12-31 13:52:13 +00:00
prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, alpha_mode_items);
RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "mul");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Multiply Colors", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "sat");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Saturation", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
RNA_def_property_ui_text(prop, "Transform", "");
prop = RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
RNA_def_property_ui_text(prop, "Crop", "");
}
static void rna_def_proxy(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
RNA_def_property_ui_text(prop, "Proxy", "");
}
static void rna_def_input(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); /* overlap tests */
RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); /* overlap tests */
RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_effect_inputs(StructRNA *srna, int count)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "input_count", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_Sequence_input_count_get", NULL, NULL);
if (count >= 1) {
prop = RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq1");
2012-05-10 15:22:29 +00:00
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Input 1", "First input for the effect strip");
}
if (count >= 2) {
prop = RNA_def_property(srna, "input_2", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq2");
2012-05-10 15:22:29 +00:00
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Input 2", "Second input for the effect strip");
}
2012-10-04 13:26:15 +00:00
#if 0
2012-05-29 10:31:42 +00:00
if (count == 3) { // not used by any effects (perhaps one day plugins?)
prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq3");
2012-05-10 15:22:29 +00:00
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip");
}
2012-10-04 13:26:15 +00:00
#endif
}
static void rna_def_color_management(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->colorspace_settings");
RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");
}
static void rna_def_image(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "ImageSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
RNA_def_property_ui_text(prop, "Directory", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next",
"rna_iterator_array_end", "rna_iterator_array_get",
"rna_SequenceEditor_elements_length", NULL, NULL, NULL);
RNA_api_sequence_elements(brna, prop);
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
/* multiview */
prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_VIEWS);
RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "views_format");
RNA_def_property_enum_items(prop, rna_enum_views_format_items);
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Stereo3dFormat");
RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3d");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
rna_def_color_management(srna);
}
static void rna_def_meta(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Sequences", "");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
}
static void rna_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_sequence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SCENE_STRIPS);
RNA_def_property_ui_text(prop, "Use Sequence", "Use scenes sequence strips directly, instead of rendering");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_SCENE_NO_GPENCIL);
RNA_def_property_ui_text(prop, "Use Grease Pencil", "Show Grease Pencil strokes in OpenGL previews");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
}
static void rna_def_movie(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MovieSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "anim_preseek");
RNA_def_property_range(prop, 0, 50);
RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "streamindex");
RNA_def_property_range(prop, 0, 20);
RNA_def_property_ui_text(prop, "Stream Index",
"For files with several movie streams, use the stream with the given index");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update_reopen_files");
prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next",
"rna_iterator_array_end", "rna_iterator_array_get",
"rna_SequenceEditor_elements_length", NULL, NULL, NULL);
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
2012-05-10 15:22:29 +00:00
"rna_Sequence_filepath_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update");
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
/* multiview */
prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_VIEWS);
RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "views_format");
RNA_def_property_enum_items(prop, rna_enum_views_format_items);
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
RNA_def_property_ui_text(prop, "Views Format", "Mode to load movie views");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Stereo3dFormat");
RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3d");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
rna_def_color_management(srna);
}
static void rna_def_movieclip(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MovieClipSequence", "Sequence");
RNA_def_struct_ui_text(srna, "MovieClip Sequence", "Sequence strip to load a video from the clip editor");
RNA_def_struct_sdna(srna, "Sequence");
2012-06-07 18:24:36 +00:00
/* TODO - add clip property? */
prop = RNA_def_property(srna, "undistort", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_UNDISTORTED);
RNA_def_property_ui_text(prop, "Undistort Clip", "Use the undistorted version of the clip");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "stabilize2d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_STABILIZED);
RNA_def_property_ui_text(prop, "Stabilize 2D Clip", "Use the 2D stabilized version of the clip");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
rna_def_filter_video(srna);
rna_def_input(srna);
}
2012-06-07 18:24:36 +00:00
static void rna_def_mask(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MaskSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Mask Sequence", "Sequence strip to load a video from a mask");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask", "Mask that this sequence uses");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
rna_def_filter_video(srna);
rna_def_input(srna);
}
static void rna_def_sound(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Sound Sequence",
"Sequence strip defining a sound to be played over a period of time");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_ui_text(prop, "Sound", "Sound data-block used by this sequence");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND);
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND);
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pan");
RNA_def_property_range(prop, -2.0f, 2.0f);
RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)");
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
2012-05-10 15:22:29 +00:00
"rna_Sequence_filepath_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update");
prop = RNA_def_property(srna, "show_waveform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM);
RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
rna_def_input(srna);
}
static void rna_def_effect(BlenderRNA *brna)
{
StructRNA *srna;
srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Effect Sequence",
"Sequence strip applying an effect on the images created by other strips");
RNA_def_struct_sdna(srna, "Sequence");
rna_def_filter_video(srna);
rna_def_proxy(srna);
}
static void rna_def_multicam(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "multicam_source");
2012-05-10 15:22:29 +00:00
RNA_def_property_range(prop, 0, MAXSEQ - 1);
RNA_def_property_ui_text(prop, "Multicam Source Channel", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
rna_def_input(srna);
}
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", ""},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem wipe_direction_items[] = {
{0, "OUT", 0, "Out", ""},
{1, "IN", 0, "In", ""},
{0, NULL, 0, NULL, NULL}
};
RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
prop = RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "edgeWidth");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Blur Width",
"Width of the blur edge, in percentage relative to the image size");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
Cleanup: Internal degrees removal. This patch changes most of the reamining degrees usage in internal code into radians. I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them. WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly in previous versions (a few angle properties would use radians values as degrees...). Details: - Data: -- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such (using getter/setter functions), still using radians internally. -- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev. - Modifiers: -- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done. - Postprocessing: -- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done. - BGE: -- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type, it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence can be either distance or angle values, depending on the mode. Will leave this to BGE team. -- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself, as it seems this is the expected value here...). -- bRadarSensor.angle: Done. Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt Thanks to all! Differential Revision: http://developer.blender.org/D59
2013-12-03 20:09:25 +01:00
RNA_def_property_range(prop, DEG2RADF(-90.0f), DEG2RADF(90.0f));
RNA_def_property_ui_text(prop, "Angle", "Edge angle");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
Cleanup: Internal degrees removal. This patch changes most of the reamining degrees usage in internal code into radians. I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them. WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly in previous versions (a few angle properties would use radians values as degrees...). Details: - Data: -- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such (using getter/setter functions), still using radians internally. -- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev. - Modifiers: -- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done. - Postprocessing: -- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done. - BGE: -- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type, it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence can be either distance or angle values, depending on the mode. Will leave this to BGE team. -- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself, as it seems this is the expected value here...). -- bRadarSensor.angle: Done. Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt Thanks to all! Differential Revision: http://developer.blender.org/D59
2013-12-03 20:09:25 +01:00
prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "forward");
RNA_def_property_enum_items(prop, wipe_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Wipe direction");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wipetype");
RNA_def_property_enum_items(prop, wipe_type_items);
RNA_def_property_ui_text(prop, "Transition Type", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_glow(StructRNA *srna)
{
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fMini");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fClamp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fBoost");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dDist");
RNA_def_property_range(prop, 0.5f, 20.0f);
RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dQuality");
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_transform(StructRNA *srna)
{
PropertyRNA *prop;
static const EnumPropertyItem interpolation_items[] = {
2010-02-11 01:11:52 +00:00
{0, "NONE", 0, "None", "No interpolation"},
{1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation"},
{2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem translation_unit_items[] = {
{0, "PIXELS", 0, "Pixels", ""},
{1, "PERCENT", 0, "Percent", ""},
{0, NULL, 0, NULL, NULL}
};
RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
prop = RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
RNA_def_property_ui_text(prop, "Scale X", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 6);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
RNA_def_property_ui_text(prop, "Scale Y", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 6);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xIni");
RNA_def_property_ui_text(prop, "Translate X", "");
RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yIni");
RNA_def_property_ui_text(prop, "Translate Y", "");
RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rotIni");
RNA_def_property_range(prop, -360.0f, 360.0f);
RNA_def_property_ui_text(prop, "Rotation", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "percent");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
RNA_def_property_enum_items(prop, translation_unit_items);
RNA_def_property_ui_text(prop, "Translation Unit", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, interpolation_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
RNA_def_property_ui_text(prop, "Interpolation", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_solid_color(StructRNA *srna)
{
PropertyRNA *prop;
2009-12-10 14:47:07 +00:00
RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_ui_text(prop, "Color", "");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_speed_control(StructRNA *srna)
{
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
prop = RNA_def_property(srna, "multiply_speed", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* seq->facf0 is used to animate this */
RNA_def_property_ui_text(prop, "Multiply Speed", "Multiply the resulting speed after the speed factor");
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, -1);
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
RNA_def_property_ui_text(prop, "Use as speed", "Interpret the value as speed instead of a frame number");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "scale_to_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
RNA_def_property_ui_text(prop, "Scale to length", "Scale values from 0.0 to 1.0 to target sequence length");
2012-05-10 15:22:29 +00:00
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_gaussian_blur(StructRNA *srna)
{
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "GaussianBlurVars", "effectdata");
prop = RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Size X", "Size of the blur along X axis");
RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Size Y", "Size of the blur along Y axis");
RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static void rna_def_text(StructRNA *srna)
{
static EnumPropertyItem text_align_x_items[] = {
{SEQ_TEXT_ALIGN_X_LEFT, "LEFT", 0, "Left", ""},
{SEQ_TEXT_ALIGN_X_CENTER, "CENTER", 0, "Center", ""},
{SEQ_TEXT_ALIGN_X_RIGHT, "RIGHT", 0, "Right", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem text_align_y_items[] = {
{SEQ_TEXT_ALIGN_Y_TOP, "TOP", 0, "Top", ""},
{SEQ_TEXT_ALIGN_Y_CENTER, "CENTER", 0, "Center", ""},
{SEQ_TEXT_ALIGN_Y_BOTTOM, "BOTTOM", 0, "Bottom", ""},
{0, NULL, 0, NULL, NULL}
};
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "TextVars", "effectdata");
prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "text_size");
RNA_def_property_ui_text(prop, "Size", "Size of the text");
RNA_def_property_ui_range(prop, 0.0f, 1000, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "Location of the text");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "wrap_width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wrap_width");
RNA_def_property_ui_text(prop, "Wrap Width", "Word wrap width as factor, zero disables");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "align_x", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "align");
RNA_def_property_enum_items(prop, text_align_x_items);
RNA_def_property_ui_text(prop, "Align X", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "align_y", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "align_y");
RNA_def_property_enum_items(prop, text_align_y_items);
RNA_def_property_ui_text(prop, "Align Y", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Text", "Text that will be displayed");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TEXT_SHADOW);
2015-07-14 21:41:24 +02:00
RNA_def_property_ui_text(prop, "Shadow", "Draw text with shadow");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
}
static EffectInfo def_effects[] = {
{"AddSequence", "Add Sequence", "Add Sequence", NULL, 2},
{"AdjustmentSequence", "Adjustment Layer Sequence",
"Sequence strip to perform filter adjustments to layers below", rna_def_input, 0},
{"AlphaOverSequence", "Alpha Over Sequence", "Alpha Over Sequence", NULL, 2},
{"AlphaUnderSequence", "Alpha Under Sequence", "Alpha Under Sequence", NULL, 2},
{"ColorSequence", "Color Sequence",
"Sequence strip creating an image filled with a single color", rna_def_solid_color, 0},
{"CrossSequence", "Cross Sequence", "Cross Sequence", NULL, 2},
{"GammaCrossSequence", "Gamma Cross Sequence", "Gamma Cross Sequence", NULL, 2},
{"GlowSequence", "Glow Sequence", "Sequence strip creating a glow effect", rna_def_glow, 1},
{"MulticamSequence", "Multicam Select Sequence", "Sequence strip to perform multicam editing",
rna_def_multicam, 0},
{"MultiplySequence", "Multiply Sequence", "Multiply Sequence", NULL, 2},
{"OverDropSequence", "Over Drop Sequence", "Over Drop Sequence", NULL, 2},
{"SpeedControlSequence", "SpeedControl Sequence",
"Sequence strip to control the speed of other strips", rna_def_speed_control, 1},
{"SubtractSequence", "Subtract Sequence", "Subtract Sequence", NULL, 2},
{"TransformSequence", "Transform Sequence",
"Sequence strip applying affine transformations to other strips", rna_def_transform, 1},
{"WipeSequence", "Wipe Sequence", "Sequence strip creating a wipe transition",
rna_def_wipe, 1},
{"GaussianBlurSequence", "Gaussian Blur Sequence", "Sequence strip creating a gaussian blur",
rna_def_gaussian_blur, 1},
{"TextSequence", "Text Sequence", "Sequence strip creating text",
rna_def_text, 0},
{"", "", "", NULL, 0}
};
static void rna_def_effects(BlenderRNA *brna)
{
StructRNA *srna;
EffectInfo *effect;
for (effect = def_effects; effect->struct_name[0] != '\0'; effect++) {
srna = RNA_def_struct(brna, effect->struct_name, "EffectSequence");
RNA_def_struct_ui_text(srna, effect->ui_name, effect->ui_desc);
RNA_def_struct_sdna(srna, "Sequence");
rna_def_effect_inputs(srna, effect->inputs);
if (effect->func)
effect->func(srna);
}
}
static void rna_def_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem mask_input_type_items[] = {
{SEQUENCE_MASK_INPUT_STRIP, "STRIP", 0, "Strip", "Use sequencer strip as mask input"},
{SEQUENCE_MASK_INPUT_ID, "ID", 0, "Mask", "Use mask ID as mask input"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "SequenceModifier", NULL);
RNA_def_struct_sdna(srna, "SequenceModifierData");
RNA_def_struct_ui_text(srna, "SequenceModifier", "Modifier for sequence strip");
RNA_def_struct_refine_func(srna, "rna_SequenceModifier_refine");
RNA_def_struct_path_func(srna, "rna_SequenceModifier_path");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceModifier_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, rna_enum_sequence_modifier_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQUENCE_MODIFIER_MUTE);
RNA_def_property_ui_text(prop, "Mute", "Mute this modifier");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQUENCE_MODIFIER_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Mute expanded settings for the modifier");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "input_mask_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mask_input_type");
RNA_def_property_enum_items(prop, mask_input_type_items);
RNA_def_property_ui_text(prop, "Mask Input Type", "Type of input data used for mask");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "input_mask_strip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mask_sequence");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_SequenceModifier_otherSequence_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask Strip", "Strip used as mask input for the modifier");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "input_mask_id", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mask_id");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask", "Mask ID used as mask input for the modifier");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_colorbalance_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "ColorBalanceModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "ColorBalanceModifierData");
RNA_def_struct_ui_text(srna, "ColorBalanceModifier", "Color balance modifier for sequence strip");
prop = RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "SequenceColorBalanceData");
prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "color_multiply");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Multiply Colors", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_whitebalance_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "WhiteBalanceModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "WhiteBalanceModifierData");
RNA_def_struct_ui_text(srna, "WhiteBalanceModifier", "White balance modifier for sequence strip");
prop = RNA_def_property(srna, "white_value", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_float_sdna(prop, NULL, "white_value");
RNA_def_property_ui_text(prop, "White value", "This color defines white in the strip");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_curves_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "CurvesModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "CurvesModifierData");
RNA_def_struct_ui_text(srna, "CurvesModifier", "RGB curves modifier for sequence strip");
prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve_mapping");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Curve Mapping", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_hue_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "HueCorrectModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "HueCorrectModifierData");
RNA_def_struct_ui_text(srna, "HueCorrectModifier", "Hue correction modifier for sequence strip");
prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve_mapping");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Curve Mapping", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_brightcontrast_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "BrightContrastModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "BrightContrastModifierData");
RNA_def_struct_ui_text(srna, "BrightContrastModifier", "Bright/contrast modifier data for sequence strip");
prop = RNA_def_property(srna, "bright", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_text(prop, "Bright", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
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_ui_text(prop, "Contrast", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_modifiers(BlenderRNA *brna)
{
rna_def_modifier(brna);
rna_def_colorbalance_modifier(brna);
rna_def_curves_modifier(brna);
rna_def_hue_modifier(brna);
rna_def_brightcontrast_modifier(brna);
rna_def_whitebalance_modifier(brna);
}
void RNA_def_sequencer(BlenderRNA *brna)
{
rna_def_color_balance(brna);
rna_def_strip_element(brna);
rna_def_strip_proxy(brna);
rna_def_strip_color_balance(brna);
rna_def_strip_crop(brna);
rna_def_strip_transform(brna);
rna_def_sequence(brna);
rna_def_editor(brna);
rna_def_image(brna);
rna_def_meta(brna);
rna_def_scene(brna);
rna_def_movie(brna);
rna_def_movieclip(brna);
2012-06-07 18:24:36 +00:00
rna_def_mask(brna);
rna_def_sound(brna);
rna_def_effect(brna);
rna_def_effects(brna);
rna_def_modifiers(brna);
}
#endif