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
|
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contributor(s): Blender Foundation (2008).
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"
#include "DNA_brush_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "WM_types.h"
static EnumPropertyItem texture_filter_items[] = {
{TXF_BOX, "BOX", 0, "Box", ""},
{TXF_EWA, "EWA", 0, "EWA", ""},
{TXF_FELINE, "FELINE", 0, "FELINE", ""},
{TXF_AREA, "AREA", 0, "Area", ""},
{TXF_SAT, "SAT", 0, "SAT (4x mem)", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
#include "BKE_texture.h"
StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
{
Tex *tex= (Tex*)ptr->data;
switch(tex->type) {
case TEX_CLOUDS:
return &RNA_CloudsTexture;
case TEX_WOOD:
return &RNA_WoodTexture;
case TEX_MARBLE:
return &RNA_MarbleTexture;
case TEX_MAGIC:
return &RNA_MagicTexture;
case TEX_BLEND:
return &RNA_BlendTexture;
case TEX_STUCCI:
return &RNA_StucciTexture;
case TEX_NOISE:
return &RNA_NoiseTexture;
case TEX_IMAGE:
return &RNA_ImageTexture;
case TEX_PLUGIN:
return &RNA_PluginTexture;
case TEX_ENVMAP:
return &RNA_EnvironmentMapTexture;
case TEX_MUSGRAVE:
return &RNA_MusgraveTexture;
case TEX_VORONOI:
return &RNA_VoronoiTexture;
case TEX_DISTNOISE:
return &RNA_DistortedNoiseTexture;
default:
return &RNA_Texture;
}
}
static int rna_TextureSlot_name_length(PointerRNA *ptr)
{
MTex *mtex= ptr->data;
if(mtex->tex)
return strlen(mtex->tex->id.name+2);
return 0;
}
static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str)
{
MTex *mtex= ptr->data;
if(mtex->tex)
strcpy(str, mtex->tex->id.name+2);
else
strcpy(str, "");
}
static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
if(value) tex->flag |= TEX_COLORBAND;
else tex->flag &= ~TEX_COLORBAND;
if((tex->flag & TEX_COLORBAND) && tex->coba == NULL)
tex->coba= add_colorband(0);
}
static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
if(value) tex->imaflag |= TEX_MIPMAP;
else tex->imaflag &= ~TEX_MIPMAP;
if((tex->imaflag & TEX_MIPMAP) && tex->texfilter == TXF_SAT)
tex->texfilter = TXF_EWA;
}
static EnumPropertyItem *rna_ImageTexture_filter_itemf(bContext *C, PointerRNA *ptr, int *free)
{
Tex *tex= (Tex*)ptr->data;
EnumPropertyItem *item= NULL;
int totitem= 0;
RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_BOX);
RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_EWA);
RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_FELINE);
RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_AREA);
if(tex->imaflag & TEX_MIPMAP)
RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_SAT);
*free= 1;
return item;
}
#else
static void rna_def_color_ramp_element(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "ColorRampElement", NULL);
RNA_def_struct_sdna(srna, "CBData");
RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp.");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Position", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_color_ramp(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_interpolation_items[] = {
{1, "EASE", 0, "Ease", ""},
{3, "CARDINAL", 0, "Cardinal", ""},
{0, "LINEAR", 0, "Linear", ""},
{2, "B_SPLINE", 0, "B-Spline", ""},
{4, "CONSTANT", 0, "Constant", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ColorRamp", NULL);
RNA_def_struct_sdna(srna, "ColorBand");
RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color.");
prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR);
RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
RNA_def_property_struct_type(prop, "ColorRampElement");
RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipotype");
RNA_def_property_enum_items(prop, prop_interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texmapping(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "TexMapping", NULL);
RNA_def_struct_ui_text(srna, "Texture Mapping", "Mapping settings");
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "has_minimum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "has_maximum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_mtex(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_blend_type_items[] = {
{MTEX_BLEND, "MIX", 0, "Mix", ""},
{MTEX_ADD, "ADD", 0, "Add", ""},
{MTEX_SUB, "SUBTRACT", 0, "Subtract", ""},
{MTEX_MUL, "MULTIPLY", 0, "Multiply", ""},
{MTEX_SCREEN, "SCREEN", 0, "Screen", ""},
{MTEX_OVERLAY, "OVERLAY", 0, "Overlay", ""},
{MTEX_DIFF, "DIFFERENCE", 0, "Difference", ""},
{MTEX_DIV, "DIVIDE", 0, "Divide", ""},
{MTEX_DARK, "DARKEN", 0, "Darken", ""},
{MTEX_LIGHT, "LIGHTEN", 0, "Lighten", ""},
{MTEX_BLEND_HUE, "HUE", 0, "Hue", ""},
{MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""},
{MTEX_BLEND_VAL, "VALUE", 0, "Value", ""},
{MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "TextureSlot", NULL);
RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Texture Slot", "Texture slot defining the mapping and influence of a texture.");
RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA);
prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "tex");
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Texture slot name.");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* mapping */
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "ofs");
RNA_def_property_ui_range(prop, -10, 10, 10, 2);
RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "The default color for textures that don't return RGB.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendtype");
RNA_def_property_enum_items(prop, prop_blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "stencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_STENCIL);
RNA_def_property_ui_text(prop, "Stencil", "Use this texture as a blending value on the next texture.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "negate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE);
RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT);
RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "def_var");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "variable_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Variable Factor", "Amount texture affects other values.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "norfac");
RNA_def_property_ui_range(prop, 0, 5, 10, 3);
RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_filter_size_common(StructRNA *srna)
{
PropertyRNA *prop;
/* XXX: not sure about the name of this, "Min" seems a bit off */
prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
RNA_def_property_ui_text(prop, "Use Filter", "Use Filter Size as a minimal filter value in pixels");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "filtersize");
RNA_def_property_range(prop, 0.1, 50.0);
RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_environment_map_common(StructRNA *srna)
{
PropertyRNA *prop;
static EnumPropertyItem prop_source_items[] = {
{ENV_STATIC, "STATIC", 0, "Static", "Calculates environment map only once"},
{ENV_ANIM, "ANIMATED", 0, "Animated", "Calculates environment map at each rendering"},
{ENV_LOAD, "LOADED", 0, "Loaded", "Loads saved environment map from disk"},
{0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_source_items);
RNA_def_property_ui_text(prop, "Source", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* XXX: move this to specific types if needed */
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_environment_map(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] = {
{ENV_CUBE, "CUBE", 0, "Cube", "Use environment map with six cube sides."},
{ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image."},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "EnvironmentMap", NULL);
RNA_def_struct_sdna(srna, "EnvMap");
RNA_def_struct_ui_text(srna, "EnvironmentMap", "Environment map created by the renderer and cached for subsequent renders.");
rna_def_environment_map_common(srna);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.01, 50, 100, 2);
RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2);
RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viewscale");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.5, 5, 100, 2);
RNA_def_property_ui_text(prop, "Zoom", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* XXX: EnvMap.notlay */
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "cuberes");
RNA_def_property_range(prop, 50, 4096);
RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static EnumPropertyItem prop_noise_basis_items[] = {
{TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", ""},
{TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", ""},
{TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", ""},
{TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", ""},
{TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", ""},
{TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", ""},
{TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", ""},
{TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", ""},
{TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", ""},
{TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_noise_type[] = {
{TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", ""},
{TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", ""},
{0, NULL, 0, NULL, NULL}};
static void rna_def_texture_clouds(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_clouds_stype[] = {
{TEX_DEFAULT, "GREYSCALE", 0, "Greyscale", ""},
{TEX_COLOR, "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "CloudsTexture", "Texture");
RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_clouds_stype);
RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_wood(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_wood_stype[] = {
{TEX_BAND, "BANDS", 0, "Bands", "Uses standard wood texture in bands"},
{TEX_RING, "RINGS", 0, "Rings", "Uses wood texture in rings"},
{TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Adds noise to standard wood"},
{TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Adds noise to rings"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_wood_noisebasis2[] = {
{TEX_SIN, "SIN", 0, "Sine", "Uses a sine wave to produce bands"},
{TEX_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"},
{TEX_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "WoodTexture", "Texture");
RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_wood_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_marble(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_marble_stype[] = {
{TEX_SOFT, "SOFT", 0, "Soft", "Uses soft marble"},
{TEX_SHARP, "SHARP", 0, "Sharp", "Uses more clearly defined marble"},
{TEX_SHARPER, "SHARPER", 0, "Sharper", "Uses very clearly defined marble"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_marble_noisebasis2[] = {
{TEX_SIN, "SIN", 0, "Sin", "Uses a sine wave to produce bands"},
{TEX_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"},
{TEX_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MarbleTexture", "Texture");
RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_marble_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_magic(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "MagicTexture", "Texture");
RNA_def_struct_ui_text(srna, "Magic Texture", "Procedural noise texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_blend(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_blend_progression[] = {
{TEX_LIN, "LINEAR", 0, "Linear", "Creates a linear progression"},
{TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"},
{TEX_EASE, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"},
{TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Creates a diagonal progression"},
{TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Creates a spherical progression"},
{TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"},
{TEX_RAD, "RADIAL", 0, "Radial", "Creates a radial progression"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "BlendTexture", "Texture");
RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_blend_progression);
RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_FLIPBLEND);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_stucci(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_stucci_stype[] = {
{TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Uses standard stucci"},
{TEX_WALLIN, "WALL_IN", 0, "Wall in", "Creates Dimples"},
{TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Creates Ridges"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "StucciTexture", "Texture");
RNA_def_struct_ui_text(srna, "Stucci Texture", "Procedural noise texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_stucci_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_noise(BlenderRNA *brna)
{
StructRNA *srna;
srna= RNA_def_struct(brna, "NoiseTexture", "Texture");
RNA_def_struct_ui_text(srna, "Noise Texture", "Procedural noise texture.");
RNA_def_struct_sdna(srna, "Tex");
}
static void rna_def_texture_image(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_image_extension[] = {
{1, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
{2, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
{4, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"},
{3, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
{5, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ImageTexture", "Texture");
RNA_def_struct_ui_text(srna, "Image Texture", "");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "mipmap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
RNA_def_property_ui_text(prop, "MIP Map Gauss", "Uses Gauss filter to sample down MIP maps");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolates pixels using Area filter");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */
prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA);
RNA_def_property_ui_text(prop, "Use Alpha", "Uses the alpha channel information in the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "calculate_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA);
RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculates an alpha channel based on RGB values in the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA);
RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
rna_def_filter_size_common(srna);
prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* XXX: mtex->normapspace "Sets space of normal map image" "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3"
* not sure why this goes in mtex instead of texture directly? */
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_image_extension);
RNA_def_property_ui_text(prop, "Extension", "Sets how the image is stretched in the texture");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat X", "Sets a repetition multiplier in the X direction");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat Y", "Sets a repetition multiplier in the Y direction");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR);
RNA_def_property_ui_text(prop, "Mirror X", "Mirrors the image repetition on the X direction");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "mirror_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR);
RNA_def_property_ui_text(prop, "Mirror Y", "Mirrors the image repetition on the Y direction");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "checker_odd", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD);
RNA_def_property_ui_text(prop, "Checker Odd", "Sets odd checker tiles");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "checker_even", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN);
RNA_def_property_ui_text(prop, "Checker Even", "Sets even checker tiles");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "checkerdist");
RNA_def_property_range(prop, 0.0, 0.99);
RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Checker Distance", "Sets distance between checker tiles");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
#if 0
/* XXX: did this as an array, but needs better descriptions than "1 2 3 4"
perhaps a new subtype could be added?
--I actually used single values for this, maybe change later with a RNA_Rect thing? */
prop= RNA_def_property(srna, "crop_rectangle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmin");
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Crop Rectangle", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
#endif
prop= RNA_def_property(srna, "crop_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmin");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum X", "Sets minimum X value to crop the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymin");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum Y", "Sets minimum Y value to crop the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum X", "Sets maximum X value to crop the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum Y", "Sets maximum Y value to crop the image");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* filtering */
prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texfilter");
RNA_def_property_enum_items(prop, texture_filter_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageTexture_filter_itemf");
RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_plugin(BlenderRNA *brna)
{
StructRNA *srna;
srna= RNA_def_struct(brna, "PluginTexture", "Texture");
RNA_def_struct_ui_text(srna, "Plugin", "External plugin texture.");
RNA_def_struct_sdna(srna, "Tex");
/* XXX: todo */
}
static void rna_def_texture_environment_map(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "EnvironmentMapTexture", "Texture");
RNA_def_struct_ui_text(srna, "Environment Map", "Environment map texture.");
RNA_def_struct_sdna(srna, "Tex");
rna_def_environment_map_common(srna);
prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "env");
RNA_def_property_struct_type(prop, "EnvironmentMap");
RNA_def_property_ui_text(prop, "Environment Map", "Gets the environment map associated with this texture");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
rna_def_filter_size_common(srna);
}
static void rna_def_texture_musgrave(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_musgrave_type[] = {
{TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", ""},
{TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", ""},
{TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", ""},
{TEX_FBM, "FBM", 0, "fBM", ""},
{TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MusgraveTexture", "Texture");
RNA_def_struct_ui_text(srna, "Musgrave", "Procedural musgrave texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "highest_dimension", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_H");
RNA_def_property_range(prop, 0.0001, 2);
RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Lacunarity", "Gap between succesive frequencies");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_octaves");
RNA_def_property_range(prop, 0, 8);
RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_offset");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Offset", "The fractal offset");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_gain");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Gain", "The gain multiplier");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_voronoi(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_distance_metric_items[] = {
{TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", ""},
{TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", ""},
{TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", ""},
{TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", ""},
{TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", ""},
{TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", ""},
{TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_coloring_items[] = {
/* XXX: OK names / descriptions? */
{TEX_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity."},
{TEX_COL1, "POSITION", 0, "Position", "Color cells by position."},
{TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F.1"},
{TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", "Multiply position and outline by intensity."},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "VoronoiTexture", "Texture");
RNA_def_struct_ui_text(srna, "Voronoi", "Procedural voronoi texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "weight_1", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w1");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w2");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w3");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w4");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_mexp");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_distm");
RNA_def_property_enum_items(prop, prop_distance_metric_items);
RNA_def_property_ui_text(prop, "Distance Metric", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_coltype");
RNA_def_property_enum_items(prop, prop_coloring_items);
RNA_def_property_ui_text(prop, "Coloring", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture_distorted_noise(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "DistortedNoiseTexture", "Texture");
RNA_def_struct_ui_text(srna, "Distorted Noise", "Procedural distorted noise texture.");
RNA_def_struct_sdna(srna, "Tex");
prop= RNA_def_property(srna, "distortion_amount", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist_amount");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Distortion Amount", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
}
static void rna_def_texture(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] = {
{0, "NONE", 0, "None", ""},
{TEX_PLUGIN, "PLUGIN", ICON_CONSTRAINT, "Plugin", ""},
{TEX_IMAGE, "IMAGE", ICON_RENDER_RESULT, "Image or Movie", ""},
{TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_RENDER_RESULT, "Environment Map", ""},
{TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", ""},
{TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", ""},
{TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", ""},
{TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", ""},
{TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", ""},
{TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", ""},
{TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", ""},
{TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", ""},
{TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", ""},
{TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Texture", "ID");
RNA_def_struct_sdna(srna, "Tex");
RNA_def_struct_ui_text(srna, "Texture", "Texture datablock used by materials, lamps, worlds and brushes.");
RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA);
RNA_def_struct_refine_func(srna, "rna_Texture_refine");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
//RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set");
RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Brightness", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
/* XXX: would be nicer to have this as a color selector?
but the values can go past [0,1]. */
prop= RNA_def_property(srna, "rgb_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rfac");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "RGB Factor", "");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
rna_def_animdata_common(srna);
/* specific types */
rna_def_texture_clouds(brna);
rna_def_texture_wood(brna);
rna_def_texture_marble(brna);
rna_def_texture_magic(brna);
rna_def_texture_blend(brna);
rna_def_texture_stucci(brna);
rna_def_texture_noise(brna);
rna_def_texture_image(brna);
rna_def_texture_plugin(brna);
rna_def_texture_environment_map(brna);
rna_def_texture_musgrave(brna);
rna_def_texture_voronoi(brna);
rna_def_texture_distorted_noise(brna);
/* XXX add more types here .. */
}
void RNA_def_texture(BlenderRNA *brna)
{
rna_def_texture(brna);
rna_def_mtex(brna);
rna_def_environment_map(brna);
rna_def_color_ramp(brna);
rna_def_color_ramp_element(brna);
rna_def_texmapping(brna);
}
#endif
|