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
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
|
/*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/** \file
* \ingroup RNA
*/
#include <limits.h>
#include <stdlib.h>
#include "DNA_anim_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "DNA_vfont_types.h"
#include "BLI_math.h"
#include "BLT_translation.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_sequencer.h"
#include "BKE_sound.h"
#include "IMB_metadata.h"
#include "MEM_guardedalloc.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
#include "WM_types.h"
typedef struct EffectInfo {
const char *struct_name;
const char *ui_name;
const char *ui_desc;
void (*func)(StructRNA *);
int inputs;
} EffectInfo;
const EnumPropertyItem rna_enum_sequence_modifier_type_items[] = {
{seqModifierType_ColorBalance, "COLOR_BALANCE", ICON_NONE, "Color Balance", ""},
{seqModifierType_Curves, "CURVES", ICON_NONE, "Curves", ""},
{seqModifierType_HueCorrect, "HUE_CORRECT", ICON_NONE, "Hue Correct", ""},
{seqModifierType_BrightContrast, "BRIGHT_CONTRAST", ICON_NONE, "Bright/Contrast", ""},
{seqModifierType_Mask, "MASK", ICON_NONE, "Mask", ""},
{seqModifierType_WhiteBalance, "WHITE_BALANCE", ICON_NONE, "White Balance", ""},
{seqModifierType_Tonemap, "TONEMAP", ICON_NONE, "Tone Map", ""},
{0, NULL, 0, NULL, NULL},
};
#ifdef RNA_RUNTIME
# include "BKE_global.h"
# include "BKE_idprop.h"
# include "BKE_movieclip.h"
# include "BKE_report.h"
# include "WM_api.h"
# include "DEG_depsgraph.h"
# include "DEG_depsgraph_build.h"
# include "IMB_imbuf.h"
typedef struct SequenceSearchData {
Sequence *seq;
void *data;
SequenceModifierData *smd;
} SequenceSearchData;
/* build a temp reference to the parent */
static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
{
for (; seq; seq = seq->next) {
seq->tmp = seq_par;
if (seq->type == SEQ_TYPE_META) {
meta_tmp_ref(seq, seq->seqbase.first);
}
}
}
static void rna_SequenceElement_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed) {
StripElem *se = (StripElem *)ptr->data;
Sequence *seq;
/* slow but we can't avoid! */
seq = BKE_sequencer_from_elem(&ed->seqbase, se);
if (seq) {
BKE_sequence_invalidate_cache_raw(scene, seq);
}
}
}
static void rna_Sequence_invalidate_raw_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed) {
Sequence *seq = (Sequence *)ptr->data;
BKE_sequence_invalidate_cache_raw(scene, seq);
}
}
static void rna_Sequence_invalidate_preprocessed_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed) {
Sequence *seq = (Sequence *)ptr->data;
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
}
}
static void rna_Sequence_invalidate_composite_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed) {
Sequence *seq = (Sequence *)ptr->data;
BKE_sequence_invalidate_cache_composite(scene, seq);
}
}
static void rna_Sequence_scene_switch_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO | ID_RECALC_SEQUENCER_STRIPS);
DEG_relations_tag_update(bmain);
}
static void rna_Sequence_use_sequence(Main *bmain, Scene *scene, PointerRNA *ptr)
{
/* General update callback. */
rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
/* Changing recursion changes set of IDs which needs to be remapped by the copy-on-write.
* the only way for this currently is to tag the ID for ID_RECALC_COPY_ON_WRITE. */
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed) {
Sequence *seq = (Sequence *)ptr->data;
if (seq->scene != NULL) {
DEG_id_tag_update(&seq->scene->id, ID_RECALC_COPY_ON_WRITE);
}
}
/* The sequencer scene is to be updated as well, including new relations from the nested
* sequencer. */
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
DEG_relations_tag_update(bmain);
}
static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter,
PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
meta_tmp_ref(NULL, ed->seqbase.first);
rna_iterator_listbase_begin(iter, &ed->seqbase, NULL);
}
static void rna_SequenceEditor_update_cache(Main *UNUSED(bmain),
Scene *scene,
PointerRNA *UNUSED(ptr))
{
Editing *ed = scene->ed;
BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
BKE_sequencer_cache_cleanup(scene);
}
static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal = &iter->internal.listbase;
Sequence *seq = (Sequence *)internal->link;
if (seq->seqbase.first) {
internal->link = (Link *)seq->seqbase.first;
}
else if (seq->next) {
internal->link = (Link *)seq->next;
}
else {
internal->link = NULL;
do {
seq = seq->tmp; /* XXX - seq's don't reference their parents! */
if (seq && seq->next) {
internal->link = (Link *)seq->next;
break;
}
} while (seq);
}
iter->valid = (internal->link != NULL);
}
/* internal use */
static int rna_SequenceEditor_elements_length(PointerRNA *ptr)
{
Sequence *seq = (Sequence *)ptr->data;
/* Hack? copied from sequencer.c::reload_sequence_new_file() */
size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(struct StripElem);
/* The problem with seq->strip->len and seq->len is that it's discounted from the offset
* (hard cut trim). */
return (int)olen;
}
static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Sequence *seq = (Sequence *)ptr->data;
rna_iterator_array_begin(iter,
(void *)seq->strip->stripdata,
sizeof(StripElem),
rna_SequenceEditor_elements_length(ptr),
0,
NULL);
}
static void rna_Sequence_views_format_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
}
static void do_sequence_frame_change_update(Scene *scene, Sequence *seq)
{
Editing *ed = BKE_sequencer_editing_get(scene, false);
ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq);
Sequence *tseq;
BKE_sequence_calc_disp(scene, seq);
/* ensure effects are always fit in length to their input */
/* TODO(sergey): probably could be optimized.
* in terms skipping update of non-changing strips
*/
for (tseq = seqbase->first; tseq; tseq = tseq->next) {
if (tseq->seq1 || tseq->seq2 || tseq->seq3) {
BKE_sequence_calc(scene, tseq);
}
}
if (BKE_sequence_test_overlap(seqbase, seq)) {
BKE_sequence_base_shuffle(seqbase, seq, scene); /* XXX - BROKEN!, uses context seqbasep */
}
BKE_sequencer_sort(scene);
}
/* A simple wrapper around above func, directly usable as prop update func.
* Also invalidate cache if needed.
*/
static void rna_Sequence_frame_change_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
do_sequence_frame_change_update(scene, (Sequence *)ptr->data);
}
static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
BKE_sequence_translate(scene, seq, value - seq->start);
do_sequence_frame_change_update(scene, seq);
BKE_sequence_invalidate_cache_composite(scene, seq);
}
static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
BKE_sequence_tx_set_final_left(seq, value);
BKE_sequence_single_fix(seq);
do_sequence_frame_change_update(scene, seq);
BKE_sequence_invalidate_cache_composite(scene, seq);
}
static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
BKE_sequence_tx_set_final_right(seq, value);
BKE_sequence_single_fix(seq);
do_sequence_frame_change_update(scene, seq);
BKE_sequence_invalidate_cache_composite(scene, seq);
}
static void rna_Sequence_frame_offset_start_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
seq->startofs = value;
}
static void rna_Sequence_frame_offset_end_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
seq->endofs = value;
}
static void rna_Sequence_frame_still_start_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
seq->startstill = value;
}
static void rna_Sequence_frame_still_end_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
seq->endstill = value;
}
static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs);
BKE_sequence_reload_new_file(G.main, scene, seq, false);
do_sequence_frame_change_update(scene, seq);
}
static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs);
BKE_sequence_reload_new_file(G.main, scene, seq, false);
do_sequence_frame_change_update(scene, seq);
}
static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
BKE_sequence_invalidate_cache_composite(scene, seq);
BKE_sequence_tx_set_final_right(seq, BKE_sequence_tx_get_final_left(seq, false) + value);
do_sequence_frame_change_update(scene, seq);
BKE_sequence_invalidate_cache_composite(scene, seq);
}
static int rna_Sequence_frame_length_get(PointerRNA *ptr)
{
Sequence *seq = (Sequence *)ptr->data;
return BKE_sequence_tx_get_final_right(seq, false) - BKE_sequence_tx_get_final_left(seq, false);
}
static int rna_Sequence_frame_editable(PointerRNA *ptr, const char **UNUSED(r_info))
{
Sequence *seq = (Sequence *)ptr->data;
/* Effect sequences' start frame and length must be readonly! */
return (BKE_sequence_effect_get_num_inputs(seq->type)) ? 0 : PROP_EDITABLE;
}
static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
{
Sequence *seq = (Sequence *)ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq);
BKE_sequence_invalidate_cache_composite(scene, seq);
/* check channel increment or decrement */
const int channel_delta = (value >= seq->machine) ? 1 : -1;
seq->machine = value;
if (BKE_sequence_test_overlap(seqbase, seq)) {
/* XXX - BROKEN!, uses context seqbasep */
BKE_sequence_base_shuffle_ex(seqbase, seq, scene, channel_delta);
}
BKE_sequencer_sort(scene);
BKE_sequence_invalidate_cache_composite(scene, seq);
}
static void rna_Sequence_frame_offset_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
{
Sequence *seq = (Sequence *)ptr->data;
*min = ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD) ? 0 : INT_MIN;
*max = INT_MAX;
}
static void rna_Sequence_use_proxy_set(PointerRNA *ptr, bool value)
{
Sequence *seq = (Sequence *)ptr->data;
BKE_sequencer_proxy_set(seq, value != 0);
}
static void rna_Sequence_use_translation_set(PointerRNA *ptr, bool value)
{
Sequence *seq = (Sequence *)ptr->data;
if (value) {
seq->flag |= SEQ_USE_TRANSFORM;
if (seq->strip->transform == NULL) {
seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
}
}
else {
seq->flag &= ~SEQ_USE_TRANSFORM;
}
}
static void rna_Sequence_use_crop_set(PointerRNA *ptr, bool value)
{
Sequence *seq = (Sequence *)ptr->data;
if (value) {
seq->flag |= SEQ_USE_CROP;
if (seq->strip->crop == NULL) {
seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
}
}
else {
seq->flag &= ~SEQ_USE_CROP;
}
}
static int transform_seq_cmp_fn(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->strip && seq->strip->transform == data->data) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_transform(Editing *ed, StripTransform *transform)
{
SequenceSearchData data;
data.seq = NULL;
data.data = transform;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, transform_seq_cmp_fn, &data);
return data.seq;
}
static char *rna_SequenceTransform_path(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_transform(ed, ptr->data);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform", name_esc);
}
else {
return BLI_strdup("");
}
}
static void rna_SequenceTransform_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_transform(ed, ptr->data);
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
}
static int crop_seq_cmp_fn(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->strip && seq->strip->crop == data->data) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_crop(Editing *ed, StripCrop *crop)
{
SequenceSearchData data;
data.seq = NULL;
data.data = crop;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, crop_seq_cmp_fn, &data);
return data.seq;
}
static char *rna_SequenceCrop_path(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_crop(ed, ptr->data);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop", name_esc);
}
else {
return BLI_strdup("");
}
}
static void rna_SequenceCrop_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_crop(ed, ptr->data);
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
}
static void rna_Sequence_text_font_set(PointerRNA *ptr,
PointerRNA ptr_value,
struct ReportList *UNUSED(reports))
{
Sequence *seq = ptr->data;
TextVars *data = seq->effectdata;
VFont *value = ptr_value.data;
BKE_sequencer_text_font_unload(data, true);
id_us_plus(&value->id);
data->text_blf_id = SEQ_FONT_NOT_LOADED;
data->text_font = value;
}
/* 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)
{
Scene *scene = (Scene *)ptr->owner_id;
Sequence *seq = (Sequence *)ptr->data;
char oldname[sizeof(seq->name)];
AnimData *adt;
/* make a copy of the old name first */
BLI_strncpy(oldname, seq->name + 2, sizeof(seq->name) - 2);
/* copy the new name into the name slot */
BLI_strncpy_utf8(seq->name + 2, value, sizeof(seq->name) - 2);
/* make sure the name is unique */
BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq);
/* fix all the animation data which may link to this */
/* Don't rename everywhere because these are per scene. */
# if 0
BKE_animdata_fix_paths_rename_all(NULL, "sequence_editor.sequences_all", oldname, seq->name + 2);
# endif
adt = BKE_animdata_from_id(&scene->id);
if (adt) {
BKE_animdata_fix_paths_rename(
&scene->id, adt, NULL, "sequence_editor.sequences_all", oldname, seq->name + 2, 0, 0, 1);
}
}
static StructRNA *rna_Sequence_refine(struct PointerRNA *ptr)
{
Sequence *seq = (Sequence *)ptr->data;
switch (seq->type) {
case SEQ_TYPE_IMAGE:
return &RNA_ImageSequence;
case SEQ_TYPE_META:
return &RNA_MetaSequence;
case SEQ_TYPE_SCENE:
return &RNA_SceneSequence;
case SEQ_TYPE_MOVIE:
return &RNA_MovieSequence;
case SEQ_TYPE_MOVIECLIP:
return &RNA_MovieClipSequence;
case SEQ_TYPE_MASK:
return &RNA_MaskSequence;
case SEQ_TYPE_SOUND_RAM:
return &RNA_SoundSequence;
case SEQ_TYPE_CROSS:
return &RNA_CrossSequence;
case SEQ_TYPE_ADD:
return &RNA_AddSequence;
case SEQ_TYPE_SUB:
return &RNA_SubtractSequence;
case SEQ_TYPE_ALPHAOVER:
return &RNA_AlphaOverSequence;
case SEQ_TYPE_ALPHAUNDER:
return &RNA_AlphaUnderSequence;
case SEQ_TYPE_GAMCROSS:
return &RNA_GammaCrossSequence;
case SEQ_TYPE_MUL:
return &RNA_MultiplySequence;
case SEQ_TYPE_OVERDROP:
return &RNA_OverDropSequence;
case SEQ_TYPE_MULTICAM:
return &RNA_MulticamSequence;
case SEQ_TYPE_ADJUSTMENT:
return &RNA_AdjustmentSequence;
case SEQ_TYPE_WIPE:
return &RNA_WipeSequence;
case SEQ_TYPE_GLOW:
return &RNA_GlowSequence;
case SEQ_TYPE_TRANSFORM:
return &RNA_TransformSequence;
case SEQ_TYPE_COLOR:
return &RNA_ColorSequence;
case SEQ_TYPE_SPEED:
return &RNA_SpeedControlSequence;
case SEQ_TYPE_GAUSSIAN_BLUR:
return &RNA_GaussianBlurSequence;
case SEQ_TYPE_TEXT:
return &RNA_TextSequence;
case SEQ_TYPE_COLORMIX:
return &RNA_ColorMixSequence;
default:
return &RNA_Sequence;
}
}
static char *rna_Sequence_path(PointerRNA *ptr)
{
Sequence *seq = (Sequence *)ptr->data;
/* sequencer data comes from scene...
* TODO: would be nice to make SequenceEditor data a data-block of its own (for shorter paths)
*/
if (seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"]", name_esc);
}
else {
return BLI_strdup("");
}
}
static IDProperty *rna_Sequence_idprops(PointerRNA *ptr, bool create)
{
Sequence *seq = ptr->data;
if (create && !seq->prop) {
IDPropertyTemplate val = {0};
seq->prop = IDP_New(IDP_GROUP, &val, "Sequence ID properties");
}
return seq->prop;
}
static PointerRNA rna_MovieSequence_metadata_get(Sequence *seq)
{
if (seq == NULL || seq->anims.first == NULL) {
return PointerRNA_NULL;
}
StripAnim *sanim = seq->anims.first;
if (sanim->anim == NULL) {
return PointerRNA_NULL;
}
IDProperty *metadata = IMB_anim_load_metadata(sanim->anim);
if (metadata == NULL) {
return PointerRNA_NULL;
}
PointerRNA ptr;
RNA_pointer_create(NULL, &RNA_IDPropertyWrapPtr, metadata, &ptr);
return ptr;
}
static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal = &iter->internal.listbase;
MetaStack *ms = (MetaStack *)internal->link;
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
/* TODO, expose seq path setting as a higher level sequencer BKE function */
static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
{
Sequence *seq = (Sequence *)(ptr->data);
BLI_split_dirfile(value,
seq->strip->dir,
seq->strip->stripdata->name,
sizeof(seq->strip->dir),
sizeof(seq->strip->stripdata->name));
}
static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
{
Sequence *seq = (Sequence *)(ptr->data);
BLI_join_dirfile(value, FILE_MAX, seq->strip->dir, seq->strip->stripdata->name);
}
static int rna_Sequence_filepath_length(PointerRNA *ptr)
{
Sequence *seq = (Sequence *)(ptr->data);
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
return strlen(path);
}
static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
{
StripProxy *proxy = (StripProxy *)(ptr->data);
BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file));
if (proxy->anim) {
IMB_free_anim(proxy->anim);
proxy->anim = NULL;
}
}
static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
{
StripProxy *proxy = (StripProxy *)(ptr->data);
BLI_join_dirfile(value, FILE_MAX, proxy->dir, proxy->file);
}
static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
{
StripProxy *proxy = (StripProxy *)(ptr->data);
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file);
return strlen(path);
}
static void rna_Sequence_audio_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
}
static int rna_Sequence_input_count_get(PointerRNA *ptr)
{
Sequence *seq = (Sequence *)(ptr->data);
return BKE_sequence_effect_get_num_inputs(seq->type);
}
# if 0
static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
Sequence *seq = (Sequence *)(ptr->data);
BLI_split_dirfile(value,
seq->strip->dir,
seq->strip->stripdata->name,
sizeof(seq->strip->dir),
sizeof(seq->strip->stripdata->name));
}
static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
{
StripElem *elem = (StripElem *)(ptr->data);
BLI_split_file_part(value, elem->name, sizeof(elem->name));
}
# endif
static void rna_Sequence_reopen_files_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
if (RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) {
BKE_sequencer_update_sound_bounds(scene, ptr->data);
}
}
static void rna_Sequence_mute_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
}
static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Sequence *seq = (Sequence *)(ptr->data);
BKE_sequence_reload_new_file(bmain, scene, seq, true);
BKE_sequence_calc(scene, seq);
rna_Sequence_invalidate_raw_update(bmain, scene, ptr);
}
static void rna_Sequence_sound_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS | ID_RECALC_AUDIO);
}
static int seqproxy_seq_cmp_fn(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->strip && seq->strip->proxy == data->data) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_proxy(Editing *ed, StripProxy *proxy)
{
SequenceSearchData data;
data.seq = NULL;
data.data = proxy;
BKE_sequencer_base_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_fn, &data);
return data.seq;
}
static void rna_Sequence_tcindex_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_proxy(ed, ptr->data);
BKE_sequence_reload_new_file(bmain, scene, seq, false);
do_sequence_frame_change_update(scene, seq);
}
static void rna_SequenceProxy_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_proxy(ed, ptr->data);
BKE_sequence_invalidate_cache_raw(scene, seq);
}
/* do_versions? */
static float rna_Sequence_opacity_get(PointerRNA *ptr)
{
Sequence *seq = (Sequence *)(ptr->data);
return seq->blend_opacity / 100.0f;
}
static void rna_Sequence_opacity_set(PointerRNA *ptr, float value)
{
Sequence *seq = (Sequence *)(ptr->data);
CLAMP(value, 0.0f, 1.0f);
seq->blend_opacity = value * 100.0f;
}
static int colbalance_seq_cmp_fn(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (seq->modifiers.first) {
SequenceModifierData *smd = seq->modifiers.first;
for (smd = seq->modifiers.first; smd; smd = smd->next) {
if (smd->type == seqModifierType_ColorBalance) {
ColorBalanceModifierData *cbmd = (ColorBalanceModifierData *)smd;
if (&cbmd->color_balance == data->data) {
data->seq = seq;
data->smd = smd;
return -1; /* done so bail out */
}
}
}
}
return 1;
}
static Sequence *sequence_get_by_colorbalance(Editing *ed,
StripColorBalance *cb,
SequenceModifierData **r_smd)
{
SequenceSearchData data;
data.seq = NULL;
data.smd = NULL;
data.data = cb;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, colbalance_seq_cmp_fn, &data);
*r_smd = data.smd;
return data.seq;
}
static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
SequenceModifierData *smd;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
if (!smd) {
/* path to old filter color balance */
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", name_esc);
}
else {
/* path to modifier */
char name_esc_smd[sizeof(smd->name) * 2];
BLI_strescape(name_esc_smd, smd->name, sizeof(name_esc_smd));
return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].modifiers[\"%s\"].color_balance",
name_esc,
name_esc_smd);
}
}
else {
return BLI_strdup("");
}
}
static void rna_SequenceColorBalance_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
SequenceModifierData *smd;
Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
}
static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, bool value)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed == NULL) {
return;
}
/* convert from abs to relative and back */
if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) == 0 && value) {
ed->over_cfra = scene->r.cfra + ed->over_ofs;
ed->over_flag |= SEQ_EDIT_OVERLAY_ABS;
}
else if ((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) {
ed->over_ofs = ed->over_cfra - scene->r.cfra;
ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS;
}
}
static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed == NULL) {
return scene->r.cfra;
}
if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS) {
return ed->over_cfra - scene->r.cfra;
}
else {
return ed->over_ofs;
}
}
static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (ed == NULL) {
return;
}
if (ed->over_flag & SEQ_EDIT_OVERLAY_ABS) {
ed->over_cfra = (scene->r.cfra + value);
}
else {
ed->over_ofs = value;
}
}
static int modifier_seq_cmp_fn(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
if (BLI_findindex(&seq->modifiers, data->data) != -1) {
data->seq = seq;
return -1; /* done so bail out */
}
return 1;
}
static Sequence *sequence_get_by_modifier(Editing *ed, SequenceModifierData *smd)
{
SequenceSearchData data;
data.seq = NULL;
data.data = smd;
/* irritating we need to search for our sequence! */
BKE_sequencer_base_recursive_apply(&ed->seqbase, modifier_seq_cmp_fn, &data);
return data.seq;
}
static StructRNA *rna_SequenceModifier_refine(struct PointerRNA *ptr)
{
SequenceModifierData *smd = (SequenceModifierData *)ptr->data;
switch (smd->type) {
case seqModifierType_ColorBalance:
return &RNA_ColorBalanceModifier;
case seqModifierType_Curves:
return &RNA_CurvesModifier;
case seqModifierType_HueCorrect:
return &RNA_HueCorrectModifier;
case seqModifierType_BrightContrast:
return &RNA_BrightContrastModifier;
case seqModifierType_WhiteBalance:
return &RNA_WhiteBalanceModifier;
case seqModifierType_Tonemap:
return &RNA_SequencerTonemapModifierData;
default:
return &RNA_SequenceModifier;
}
}
static char *rna_SequenceModifier_path(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
SequenceModifierData *smd = ptr->data;
Sequence *seq = sequence_get_by_modifier(ed, smd);
if (seq && seq->name + 2) {
char name_esc[(sizeof(seq->name) - 2) * 2];
char name_esc_smd[sizeof(smd->name) * 2];
BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
BLI_strescape(name_esc_smd, smd->name, sizeof(name_esc_smd));
return BLI_sprintfN(
"sequence_editor.sequences_all[\"%s\"].modifiers[\"%s\"]", name_esc, name_esc_smd);
}
else {
return BLI_strdup("");
}
}
static void rna_SequenceModifier_name_set(PointerRNA *ptr, const char *value)
{
SequenceModifierData *smd = ptr->data;
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_modifier(ed, smd);
AnimData *adt;
char oldname[sizeof(smd->name)];
/* make a copy of the old name first */
BLI_strncpy(oldname, smd->name, sizeof(smd->name));
/* copy the new name into the name slot */
BLI_strncpy_utf8(smd->name, value, sizeof(smd->name));
/* make sure the name is truly unique */
BKE_sequence_modifier_unique_name(seq, smd);
/* fix all the animation data which may link to this */
adt = BKE_animdata_from_id(&scene->id);
if (adt) {
char path[1024];
BLI_snprintf(
path, sizeof(path), "sequence_editor.sequences_all[\"%s\"].modifiers", seq->name + 2);
BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, path, oldname, smd->name, 0, 0, 1);
}
}
static void rna_SequenceModifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
/* strip from other scenes could be modified, so using active scene is not reliable */
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_modifier(ed, ptr->data);
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
}
static bool rna_SequenceModifier_otherSequence_poll(PointerRNA *ptr, PointerRNA value)
{
Scene *scene = (Scene *)ptr->owner_id;
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = sequence_get_by_modifier(ed, ptr->data);
Sequence *cur = (Sequence *)value.data;
if ((seq == cur) || (cur->type == SEQ_TYPE_SOUND_RAM)) {
return false;
}
return true;
}
static SequenceModifierData *rna_Sequence_modifier_new(
Sequence *seq, bContext *C, ReportList *reports, const char *name, int type)
{
if (!BKE_sequence_supports_modifiers(seq)) {
BKE_report(reports, RPT_ERROR, "Sequence type does not support modifiers");
return NULL;
}
else {
Scene *scene = CTX_data_scene(C);
SequenceModifierData *smd;
smd = BKE_sequence_modifier_new(seq, name, type);
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
return smd;
}
}
static void rna_Sequence_modifier_remove(Sequence *seq,
bContext *C,
ReportList *reports,
PointerRNA *smd_ptr)
{
SequenceModifierData *smd = smd_ptr->data;
Scene *scene = CTX_data_scene(C);
if (BKE_sequence_modifier_remove(seq, smd) == false) {
BKE_report(reports, RPT_ERROR, "Modifier was not found in the stack");
return;
}
RNA_POINTER_INVALIDATE(smd_ptr);
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
}
static void rna_Sequence_modifier_clear(Sequence *seq, bContext *C)
{
Scene *scene = CTX_data_scene(C);
BKE_sequence_modifier_clear(seq);
BKE_sequence_invalidate_cache_preprocessed(scene, seq);
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
}
static float rna_Sequence_fps_get(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->owner_id;
Sequence *seq = (Sequence *)(ptr->data);
return BKE_sequence_get_fps(scene, seq);
}
#else
static void rna_def_strip_element(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceElement", NULL);
RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame");
RNA_def_struct_sdna(srna, "StripElem");
prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "Name of the source file");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceElement_update");
prop = RNA_def_property(srna, "orig_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orig_width");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Orig Width", "Original image width");
prop = RNA_def_property(srna, "orig_height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orig_height");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Orig Height", "Original image height");
}
static void rna_def_strip_crop(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceCrop", NULL);
RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripCrop");
prop = RNA_def_property(srna, "max_y", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "top");
RNA_def_property_ui_text(prop, "Top", "Number of pixels to crop from the top");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
prop = RNA_def_property(srna, "min_y", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "bottom");
RNA_def_property_ui_text(prop, "Bottom", "Number of pixels to crop from the bottom");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "left");
RNA_def_property_ui_text(prop, "Left", "Number of pixels to crop from the left side");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
prop = RNA_def_property(srna, "max_x", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "right");
RNA_def_property_ui_text(prop, "Right", "Number of pixels to crop from the right side");
RNA_def_property_ui_range(prop, 0, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update");
RNA_def_struct_path_func(srna, "rna_SequenceCrop_path");
}
static void rna_def_strip_transform(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceTransform", NULL);
RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripTransform");
prop = RNA_def_property(srna, "offset_x", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "xofs");
RNA_def_property_ui_text(
prop, "Offset X", "Amount to move the input on the X axis within its boundaries");
RNA_def_property_ui_range(prop, -4096, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
prop = RNA_def_property(srna, "offset_y", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "yofs");
RNA_def_property_ui_text(
prop, "Offset Y", "Amount to move the input on the Y axis within its boundaries");
RNA_def_property_ui_range(prop, -4096, 4096, 1, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update");
RNA_def_struct_path_func(srna, "rna_SequenceTransform_path");
}
static void rna_def_strip_proxy(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem seq_tc_items[] = {
{SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""},
{SEQ_PROXY_TC_RECORD_RUN,
"RECORD_RUN",
0,
"Record Run",
"Use images in the order as they are recorded"},
{SEQ_PROXY_TC_FREE_RUN,
"FREE_RUN",
0,
"Free Run",
"Use global timestamp written by recording device"},
{SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN,
"FREE_RUN_REC_DATE",
0,
"Free Run (rec date)",
"Interpolate a global timestamp using the "
"record date and time written by recording device"},
{SEQ_PROXY_TC_RECORD_RUN_NO_GAPS,
"RECORD_RUN_NO_GAPS",
0,
"Record Run No Gaps",
"Like record run, but ignore timecode, "
"changes in framerate or dropouts"},
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "SequenceProxy", NULL);
RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripProxy");
prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir");
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file");
RNA_def_property_string_funcs(prop,
"rna_Sequence_proxy_filepath_get",
"rna_Sequence_proxy_filepath_length",
"rna_Sequence_proxy_filepath_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update");
prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "build_flags", SEQ_PROXY_SKIP_EXISTING);
RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing proxy files when building");
prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25);
RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution");
prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50);
RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution");
prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75);
RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution");
prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100);
RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution");
prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN);
RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
prop = RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN);
RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
prop = RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(
prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN);
RNA_def_property_ui_text(
prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "quality");
RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build");
RNA_def_property_ui_range(prop, 1, 100, 1, -1);
prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tc");
RNA_def_property_enum_items(prop, seq_tc_items);
RNA_def_property_ui_text(prop, "Timecode", "Method for reading the inputs timecode");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_tcindex_update");
prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_DIR);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "use_proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "storage", SEQ_STORAGE_PROXY_CUSTOM_FILE);
RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
}
static void rna_def_color_balance(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SequenceColorBalanceData", NULL);
RNA_def_struct_ui_text(srna,
"Sequence Color Balance Data",
"Color balance parameters for a sequence strip and it's modifiers");
RNA_def_struct_sdna(srna, "StripColorBalance");
prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_ui_text(prop, "Lift", "Color balance lift (shadows)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_ui_text(prop, "Gamma", "Color balance gamma (midtones)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_ui_text(prop, "Gain", "Color balance gain (highlights)");
RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "invert_gain", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAIN);
RNA_def_property_ui_text(prop, "Inverse Gain", "Invert the gain color`");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "invert_gamma", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_GAMMA);
RNA_def_property_ui_text(prop, "Inverse Gamma", "Invert the gamma color");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
prop = RNA_def_property(srna, "invert_lift", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT);
RNA_def_property_ui_text(prop, "Inverse Lift", "Invert the lift color");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceColorBalance_update");
/* not yet used */
# if 0
prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Exposure", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Saturation", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
# endif
RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path");
}
static void rna_def_strip_color_balance(BlenderRNA *brna)
{
StructRNA *srna;
srna = RNA_def_struct(brna, "SequenceColorBalance", "SequenceColorBalanceData");
RNA_def_struct_ui_text(
srna, "Sequence Color Balance", "Color balance parameters for a sequence strip");
RNA_def_struct_sdna(srna, "StripColorBalance");
}
static const EnumPropertyItem blend_mode_items[] = {
{SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
{SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_DARKEN, "DARKEN", 0, "Darken", ""},
{SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
{SEQ_TYPE_COLOR_BURN, "BURN", 0, "Color Burn", ""},
{SEQ_TYPE_LINEAR_BURN, "LINEAR_BURN", 0, "Linear Burn", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_LIGHTEN, "LIGHTEN", 0, "Lighten", ""},
{SEQ_TYPE_SCREEN, "SCREEN", 0, "Screen", ""},
{SEQ_TYPE_DODGE, "DODGE", 0, "Color Dodge", ""},
{SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_OVERLAY, "OVERLAY", 0, "Overlay", ""},
{SEQ_TYPE_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
{SEQ_TYPE_HARD_LIGHT, "HARD_LIGHT", 0, "Hard Light", ""},
{SEQ_TYPE_VIVID_LIGHT, "VIVID_LIGHT", 0, "Vivid Light", ""},
{SEQ_TYPE_LIN_LIGHT, "LINEAR_LIGHT", 0, "Linear Light", ""},
{SEQ_TYPE_PIN_LIGHT, "PIN_LIGHT", 0, "Pin Light", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_DIFFERENCE, "DIFFERENCE", 0, "Difference", ""},
{SEQ_TYPE_EXCLUSION, "EXCLUSION", 0, "Exclusion", ""},
{SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_HUE, "HUE", 0, "Hue", ""},
{SEQ_TYPE_SATURATION, "SATURATION", 0, "Saturation", ""},
{SEQ_TYPE_BLEND_COLOR, "COLOR", 0, "Color", ""},
{SEQ_TYPE_VALUE, "VALUE", 0, "Value", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
{SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
{SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
{SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
{0, NULL, 0, NULL, NULL},
};
static void rna_def_sequence_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "SequenceModifiers");
srna = RNA_def_struct(brna, "SequenceModifiers", NULL);
RNA_def_struct_sdna(srna, "Sequence");
RNA_def_struct_ui_text(srna, "Strip Modifiers", "Collection of strip modifiers");
/* add modifier */
func = RNA_def_function(srna, "new", "rna_Sequence_modifier_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new modifier");
parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the modifier");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
/* modifier to add */
parm = RNA_def_enum(func,
"type",
rna_enum_sequence_modifier_type_items,
seqModifierType_ColorBalance,
"",
"Modifier type to add");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
/* return type */
parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Newly created modifier");
RNA_def_function_return(func, parm);
/* remove modifier */
func = RNA_def_function(srna, "remove", "rna_Sequence_modifier_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an existing modifier from the sequence");
/* modifier to remove */
parm = RNA_def_pointer(func, "modifier", "SequenceModifier", "", "Modifier to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
/* clear all modifiers */
func = RNA_def_function(srna, "clear", "rna_Sequence_modifier_clear");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Remove all modifiers from the sequence");
}
static void rna_def_sequence(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem seq_type_items[] = {
{SEQ_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
{SEQ_TYPE_META, "META", 0, "Meta", ""},
{SEQ_TYPE_SCENE, "SCENE", 0, "Scene", ""},
{SEQ_TYPE_MOVIE, "MOVIE", 0, "Movie", ""},
{SEQ_TYPE_MOVIECLIP, "MOVIECLIP", 0, "Clip", ""},
{SEQ_TYPE_MASK, "MASK", 0, "Mask", ""},
{SEQ_TYPE_SOUND_RAM, "SOUND", 0, "Sound", ""},
{SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
{SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
{SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
{SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
{SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
{SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
{SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
{SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
{SEQ_TYPE_WIPE, "WIPE", 0, "Wipe", ""},
{SEQ_TYPE_GLOW, "GLOW", 0, "Glow", ""},
{SEQ_TYPE_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
{SEQ_TYPE_COLOR, "COLOR", 0, "Color", ""},
{SEQ_TYPE_SPEED, "SPEED", 0, "Speed", ""},
{SEQ_TYPE_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
{SEQ_TYPE_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
{SEQ_TYPE_GAUSSIAN_BLUR, "GAUSSIAN_BLUR", 0, "Gaussian Blur", ""},
{SEQ_TYPE_TEXT, "TEXT", 0, "Text", ""},
{SEQ_TYPE_COLORMIX, "COLORMIX", 0, "Color Mix", ""},
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "Sequence", NULL);
RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor");
RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
RNA_def_struct_path_func(srna, "rna_Sequence_path");
RNA_def_struct_idprops_func(srna, "rna_Sequence_idprops");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(
prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
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);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, seq_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
/* flags */
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
RNA_def_property_ui_text(prop, "Left Handle Selected", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
RNA_def_property_ui_text(prop, "Right Handle Selected", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, -1);
RNA_def_property_ui_text(
prop, "Mute", "Disable strip so that it cannot be viewed in the output");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_mute_update");
prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
RNA_def_property_ui_text(prop, "Lock", "Lock strip so that it cannot be transformed");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
/* strip positioning */
/* Cache has to be invalidated before and after transformation. */
prop = RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(
prop, "Length", "The length of the contents of this strip after the handles are applied");
RNA_def_property_int_funcs(
prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set", NULL);
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "len");
RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_ui_text(
prop, "Length", "The length of the contents of this strip before the handles are applied");
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Start Frame", "X position where the strip begins");
RNA_def_property_int_funcs(
prop, NULL, "rna_Sequence_start_frame_set", NULL); /* overlap tests and calc_seq_disp */
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startdisp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(
prop,
"Start Frame",
"Start frame displayed in the sequence editor after offsets are applied, setting this is "
"equivalent to moving the handle, not the actual start frame");
/* overlap tests and calc_seq_disp */
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL);
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "enddisp");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(
prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied");
/* overlap tests and calc_seq_disp */
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL);
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startofs");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_ui_text(prop, "Start Offset", "");
RNA_def_property_int_funcs(
prop, NULL, "rna_Sequence_frame_offset_start_set", "rna_Sequence_frame_offset_range");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endofs");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_ui_text(prop, "End Offset", "");
RNA_def_property_int_funcs(
prop, NULL, "rna_Sequence_frame_offset_end_set", "rna_Sequence_frame_offset_range");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "startstill");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Still", "");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_frame_still_start_set", NULL);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "endstill");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "End Still", "");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_frame_still_end_set", NULL);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "machine");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, MAXSEQ);
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip");
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set", NULL); /* overlap test */
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_linear_modifiers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_LINEAR_MODIFIERS);
RNA_def_property_ui_text(prop,
"Use Linear Modifiers",
"Calculate modifiers in linear space instead of sequencer's space");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
/* blending */
prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blend_mode");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(
prop, "Blending Mode", "Method for controlling how the strip combines with other strips");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(
prop, "Blend Opacity", "Percentage of how much the strip's colors affect other strips");
/* stupid 0-100 -> 0-1 */
RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_composite_update");
prop = RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_float_sdna(prop, NULL, "effect_fader");
RNA_def_property_ui_text(prop, "Effect Fader Position", "Custom fade value");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_default_fade", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_EFFECT_DEFAULT_FADE);
RNA_def_property_ui_text(
prop,
"Use Default Fade",
"Fade effect using the built-in default (usually make transition as long as "
"effect strip)");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_fader");
RNA_def_property_ui_text(
prop,
"Speed Factor",
"Multiply the current speed of the sequence with this number or remap current frame "
"to this frame");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
/* modifiers */
prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "SequenceModifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting this strip");
rna_def_sequence_modifiers(brna, prop);
prop = RNA_def_property(srna, "use_cache_raw", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_RAW);
RNA_def_property_ui_text(prop,
"Cache Raw",
"Cache raw images read from disk, for faster tweaking of strip "
"parameters at the cost of memory usage");
prop = RNA_def_property(srna, "use_cache_preprocessed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_PREPROCESSED);
RNA_def_property_ui_text(
prop,
"Cache Pre-processed",
"Cache pre-processed images, for faster tweaking of effects at the cost of memory usage");
prop = RNA_def_property(srna, "use_cache_composite", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_COMPOSITE);
RNA_def_property_ui_text(prop,
"Cache Composite",
"Cache intermediate composited images, for faster tweaking of stacked "
"strips at the cost of memory usage");
prop = RNA_def_property(srna, "override_cache_settings", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_OVERRIDE);
RNA_def_property_ui_text(prop, "Override Cache Settings", "Override global cache settings");
RNA_api_sequence_strip(srna);
}
static void rna_def_editor(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem editing_storage_items[] = {
{0, "PER_STRIP", 0, "Per Strip", "Store proxies using per strip settings"},
{SEQ_EDIT_PROXY_DIR_STORAGE,
"PROJECT",
0,
"Project",
"Store proxies using project directory"},
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "SequenceEditor", NULL);
RNA_def_struct_ui_text(srna, "Sequence Editor", "Sequence editing data for a Scene data-block");
RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
RNA_def_struct_sdna(srna, "Editing");
prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Sequences", "Top-level strips only");
RNA_api_sequences(brna, prop);
prop = RNA_def_property(srna, "sequences_all", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(
prop, "All Sequences", "All strips, recursively including those inside metastrips");
RNA_def_property_collection_funcs(prop,
"rna_SequenceEditor_sequences_all_begin",
"rna_SequenceEditor_sequences_all_next",
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
prop = RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(
prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip");
RNA_def_property_collection_funcs(
prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get", NULL, NULL, NULL, NULL);
prop = RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip");
prop = RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW);
RNA_def_property_ui_text(
prop, "Show Overlay", "Partial overlay on top of the sequencer with a frame offset");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
prop = RNA_def_property(srna, "use_overlay_lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS);
RNA_def_property_ui_text(prop, "Overlay Lock", "");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
/* access to fixed and relative frame */
prop = RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Overlay Offset", "Number of frames to offset");
RNA_def_property_int_funcs(
prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
prop = RNA_def_property(srna, "proxy_storage", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, editing_storage_items);
RNA_def_property_ui_text(prop, "Proxy Storage", "How to store proxies for this project");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
prop = RNA_def_property(srna, "proxy_dir", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "proxy_dir");
RNA_def_property_ui_text(prop, "Proxy Directory", "");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
/* cache flags */
prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_VIEW_ENABLE);
RNA_def_property_ui_text(prop, "Show Cache", "Visualize cached images on the timeline");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "show_cache_final_out", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_VIEW_FINAL_OUT);
RNA_def_property_ui_text(prop, "Final Images", "Visualize cached complete frames");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "show_cache_raw", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_VIEW_RAW);
RNA_def_property_ui_text(prop, "Raw Images", "Visualize cached raw images");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "show_cache_preprocessed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_VIEW_PREPROCESSED);
RNA_def_property_ui_text(prop, "Pre-processed Images", "Visualize cached pre-processed images");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "show_cache_composite", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_VIEW_COMPOSITE);
RNA_def_property_ui_text(prop, "Composite Images", "Visualize cached composite images");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "use_cache_raw", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_RAW);
RNA_def_property_ui_text(prop,
"Cache Raw",
"Cache raw images read from disk, for faster tweaking of strip "
"parameters at the cost of memory usage");
prop = RNA_def_property(srna, "use_cache_preprocessed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_PREPROCESSED);
RNA_def_property_ui_text(
prop,
"Cache Pre-processed",
"Cache pre-processed images, for faster tweaking of effects at the cost of memory usage");
prop = RNA_def_property(srna, "use_cache_composite", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_COMPOSITE);
RNA_def_property_ui_text(prop,
"Cache Composite",
"Cache intermediate composited images, for faster tweaking of stacked "
"strips at the cost of memory usage");
prop = RNA_def_property(srna, "use_cache_final", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_STORE_FINAL_OUT);
RNA_def_property_ui_text(prop, "Cache Final", "Cache final image for each frame");
prop = RNA_def_property(srna, "use_prefetch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cache_flag", SEQ_CACHE_PREFETCH_ENABLE);
RNA_def_property_ui_text(prop,
"Prefetch frames",
"Render frames ahead of playhead in background for faster playback");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "recycle_max_cost", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, SEQ_CACHE_COST_MAX);
RNA_def_property_ui_range(prop, 0.0f, SEQ_CACHE_COST_MAX, 0.1f, 1);
RNA_def_property_float_sdna(prop, NULL, "recycle_max_cost");
RNA_def_property_ui_text(
prop, "Recycle Up To Cost", "Only frames with cost lower than this value will be recycled");
}
static void rna_def_filter_video(StructRNA *srna)
{
PropertyRNA *prop;
static const EnumPropertyItem alpha_mode_items[] = {
{SEQ_ALPHA_STRAIGHT,
"STRAIGHT",
0,
"Straight",
"RGB channels in transparent pixels are unaffected by the alpha channel"},
{SEQ_ALPHA_PREMUL,
"PREMUL",
0,
"Premultiplied",
"RGB channels in transparent pixels are multiplied by the alpha channel"},
{0, NULL, 0, NULL, NULL},
};
prop = RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FILTERY);
RNA_def_property_ui_text(prop, "Deinterlace", "Remove fields from video movies");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_reopen_files_update");
prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, alpha_mode_items);
RNA_def_property_ui_text(
prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX);
RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY);
RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "use_float", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT);
RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse frame order");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "mul");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Multiply Colors", "");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "sat");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 3, 3);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Saturation", "Adjust the intensity of the input's color");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_translation_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
RNA_def_property_ui_text(prop, "Transform", "");
prop = RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_crop_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");
RNA_def_property_ui_text(prop, "Crop", "");
}
static void rna_def_proxy(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY);
RNA_def_property_ui_text(
prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy");
RNA_def_property_ui_text(prop, "Proxy", "");
}
static void rna_def_input(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(
prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); /* overlap tests */
RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(
prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); /* overlap tests */
RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_effect_inputs(StructRNA *srna, int count)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "input_count", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_funcs(prop, "rna_Sequence_input_count_get", NULL, NULL);
if (count >= 1) {
prop = RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq1");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Input 1", "First input for the effect strip");
}
if (count >= 2) {
prop = RNA_def_property(srna, "input_2", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq2");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Input 2", "Second input for the effect strip");
}
# if 0
if (count == 3) {
/* Not used by any effects (perhaps one day plugins?). */
prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "seq3");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip");
}
# endif
}
static void rna_def_color_management(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "strip->colorspace_settings");
RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");
}
static void rna_def_movie_types(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "fps", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "FPS", "Frames per second");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_Sequence_fps_get", NULL, NULL);
}
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", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_collection_funcs(prop,
"rna_SequenceEditor_elements_begin",
"rna_iterator_array_next",
"rna_iterator_array_end",
"rna_iterator_array_get",
"rna_SequenceEditor_elements_length",
NULL,
NULL,
NULL);
RNA_api_sequence_elements(brna, prop);
/* multiview */
prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_VIEWS);
RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "views_format");
RNA_def_property_enum_items(prop, rna_enum_views_format_items);
RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Stereo3dFormat");
RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3d");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
rna_def_color_management(srna);
}
static void rna_def_meta(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MetaSequence", "Sequence");
RNA_def_struct_ui_text(
srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "sequences", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Sequences", "");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
}
static void rna_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem scene_input_items[] = {
{0, "CAMERA", ICON_VIEW3D, "Camera", "Use the Scene's 3D camera as input"},
{SEQ_SCENE_STRIPS,
"SEQUENCER",
ICON_SEQUENCE,
"Sequencer",
"Use the Scene's Sequencer timeline as input"},
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
RNA_def_struct_ui_text(
srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_scene_switch_update");
prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "scene_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, scene_input_items);
RNA_def_property_ui_text(prop, "Input", "Input type to use for the Scene strip");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_use_sequence");
prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_SCENE_NO_GPENCIL);
RNA_def_property_ui_text(
prop, "Use Grease Pencil", "Show Grease Pencil strokes in OpenGL previews");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
rna_def_movie_types(srna);
}
static void rna_def_movie(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
FunctionRNA *func;
PropertyRNA *parm;
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");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "streamindex");
RNA_def_property_range(prop, 0, 20);
RNA_def_property_ui_text(
prop,
"Stream Index",
"For files with several movie streams, use the stream with the given index");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_reopen_files_update");
prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_collection_funcs(prop,
"rna_SequenceEditor_elements_begin",
"rna_iterator_array_next",
"rna_iterator_array_end",
"rna_iterator_array_get",
"rna_SequenceEditor_elements_length",
NULL,
NULL,
NULL);
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
RNA_def_property_string_funcs(prop,
"rna_Sequence_filepath_get",
"rna_Sequence_filepath_length",
"rna_Sequence_filepath_set");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update");
/* metadata */
func = RNA_def_function(srna, "metadata", "rna_MovieSequence_metadata_get");
RNA_def_function_ui_description(func, "Retrieve metadata of the movie file");
/* return type */
parm = RNA_def_pointer(
func, "metadata", "IDPropertyWrapPtr", "", "Dict-like object containing the metadata");
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
RNA_def_function_return(func, parm);
/* multiview */
prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_VIEWS);
RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "views_format");
RNA_def_property_enum_items(prop, rna_enum_views_format_items);
RNA_def_property_ui_text(prop, "Views Format", "Mode to load movie views");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Sequence_views_format_update");
prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Stereo3dFormat");
RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3d");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);
rna_def_color_management(srna);
rna_def_movie_types(srna);
}
static void rna_def_movieclip(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MovieClipSequence", "Sequence");
RNA_def_struct_ui_text(
srna, "MovieClip Sequence", "Sequence strip to load a video from the clip editor");
RNA_def_struct_sdna(srna, "Sequence");
/* TODO - add clip property? */
prop = RNA_def_property(srna, "undistort", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_UNDISTORTED);
RNA_def_property_ui_text(prop, "Undistort Clip", "Use the undistorted version of the clip");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
prop = RNA_def_property(srna, "stabilize2d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "clip_flag", SEQ_MOVIECLIP_RENDER_STABILIZED);
RNA_def_property_ui_text(prop, "Stabilize 2D Clip", "Use the 2D stabilized version of the clip");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
rna_def_filter_video(srna);
rna_def_input(srna);
rna_def_movie_types(srna);
}
static void rna_def_mask(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "MaskSequence", "Sequence");
RNA_def_struct_ui_text(srna, "Mask Sequence", "Sequence strip to load a video from a mask");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask", "Mask that this sequence uses");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
rna_def_filter_video(srna);
rna_def_input(srna);
}
static void rna_def_sound(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SoundSequence", "Sequence");
RNA_def_struct_ui_text(srna,
"Sound Sequence",
"Sequence strip defining a sound to be played over a period of time");
RNA_def_struct_sdna(srna, "Sequence");
prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_ui_text(prop, "Sound", "Sound data-block used by this sequence");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_sound_update");
prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update");
prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update");
prop = RNA_def_property(srna, "pan", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pan");
RNA_def_property_range(prop, -2.0f, 2.0f);
RNA_def_property_ui_text(prop, "Pan", "Playback panning of the sound (only for Mono sources)");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_audio_update");
prop = RNA_def_property(srna, "show_waveform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM);
RNA_def_property_ui_text(
prop, "Display Waveform", "Display the audio waveform inside the strip");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
rna_def_input(srna);
}
static void rna_def_effect(BlenderRNA *brna)
{
StructRNA *srna;
srna = RNA_def_struct(brna, "EffectSequence", "Sequence");
RNA_def_struct_ui_text(
srna,
"Effect Sequence",
"Sequence strip applying an effect on the images created by other strips");
RNA_def_struct_sdna(srna, "Sequence");
rna_def_filter_video(srna);
rna_def_proxy(srna);
}
static void rna_def_multicam(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "multicam_source");
RNA_def_property_range(prop, 0, MAXSEQ - 1);
RNA_def_property_ui_text(prop, "Multicam Source Channel", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
rna_def_input(srna);
}
static void rna_def_wipe(StructRNA *srna)
{
PropertyRNA *prop;
static const EnumPropertyItem wipe_type_items[] = {
{DO_SINGLE_WIPE, "SINGLE", 0, "Single", ""},
{DO_DOUBLE_WIPE, "DOUBLE", 0, "Double", ""},
/* not used yet {DO_BOX_WIPE, "BOX", 0, "Box", ""}, */
/* not used yet {DO_CROSS_WIPE, "CROSS", 0, "Cross", ""}, */
{DO_IRIS_WIPE, "IRIS", 0, "Iris", ""},
{DO_CLOCK_WIPE, "CLOCK", 0, "Clock", ""},
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem wipe_direction_items[] = {
{0, "OUT", 0, "Out", ""},
{1, "IN", 0, "In", ""},
{0, NULL, 0, NULL, NULL},
};
RNA_def_struct_sdna_from(srna, "WipeVars", "effectdata");
prop = RNA_def_property(srna, "blur_width", PROP_FLOAT, PROP_FACTOR);
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");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, DEG2RADF(-90.0f), DEG2RADF(90.0f));
RNA_def_property_ui_text(prop, "Angle", "Edge angle");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
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");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wipetype");
RNA_def_property_enum_items(prop, wipe_type_items);
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE);
RNA_def_property_ui_text(prop, "Transition Type", "");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_glow(StructRNA *srna)
{
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata");
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_FACTOR);
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");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fClamp");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fBoost");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dDist");
RNA_def_property_range(prop, 0.5f, 20.0f);
RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dQuality");
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0);
RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_transform(StructRNA *srna)
{
PropertyRNA *prop;
static const EnumPropertyItem interpolation_items[] = {
{0, "NONE", 0, "None", "No interpolation"},
{1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation"},
{2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation"},
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem translation_unit_items[] = {
{0, "PIXELS", 0, "Pixels", ""},
{1, "PERCENT", 0, "Percent", ""},
{0, NULL, 0, NULL, NULL},
};
RNA_def_struct_sdna_from(srna, "TransformVars", "effectdata");
prop = RNA_def_property(srna, "scale_start_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScalexIni");
RNA_def_property_ui_text(prop, "Scale X", "Amount to scale the input in the X axis");
RNA_def_property_ui_range(prop, 0, 10, 3, 6);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "ScaleyIni");
RNA_def_property_ui_text(prop, "Scale Y", "Amount to scale the input in the Y axis");
RNA_def_property_ui_range(prop, 0, 10, 3, 6);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0);
RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xIni");
RNA_def_property_ui_text(prop, "Translate X", "Amount to move the input on the X axis");
RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yIni");
RNA_def_property_ui_text(prop, "Translate Y", "Amount to move the input on the Y axis");
RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rotIni");
RNA_def_property_ui_text(prop, "Rotation", "Degrees to rotate the input");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "percent");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
RNA_def_property_enum_items(prop, translation_unit_items);
RNA_def_property_ui_text(prop, "Translation Unit", "Unit of measure to translate the input");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, interpolation_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */
RNA_def_property_ui_text(
prop, "Interpolation", "Method to determine how missing pixels are created");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_solid_color(StructRNA *srna)
{
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata");
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "col");
RNA_def_property_ui_text(prop, "Color", "Effect Strip color");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
}
static void rna_def_speed_control(StructRNA *srna)
{
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "SpeedControlVars", "effectdata");
prop = RNA_def_property(srna, "multiply_speed", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "globalSpeed");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* seq->facf0 is used to animate this */
RNA_def_property_ui_text(
prop, "Multiply Speed", "Multiply the resulting speed after the speed factor");
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, -1);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE);
RNA_def_property_ui_text(
prop, "Use as Speed", "Interpret the value as speed instead of a frame number");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_scale_to_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_COMPRESS_IPO_Y);
RNA_def_property_ui_text(
prop, "Scale to Length", "Scale values from 0.0 to 1.0 to target sequence length");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_gaussian_blur(StructRNA *srna)
{
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "GaussianBlurVars", "effectdata");
prop = RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Size X", "Size of the blur along X axis");
RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_ui_text(prop, "Size Y", "Size of the blur along Y axis");
RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, -1);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_text(StructRNA *srna)
{
/* Avoid text icons because they imply this aligns within a frame, see: T71082 */
static const EnumPropertyItem text_align_x_items[] = {
{SEQ_TEXT_ALIGN_X_LEFT, "LEFT", ICON_ANCHOR_LEFT, "Left", ""},
{SEQ_TEXT_ALIGN_X_CENTER, "CENTER", ICON_ANCHOR_CENTER, "Center", ""},
{SEQ_TEXT_ALIGN_X_RIGHT, "RIGHT", ICON_ANCHOR_RIGHT, "Right", ""},
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem text_align_y_items[] = {
{SEQ_TEXT_ALIGN_Y_TOP, "TOP", ICON_ANCHOR_TOP, "Top", ""},
{SEQ_TEXT_ALIGN_Y_CENTER, "CENTER", ICON_ANCHOR_CENTER, "Center", ""},
{SEQ_TEXT_ALIGN_Y_BOTTOM, "BOTTOM", ICON_ANCHOR_BOTTOM, "Bottom", ""},
{0, NULL, 0, NULL, NULL},
};
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "TextVars", "effectdata");
prop = RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "text_font");
RNA_def_property_ui_icon(prop, ICON_FILE_FONT, false);
RNA_def_property_ui_text(prop, "Font", "Font of the text. Falls back to the UI font by default");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Sequence_text_font_set", NULL, NULL);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "text_size");
RNA_def_property_ui_text(prop, "Size", "Size of the text");
RNA_def_property_range(prop, 0.0, 2000);
RNA_def_property_ui_range(prop, 0.0f, 1000, 1, -1);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "color");
RNA_def_property_ui_text(prop, "Color", "Text color");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "shadow_color");
RNA_def_property_ui_text(prop, "Shadow Color", "");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "Location of the text");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "wrap_width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wrap_width");
RNA_def_property_ui_text(prop, "Wrap Width", "Word wrap width as factor, zero disables");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "align_x", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "align");
RNA_def_property_enum_items(prop, text_align_x_items);
RNA_def_property_ui_text(
prop, "Align X", "Align the text along the X axis, relative to the text bounds");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "align_y", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "align_y");
RNA_def_property_enum_items(prop, text_align_y_items);
RNA_def_property_ui_text(
prop, "Align Y", "Align the text along the Y axis, relative to the text bounds");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Text", "Text that will be displayed");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TEXT_SHADOW);
RNA_def_property_ui_text(prop, "Shadow", "Display shadow behind text");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static void rna_def_color_mix(StructRNA *srna)
{
static EnumPropertyItem blend_color_items[] = {
{SEQ_TYPE_DARKEN, "DARKEN", 0, "Darken", ""},
{SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
{SEQ_TYPE_COLOR_BURN, "BURN", 0, "Color Burn", ""},
{SEQ_TYPE_LINEAR_BURN, "LINEAR_BURN", 0, "Linear Burn", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_LIGHTEN, "LIGHTEN", 0, "Lighten", ""},
{SEQ_TYPE_SCREEN, "SCREEN", 0, "Screen", ""},
{SEQ_TYPE_DODGE, "DODGE", 0, "Color Dodge", ""},
{SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_OVERLAY, "OVERLAY", 0, "Overlay", ""},
{SEQ_TYPE_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
{SEQ_TYPE_HARD_LIGHT, "HARD_LIGHT", 0, "Hard Light", ""},
{SEQ_TYPE_VIVID_LIGHT, "VIVID_LIGHT", 0, "Vivid Light", ""},
{SEQ_TYPE_LIN_LIGHT, "LINEAR_LIGHT", 0, "Linear Light", ""},
{SEQ_TYPE_PIN_LIGHT, "PIN_LIGHT", 0, "Pin Light", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_DIFFERENCE, "DIFFERENCE", 0, "Difference", ""},
{SEQ_TYPE_EXCLUSION, "EXCLUSION", 0, "Exclusion", ""},
{SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
{0, "", ICON_NONE, NULL, NULL},
{SEQ_TYPE_HUE, "HUE", 0, "Hue", ""},
{SEQ_TYPE_SATURATION, "SATURATION", 0, "Saturation", ""},
{SEQ_TYPE_BLEND_COLOR, "COLOR", 0, "Color", ""},
{SEQ_TYPE_VALUE, "VALUE", 0, "Value", ""},
{0, NULL, 0, NULL, NULL},
};
PropertyRNA *prop;
RNA_def_struct_sdna_from(srna, "ColorMixVars", "effectdata");
prop = RNA_def_property(srna, "blend_effect", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blend_effect");
RNA_def_property_enum_items(prop, blend_color_items);
RNA_def_property_ui_text(
prop, "Blending Mode", "Method for controlling how the strip combines with other strips");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(
prop, "Blend Factor", "Percentage of how much the strip's colors affect other strips");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
}
static EffectInfo def_effects[] = {
{"AddSequence", "Add Sequence", "Add Sequence", NULL, 2},
{"AdjustmentSequence",
"Adjustment Layer Sequence",
"Sequence strip to perform filter adjustments to layers below",
rna_def_input,
0},
{"AlphaOverSequence", "Alpha Over Sequence", "Alpha Over Sequence", NULL, 2},
{"AlphaUnderSequence", "Alpha Under Sequence", "Alpha Under Sequence", NULL, 2},
{"ColorSequence",
"Color Sequence",
"Sequence strip creating an image filled with a single color",
rna_def_solid_color,
0},
{"CrossSequence", "Cross Sequence", "Cross Sequence", NULL, 2},
{"GammaCrossSequence", "Gamma Cross Sequence", "Gamma Cross Sequence", NULL, 2},
{"GlowSequence", "Glow Sequence", "Sequence strip creating a glow effect", rna_def_glow, 1},
{"MulticamSequence",
"Multicam Select Sequence",
"Sequence strip to perform multicam editing",
rna_def_multicam,
0},
{"MultiplySequence", "Multiply Sequence", "Multiply Sequence", NULL, 2},
{"OverDropSequence", "Over Drop Sequence", "Over Drop Sequence", NULL, 2},
{"SpeedControlSequence",
"SpeedControl Sequence",
"Sequence strip to control the speed of other strips",
rna_def_speed_control,
1},
{"SubtractSequence", "Subtract Sequence", "Subtract Sequence", NULL, 2},
{"TransformSequence",
"Transform Sequence",
"Sequence strip applying affine transformations to other strips",
rna_def_transform,
1},
{"WipeSequence",
"Wipe Sequence",
"Sequence strip creating a wipe transition",
rna_def_wipe,
2},
{"GaussianBlurSequence",
"Gaussian Blur Sequence",
"Sequence strip creating a gaussian blur",
rna_def_gaussian_blur,
1},
{"TextSequence", "Text Sequence", "Sequence strip creating text", rna_def_text, 0},
{"ColorMixSequence", "Color Mix Sequence", "Color Mix Sequence", rna_def_color_mix, 2},
{"", "", "", NULL, 0},
};
static void rna_def_effects(BlenderRNA *brna)
{
StructRNA *srna;
EffectInfo *effect;
for (effect = def_effects; effect->struct_name[0] != '\0'; effect++) {
srna = RNA_def_struct(brna, effect->struct_name, "EffectSequence");
RNA_def_struct_ui_text(srna, effect->ui_name, effect->ui_desc);
RNA_def_struct_sdna(srna, "Sequence");
rna_def_effect_inputs(srna, effect->inputs);
if (effect->func) {
effect->func(srna);
}
}
}
static void rna_def_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem mask_input_type_items[] = {
{SEQUENCE_MASK_INPUT_STRIP, "STRIP", 0, "Strip", "Use sequencer strip as mask input"},
{SEQUENCE_MASK_INPUT_ID, "ID", 0, "Mask", "Use mask ID as mask input"},
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem mask_time_items[] = {
{SEQUENCE_MASK_TIME_RELATIVE,
"RELATIVE",
0,
"Relative",
"Mask animation is offset to start of strip"},
{SEQUENCE_MASK_TIME_ABSOLUTE,
"ABSOLUTE",
0,
"Absolute",
"Mask animation is in sync with scene frame"},
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "SequenceModifier", NULL);
RNA_def_struct_sdna(srna, "SequenceModifierData");
RNA_def_struct_ui_text(srna, "SequenceModifier", "Modifier for sequence strip");
RNA_def_struct_refine_func(srna, "rna_SequenceModifier_refine");
RNA_def_struct_path_func(srna, "rna_SequenceModifier_path");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceModifier_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_items(prop, rna_enum_sequence_modifier_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQUENCE_MODIFIER_MUTE);
RNA_def_property_ui_text(prop, "Mute", "Mute this modifier");
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQUENCE_MODIFIER_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Mute expanded settings for the modifier");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "input_mask_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mask_input_type");
RNA_def_property_enum_items(prop, mask_input_type_items);
RNA_def_property_ui_text(prop, "Mask Input Type", "Type of input data used for mask");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "mask_time", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mask_time");
RNA_def_property_enum_items(prop, mask_time_items);
RNA_def_property_ui_text(prop, "Mask Time", "Time to use for the Mask animation");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "input_mask_strip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mask_sequence");
RNA_def_property_pointer_funcs(
prop, NULL, NULL, NULL, "rna_SequenceModifier_otherSequence_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask Strip", "Strip used as mask input for the modifier");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "input_mask_id", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mask_id");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask", "Mask ID used as mask input for the modifier");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_colorbalance_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "ColorBalanceModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "ColorBalanceModifierData");
RNA_def_struct_ui_text(
srna, "ColorBalanceModifier", "Color balance modifier for sequence strip");
prop = RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "SequenceColorBalanceData");
prop = RNA_def_property(srna, "color_multiply", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "color_multiply");
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Multiply Colors", "Multiply the intensity of each pixel");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_whitebalance_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "WhiteBalanceModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "WhiteBalanceModifierData");
RNA_def_struct_ui_text(
srna, "WhiteBalanceModifier", "White balance modifier for sequence strip");
prop = RNA_def_property(srna, "white_value", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_float_sdna(prop, NULL, "white_value");
RNA_def_property_ui_text(prop, "White Value", "This color defines white in the strip");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_curves_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "CurvesModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "CurvesModifierData");
RNA_def_struct_ui_text(srna, "CurvesModifier", "RGB curves modifier for sequence strip");
prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve_mapping");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Curve Mapping", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_hue_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "HueCorrectModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "HueCorrectModifierData");
RNA_def_struct_ui_text(srna, "HueCorrectModifier", "Hue correction modifier for sequence strip");
prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve_mapping");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Curve Mapping", "");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_brightcontrast_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "BrightContrastModifier", "SequenceModifier");
RNA_def_struct_sdna(srna, "BrightContrastModifierData");
RNA_def_struct_ui_text(
srna, "BrightContrastModifier", "Bright/contrast modifier data for sequence strip");
prop = RNA_def_property(srna, "bright", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_text(prop, "Bright", "Adjust the luminosity of the colors");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "contrast");
RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Contrast", "Adjust the difference in luminosity between pixels");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_tonemap_modifier(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem type_items[] = {
{SEQ_TONEMAP_RD_PHOTORECEPTOR, "RD_PHOTORECEPTOR", 0, "R/D Photoreceptor", ""},
{SEQ_TONEMAP_RH_SIMPLE, "RH_SIMPLE", 0, "Rh Simple", ""},
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "SequencerTonemapModifierData", "SequenceModifier");
RNA_def_struct_sdna(srna, "SequencerTonemapModifierData");
RNA_def_struct_ui_text(srna, "SequencerTonemapModifierData", "Tone mapping modifier");
prop = RNA_def_property(srna, "tonemap_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Tonemap Type", "Tone mapping algorithm");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "key", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Key", "The value the average luminance is mapped to");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_ui_text(
prop,
"Offset",
"Normally always 1, but can be used as an extra control to alter the brightness curve");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001f, 3.0f);
RNA_def_property_ui_text(prop, "Gamma", "If not used, set to 1");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -8.0f, 8.0f);
RNA_def_property_ui_text(
prop, "Intensity", "If less than zero, darkens image; otherwise, makes it brighter");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Contrast", "Set to 0 to use estimate from input image");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "adaptation", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Adaptation", "If 0, global; if 1, based on pixel intensity");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(
prop, "Color Correction", "If 0, same for all channels; if 1, each independent");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceModifier_update");
}
static void rna_def_modifiers(BlenderRNA *brna)
{
rna_def_modifier(brna);
rna_def_colorbalance_modifier(brna);
rna_def_curves_modifier(brna);
rna_def_hue_modifier(brna);
rna_def_brightcontrast_modifier(brna);
rna_def_whitebalance_modifier(brna);
rna_def_tonemap_modifier(brna);
}
void RNA_def_sequencer(BlenderRNA *brna)
{
rna_def_color_balance(brna);
rna_def_strip_element(brna);
rna_def_strip_proxy(brna);
rna_def_strip_color_balance(brna);
rna_def_strip_crop(brna);
rna_def_strip_transform(brna);
rna_def_sequence(brna);
rna_def_editor(brna);
rna_def_image(brna);
rna_def_meta(brna);
rna_def_scene(brna);
rna_def_movie(brna);
rna_def_movieclip(brna);
rna_def_mask(brna);
rna_def_sound(brna);
rna_def_effect(brna);
rna_def_effects(brna);
rna_def_modifiers(brna);
}
#endif
|