Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * Contributor(s): Blender Foundation (2008) 00019 * 00020 * ***** END GPL LICENSE BLOCK ***** 00021 */ 00022 00028 #include <stdlib.h> 00029 #include <limits.h> 00030 00031 #include "RNA_access.h" 00032 #include "RNA_define.h" 00033 00034 #include "rna_internal.h" 00035 00036 #include "DNA_anim_types.h" 00037 #include "DNA_object_types.h" 00038 #include "DNA_scene_types.h" 00039 #include "DNA_sequence_types.h" 00040 00041 #include "BKE_animsys.h" 00042 #include "BKE_global.h" 00043 #include "BKE_sequencer.h" 00044 #include "BKE_sound.h" 00045 00046 #include "MEM_guardedalloc.h" 00047 00048 #include "WM_types.h" 00049 #include "BLI_math.h" 00050 00051 #ifdef RNA_RUNTIME 00052 00053 /* build a temp referene to the parent */ 00054 static void meta_tmp_ref(Sequence *seq_par, Sequence *seq) 00055 { 00056 for (; seq; seq= seq->next) { 00057 seq->tmp= seq_par; 00058 if(seq->type == SEQ_META) { 00059 meta_tmp_ref(seq, seq->seqbase.first); 00060 } 00061 } 00062 } 00063 00064 static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) 00065 { 00066 Scene *scene= (Scene*)ptr->id.data; 00067 Editing *ed= seq_give_editing(scene, FALSE); 00068 00069 meta_tmp_ref(NULL, ed->seqbase.first); 00070 00071 rna_iterator_listbase_begin(iter, &ed->seqbase, NULL); 00072 } 00073 00074 static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *iter) 00075 { 00076 ListBaseIterator *internal= iter->internal; 00077 Sequence *seq= (Sequence*)internal->link; 00078 00079 if(seq->seqbase.first) 00080 internal->link= (Link*)seq->seqbase.first; 00081 else if(seq->next) 00082 internal->link= (Link*)seq->next; 00083 else { 00084 internal->link= NULL; 00085 00086 do { 00087 seq= seq->tmp; // XXX - seq's dont reference their parents! 00088 if(seq && seq->next) { 00089 internal->link= (Link*)seq->next; 00090 break; 00091 } 00092 } while(seq); 00093 } 00094 00095 iter->valid= (internal->link != NULL); 00096 } 00097 00098 /* internal use */ 00099 static int rna_SequenceEditor_elements_length(PointerRNA *ptr) 00100 { 00101 Sequence *seq= (Sequence*)ptr->data; 00102 00103 /* Hack? copied from sequencer.c::reload_sequence_new_file() */ 00104 size_t olen = MEM_allocN_len(seq->strip->stripdata)/sizeof(struct StripElem); 00105 00106 /* the problem with seq->strip->len and seq->len is that it's discounted from the offset (hard cut trim) */ 00107 return (int) olen; 00108 } 00109 00110 static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) 00111 { 00112 Sequence *seq= (Sequence*)ptr->data; 00113 rna_iterator_array_begin(iter, (void*)seq->strip->stripdata, sizeof(StripElem), rna_SequenceEditor_elements_length(ptr), 0, NULL); 00114 } 00115 00116 static void rna_Sequence_frame_change_update(Scene *scene, Sequence *seq) 00117 { 00118 Editing *ed= seq_give_editing(scene, FALSE); 00119 ListBase *seqbase= seq_seqbase(&ed->seqbase, seq); 00120 calc_sequence_disp(scene, seq); 00121 00122 if(seq_test_overlap(seqbase, seq)) { 00123 shuffle_seq(seqbase, seq, scene); // XXX - BROKEN!, uses context seqbasep 00124 } 00125 sort_seq(scene); 00126 } 00127 00128 static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) 00129 { 00130 Sequence *seq= (Sequence*)ptr->data; 00131 Scene *scene= (Scene*)ptr->id.data; 00132 00133 seq_translate(scene, seq, value - seq->start); 00134 rna_Sequence_frame_change_update(scene, seq); 00135 } 00136 00137 static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value) 00138 { 00139 Sequence *seq= (Sequence*)ptr->data; 00140 Scene *scene= (Scene*)ptr->id.data; 00141 00142 seq_tx_set_final_left(seq, value); 00143 seq_single_fix(seq); 00144 rna_Sequence_frame_change_update(scene, seq); 00145 } 00146 00147 static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value) 00148 { 00149 Sequence *seq= (Sequence*)ptr->data; 00150 Scene *scene= (Scene*)ptr->id.data; 00151 00152 seq_tx_set_final_right(seq, value); 00153 seq_single_fix(seq); 00154 rna_Sequence_frame_change_update(scene, seq); 00155 } 00156 00157 static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value) 00158 { 00159 Sequence *seq= (Sequence*)ptr->data; 00160 Scene *scene= (Scene*)ptr->id.data; 00161 00162 seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs); 00163 00164 reload_sequence_new_file(scene, seq, FALSE); 00165 rna_Sequence_frame_change_update(scene, seq); 00166 } 00167 00168 static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value) 00169 { 00170 Sequence *seq= (Sequence*)ptr->data; 00171 Scene *scene= (Scene*)ptr->id.data; 00172 00173 seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs); 00174 00175 reload_sequence_new_file(scene, seq, FALSE); 00176 rna_Sequence_frame_change_update(scene, seq); 00177 } 00178 00179 static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value) 00180 { 00181 Sequence *seq= (Sequence*)ptr->data; 00182 Scene *scene= (Scene*)ptr->id.data; 00183 00184 seq_tx_set_final_right(seq, seq->start+value); 00185 rna_Sequence_frame_change_update(scene, seq); 00186 } 00187 00188 static int rna_Sequence_frame_length_get(PointerRNA *ptr) 00189 { 00190 Sequence *seq= (Sequence*)ptr->data; 00191 return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0); 00192 } 00193 00194 static int rna_Sequence_frame_editable(PointerRNA *ptr) 00195 { 00196 Sequence *seq = (Sequence*)ptr->data; 00197 /* Effect sequences' start frame and length must be readonly! */ 00198 return (get_sequence_effect_num_inputs(seq->type))? 0: PROP_EDITABLE; 00199 } 00200 00201 static void rna_Sequence_channel_set(PointerRNA *ptr, int value) 00202 { 00203 Sequence *seq= (Sequence*)ptr->data; 00204 Scene *scene= (Scene*)ptr->id.data; 00205 Editing *ed= seq_give_editing(scene, FALSE); 00206 ListBase *seqbase= seq_seqbase(&ed->seqbase, seq); 00207 00208 seq->machine= value; 00209 00210 if( seq_test_overlap(seqbase, seq) ) { 00211 shuffle_seq(seqbase, seq, scene); // XXX - BROKEN!, uses context seqbasep 00212 } 00213 sort_seq(scene); 00214 } 00215 00216 /* properties that need to allocate structs */ 00217 static void rna_Sequence_use_color_balance_set(PointerRNA *ptr, int value) 00218 { 00219 Sequence *seq= (Sequence*)ptr->data; 00220 int c; 00221 00222 if(value) { 00223 seq->flag |= SEQ_USE_COLOR_BALANCE; 00224 if(seq->strip->color_balance == NULL) { 00225 seq->strip->color_balance = MEM_callocN(sizeof(struct StripColorBalance), "StripColorBalance"); 00226 for (c=0; c<3; c++) { 00227 seq->strip->color_balance->lift[c] = 1.0f; 00228 seq->strip->color_balance->gamma[c] = 1.0f; 00229 seq->strip->color_balance->gain[c] = 1.0f; 00230 } 00231 } 00232 } else { 00233 seq->flag ^= SEQ_USE_COLOR_BALANCE; 00234 } 00235 } 00236 00237 static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value) 00238 { 00239 Sequence *seq= (Sequence*)ptr->data; 00240 if(value) { 00241 seq->flag |= SEQ_USE_PROXY; 00242 if(seq->strip->proxy == NULL) { 00243 seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy"); 00244 seq->strip->proxy->quality = 90; 00245 seq->strip->proxy->build_tc_flags = SEQ_PROXY_TC_ALL; 00246 seq->strip->proxy->build_size_flags 00247 = SEQ_PROXY_IMAGE_SIZE_25; 00248 } 00249 } else { 00250 seq->flag ^= SEQ_USE_PROXY; 00251 } 00252 } 00253 00254 static void rna_Sequence_use_translation_set(PointerRNA *ptr, int value) 00255 { 00256 Sequence *seq= (Sequence*)ptr->data; 00257 if(value) { 00258 seq->flag |= SEQ_USE_TRANSFORM; 00259 if(seq->strip->transform == NULL) { 00260 seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform"); 00261 } 00262 } else { 00263 seq->flag ^= SEQ_USE_TRANSFORM; 00264 } 00265 } 00266 00267 static void rna_Sequence_use_crop_set(PointerRNA *ptr, int value) 00268 { 00269 Sequence *seq= (Sequence*)ptr->data; 00270 if(value) { 00271 seq->flag |= SEQ_USE_CROP; 00272 if(seq->strip->crop == NULL) { 00273 seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop"); 00274 } 00275 } else { 00276 seq->flag ^= SEQ_USE_CROP; 00277 } 00278 } 00279 00280 static int transform_seq_cmp_cb(Sequence *seq, void *arg_pt) 00281 { 00282 struct { Sequence *seq; void *transform; } *data= arg_pt; 00283 00284 if(seq->strip && seq->strip->transform == data->transform) { 00285 data->seq= seq; 00286 return -1; /* done so bail out */ 00287 } 00288 return 1; 00289 } 00290 00291 static char *rna_SequenceTransform_path(PointerRNA *ptr) 00292 { 00293 Scene *scene= ptr->id.data; 00294 Editing *ed= seq_give_editing(scene, FALSE); 00295 Sequence *seq; 00296 00297 struct { Sequence *seq; void *transform; } data; 00298 data.seq= NULL; 00299 data.transform= ptr->data; 00300 00301 /* irritating we need to search for our sequence! */ 00302 seqbase_recursive_apply(&ed->seqbase, transform_seq_cmp_cb, &data); 00303 seq= data.seq; 00304 00305 if (seq && seq->name+2) 00306 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform", seq->name+2); 00307 else 00308 return BLI_strdup(""); 00309 } 00310 00311 static int crop_seq_cmp_cb(Sequence *seq, void *arg_pt) 00312 { 00313 struct { Sequence *seq; void *crop; } *data= arg_pt; 00314 00315 if(seq->strip && seq->strip->crop == data->crop) { 00316 data->seq= seq; 00317 return -1; /* done so bail out */ 00318 } 00319 return 1; 00320 } 00321 00322 static char *rna_SequenceCrop_path(PointerRNA *ptr) 00323 { 00324 Scene *scene= ptr->id.data; 00325 Editing *ed= seq_give_editing(scene, FALSE); 00326 Sequence *seq; 00327 00328 struct { Sequence *seq; void *crop; } data; 00329 data.seq= NULL; 00330 data.crop= ptr->data; 00331 00332 /* irritating we need to search for our sequence! */ 00333 seqbase_recursive_apply(&ed->seqbase, crop_seq_cmp_cb, &data); 00334 seq= data.seq; 00335 00336 if (seq && seq->name+2) 00337 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop", seq->name+2); 00338 else 00339 return BLI_strdup(""); 00340 } 00341 00342 00343 /* name functions that ignore the first two characters */ 00344 static void rna_Sequence_name_get(PointerRNA *ptr, char *value) 00345 { 00346 Sequence *seq= (Sequence*)ptr->data; 00347 BLI_strncpy(value, seq->name+2, sizeof(seq->name)-2); 00348 } 00349 00350 static int rna_Sequence_name_length(PointerRNA *ptr) 00351 { 00352 Sequence *seq= (Sequence*)ptr->data; 00353 return strlen(seq->name+2); 00354 } 00355 00356 static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) 00357 { 00358 Scene *scene= (Scene*)ptr->id.data; 00359 Sequence *seq= (Sequence*)ptr->data; 00360 char oldname[sizeof(seq->name)]; 00361 AnimData *adt; 00362 00363 /* make a copy of the old name first */ 00364 BLI_strncpy(oldname, seq->name+2, sizeof(seq->name)-2); 00365 00366 /* copy the new name into the name slot */ 00367 BLI_strncpy_utf8(seq->name+2, value, sizeof(seq->name)-2); 00368 00369 /* make sure the name is unique */ 00370 seqbase_unique_name_recursive(&scene->ed->seqbase, seq); 00371 00372 /* fix all the animation data which may link to this */ 00373 00374 /* dont rename everywhere because these are per scene */ 00375 /* BKE_all_animdata_fix_paths_rename("sequence_editor.sequences_all", oldname, seq->name+2); */ 00376 adt= BKE_animdata_from_id(&scene->id); 00377 if(adt) 00378 BKE_animdata_fix_paths_rename(&scene->id, adt, "sequence_editor.sequences_all", oldname, seq->name+2, 0, 0, 1); 00379 } 00380 00381 static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) 00382 { 00383 Sequence *seq= (Sequence*)ptr->data; 00384 00385 switch(seq->type) { 00386 case SEQ_IMAGE: 00387 return &RNA_ImageSequence; 00388 case SEQ_META: 00389 return &RNA_MetaSequence; 00390 case SEQ_SCENE: 00391 return &RNA_SceneSequence; 00392 case SEQ_MOVIE: 00393 return &RNA_MovieSequence; 00394 case SEQ_SOUND: 00395 return &RNA_SoundSequence; 00396 case SEQ_CROSS: 00397 case SEQ_ADD: 00398 case SEQ_SUB: 00399 case SEQ_ALPHAOVER: 00400 case SEQ_ALPHAUNDER: 00401 case SEQ_GAMCROSS: 00402 case SEQ_MUL: 00403 case SEQ_OVERDROP: 00404 return &RNA_EffectSequence; 00405 case SEQ_MULTICAM: 00406 return &RNA_MulticamSequence; 00407 case SEQ_ADJUSTMENT: 00408 return &RNA_AdjustmentSequence; 00409 case SEQ_PLUGIN: 00410 return &RNA_PluginSequence; 00411 case SEQ_WIPE: 00412 return &RNA_WipeSequence; 00413 case SEQ_GLOW: 00414 return &RNA_GlowSequence; 00415 case SEQ_TRANSFORM: 00416 return &RNA_TransformSequence; 00417 case SEQ_COLOR: 00418 return &RNA_ColorSequence; 00419 case SEQ_SPEED: 00420 return &RNA_SpeedControlSequence; 00421 default: 00422 return &RNA_Sequence; 00423 } 00424 } 00425 00426 static char *rna_Sequence_path(PointerRNA *ptr) 00427 { 00428 Sequence *seq= (Sequence*)ptr->data; 00429 00430 /* sequencer data comes from scene... 00431 * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths) 00432 */ 00433 if (seq->name+2) 00434 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", seq->name+2); 00435 else 00436 return BLI_strdup(""); 00437 } 00438 00439 static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter) 00440 { 00441 ListBaseIterator *internal= iter->internal; 00442 MetaStack *ms= (MetaStack*)internal->link; 00443 00444 return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq); 00445 } 00446 00447 /* TODO, expose seq path setting as a higher level sequencer BKE function */ 00448 static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value) 00449 { 00450 Sequence *seq= (Sequence*)(ptr->data); 00451 00452 if(seq->type == SEQ_SOUND && seq->sound) { 00453 /* for sound strips we need to update the sound as well. 00454 * arguably, this could load in a new sound rather than modify an existing one. 00455 * but while using the sequencer its most likely your not using the sound in the game engine too. 00456 */ 00457 PointerRNA id_ptr; 00458 RNA_id_pointer_create((ID *)seq->sound, &id_ptr); 00459 RNA_string_set(&id_ptr, "filepath", value); 00460 sound_load(G.main, seq->sound); 00461 sound_update_scene_sound(seq->scene_sound, seq->sound); 00462 } 00463 00464 BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name)); 00465 } 00466 00467 static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value) 00468 { 00469 Sequence *seq= (Sequence*)(ptr->data); 00470 00471 BLI_join_dirfile(value, FILE_MAX, seq->strip->dir, seq->strip->stripdata->name); 00472 } 00473 00474 static int rna_Sequence_filepath_length(PointerRNA *ptr) 00475 { 00476 Sequence *seq= (Sequence*)(ptr->data); 00477 char path[FILE_MAX]; 00478 00479 BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name); 00480 return strlen(path); 00481 } 00482 00483 static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value) 00484 { 00485 StripProxy *proxy= (StripProxy*)(ptr->data); 00486 BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file)); 00487 } 00488 00489 static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value) 00490 { 00491 StripProxy *proxy= (StripProxy*)(ptr->data); 00492 00493 BLI_join_dirfile(value, FILE_MAX, proxy->dir, proxy->file); 00494 } 00495 00496 static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr) 00497 { 00498 StripProxy *proxy= (StripProxy*)(ptr->data); 00499 char path[FILE_MAX]; 00500 00501 BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file); 00502 return strlen(path); 00503 } 00504 00505 static void rna_Sequence_volume_set(PointerRNA *ptr, float value) 00506 { 00507 Sequence *seq= (Sequence*)(ptr->data); 00508 00509 seq->volume = value; 00510 if(seq->scene_sound) 00511 sound_set_scene_sound_volume(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0); 00512 } 00513 00514 static void rna_Sequence_pitch_set(PointerRNA *ptr, float value) 00515 { 00516 Sequence *seq= (Sequence*)(ptr->data); 00517 00518 seq->pitch = value; 00519 if(seq->scene_sound) 00520 sound_set_scene_sound_pitch(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0); 00521 } 00522 00523 static void rna_Sequence_pan_set(PointerRNA *ptr, float value) 00524 { 00525 Sequence *seq= (Sequence*)(ptr->data); 00526 00527 seq->pan = value; 00528 if(seq->scene_sound) 00529 sound_set_scene_sound_pan(seq->scene_sound, value, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0); 00530 } 00531 00532 00533 static int rna_Sequence_input_count_get(PointerRNA *ptr) 00534 { 00535 Sequence *seq= (Sequence*)(ptr->data); 00536 00537 return get_sequence_effect_num_inputs(seq->type); 00538 } 00539 /*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value) 00540 { 00541 Sequence *seq= (Sequence*)(ptr->data); 00542 BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name)); 00543 } 00544 00545 static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value) 00546 { 00547 StripElem *elem= (StripElem*)(ptr->data); 00548 BLI_split_file_part(value, elem->name, sizeof(elem->name)); 00549 }*/ 00550 00551 static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) 00552 { 00553 Editing *ed= seq_give_editing(scene, FALSE); 00554 00555 if(ed) 00556 free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE); 00557 } 00558 00559 static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) 00560 { 00561 Editing *ed= seq_give_editing(scene, FALSE); 00562 00563 free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE); 00564 00565 if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) 00566 seq_update_sound_bounds(scene, ptr->data); 00567 } 00568 00569 static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00570 { 00571 Editing *ed= seq_give_editing(scene, FALSE); 00572 00573 seq_update_muting(ed); 00574 rna_Sequence_update(bmain, scene, ptr); 00575 } 00576 00577 static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00578 { 00579 Sequence *seq= (Sequence*)(ptr->data); 00580 reload_sequence_new_file(scene, seq, TRUE); 00581 calc_sequence(scene, seq); 00582 rna_Sequence_update(bmain, scene, ptr); 00583 } 00584 00585 static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt) 00586 { 00587 struct { Sequence *seq; void *seq_proxy; } *data= arg_pt; 00588 00589 if(seq->strip && seq->strip->proxy == data->seq_proxy) { 00590 data->seq= seq; 00591 return -1; /* done so bail out */ 00592 } 00593 return 1; 00594 } 00595 00596 static void rna_Sequence_tcindex_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00597 { 00598 Editing *ed= seq_give_editing(scene, FALSE); 00599 Sequence *seq; 00600 00601 struct { Sequence *seq; void *seq_proxy; } data; 00602 00603 data.seq= NULL; 00604 data.seq_proxy = ptr->data; 00605 00606 seqbase_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data); 00607 seq= data.seq; 00608 00609 reload_sequence_new_file(scene, seq, FALSE); 00610 rna_Sequence_frame_change_update(scene, seq); 00611 } 00612 00613 /* do_versions? */ 00614 static float rna_Sequence_opacity_get(PointerRNA *ptr) 00615 { 00616 Sequence *seq= (Sequence*)(ptr->data); 00617 return seq->blend_opacity / 100.0f; 00618 } 00619 static void rna_Sequence_opacity_set(PointerRNA *ptr, float value) 00620 { 00621 Sequence *seq= (Sequence*)(ptr->data); 00622 CLAMP(value, 0.0f, 1.0f); 00623 seq->blend_opacity = value * 100.0f; 00624 } 00625 00626 00627 static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt) 00628 { 00629 struct { Sequence *seq; void *color_balance; } *data= arg_pt; 00630 00631 if(seq->strip && seq->strip->color_balance == data->color_balance) { 00632 data->seq= seq; 00633 return -1; /* done so bail out */ 00634 } 00635 return 1; 00636 } 00637 static char *rna_SequenceColorBalance_path(PointerRNA *ptr) 00638 { 00639 Scene *scene= ptr->id.data; 00640 Editing *ed= seq_give_editing(scene, FALSE); 00641 Sequence *seq; 00642 00643 struct { Sequence *seq; void *color_balance; } data; 00644 data.seq= NULL; 00645 data.color_balance= ptr->data; 00646 00647 /* irritating we need to search for our sequence! */ 00648 seqbase_recursive_apply(&ed->seqbase, colbalance_seq_cmp_cb, &data); 00649 seq= data.seq; 00650 00651 if (seq && seq->name+2) 00652 return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", seq->name+2); 00653 else 00654 return BLI_strdup(""); 00655 } 00656 00657 static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value) 00658 { 00659 Scene *scene= ptr->id.data; 00660 Editing *ed= seq_give_editing(scene, FALSE); 00661 00662 if(ed==NULL) 00663 return; 00664 00665 /* convert from abs to relative and back */ 00666 if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS)==0 && value) { 00667 ed->over_cfra= scene->r.cfra + ed->over_ofs; 00668 ed->over_flag |= SEQ_EDIT_OVERLAY_ABS; 00669 } 00670 else if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) { 00671 ed->over_ofs= ed->over_cfra - scene->r.cfra; 00672 ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS; 00673 } 00674 } 00675 00676 static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr) 00677 { 00678 Scene *scene= (Scene *)ptr->id.data; 00679 Editing *ed= seq_give_editing(scene, FALSE); 00680 00681 if(ed==NULL) 00682 return scene->r.cfra; 00683 00684 if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS) 00685 return ed->over_cfra - scene->r.cfra; 00686 else 00687 return ed->over_ofs; 00688 00689 } 00690 00691 static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value) 00692 { 00693 Scene *scene= (Scene *)ptr->id.data; 00694 Editing *ed= seq_give_editing(scene, FALSE); 00695 00696 if(ed==NULL) 00697 return; 00698 00699 00700 if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS) 00701 ed->over_cfra= (scene->r.cfra + value); 00702 else 00703 ed->over_ofs= value; 00704 } 00705 00706 00707 static void rna_WipeSequence_angle_set(PointerRNA *ptr, float value) 00708 { 00709 Sequence *seq= (Sequence *)(ptr->data); 00710 value= RAD2DEGF(value); 00711 CLAMP(value, -90.0f, 90.0f); 00712 ((WipeVars *)seq->effectdata)->angle= value; 00713 } 00714 00715 static float rna_WipeSequence_angle_get(PointerRNA *ptr) 00716 { 00717 Sequence *seq= (Sequence *)(ptr->data); 00718 00719 return DEG2RADF(((WipeVars *)seq->effectdata)->angle); 00720 } 00721 00722 00723 #else 00724 00725 static void rna_def_strip_element(BlenderRNA *brna) 00726 { 00727 StructRNA *srna; 00728 PropertyRNA *prop; 00729 00730 srna = RNA_def_struct(brna, "SequenceElement", NULL); 00731 RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame"); 00732 RNA_def_struct_sdna(srna, "StripElem"); 00733 00734 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME); 00735 RNA_def_property_string_sdna(prop, NULL, "name"); 00736 RNA_def_property_ui_text(prop, "Filename", ""); 00737 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00738 00739 prop= RNA_def_property(srna, "orig_width", PROP_INT, PROP_NONE); 00740 RNA_def_property_int_sdna(prop, NULL, "orig_width"); 00741 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00742 RNA_def_property_ui_text(prop, "Orig Width", "Original image width"); 00743 00744 prop= RNA_def_property(srna, "orig_height", PROP_INT, PROP_NONE); 00745 RNA_def_property_int_sdna(prop, NULL, "orig_height"); 00746 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00747 RNA_def_property_ui_text(prop, "Orig Height", "Original image height"); 00748 } 00749 00750 static void rna_def_strip_crop(BlenderRNA *brna) 00751 { 00752 StructRNA *srna; 00753 PropertyRNA *prop; 00754 00755 srna = RNA_def_struct(brna, "SequenceCrop", NULL); 00756 RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip"); 00757 RNA_def_struct_sdna(srna, "StripCrop"); 00758 00759 prop= RNA_def_property(srna, "max_y", PROP_INT, PROP_UNSIGNED); 00760 RNA_def_property_int_sdna(prop, NULL, "top"); 00761 RNA_def_property_ui_text(prop, "Top", ""); 00762 RNA_def_property_ui_range(prop, 0, 4096, 1, 0); 00763 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00764 00765 prop= RNA_def_property(srna, "min_y", PROP_INT, PROP_UNSIGNED); 00766 RNA_def_property_int_sdna(prop, NULL, "bottom"); 00767 RNA_def_property_ui_text(prop, "Bottom", ""); 00768 RNA_def_property_ui_range(prop, 0, 4096, 1, 0); 00769 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00770 00771 prop= RNA_def_property(srna, "min_x", PROP_INT, PROP_UNSIGNED); 00772 RNA_def_property_int_sdna(prop, NULL, "left"); 00773 RNA_def_property_ui_text(prop, "Left", ""); 00774 RNA_def_property_ui_range(prop, 0, 4096, 1, 0); 00775 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00776 00777 prop= RNA_def_property(srna, "max_x", PROP_INT, PROP_UNSIGNED); 00778 RNA_def_property_int_sdna(prop, NULL, "right"); 00779 RNA_def_property_ui_text(prop, "Right", ""); 00780 RNA_def_property_ui_range(prop, 0, 4096, 1, 0); 00781 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00782 00783 RNA_def_struct_path_func(srna, "rna_SequenceCrop_path"); 00784 } 00785 00786 static void rna_def_strip_transform(BlenderRNA *brna) 00787 { 00788 StructRNA *srna; 00789 PropertyRNA *prop; 00790 00791 srna = RNA_def_struct(brna, "SequenceTransform", NULL); 00792 RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip"); 00793 RNA_def_struct_sdna(srna, "StripTransform"); 00794 00795 prop= RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE); 00796 RNA_def_property_int_sdna(prop, NULL, "xofs"); 00797 RNA_def_property_ui_text(prop, "Offset X", ""); 00798 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0); 00799 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00800 00801 prop= RNA_def_property(srna, "offset_y", PROP_INT, PROP_NONE); 00802 RNA_def_property_int_sdna(prop, NULL, "yofs"); 00803 RNA_def_property_ui_text(prop, "Offset Y", ""); 00804 RNA_def_property_ui_range(prop, -4096, 4096, 1, 0); 00805 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00806 00807 RNA_def_struct_path_func(srna, "rna_SequenceTransform_path"); 00808 00809 } 00810 00811 static void rna_def_strip_proxy(BlenderRNA *brna) 00812 { 00813 StructRNA *srna; 00814 PropertyRNA *prop; 00815 00816 static const EnumPropertyItem seq_tc_items[]= { 00817 {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""}, 00818 {SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", 00819 "Use images in the order as they are recorded"}, 00820 {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", 00821 "Use global timestamp written by recording device"}, 00822 {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", 00823 "Interpolate a global timestamp using the " 00824 "record date and time written by recording device"}, 00825 {SEQ_PROXY_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps", 00826 "Record run, but ignore timecode, " 00827 "changes in framerate or dropouts"}, 00828 {0, NULL, 0, NULL, NULL}}; 00829 00830 srna = RNA_def_struct(brna, "SequenceProxy", NULL); 00831 RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip"); 00832 RNA_def_struct_sdna(srna, "StripProxy"); 00833 00834 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); 00835 RNA_def_property_string_sdna(prop, NULL, "dir"); 00836 RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files"); 00837 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00838 00839 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); 00840 RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file"); 00841 RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", "rna_Sequence_proxy_filepath_set"); 00842 00843 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00844 00845 prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE); 00846 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25); 00847 RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution"); 00848 00849 prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE); 00850 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50); 00851 RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution"); 00852 00853 prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE); 00854 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75); 00855 RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution"); 00856 00857 prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE); 00858 RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100); 00859 RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution"); 00860 00861 prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE); 00862 RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN); 00863 RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index"); 00864 00865 prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE); 00866 RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN); 00867 RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index"); 00868 00869 prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE); 00870 RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN); 00871 RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time"); 00872 00873 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); 00874 RNA_def_property_int_sdna(prop, NULL, "quality"); 00875 RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build"); 00876 RNA_def_property_ui_range(prop, 1, 100, 1, 0); 00877 00878 prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE); 00879 RNA_def_property_enum_sdna(prop, NULL, "tc"); 00880 RNA_def_property_enum_items(prop, seq_tc_items); 00881 RNA_def_property_ui_text(prop, "Timecode", ""); 00882 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_tcindex_update"); 00883 00884 } 00885 00886 static void rna_def_strip_color_balance(BlenderRNA *brna) 00887 { 00888 StructRNA *srna; 00889 PropertyRNA *prop; 00890 00891 srna = RNA_def_struct(brna, "SequenceColorBalance", NULL); 00892 RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip"); 00893 RNA_def_struct_sdna(srna, "StripColorBalance"); 00894 00895 prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR); 00896 RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows)"); 00897 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); 00898 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00899 00900 prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR); 00901 RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones)"); 00902 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); 00903 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00904 00905 prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR); 00906 RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights)"); 00907 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); 00908 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00909 00910 prop= RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE); 00911 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN); 00912 RNA_def_property_ui_text(prop, "Inverse Gain", ""); 00913 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00914 00915 prop= RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE); 00916 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA); 00917 RNA_def_property_ui_text(prop, "Inverse Gamma", ""); 00918 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00919 00920 prop= RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE); 00921 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT); 00922 RNA_def_property_ui_text(prop, "Inverse Lift", ""); 00923 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00924 00925 RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path"); 00926 00927 /* not yet used 00928 prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); 00929 RNA_def_property_range(prop, 0.0f, 1.0f); 00930 RNA_def_property_ui_text(prop, "Exposure", ""); 00931 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00932 00933 prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); 00934 RNA_def_property_range(prop, 0.0f, 1.0f); 00935 RNA_def_property_ui_text(prop, "Saturation", ""); 00936 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); */ 00937 } 00938 00939 static void rna_def_sequence(BlenderRNA *brna) 00940 { 00941 StructRNA *srna; 00942 PropertyRNA *prop; 00943 00944 static const EnumPropertyItem seq_type_items[]= { 00945 {SEQ_IMAGE, "IMAGE", 0, "Image", ""}, 00946 {SEQ_META, "META", 0, "Meta", ""}, 00947 {SEQ_SCENE, "SCENE", 0, "Scene", ""}, 00948 {SEQ_MOVIE, "MOVIE", 0, "Movie", ""}, 00949 {SEQ_SOUND, "SOUND", 0, "Sound", ""}, 00950 {SEQ_CROSS, "CROSS", 0, "Cross", ""}, 00951 {SEQ_ADD, "ADD", 0, "Add", ""}, 00952 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""}, 00953 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""}, 00954 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""}, 00955 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""}, 00956 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""}, 00957 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""}, 00958 {SEQ_PLUGIN, "PLUGIN", 0, "plugin", ""}, 00959 {SEQ_WIPE, "WIPE", 0, "Wipe", ""}, 00960 {SEQ_GLOW, "GLOW", 0, "Glow", ""}, 00961 {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""}, 00962 {SEQ_COLOR, "COLOR", 0, "Color", ""}, 00963 {SEQ_SPEED, "SPEED", 0, "Speed", ""}, 00964 {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""}, 00965 {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""}, 00966 {0, NULL, 0, NULL, NULL}}; 00967 00968 static const EnumPropertyItem blend_mode_items[]= { 00969 {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""}, 00970 {SEQ_CROSS, "CROSS", 0, "Cross", ""}, 00971 {SEQ_ADD, "ADD", 0, "Add", ""}, 00972 {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""}, 00973 {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""}, 00974 {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""}, 00975 {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""}, 00976 {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""}, 00977 {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""}, 00978 {0, NULL, 0, NULL, NULL}}; 00979 00980 srna = RNA_def_struct(brna, "Sequence", NULL); 00981 RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor"); 00982 RNA_def_struct_refine_func(srna, "rna_Sequence_refine"); 00983 RNA_def_struct_path_func(srna, "rna_Sequence_path"); 00984 00985 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); 00986 RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set"); 00987 RNA_def_property_string_maxlength(prop, sizeof(((Sequence*)NULL)->name)-2); 00988 RNA_def_property_ui_text(prop, "Name", ""); 00989 RNA_def_struct_name_property(srna, prop); 00990 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); 00991 00992 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); 00993 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00994 RNA_def_property_enum_items(prop, seq_type_items); 00995 RNA_def_property_ui_text(prop, "Type", ""); 00996 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 00997 00998 //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); 00999 //RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by this sequence"); 01000 01001 /* flags */ 01002 01003 prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); 01004 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); 01005 RNA_def_property_ui_text(prop, "Select", ""); 01006 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL); 01007 01008 prop= RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE); 01009 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL); 01010 RNA_def_property_ui_text(prop, "Left Handle Selected", ""); 01011 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL); 01012 01013 prop= RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE); 01014 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL); 01015 RNA_def_property_ui_text(prop, "Right Handle Selected", ""); 01016 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL); 01017 01018 prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); 01019 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE); 01020 RNA_def_property_ui_text(prop, "Mute", ""); 01021 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_mute_update"); 01022 01023 prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); 01024 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK); 01025 RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed"); 01026 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); 01027 01028 prop= RNA_def_property(srna, "waveform", PROP_BOOLEAN, PROP_NONE); 01029 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM); 01030 RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform"); 01031 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); 01032 01033 /* strip positioning */ 01034 01035 prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME); 01036 RNA_def_property_range(prop, 1, MAXFRAME); 01037 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); 01038 RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied"); 01039 RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set",NULL); 01040 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); 01041 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01042 01043 prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME); 01044 RNA_def_property_int_sdna(prop, NULL, "len"); 01045 RNA_def_property_clear_flag(prop, PROP_EDITABLE|PROP_ANIMATABLE); 01046 RNA_def_property_range(prop, 1, MAXFRAME); 01047 RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied"); 01048 01049 prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); 01050 RNA_def_property_int_sdna(prop, NULL, "start"); 01051 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); 01052 RNA_def_property_ui_text(prop, "Start Frame", ""); 01053 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp 01054 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); 01055 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01056 01057 prop= RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME); 01058 RNA_def_property_int_sdna(prop, NULL, "startdisp"); 01059 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); 01060 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"); 01061 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp 01062 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); 01063 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01064 01065 prop= RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME); 01066 RNA_def_property_int_sdna(prop, NULL, "enddisp"); 01067 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); 01068 RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied"); 01069 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp 01070 RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); 01071 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01072 01073 prop= RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME); 01074 RNA_def_property_int_sdna(prop, NULL, "startofs"); 01075 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests 01076 RNA_def_property_ui_text(prop, "Start Offset", ""); 01077 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01078 01079 prop= RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME); 01080 RNA_def_property_int_sdna(prop, NULL, "endofs"); 01081 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests 01082 RNA_def_property_ui_text(prop, "End Offset", ""); 01083 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01084 01085 prop= RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME); 01086 RNA_def_property_int_sdna(prop, NULL, "startstill"); 01087 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests 01088 RNA_def_property_range(prop, 0, MAXFRAME); 01089 RNA_def_property_ui_text(prop, "Start Still", ""); 01090 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01091 01092 prop= RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME); 01093 RNA_def_property_int_sdna(prop, NULL, "endstill"); 01094 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests 01095 RNA_def_property_range(prop, 0, MAXFRAME); 01096 RNA_def_property_ui_text(prop, "End Still", ""); 01097 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01098 01099 prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); 01100 RNA_def_property_int_sdna(prop, NULL, "machine"); 01101 RNA_def_property_range(prop, 0, MAXSEQ-1); 01102 RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip"); 01103 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set",NULL); // overlap test 01104 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01105 01106 /* blending */ 01107 01108 prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); 01109 RNA_def_property_enum_sdna(prop, NULL, "blend_mode"); 01110 RNA_def_property_enum_items(prop, blend_mode_items); 01111 RNA_def_property_ui_text(prop, "Blend Mode", ""); 01112 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01113 01114 prop= RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR); 01115 RNA_def_property_range(prop, 0.0f, 1.0f); 01116 RNA_def_property_ui_text(prop, "Blend Opacity", ""); 01117 RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL); // stupid 0-100 -> 0-1 01118 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01119 01120 prop= RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE); 01121 RNA_def_property_range(prop, 0.0f, 1.0f); 01122 RNA_def_property_float_sdna(prop, NULL, "effect_fader"); 01123 RNA_def_property_ui_text(prop, "Effect fader position", ""); 01124 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01125 01126 prop= RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE); 01127 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE); 01128 RNA_def_property_ui_text(prop, "Use Default Fade", "Fade effect using the built-in default (usually make transition as long as effect strip)"); 01129 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01130 01131 01132 prop= RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE); 01133 RNA_def_property_float_sdna(prop, NULL, "speed_fader"); 01134 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"); 01135 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01136 01137 /* effect strip inputs */ 01138 01139 prop= RNA_def_property(srna, "input_count", PROP_INT, PROP_UNSIGNED); 01140 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01141 RNA_def_property_int_funcs(prop, "rna_Sequence_input_count_get", NULL, NULL); 01142 01143 prop= RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE); 01144 RNA_def_property_pointer_sdna(prop, NULL, "seq1"); 01145 RNA_def_property_ui_text(prop, "Input 1", "First input for the effect strip"); 01146 01147 prop= RNA_def_property(srna, "input_2", PROP_POINTER, PROP_NONE); 01148 RNA_def_property_pointer_sdna(prop, NULL, "seq2"); 01149 RNA_def_property_ui_text(prop, "Input 2", "Second input for the effect strip"); 01150 01151 prop= RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE); 01152 RNA_def_property_pointer_sdna(prop, NULL, "seq1"); 01153 RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip"); 01154 01155 RNA_api_sequence_strip(srna); 01156 } 01157 01158 static void rna_def_editor(BlenderRNA *brna) 01159 { 01160 StructRNA *srna; 01161 PropertyRNA *prop; 01162 01163 srna = RNA_def_struct(brna, "SequenceEditor", NULL); 01164 RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock"); 01165 RNA_def_struct_ui_icon(srna, ICON_SEQUENCE); 01166 RNA_def_struct_sdna(srna, "Editing"); 01167 01168 prop= RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE); 01169 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL); 01170 RNA_def_property_struct_type(prop, "Sequence"); 01171 RNA_def_property_ui_text(prop, "Sequences", ""); 01172 01173 prop= RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE); 01174 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL); 01175 RNA_def_property_struct_type(prop, "Sequence"); 01176 RNA_def_property_ui_text(prop, "Sequences", ""); 01177 RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", NULL, NULL, NULL, NULL, NULL, NULL); 01178 01179 prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE); 01180 RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL); 01181 RNA_def_property_struct_type(prop, "Sequence"); 01182 RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip"); 01183 RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get", NULL, NULL, NULL, NULL); 01184 01185 prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE); 01186 RNA_def_property_pointer_sdna(prop, NULL, "act_seq"); 01187 RNA_def_property_flag(prop, PROP_EDITABLE); 01188 01189 prop= RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE); 01190 RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW); 01191 RNA_def_property_ui_text(prop, "Draw Axes", "Partial overlay on top of the sequencer"); 01192 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); 01193 01194 prop= RNA_def_property(srna, "overlay_lock", PROP_BOOLEAN, PROP_NONE); 01195 RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS); 01196 RNA_def_property_ui_text(prop, "Overlay Lock", ""); 01197 RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set"); 01198 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); 01199 01200 /* access to fixed and relative frame */ 01201 prop= RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE); 01202 RNA_def_property_ui_text(prop, "Overlay Offset", ""); 01203 RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL); 01204 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); 01205 RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip"); 01206 } 01207 01208 static void rna_def_filter_video(StructRNA *srna) 01209 { 01210 PropertyRNA *prop; 01211 01212 prop= RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE); 01213 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY); 01214 RNA_def_property_ui_text(prop, "De-Interlace", "For video movies to remove fields"); 01215 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files"); 01216 01217 prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); 01218 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL); 01219 RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha"); 01220 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); 01221 01222 prop= RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE); 01223 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX); 01224 RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis"); 01225 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01226 01227 prop= RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE); 01228 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY); 01229 RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis"); 01230 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01231 01232 prop= RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE); 01233 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT); 01234 RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data"); 01235 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01236 01237 prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE); 01238 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES); 01239 RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order"); 01240 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01241 01242 prop= RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED); 01243 RNA_def_property_float_sdna(prop, NULL, "mul"); 01244 RNA_def_property_range(prop, 0.0f, 20.0f); 01245 RNA_def_property_ui_text(prop, "Multiply Colors", ""); 01246 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01247 01248 prop= RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED); 01249 RNA_def_property_float_sdna(prop, NULL, "sat"); 01250 RNA_def_property_range(prop, 0.0f, 20.0f); 01251 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3); 01252 RNA_def_property_ui_text(prop, "Saturation", ""); 01253 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01254 01255 prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE); 01256 RNA_def_property_range(prop, 1.0f, 30.0f); 01257 RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame"); 01258 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01259 01260 prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE); 01261 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE); 01262 RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input"); 01263 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_color_balance_set"); 01264 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01265 01266 prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE); 01267 RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance"); 01268 RNA_def_property_ui_text(prop, "Color Balance", ""); 01269 01270 prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE); 01271 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM); 01272 RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing"); 01273 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set"); 01274 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01275 01276 prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE); 01277 RNA_def_property_pointer_sdna(prop, NULL, "strip->transform"); 01278 RNA_def_property_ui_text(prop, "Transform", ""); 01279 01280 prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE); 01281 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP); 01282 RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing"); 01283 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set"); 01284 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01285 01286 prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE); 01287 RNA_def_property_pointer_sdna(prop, NULL, "strip->crop"); 01288 RNA_def_property_ui_text(prop, "Crop", ""); 01289 } 01290 01291 static void rna_def_proxy(StructRNA *srna) 01292 { 01293 PropertyRNA *prop; 01294 01295 prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE); 01296 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY); 01297 RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip"); 01298 RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set"); 01299 01300 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); 01301 RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy"); 01302 RNA_def_property_ui_text(prop, "Proxy", ""); 01303 01304 prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE); 01305 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR); 01306 RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data"); 01307 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01308 01309 prop= RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE); 01310 RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_FILE); 01311 RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from"); 01312 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01313 } 01314 01315 static void rna_def_input(StructRNA *srna) 01316 { 01317 PropertyRNA *prop; 01318 01319 prop= RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED); 01320 RNA_def_property_int_sdna(prop, NULL, "anim_startofs"); 01321 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); 01322 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); // overlap tests 01323 01324 RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)"); 01325 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01326 01327 prop= RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED); 01328 RNA_def_property_int_sdna(prop, NULL, "anim_endofs"); 01329 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); 01330 RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); // overlap tests 01331 RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)"); 01332 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01333 } 01334 01335 static void rna_def_image(BlenderRNA *brna) 01336 { 01337 StructRNA *srna; 01338 PropertyRNA *prop; 01339 01340 srna = RNA_def_struct(brna, "ImageSequence", "Sequence"); 01341 RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images"); 01342 RNA_def_struct_sdna(srna, "Sequence"); 01343 01344 prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); 01345 RNA_def_property_string_sdna(prop, NULL, "strip->dir"); 01346 RNA_def_property_ui_text(prop, "Directory", ""); 01347 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01348 01349 prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE); 01350 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); 01351 RNA_def_property_struct_type(prop, "SequenceElement"); 01352 RNA_def_property_ui_text(prop, "Elements", ""); 01353 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); 01354 01355 rna_def_filter_video(srna); 01356 rna_def_proxy(srna); 01357 rna_def_input(srna); 01358 } 01359 01360 static void rna_def_meta(BlenderRNA *brna) 01361 { 01362 StructRNA *srna; 01363 PropertyRNA *prop; 01364 01365 srna = RNA_def_struct(brna, "MetaSequence", "Sequence"); 01366 RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip"); 01367 RNA_def_struct_sdna(srna, "Sequence"); 01368 01369 prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE); 01370 RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL); 01371 RNA_def_property_struct_type(prop, "Sequence"); 01372 RNA_def_property_ui_text(prop, "Sequences", ""); 01373 01374 rna_def_filter_video(srna); 01375 rna_def_proxy(srna); 01376 rna_def_input(srna); 01377 } 01378 01379 static void rna_def_scene(BlenderRNA *brna) 01380 { 01381 StructRNA *srna; 01382 PropertyRNA *prop; 01383 01384 srna = RNA_def_struct(brna, "SceneSequence", "Sequence"); 01385 RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene"); 01386 RNA_def_struct_sdna(srna, "Sequence"); 01387 01388 prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); 01389 RNA_def_property_flag(prop, PROP_EDITABLE); 01390 RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses"); 01391 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01392 01393 prop= RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE); 01394 RNA_def_property_flag(prop, PROP_EDITABLE); 01395 RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll"); 01396 RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera"); 01397 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01398 01399 rna_def_filter_video(srna); 01400 rna_def_proxy(srna); 01401 rna_def_input(srna); 01402 } 01403 01404 static void rna_def_movie(BlenderRNA *brna) 01405 { 01406 StructRNA *srna; 01407 PropertyRNA *prop; 01408 01409 srna = RNA_def_struct(brna, "MovieSequence", "Sequence"); 01410 RNA_def_struct_ui_text(srna, "Movie Sequence", "Sequence strip to load a video"); 01411 RNA_def_struct_sdna(srna, "Sequence"); 01412 01413 prop= RNA_def_property(srna, "mpeg_preseek", PROP_INT, PROP_NONE); 01414 RNA_def_property_int_sdna(prop, NULL, "anim_preseek"); 01415 RNA_def_property_range(prop, 0, 50); 01416 RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames"); 01417 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01418 01419 prop= RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE); 01420 RNA_def_property_int_sdna(prop, NULL, "streamindex"); 01421 RNA_def_property_range(prop, 0, 20); 01422 RNA_def_property_ui_text(prop, "Streamindex", "For files with several movie streams, use the stream with the given index"); 01423 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files"); 01424 01425 prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE); 01426 RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); 01427 RNA_def_property_struct_type(prop, "SequenceElement"); 01428 RNA_def_property_ui_text(prop, "Elements", ""); 01429 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); 01430 01431 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); 01432 RNA_def_property_ui_text(prop, "File", ""); 01433 RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length", 01434 "rna_Sequence_filepath_set"); 01435 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_filepath_update"); 01436 01437 rna_def_filter_video(srna); 01438 rna_def_proxy(srna); 01439 rna_def_input(srna); 01440 } 01441 01442 static void rna_def_sound(BlenderRNA *brna) 01443 { 01444 StructRNA *srna; 01445 PropertyRNA *prop; 01446 01447 srna = RNA_def_struct(brna, "SoundSequence", "Sequence"); 01448 RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time"); 01449 RNA_def_struct_sdna(srna, "Sequence"); 01450 01451 prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE); 01452 RNA_def_property_struct_type(prop, "Sound"); 01453 RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence"); 01454 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01455 01456 prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); 01457 RNA_def_property_float_sdna(prop, NULL, "volume"); 01458 RNA_def_property_range(prop, 0.0f, 100.0f); 01459 RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound"); 01460 RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL); 01461 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01462 01463 prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); 01464 RNA_def_property_float_sdna(prop, NULL, "pitch"); 01465 RNA_def_property_range(prop, 0.1f, 10.0f); 01466 RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound"); 01467 RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL); 01468 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01469 01470 prop= RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE); 01471 RNA_def_property_float_sdna(prop, NULL, "pan"); 01472 RNA_def_property_range(prop, -2.0f, 2.0f); 01473 RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)"); 01474 RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL); 01475 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01476 01477 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); 01478 RNA_def_property_ui_text(prop, "File", ""); 01479 RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length", 01480 "rna_Sequence_filepath_set"); 01481 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_filepath_update"); 01482 01483 rna_def_input(srna); 01484 } 01485 01486 static void rna_def_effect(BlenderRNA *brna) 01487 { 01488 StructRNA *srna; 01489 01490 srna = RNA_def_struct(brna, "EffectSequence", "Sequence"); 01491 RNA_def_struct_ui_text(srna, "Effect Sequence", "Sequence strip applying an effect on the images created by other strips"); 01492 RNA_def_struct_sdna(srna, "Sequence"); 01493 01494 rna_def_filter_video(srna); 01495 rna_def_proxy(srna); 01496 } 01497 01498 static void rna_def_multicam(BlenderRNA *brna) 01499 { 01500 StructRNA *srna; 01501 PropertyRNA *prop; 01502 01503 srna = RNA_def_struct(brna, "MulticamSequence", "Sequence"); 01504 RNA_def_struct_ui_text(srna, "Multicam Select Sequence", "Sequence strip to perform multicam editing: select channel from below"); 01505 RNA_def_struct_sdna(srna, "Sequence"); 01506 01507 prop= RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED); 01508 RNA_def_property_int_sdna(prop, NULL, "multicam_source"); 01509 RNA_def_property_range(prop, 0, MAXSEQ-1); 01510 RNA_def_property_ui_text(prop, "Multicam Source Channel", ""); 01511 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01512 01513 rna_def_filter_video(srna); 01514 rna_def_proxy(srna); 01515 rna_def_input(srna); 01516 } 01517 01518 static void rna_def_adjustment(BlenderRNA *brna) 01519 { 01520 StructRNA *srna; 01521 // PropertyRNA *prop; 01522 01523 srna = RNA_def_struct(brna, "AdjustmentSequence", "Sequence"); 01524 RNA_def_struct_ui_text(srna, "Adjustment Layer Sequence", "Sequence strip to perform filter adjustments to layers below"); 01525 RNA_def_struct_sdna(srna, "Sequence"); 01526 01527 rna_def_filter_video(srna); 01528 rna_def_proxy(srna); 01529 rna_def_input(srna); 01530 } 01531 01532 static void rna_def_plugin(BlenderRNA *brna) 01533 { 01534 StructRNA *srna; 01535 PropertyRNA *prop; 01536 01537 srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence"); 01538 RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin"); 01539 RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin"); 01540 01541 prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME); 01542 RNA_def_property_string_sdna(prop, NULL, "name"); 01543 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01544 RNA_def_property_ui_text(prop, "Filename", ""); 01545 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01546 01547 /* plugin properties need custom wrapping code like ID properties */ 01548 } 01549 01550 static void rna_def_wipe(BlenderRNA *brna) 01551 { 01552 StructRNA *srna; 01553 PropertyRNA *prop; 01554 01555 static const EnumPropertyItem wipe_type_items[]= { 01556 {0, "SINGLE", 0, "Single", ""}, 01557 {1, "DOUBLE", 0, "Double", ""}, 01558 /* not used yet {2, "BOX", 0, "Box", ""}, */ 01559 /* not used yet {3, "CROSS", 0, "Cross", ""}, */ 01560 {4, "IRIS", 0, "Iris", ""}, 01561 {5, "CLOCK", 0, "Clock", ""}, 01562 {0, NULL, 0, NULL, NULL} 01563 }; 01564 01565 static const EnumPropertyItem wipe_direction_items[]= { 01566 {0, "OUT", 0, "Out", ""}, 01567 {1, "IN", 0, "In", ""}, 01568 {0, NULL, 0, NULL, NULL} 01569 }; 01570 01571 srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence"); 01572 RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition"); 01573 RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata"); 01574 01575 prop= RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_UNSIGNED); 01576 RNA_def_property_float_sdna(prop, NULL, "edgeWidth"); 01577 RNA_def_property_range(prop, 0.0f, 1.0f); 01578 RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size"); 01579 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01580 01581 #if 1 /* expose as radians */ 01582 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); 01583 RNA_def_property_float_funcs(prop, "rna_WipeSequence_angle_get", "rna_WipeSequence_angle_set", NULL); 01584 RNA_def_property_range(prop, DEG2RAD(-90.0), DEG2RAD(90.0)); 01585 #else 01586 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); 01587 RNA_def_property_float_sdna(prop, NULL, "angle"); 01588 RNA_def_property_range(prop, -90.0f, 90.0f); 01589 #endif 01590 RNA_def_property_ui_text(prop, "Angle", "Edge angle"); 01591 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01592 01593 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); 01594 RNA_def_property_enum_sdna(prop, NULL, "forward"); 01595 RNA_def_property_enum_items(prop, wipe_direction_items); 01596 RNA_def_property_ui_text(prop, "Direction", "Wipe direction"); 01597 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01598 01599 prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE); 01600 RNA_def_property_enum_sdna(prop, NULL, "wipetype"); 01601 RNA_def_property_enum_items(prop, wipe_type_items); 01602 RNA_def_property_ui_text(prop, "Transition Type", ""); 01603 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01604 } 01605 01606 static void rna_def_glow(BlenderRNA *brna) 01607 { 01608 StructRNA *srna; 01609 PropertyRNA *prop; 01610 01611 srna = RNA_def_struct(brna, "GlowSequence", "EffectSequence"); 01612 RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect"); 01613 RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata"); 01614 01615 prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); 01616 RNA_def_property_float_sdna(prop, NULL, "fMini"); 01617 RNA_def_property_range(prop, 0.0f, 1.0f); 01618 RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow"); 01619 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01620 01621 prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE); 01622 RNA_def_property_float_sdna(prop, NULL, "fClamp"); 01623 RNA_def_property_range(prop, 0.0f, 1.0f); 01624 RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity"); 01625 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01626 01627 prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE); 01628 RNA_def_property_float_sdna(prop, NULL, "fBoost"); 01629 RNA_def_property_range(prop, 0.0f, 10.0f); 01630 RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier"); 01631 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01632 01633 prop= RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE); 01634 RNA_def_property_float_sdna(prop, NULL, "dDist"); 01635 RNA_def_property_range(prop, 0.5f, 20.0f); 01636 RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect"); 01637 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01638 01639 prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); 01640 RNA_def_property_int_sdna(prop, NULL, "dQuality"); 01641 RNA_def_property_range(prop, 1, 5); 01642 RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect"); 01643 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01644 01645 prop= RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE); 01646 RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0); 01647 RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only"); 01648 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01649 } 01650 01651 static void rna_def_transform(BlenderRNA *brna) 01652 { 01653 StructRNA *srna; 01654 PropertyRNA *prop; 01655 01656 static const EnumPropertyItem interpolation_items[]= { 01657 {0, "NONE", 0, "None", "No interpolation"}, 01658 {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation"}, 01659 {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation"}, 01660 {0, NULL, 0, NULL, NULL} 01661 }; 01662 01663 static const EnumPropertyItem translation_unit_items[]= { 01664 {0, "PIXELS", 0, "Pixels", ""}, 01665 {1, "PERCENT", 0, "Percent", ""}, 01666 {0, NULL, 0, NULL, NULL} 01667 }; 01668 01669 srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence"); 01670 RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips"); 01671 RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata"); 01672 01673 prop= RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED); 01674 RNA_def_property_float_sdna(prop, NULL, "ScalexIni"); 01675 RNA_def_property_ui_text(prop, "Scale X", ""); 01676 RNA_def_property_ui_range(prop, 0, 10, 3, 10); 01677 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01678 01679 prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED); 01680 RNA_def_property_float_sdna(prop, NULL, "ScaleyIni"); 01681 RNA_def_property_ui_text(prop, "Scale Y", ""); 01682 RNA_def_property_ui_range(prop, 0, 10, 3, 10); 01683 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01684 01685 prop= RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE); 01686 RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0); 01687 RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio"); 01688 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01689 01690 prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE); 01691 RNA_def_property_float_sdna(prop, NULL, "xIni"); 01692 RNA_def_property_ui_text(prop, "Translate X", ""); 01693 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10); 01694 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01695 01696 prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE); 01697 RNA_def_property_float_sdna(prop, NULL, "yIni"); 01698 RNA_def_property_ui_text(prop, "Translate Y", ""); 01699 RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10); 01700 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01701 01702 prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE); 01703 RNA_def_property_float_sdna(prop, NULL, "rotIni"); 01704 RNA_def_property_range(prop, -360.0f, 360.0f); 01705 RNA_def_property_ui_text(prop, "Rotation", ""); 01706 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01707 01708 prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE); 01709 RNA_def_property_enum_sdna(prop, NULL, "percent"); 01710 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */ 01711 RNA_def_property_enum_items(prop, translation_unit_items); 01712 RNA_def_property_ui_text(prop, "Translation Unit", ""); 01713 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01714 01715 prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); 01716 RNA_def_property_enum_items(prop, interpolation_items); 01717 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */ 01718 RNA_def_property_ui_text(prop, "Interpolation", ""); 01719 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01720 } 01721 01722 static void rna_def_solid_color(BlenderRNA *brna) 01723 { 01724 StructRNA *srna; 01725 PropertyRNA *prop; 01726 01727 srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence"); 01728 RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color"); 01729 RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata"); 01730 01731 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); 01732 RNA_def_property_float_sdna(prop, NULL, "col"); 01733 RNA_def_property_ui_text(prop, "Color", ""); 01734 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01735 } 01736 01737 static void rna_def_speed_control(BlenderRNA *brna) 01738 { 01739 StructRNA *srna; 01740 PropertyRNA *prop; 01741 01742 srna = RNA_def_struct(brna, "SpeedControlSequence", "EffectSequence"); 01743 RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips"); 01744 RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata"); 01745 01746 prop= RNA_def_property(srna, "multiply_speed", PROP_FLOAT, PROP_UNSIGNED); 01747 RNA_def_property_float_sdna(prop, NULL, "globalSpeed"); 01748 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* seq->facf0 is used to animate this */ 01749 RNA_def_property_ui_text(prop, "Multiply Speed", "Multiply the resulting speed after the speed factor"); 01750 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0); 01751 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01752 01753 prop= RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE); 01754 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE); 01755 RNA_def_property_ui_text(prop, "Use as speed", "Interpret the value as speed instead of a frame number"); 01756 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01757 01758 prop= RNA_def_property(srna, "use_frame_blend", PROP_BOOLEAN, PROP_NONE); 01759 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND); 01760 RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result"); 01761 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01762 01763 prop= RNA_def_property(srna, "scale_to_length", PROP_BOOLEAN, PROP_NONE); 01764 RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y); 01765 RNA_def_property_ui_text(prop, "Scale to length", "Scale values from 0.0 to 1.0 to target sequence length"); 01766 RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); 01767 } 01768 01769 void RNA_def_sequencer(BlenderRNA *brna) 01770 { 01771 rna_def_strip_element(brna); 01772 rna_def_strip_proxy(brna); 01773 rna_def_strip_color_balance(brna); 01774 rna_def_strip_crop(brna); 01775 rna_def_strip_transform(brna); 01776 01777 rna_def_sequence(brna); 01778 rna_def_editor(brna); 01779 01780 rna_def_image(brna); 01781 rna_def_meta(brna); 01782 rna_def_scene(brna); 01783 rna_def_movie(brna); 01784 rna_def_sound(brna); 01785 rna_def_effect(brna); 01786 rna_def_multicam(brna); 01787 rna_def_adjustment(brna); 01788 rna_def_plugin(brna); 01789 rna_def_wipe(brna); 01790 rna_def_glow(brna); 01791 rna_def_transform(brna); 01792 rna_def_solid_color(brna); 01793 rna_def_speed_control(brna); 01794 } 01795 01796 #endif 01797