1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
|
/**
* $Id$
*
* ***** 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,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contributor(s): Blender Foundation (2008)
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <stdlib.h>
#include <limits.h>
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#ifdef RNA_RUNTIME
/* name functions that ignore the first two characters */
static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
{
Sequence *seq= (Sequence*)ptr->data;
BLI_strncpy(value, seq->name+2, sizeof(seq->name)-2);
}
static int rna_Sequence_name_length(PointerRNA *ptr)
{
Sequence *seq= (Sequence*)ptr->data;
return strlen(seq->name+2);
}
static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)ptr->data;
BLI_strncpy(seq->name+2, value, sizeof(seq->name)-2);
}
static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
{
Sequence *seq= (Sequence*)ptr->data;
switch(seq->type) {
case SEQ_IMAGE:
return &RNA_ImageSequence;
case SEQ_META:
return &RNA_MetaSequence;
case SEQ_SCENE:
return &RNA_SceneSequence;
case SEQ_MOVIE:
case SEQ_MOVIE_AND_HD_SOUND:
return &RNA_MovieSequence;
case SEQ_RAM_SOUND:
case SEQ_HD_SOUND:
return &RNA_SoundSequence;
case SEQ_CROSS:
case SEQ_ADD:
case SEQ_SUB:
case SEQ_ALPHAOVER:
case SEQ_ALPHAUNDER:
case SEQ_GAMCROSS:
case SEQ_MUL:
case SEQ_OVERDROP:
return &RNA_EffectSequence;
case SEQ_PLUGIN:
return &RNA_PluginSequence;
case SEQ_WIPE:
return &RNA_WipeSequence;
case SEQ_GLOW:
return &RNA_GlowSequence;
case SEQ_TRANSFORM:
return &RNA_TransformSequence;
case SEQ_COLOR:
return &RNA_ColorSequence;
case SEQ_SPEED:
return &RNA_SpeedControlSequence;
default:
return &RNA_Sequence;
}
}
static void *rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal= iter->internal;
MetaStack *ms= (MetaStack*)internal->link;
return (Sequence*)ms->parseq;
}
#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_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "");
}
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, "top", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Top", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
prop= RNA_def_property(srna, "bottom", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Bottom", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
prop= RNA_def_property(srna, "left", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Left", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
prop= RNA_def_property(srna, "right", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Right", "");
RNA_def_property_ui_range(prop, 0, 4096, 1, 0);
}
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 paramaters 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");
RNA_def_property_ui_text(prop, "Offset Y", "");
RNA_def_property_ui_range(prop, -4096, 4096, 1, 0);
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, 0);
}
static void rna_def_strip_proxy(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
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", "");
}
static void rna_def_strip_color_balance(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceColorBalance", NULL);
RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance paramaters for a sequence strip.");
RNA_def_struct_sdna(srna, "StripColorBalance");
prop= RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows).");
prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones).");
prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR);
RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights).");
prop= RNA_def_property(srna, "inverse_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", "");
prop= RNA_def_property(srna, "inverse_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", "");
prop= RNA_def_property(srna, "inverse_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", "");
/* not yet used
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", "");
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", "");*/
}
static void rna_def_sequence(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem seq_type_items[]= {
{SEQ_IMAGE, "IMAGE", "Image", ""},
{SEQ_META, "META", "Meta", ""},
{SEQ_SCENE, "SCENE", "Scene", ""},
{SEQ_MOVIE, "MOVIE", "Movie", ""},
{SEQ_RAM_SOUND, "RAM_SOUND", "Ram Sound", ""},
{SEQ_HD_SOUND, "HD_SOUND", "HD Sound", ""},
{SEQ_MOVIE_AND_HD_SOUND, "MOVIE_AND_HD_SOUND", "Movie and HD Sound", ""},
{SEQ_EFFECT, "REPLACE", "Replace", ""},
{SEQ_CROSS, "CROSS", "Cross", ""},
{SEQ_ADD, "ADD", "Add", ""},
{SEQ_SUB, "SUBTRACT", "Subtract", ""},
{SEQ_ALPHAOVER, "ALPHA_OVER", "Alpha Over", ""},
{SEQ_ALPHAUNDER, "ALPHA_UNDER", "Alpha Under", ""},
{SEQ_GAMCROSS, "GAMMA_ACROSS", "Gamma Cross", ""},
{SEQ_MUL, "MULTIPLY", "Multiply", ""},
{SEQ_OVERDROP, "OVER_DROP", "Over Drop", ""},
{SEQ_PLUGIN, "PLUGIN", "plugin", ""},
{SEQ_WIPE, "WIPE", "Wipe", ""},
{SEQ_GLOW, "GLOW", "Glow", ""},
{SEQ_TRANSFORM, "TRANSFORM", "Transform", ""},
{SEQ_COLOR, "COLOR", "Color", ""},
{SEQ_SPEED, "SPEED", "Speed", ""},
{0, NULL, NULL, NULL}
};
static const EnumPropertyItem blend_mode_items[]= {
{SEQ_BLEND_REPLACE, "REPLACE", "Replace", ""},
{SEQ_CROSS, "CROSS", "Cross", ""},
{SEQ_ADD, "ADD", "Add", ""},
{SEQ_SUB, "SUBTRACT", "Subtract", ""},
{SEQ_ALPHAOVER, "ALPHA_OVER", "Alpha Over", ""},
{SEQ_ALPHAUNDER, "ALPHA_UNDER", "Alpha Under", ""},
{SEQ_GAMCROSS, "GAMMA_CROSS", "Gamma Cross", ""},
{SEQ_MUL, "MULTIPLY", "Multiply", ""},
{SEQ_OVERDROP, "OVER_DROP", "Over Drop", ""},
{SEQ_PLUGIN, "PLUGIN", "plugin", ""},
{SEQ_WIPE, "WIPE", "Wipe", ""},
{SEQ_GLOW, "GLOW", "Glow", ""},
{SEQ_TRANSFORM, "TRANSFORM", "Transform", ""},
{SEQ_COLOR, "COLOR", "Color", ""},
{SEQ_SPEED, "SPEED", "Speed", ""},
{0, NULL, 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");
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");
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);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_enum_items(prop, seq_type_items);
RNA_def_property_ui_text(prop, "Type", "");
//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
//RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this sequence.");
/* flags */
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Selected", "");
prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
RNA_def_property_ui_text(prop, "Left Handle Selected", "");
prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
RNA_def_property_ui_text(prop, "Right Handle Selected", "");
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
RNA_def_property_ui_text(prop, "Mute", "");
prop= RNA_def_property(srna, "ipo_frame_locked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED);
RNA_def_property_ui_text(prop, "IPO Frame Locked", "Lock the IPO coordinates to the global frame counter.");
prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it can't be transformed.");
/* strip positioning */
prop= RNA_def_property(srna, "length", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "len");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // computed from other values
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, "start_frame", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap tests
RNA_def_property_ui_text(prop, "Start Frame", "");
prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "startofs");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap tests
RNA_def_property_ui_text(prop, "Start Offset", "");
prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "endofs");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap tests
RNA_def_property_ui_text(prop, "End offset", "");
prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "startstill");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap tests
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Still", "");
prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "endstill");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap tests
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "End Still", "");
prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "machine");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap test
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
/* blending */
prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "");
prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Blend Opacity", "");
}
void rna_def_editor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceEditor", NULL);
RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene datablock.");
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", "");
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, 0, 0, 0, "rna_SequenceEdtior_meta_stack_get", 0, 0, 0, 0);
}
static void rna_def_filter_video(StructRNA *srna)
{
PropertyRNA *prop;
prop= RNA_def_property(srna, "de_interlace", 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.");
prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL);
RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha.");
prop= RNA_def_property(srna, "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.");
prop= RNA_def_property(srna, "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.");
prop= RNA_def_property(srna, "convert_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.");
prop= RNA_def_property(srna, "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.");
prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "mul");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Multiply Colors", "");
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.");
prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // allocate color balance
RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input.");
prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance");
RNA_def_property_ui_text(prop, "Color Balance", "");
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_flag(prop, PROP_NOT_EDITABLE); // allocate transform
RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing.");
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_flag(prop, PROP_NOT_EDITABLE); // allocate crop
RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing.");
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_filter_sound(StructRNA *srna)
{
PropertyRNA *prop;
prop= RNA_def_property(srna, "sound_gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "level");
RNA_def_property_range(prop, -96.0f, 6.0f);
RNA_def_property_ui_text(prop, "Sound Gain", "Sound level in dB (0 = full volume).");
prop= RNA_def_property(srna, "sound_pan", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pan");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Sound Pan", "Stereo sound balance.");
}
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_flag(prop, PROP_NOT_EDITABLE); // allocate proxy
RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip.");
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", "");
prop= RNA_def_property(srna, "proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data.");
}
static void rna_def_input(StructRNA *srna)
{
PropertyRNA *prop;
prop= RNA_def_property(srna, "animation_start_offset", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap test
RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start).");
prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // overlap test
RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end).");
}
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", "");
prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len");
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(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_ui_text(prop, "Scene", "Scene that this sequence uses.");
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.");
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
RNA_def_property_ui_text(prop, "Filename", "");
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", "");
rna_def_filter_video(srna);
rna_def_proxy(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, "UnknownType");
RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence (RAM audio only).");
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
RNA_def_property_ui_text(prop, "Filename", "");
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", "");
rna_def_filter_sound(srna);
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_proxy(srna);
}
static void rna_def_plugin(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "PluginSequence", "EffectSequence");
RNA_def_struct_ui_text(srna, "Plugin Sequence", "Sequence strip applying an effect, loaded from an external plugin.");
RNA_def_struct_sdna_from(srna, "PluginSeq", "plugin");
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "");
/* plugin properties need custom wrapping code like ID properties */
}
static void rna_def_wipe(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem wipe_type_items[]= {
{0, "SINGLE", "Single", ""},
{1, "DOUBLE", "Double", ""},
/* not used yet {2, "BOX", "Box", ""}, */
/* not used yet {3, "CROSS", "Cross", ""}, */
{4, "IRIS", "Iris", ""},
{5, "CLOCK", "Clock", ""},
{0, NULL, NULL, NULL}
};
static const EnumPropertyItem wipe_direction_items[]= {
{0, "OUT", "Out", ""},
{1, "IN", "In", ""},
{0, NULL, NULL, NULL}
};
srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence");
RNA_def_struct_ui_text(srna, "Wipe Sequence", "Sequence strip creating a wipe transition.");
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.");
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, -90.0f, 90.0f);
RNA_def_property_ui_text(prop, "Angle", "Edge angle.");
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.");
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", "");
}
static void rna_def_glow(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "GlowSequence", "EffectSequence");
RNA_def_struct_ui_text(srna, "Glow Sequence", "Sequence strip creating a glow effect.");
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");
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", "rightness limit of intensity.");
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.");
prop= RNA_def_property(srna, "blur_distance", 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.");
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.");
prop= RNA_def_property(srna, "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.");
}
static void rna_def_transform(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem interpolation_items[]= {
{0, "NONE", "None", "No interpolation."},
{1, "BILINEAR", "Bilinear", "Bilinear interpolation."},
{2, "BICUBIC", "Bicubic", "Bicubic interpolation."},
{0, NULL, NULL, NULL}
};
static const EnumPropertyItem translation_unit_items[]= {
{0, "PIXELS", "Pixels", ""},
{1, "PERCENT", "Percent", ""},
{0, NULL, NULL, NULL}
};
srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence");
RNA_def_struct_ui_text(srna, "Transform Sequence", "Sequence strip applying affine transformations to other strips.");
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 Start X", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
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 Start Y", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
prop= RNA_def_property(srna, "scale_end_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScalexFin");
RNA_def_property_ui_text(prop, "Scale End X", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
prop= RNA_def_property(srna, "scale_end_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScaleyFin");
RNA_def_property_ui_text(prop, "Scale End Y", "");
RNA_def_property_ui_range(prop, 0, 10, 3, 10);
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 Start X", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
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 Start Y", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
prop= RNA_def_property(srna, "translate_end_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xFin");
RNA_def_property_ui_text(prop, "Translate End X", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
prop= RNA_def_property(srna, "translate_end_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yFin");
RNA_def_property_ui_text(prop, "Translate End Y", "");
RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10);
prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rotIni");
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Rotation Start", "");
prop= RNA_def_property(srna, "rotation_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rotFin");
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Rotation End", "");
prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "percent");
RNA_def_property_enum_items(prop, translation_unit_items);
RNA_def_property_ui_text(prop, "Translation Unit", "");
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "");
}
static void rna_def_solid_color(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence");
RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color.");
RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_ui_text(prop, "Color", "");
}
static void rna_def_speed_control(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SpeedControlSequence", "EffectSequence");
RNA_def_struct_ui_text(srna, "SpeedControl Sequence", "Sequence strip to control the speed of other strips.");
RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
prop= RNA_def_property(srna, "global_speed", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
RNA_def_property_ui_text(prop, "Global Speed", "");
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 0);
prop= RNA_def_property(srna, "ipo_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
RNA_def_property_ui_text(prop, "IPO Velocity", "Interpret the IPO value as a velocity instead of a frame number.");
prop= RNA_def_property(srna, "frame_blending", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_BLEND);
RNA_def_property_ui_text(prop, "Frame Blending", "Blend two frames into the target for a smoother result.");
prop= RNA_def_property(srna, "ipo_compress_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
RNA_def_property_ui_text(prop, "IPO Compress Y", "Scale IPO value to get the target frame number, IPO value runs from 0.0 to 1.0.");
}
void RNA_def_sequence(BlenderRNA *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_sound(brna);
rna_def_effect(brna);
rna_def_plugin(brna);
rna_def_wipe(brna);
rna_def_glow(brna);
rna_def_transform(brna);
rna_def_solid_color(brna);
rna_def_speed_control(brna);
}
#endif
|