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
|
/**
* $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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Blender Foundation (2008).
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <stdlib.h>
#include "RNA_define.h"
#include "rna_internal.h"
#include "DNA_object_types.h"
#include "DNA_actuator_types.h"
#include "DNA_scene_types.h" // for MAXFRAME
#include "WM_types.h"
EnumPropertyItem actuator_type_items[] ={
{ACT_ACTION, "ACTION", 0, "Action", ""},
{ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
{ACT_CAMERA, "CAMERA", 0, "Camera", ""},
{ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""},
{ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""},
{ACT_2DFILTER, "FILTER_2D", 0, "2D Filter", ""},
{ACT_GAME, "GAME", 0, "Game", ""},
{ACT_IPO, "IPO", 0, "IPO", ""},
{ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
{ACT_OBJECT, "OBJECT", 0, "Motion", ""},
{ACT_PARENT, "PARENT", 0, "Parent", ""},
{ACT_PROPERTY, "PROPERTY", 0, "Property", ""},
{ACT_RANDOM, "RANDOM", 0, "Random", ""},
{ACT_SCENE, "SCENE", 0, "Scene", ""},
{ACT_SHAPEACTION, "SHAPE_ACTION", 0, "Shape Action", ""},
{ACT_SOUND, "SOUND", 0, "Sound", ""},
{ACT_STATE, "STATE", 0, "State", ""},
{ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem edit_object_type_items[] ={
{ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""},
{ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""},
{ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""},
{ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""},
{ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""},
{0, NULL, 0, NULL, NULL} };
#ifdef RNA_RUNTIME
#include "BKE_sca.h"
static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
{
bActuator *actuator= (bActuator*)ptr->data;
switch(actuator->type) {
case ACT_ACTION:
return &RNA_ActionActuator;
case ACT_OBJECT:
return &RNA_ObjectActuator;
case ACT_IPO:
return &RNA_IpoActuator;
case ACT_CAMERA:
return &RNA_CameraActuator;
case ACT_SOUND:
return &RNA_SoundActuator;
case ACT_PROPERTY:
return &RNA_PropertyActuator;
case ACT_CONSTRAINT:
return &RNA_ConstraintActuator;
case ACT_EDIT_OBJECT:
return &RNA_EditObjectActuator;
case ACT_SCENE:
return &RNA_SceneActuator;
case ACT_RANDOM:
return &RNA_RandomActuator;
case ACT_MESSAGE:
return &RNA_MessageActuator;
case ACT_GAME:
return &RNA_GameActuator;
case ACT_VISIBILITY:
return &RNA_VisibilityActuator;
case ACT_2DFILTER:
return &RNA_Filter2DActuator;
case ACT_PARENT:
return &RNA_ParentActuator;
case ACT_SHAPEACTION:
return &RNA_ShapeActionActuator;
case ACT_STATE:
return &RNA_StateActuator;
case ACT_ARMATURE:
return &RNA_ArmatureActuator;
default:
return &RNA_Actuator;
}
}
static void rna_Actuator_type_set(struct PointerRNA *ptr, int value)
{
bActuator *act= (bActuator *)ptr->data;
if (value != act->type)
{
act->type = value;
init_actuator(act);
}
}
static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bObjectActuator *oa = act->data;
oa->forcerot[1] = value;
oa->forcerot[0] = 60.0f*oa->forcerot[1];
}
static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values)
{
bActuator *act = (bActuator*)ptr->data;
bStateActuator *sa = act->data;
int i, tot= 0;
/* ensure we always have some state selected */
for(i=0; i<OB_MAX_STATES; i++)
if(values[i])
tot++;
if(tot==0)
return;
for(i=0; i<OB_MAX_STATES; i++) {
if(values[i]) sa->mask |= (1<<i);
else sa->mask &= ~(1<<i);
}
}
static EnumPropertyItem *rna_EditObjectActuator_mode_itemf(bContext *C, PointerRNA *ptr, int *free)
{
EnumPropertyItem *item= NULL;
Object *ob = (Object *)ptr->id.data;
int totitem= 0;
if (ob->type!=OB_ARMATURE)
{
RNA_enum_items_add_value(&item, &totitem, edit_object_type_items, ACT_EDOB_REPLACE_MESH);
RNA_enum_items_add_value(&item, &totitem, edit_object_type_items, ACT_EDOB_DYNAMICS);
}
RNA_enum_items_add_value(&item, &totitem, edit_object_type_items, ACT_EDOB_ADD_OBJECT);
RNA_enum_items_add_value(&item, &totitem, edit_object_type_items, ACT_EDOB_END_OBJECT);
RNA_enum_items_add_value(&item, &totitem, edit_object_type_items, ACT_EDOB_TRACK_TO);
RNA_enum_item_end(&item, &totitem);
*free= 1;
return item;
}
static EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *free)
{
EnumPropertyItem *item= NULL;
Object *ob = (Object *)ptr->id.data;
int totitem= 0;
if (ob->type==OB_ARMATURE)
{
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE);
}
else
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SHAPEACTION);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_2DFILTER);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_GAME);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_IPO);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_MESSAGE);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_OBJECT);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PARENT);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PROPERTY);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_RANDOM);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SCENE);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY);
RNA_enum_item_end(&item, &totitem);
*free= 1;
return item;
}
#else
void rna_def_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "Actuator", NULL);
RNA_def_struct_ui_text(srna, "Actuator", "Actuator to apply actions in the game engine");
RNA_def_struct_sdna(srna, "bActuator");
RNA_def_struct_refine_func(srna, "rna_Actuator_refine");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, actuator_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Actuator_type_set", "rna_Actuator_type_itemf");
RNA_def_property_ui_text(prop, "Type", "");
prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SHOW);
RNA_def_property_ui_text(prop, "Expanded", "Set actuator expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
}
static void rna_def_action_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
{ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
{ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""},
{ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""},
{ACT_ACTION_FROM_PROP, "PROPERTY", 0, "Property", ""},
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
{ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""},
#endif
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ActionActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement");
RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Action type", "Action playback type");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_struct_type(prop, "Action");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Action", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "continue_last_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "end_reset", 1);
RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sta");
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Start frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "End frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "blendin", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers. With 2 or more actions at once, the overriding channels must be lower in the stack");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "frameProp");
RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stridelength");
RNA_def_property_range(prop, 0.0, 2500.0);
RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action");
RNA_def_property_update(prop, NC_LOGIC, NULL);
#endif
}
static void rna_def_object_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA* prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""},
{ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ObjectActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Motion Actuator", "Actuator to control the object movement");
RNA_def_struct_sdna_from(srna, "bObjectActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Motion Type", "Specify the motion system");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "reference");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Reference Object", "Reference object for velocity calculation, leave empty for world reference");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "damping", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1000, 1, 1);
RNA_def_property_ui_text(prop, "Damping", "Number of frames to reach the target velocity");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "proportional_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[0]");
RNA_def_property_ui_range(prop, 0.0, 200.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Proportional Coefficient", "Typical value is 60x integral coefficient");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "integral_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[1]");
RNA_def_property_ui_range(prop, 0.0, 3.0, 0.1, 0.01);
RNA_def_property_float_funcs(prop, NULL, "rna_ObjectActuator_integralcoefficient_set", NULL);
RNA_def_property_ui_text(prop, "Integral Coefficient", "Low value (0.01) for slow response, high value (0.5) for fast response");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "derivate_coefficient", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "forcerot[2]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Servo Limit */
prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drot[0]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drot[1]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dloc[2]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drot[2]");
RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Min", "Set the lower limit for force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats 3 Arrays*/
prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dloc");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
RNA_def_property_ui_text(prop, "Loc", "Sets the location");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "drot");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
RNA_def_property_ui_text(prop, "Rot", "Sets the rotation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "forceloc");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
RNA_def_property_ui_text(prop, "Force", "Sets the force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "torque", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "forcerot");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
RNA_def_property_ui_text(prop, "Torque", "Sets the torque");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "linearvelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
RNA_def_property_ui_text(prop, "Linear Velocity", "Sets the linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "angularvelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 0.1, 0.001);
RNA_def_property_ui_text(prop, "Angular Velocity", "Sets the angular velocity");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
prop= RNA_def_property(srna, "local_location", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DLOC_LOCAL);
RNA_def_property_ui_text(prop, "L", "Location is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "local_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DROT_LOCAL);
RNA_def_property_ui_text(prop, "L", "Rotation is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "local_force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_FORCE_LOCAL);
RNA_def_property_ui_text(prop, "L", "Force is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "local_torque", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TORQUE_LOCAL);
RNA_def_property_ui_text(prop, "L", "Torque is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_LIN_VEL_LOCAL);
RNA_def_property_ui_text(prop, "L", "Velocity is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ANG_VEL_LOCAL);
RNA_def_property_ui_text(prop, "L", "Angular velocity is defined in local coordinates");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "add_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_ADD_LIN_VEL);
RNA_def_property_ui_text(prop, "Add", "Toggles between ADD and SET linV");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "servo_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_X);
RNA_def_property_ui_text(prop, "X", "Set limit to force along the X axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "servo_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Y);
RNA_def_property_ui_text(prop, "Y", "Set limit to force along the Y axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "servo_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SERVO_LIMIT_Z);
RNA_def_property_ui_text(prop, "Z", "Set limit to force along the Z axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_ipo_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_IPO_PLAY, "PLAY", 0, "Play", ""},
{ACT_IPO_PINGPONG, "PINGPONG", 0, "Ping Pong", ""},
{ACT_IPO_FLIPPER, "FLIPPER", 0, "Flipper", ""},
{ACT_IPO_LOOP_STOP, "STOP", 0, "Loop Stop", ""},
{ACT_IPO_LOOP_END, "END", 0, "Loop End", ""},
// {ACT_IPO_KEY2KEY, "IPOCHILD", 0, "Key to Key", ""},
{ACT_IPO_FROM_PROP, "PROP", 0, "Property", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "IpoActuator", "Actuator");
RNA_def_struct_ui_text(srna, "IPO Actuator", "Actuator to animate the object");
RNA_def_struct_sdna_from(srna, "bIpoActuator", "data");
prop= RNA_def_property(srna, "play_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, "IPO Type", "Specify the way you want to play the animation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sta");
RNA_def_property_ui_range(prop, 1, MAXFRAME, 1, 1);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_ui_range(prop, 1, MAXFRAME, 1, 1);
RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Use this property to define the Ipo position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "frameProp");
RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
/* booleans */
prop= RNA_def_property(srna, "force", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOFORCE);
RNA_def_property_ui_text(prop, "Force", "Apply IPO as a global or local force depending on the local option (dynamic objects only)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX logic_window::change_ipo_actuator
// RNA_def_property_boolean_funcs(prop, "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_range");
prop= RNA_def_property(srna, "local", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOLOCAL);
RNA_def_property_ui_text(prop, "L", "Let the IPO act in local coordinates, used in Force and Add mode");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "child", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOCHILD);
RNA_def_property_ui_text(prop, "Child", "Update IPO on all children Objects as well");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "add", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOADD);
RNA_def_property_ui_text(prop, "Add", "Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX logic_window::change_ipo_actuator
// RNA_def_property_boolean_funcs(prop, "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_get", "rna_Actuator_Ipo_range");
}
static void rna_def_camera_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_axis_items[] ={
{(float)'x', "X", 0, "X", "Camera tries to get behind the X axis"},
{(float)'y', "Y", 0, "Y", "Camera tries to get behind the Y axis"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "CameraActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Camera Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bCameraActuator", "data");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Camera Object", "Look at this Object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats */
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
RNA_def_property_ui_text(prop, "Height", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 20.0, 0.1, 0.1);
RNA_def_property_ui_text(prop, "Max", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* x/y */
// It could be changed to be a regular ENUM instead of this weird "(float)string enum"
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axis");
RNA_def_property_enum_items(prop, prop_axis_items);
RNA_def_property_ui_text(prop, "Axis", "Specify the axis the Camera will try to get behind");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX it's not working (no default value)
// probably need to make a get/set function
}
static void rna_def_sound_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_SND_PLAY_STOP_SOUND, "PLAYSTOP", 0, "Play Stop", ""},
{ACT_SND_PLAY_END_SOUND, "PLAYEND", 0, "Play End", ""},
{ACT_SND_LOOP_STOP_SOUND, "LOOPSTOP", 0, "Loop Stop", ""},
{ACT_SND_LOOP_END_SOUND, "LOOPEND", 0, "Loop End", ""},
{ACT_SND_LOOP_BIDIRECTIONAL_SOUND, "LOOPBIDIRECTIONAL", 0, "Loop Bidirectional", ""},
{ACT_SND_LOOP_BIDIRECTIONAL_STOP_SOUND, "LOOPBIDIRECTIONALSTOP", 0, "Loop Bidirectional Stop", ""},
{0, NULL, 0, NULL, NULL}
};
srna= RNA_def_struct(brna, "SoundActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Sound Actuator", "Actuator to handle sound");
RNA_def_struct_sdna_from(srna, "bSoundActuator", "data");
prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_struct_ui_text(srna, "Sound", "Sound file");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "mode", 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, "Play Mode", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Volume", "Sets the initial volume of the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, -12.0, 12.0, 1.0, 0.1);
RNA_def_property_ui_text(prop, "Pitch", "Sets the pitch of the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats - 3D Parameters */
prop= RNA_def_property(srna, "minimum_gain_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.min_gain");
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Minimum Gain", "The minimum gain of the sound, no matter how far it is away");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "maximum_gain_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.max_gain");
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Minimum Gain", "The maximum gain of the sound, no matter how near it is");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "reference_distance_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.reference_distance");
RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1.0, 0.01);
RNA_def_property_ui_text(prop, "Reference Distance", "The distance where the sound has a gain of 1.0");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "max_distance_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.max_distance");
RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1.0, 0.01);
RNA_def_property_ui_text(prop, "Maximum Distance", "The maximum distance at which you can hear the sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "rolloff_factor_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.rolloff_factor");
RNA_def_property_ui_range(prop, 0.0, 5.0, 1.0, 0.01);
RNA_def_property_ui_text(prop, "Rolloff", "The influence factor on volume depending on distance");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "cone_outer_gain_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_gain");
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Cone Outer Gain", "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value and the normal gain in the inner cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "cone_outer_angle_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_outer_angle");
RNA_def_property_ui_range(prop, 0.0, 360.0, 1.0, 0.01);
RNA_def_property_ui_text(prop, "Cone Outer Angle", "The angle of the outer cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "cone_inner_angle_3d", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sound3D.cone_inner_angle");
RNA_def_property_ui_range(prop, 0.0, 360.0, 1.0, 0.01);
RNA_def_property_ui_text(prop, "Cone Inner Angle", "The angle of the inner cone");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
prop= RNA_def_property(srna, "enable_sound_3d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SND_3D_SOUND);
RNA_def_property_ui_text(prop, "3D Sound", "Enable/Disable 3D Sound");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_property_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_PROP_ASSIGN, "ASSIGN", 0, "Assign", ""},
{ACT_PROP_ADD, "ADD", 0, "Add", ""},
{ACT_PROP_COPY, "COPY", 0, "Copy", ""},
{ACT_PROP_TOGGLE, "TOGGLE", 0, "Toggle", "For bool/int/float/timer properties only"},
{0, NULL, 0, NULL, NULL}
};
srna= RNA_def_struct(brna, "PropertyActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Property Actuator", "Actuator to handle properties");
RNA_def_struct_sdna_from(srna, "bPropertyActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Mode", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX add magic property lookup
prop= RNA_def_property(srna, "prop_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "The name of the property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Value", "The value to use, use \"\" around strings");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Copy Mode */
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Copy from this Object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX add even magic'er property lookup (need to look for the property list of the target object)
prop= RNA_def_property(srna, "object_prop_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Property Name", "Copy this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_constraint_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_CONST_TYPE_LOC, "LOC", 0, "Location Constraint", ""},
{ACT_CONST_TYPE_DIST, "DIST", 0, "Distance Constraint", ""},
{ACT_CONST_TYPE_ORI, "ORI", 0, "Orientation Constraint", ""},
{ACT_CONST_TYPE_FH, "FH", 0, "Force Field Constraint", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_limit_items[] ={
{ACT_CONST_NONE, "NONE", 0, "None", ""},
{ACT_CONST_LOCX, "LOCX", 0, "Loc X", ""},
{ACT_CONST_LOCY, "LOCY", 0, "Loc Y", ""},
{ACT_CONST_LOCZ, "LOCZ", 0, "Loc Z", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_direction_items[] ={
{ACT_CONST_NONE, "NONE", 0, "None", ""},
{ACT_CONST_DIRPX, "DIRPX", 0, "X axis", ""},
{ACT_CONST_DIRPY, "DIRPY", 0, "Y axis", ""},
{ACT_CONST_DIRPZ, "DIRPZ", 0, "Z axis", ""},
{ACT_CONST_DIRNX, "DIRNX", 0, "-X axis", ""},
{ACT_CONST_DIRNY, "DIRNY", 0, "-Y axis", ""},
{ACT_CONST_DIRNZ, "DIRNZ", 0, "-Z axis", ""},
{0, NULL, 0, NULL, NULL}
};
srna= RNA_def_struct(brna, "ConstraintActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Constraint Actuator", "Actuator to handle Constraints");
RNA_def_struct_sdna_from(srna, "bConstraintActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Constraints Mode", "The type of the constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "limit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_limit_items);
RNA_def_property_ui_text(prop, "Limit", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Set the direction of the ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "direction_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Select the axis to be aligned along the reference direction");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_LOC */
prop= RNA_def_property(srna, "limit_loc_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[0]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "limit_loc_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[1]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "limit_loc_min_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[2]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "limit_loc_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[0]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "limit_loc_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[1]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "limit_loc_max_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[2]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Min", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "damping", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "damp");
RNA_def_property_ui_range(prop, 0, 100, 1, 1);
RNA_def_property_ui_text(prop, "Damping", "Damping factor: time constant (in frame) of low pass filter");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_DIST */
prop= RNA_def_property(srna, "range_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[0]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Range", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "range_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[1]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Range", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "range_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[2]");
RNA_def_property_ui_range(prop, -2000.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Range", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[0]");
RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Distance", "Set the maximum length of ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[1]");
RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Distance", "Set the maximum length of ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[2]");
RNA_def_property_ui_range(prop, 0.f, 2000.f, 1, 2);
RNA_def_property_ui_text(prop, "Distance", "Set the maximum length of ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX to use a pointer or add a material lookup
prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matprop");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material", "Ray detects only Objects with this material");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX add magic property lookup
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matprop");
RNA_def_property_ui_text(prop, "Property", "Ray detect only Objects with this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1000, 1, 2);
RNA_def_property_ui_text(prop, "Time", "Maximum activation time in frame, 0 for unlimited");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "damping_rotation", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "rotdamp");
RNA_def_property_ui_range(prop, 0, 100, 1, 1);
RNA_def_property_ui_text(prop, "rotDamp", "Use a different damping for orientation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_ORI */
prop= RNA_def_property(srna, "max_rotation", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "maxrot");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -2000.0, 2000.0, 0.1, 0.001);
RNA_def_property_ui_text(prop, "Reference Direction", "Reference Direction");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "min_angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[0]");
RNA_def_property_ui_range(prop, 0.0, 180.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "max_angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[0]");
RNA_def_property_ui_range(prop, 0.0, 180.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_CONST_TYPE_FH */
prop= RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxrot[0]");
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 1);
RNA_def_property_ui_text(prop, "Damping", "Damping factor of the Fh spring force");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "fh_height_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[0]");
RNA_def_property_ui_range(prop, 0.01, 2000.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Distance", "Height of the Fh area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "fh_height_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[1]");
RNA_def_property_ui_range(prop, 0.01, 2000.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Distance", "Height of the Fh area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "fh_height_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minloc[2]");
RNA_def_property_ui_range(prop, 0.01, 2000.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Distance", "Height of the Fh area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "spring_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[0]");
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Fh", "Spring force within the Fh area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "spring_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[1]");
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Fh", "Spring force within the Fh area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "spring_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxloc[2]");
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Fh", "Spring force within the Fh area");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
prop= RNA_def_property(srna, "force_distance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DISTANCE);
RNA_def_property_ui_text(prop, "Force Distance", "Force distance of object to point of impact of ray");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "local", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_LOCAL);
RNA_def_property_ui_text(prop, "L", "Set ray along object's axis or global axis");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "nomal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
RNA_def_property_ui_text(prop, "N", "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "persistent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_PERMANENT);
RNA_def_property_ui_text(prop, "PER", "Persistent actuator: stays active even if ray does not reach target");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX to use an enum instead of a flag if possible
prop= RNA_def_property(srna, "detect_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_MATERIAL);
RNA_def_property_ui_text(prop, "M/P", "Detect material instead of property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "fh_paralel_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_DOROTFH);
RNA_def_property_ui_text(prop, "Rot Fh", "Keep object axis parallel to normal");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "fh_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_CONST_NORMAL);
RNA_def_property_ui_text(prop, "N", "Add a horizontal spring force on slopes");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX to replace all maxloc and minloc by a single one with get/set funcs
}
static void rna_def_edit_object_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_dyn_items[] ={
{ACT_EDOB_RESTORE_DYN, "RESTOREDYN", 0, "Restore Dynamics", ""},
{ACT_EDOB_SUSPEND_DYN, "SUSPENDDYN", 0, "Suspend Dynamics", ""},
{ACT_EDOB_ENABLE_RB, "ENABLERIGIDBODY", 0, "Enable Rigid Body", ""},
{ACT_EDOB_DISABLE_RB, "DISABLERIGIDBODY", 0, "Disable Rigid Body", ""},
{ACT_EDOB_SET_MASS, "SETMASS", 0, "Set Mass", ""},
{0, NULL, 0, NULL, NULL} };
srna= RNA_def_struct(brna, "EditObjectActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Edit Object Actuator", "Actuator used to edit objects");
RNA_def_struct_sdna_from(srna, "bEditObjectActuator", "data");
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, edit_object_type_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_EditObjectActuator_mode_itemf");
RNA_def_property_ui_text(prop, "Edit Object", "The mode of the actuator");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "dynamic_operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dyn_operation");
RNA_def_property_enum_items(prop, prop_dyn_items);
RNA_def_property_ui_text(prop, "Dynamic Operation", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Add this Object and all its children (cant be on an visible layer)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "track_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Track to this Object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Mesh");
RNA_def_property_pointer_sdna(prop, NULL, "me");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mesh", "Replace the existing, when left blank 'Phys' will remake the existing physics mesh");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 2000, 1, 1);
RNA_def_property_ui_text(prop, "Time", "Duration the new Object lives or the track takes");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10000, 1, 0.01);
RNA_def_property_ui_text(prop, "Mass", "The mass of the object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats 3 Arrays*/
prop= RNA_def_property(srna, "linear_velocity", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "linVelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -100.0, 100.0, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Linear Velocity", "Velocity upon creation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "angVelocity");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1.0, 0.01);
RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity upon creation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
prop= RNA_def_property(srna, "local_linear_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_LINV);
RNA_def_property_ui_text(prop, "L", "Apply the transformation locally");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "local_angular_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "localflag", ACT_EDOB_LOCAL_ANGV);
RNA_def_property_ui_text(prop, "L", "Apply the rotation locally");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "replace_display_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_NOGFX);
RNA_def_property_ui_text(prop, "Gfx", "Replace the display mesh");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "replace_physics_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_PHYS);
RNA_def_property_ui_text(prop, "Phys", "Replace the physics mesh (triangle bounds only - compound shapes not supported)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "enable_3d_tracking", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_TRACK_3D);
RNA_def_property_ui_text(prop, "3D", "Enable 3D tracking");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_scene_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_SCENE_RESTART, "RESTART", 0, "Restart", ""},
{ACT_SCENE_SET, "SET", 0, "Set Scene", ""},
{ACT_SCENE_CAMERA, "CAMERA", 0, "Set Camera", ""},
{ACT_SCENE_ADD_FRONT, "ADDFRONT", 0, "Add OverlayScene", ""},
{ACT_SCENE_ADD_BACK, "ADDBACK", 0, "Add BackgroundScene", ""},
{ACT_SCENE_REMOVE, "REMOVE", 0, "Remove Scene", ""},
{ACT_SCENE_SUSPEND, "SUSPEND", 0, "Suspend Scene", ""},
{ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SceneActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Scene Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bSceneActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Scene", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Camera");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Camera Object", "Set this Camera. Leave empty to refer to self object");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Scene", "Set the Scene to be added/removed/paused/resumed");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* XXX no need for those tooltips. to remove soon
Originally we had different 'scene' tooltips for different values of 'type'.
They were:
ACT_SCENE_RESTART ""
ACT_SCENE_CAMERA ""
ACT_SCENE_SET "Set this Scene"
ACT_SCENE_ADD_FRONT "Add an Overlay Scene"
ACT_SCENE_ADD_BACK "Add a Background Scene"
ACT_SCENE_REMOVE "Remove a Scene"
ACT_SCENE_SUSPEND "Pause a Scene"
ACT_SCENE_RESUME "Unpause a Scene"
It can be done in the ui script if still needed.
*/
}
static void rna_def_random_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_distribution_items[] ={
{ACT_RANDOM_BOOL_CONST, "RESTART", 0, "Bool Constant", ""},
{ACT_RANDOM_BOOL_UNIFORM, "SET", 0, "Bool Uniform", ""},
{ACT_RANDOM_BOOL_BERNOUILLI, "CAMERA", 0, "Bool Bernoulli", ""},
{ACT_RANDOM_INT_CONST, "ADDFRONT", 0, "Int Constant", ""},
{ACT_RANDOM_INT_UNIFORM, "ADDBACK", 0, "Int Uniform", ""},
{ACT_RANDOM_INT_POISSON, "REMOVE", 0, "Int Poisson", ""},
{ACT_RANDOM_FLOAT_CONST, "SUSPEND", 0, "Float Constant", ""},
{ACT_RANDOM_FLOAT_UNIFORM, "RESUME", 0, "Float Uniform", ""},
{ACT_RANDOM_FLOAT_NORMAL, "RESUME", 0, "Float Normal", ""},
{ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL, "RESUME", 0, "Float Neg. Exp.", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RandomActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Random Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bRandomActuator", "data");
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 1000, 1, 1);
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Seed", "Initial seed of the random generator. Use Python for more freedom (choose 0 for not random)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX add magic property lookup
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "propname");
RNA_def_property_ui_text(prop, "Property", "Assign the random value to this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_distribution_items);
RNA_def_property_ui_text(prop, "Distribution", "Choose the type of distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* arguments for the distribution */
/* int_arg_1, int_arg_2, float_arg_1, float_arg_2 */
/* ACT_RANDOM_BOOL_CONST */
prop= RNA_def_property(srna, "always_true", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "int_arg_1", 1);
RNA_def_property_ui_text(prop, "Always true", "Always false or always true");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_BOOL_UNIFORM */
// label => "Choose between true and false, 50% chance each"
/* ACT_RANDOM_BOOL_BERNOUILLI */
prop= RNA_def_property(srna, "chance", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Chance", "Pick a number between 0 and 1. Success if you stay below this value");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_INT_CONST */
prop= RNA_def_property(srna, "int_value", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg_1");
RNA_def_property_ui_range(prop, -1000, 1000, 1, 1);
RNA_def_property_ui_text(prop, "Value", "Always return this number");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_INT_UNIFORM */
prop= RNA_def_property(srna, "int_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg_1");
RNA_def_property_range(prop, -1000, 1000);
RNA_def_property_ui_text(prop, "Min", "Choose a number from a range. Lower boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "int_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg_2");
RNA_def_property_range(prop, -1000, 1000);
RNA_def_property_ui_text(prop, "Max", "Choose a number from a range. Upper boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_INT_POISSON */
prop= RNA_def_property(srna, "int_mean", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, 0.01, 100.0);
RNA_def_property_ui_text(prop, "Mean", "Expected mean value of the distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_CONST */
prop= RNA_def_property(srna, "float_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Value", "Always return this number");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_UNIFORM */
prop= RNA_def_property(srna, "float_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Min", "Choose a number from a range. Lower boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "float_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_2");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Max", "Choose a number from a range. Upper boundary of the range");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_NORMAL */
prop= RNA_def_property(srna, "float_mean", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Mean", "A normal distribution. Mean of the distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "standard_derivation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_2");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "SD", "A normal distribution. Standard deviation of the distribution");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL */
prop= RNA_def_property(srna, "half_life_time", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "float_arg_1");
RNA_def_property_range(prop, -1000.0, 1000.0);
RNA_def_property_ui_text(prop, "Half-life time", "Negative exponential dropoff");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_message_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_body_type_items[] ={
{ACT_MESG_MESG, "TEXT", 0, "Text", ""},
{ACT_MESG_PROP, "PROPERTY", 0, "Property", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MessageActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Message Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bMessageActuator", "data");
prop= RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "toPropName");
RNA_def_property_ui_text(prop, "To", "Optional send message to objects with this name only, or empty to broadcast");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Subject", "Optional message subject. This is what can be filtered on");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "body_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "bodyType");
RNA_def_property_enum_items(prop, prop_body_type_items);
RNA_def_property_ui_text(prop, "Body Type", "Toggle message type: either Text or a PropertyName");
/* ACT_MESG_MESG */
prop= RNA_def_property(srna, "body_message", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "body");
RNA_def_property_ui_text(prop, "Body", "Optional message body Text");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_MESG_PROP */
prop= RNA_def_property(srna, "body_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "body");
RNA_def_property_ui_text(prop, "Propname", "The message body will be set by the Property Value");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_game_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
// {ACT_GAME_LOAD, "LOAD", 0, "Load game", ""},
// {ACT_GAME_START, "START", 0, "Start loaded game", ""},
// keeping the load/start hacky for compatibility with 2.49
// ideally we could use ACT_GAME_START again and do a do_version()
{ACT_GAME_LOAD, "START", 0, "Start new game", ""},
{ACT_GAME_RESTART, "RESTART", 0, "Restart this game", ""},
{ACT_GAME_QUIT, "QUIT", 0, "Quit this game", ""},
{ACT_GAME_SAVECFG, "SAVECFG", 0, "Save GameLogic.globalDict", ""},
{ACT_GAME_LOADCFG, "LOADCFG", 0, "Load GameLogic.globalDict", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "GameActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Game Actuator", "");
RNA_def_struct_sdna_from(srna, "bGameActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Game", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* ACT_GAME_LOAD */
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX to do: an operator that calls file_browse with relative_path on and blender filtering active
}
static void rna_def_visibility_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "VisibilityActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Visibility Actuator", "Actuator to set visibility and occlusion of the object");
RNA_def_struct_sdna_from(srna, "bVisibilityActuator", "data");
prop= RNA_def_property(srna, "visible", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_INVISIBLE);
RNA_def_property_ui_text(prop, "Visible", "Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_OCCLUSION);
RNA_def_property_ui_text(prop, "Occlusion", "Set the object to occlude objects behind it. Initialized from the object type in physics button");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "children", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_VISIBILITY_RECURSIVE);
RNA_def_property_ui_text(prop, "Children", "Set all the children of this object to the same visibility/occlusion recursively");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_twodfilter_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_2DFILTER_ENABLED, "ENABLE", 0, "Enable Filter", ""},
{ACT_2DFILTER_DISABLED, "DISABLE", 0, "Disable Filter", ""},
{ACT_2DFILTER_NOFILTER, "REMOVE", 0, "Remove Filter", ""},
{ACT_2DFILTER_MOTIONBLUR, "MOTIONBLUR", 0, "Motion Blur", ""},
{ACT_2DFILTER_BLUR, "BLUR", 0, "Blur", ""},
{ACT_2DFILTER_SHARPEN, "SHARPEN", 0, "Sharpen", ""},
{ACT_2DFILTER_DILATION, "DILATION", 0, "Dilation", ""},
{ACT_2DFILTER_EROSION, "EROSION", 0, "Erosion", ""},
{ACT_2DFILTER_LAPLACIAN, "LAPLACIAN", 0, "Laplacian", ""},
{ACT_2DFILTER_SOBEL, "SOBEL", 0, "Sobel", ""},
{ACT_2DFILTER_PREWITT, "PREWITT", 0, "Prewitt", ""},
{ACT_2DFILTER_GRAYSCALE, "GRAYSCALE", 0, "Gray Scale", ""},
{ACT_2DFILTER_SEPIA, "SEPIA", 0, "Sepia", ""},
{ACT_2DFILTER_INVERT, "INVERT", 0, "Invert", ""},
{ACT_2DFILTER_CUSTOMFILTER, "CUSTOMFILTER", 0, "Custom Filter", ""},
// {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Filter2DActuator", "Actuator");
RNA_def_struct_ui_text(srna, "2D Filter Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bTwoDFilterActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "2D Filter Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "glsl_shader", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "text");
RNA_def_property_struct_type(prop, "Text");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Script", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "filter_pass", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "int_arg");
RNA_def_property_ui_text(prop, "Pass Number", "Set filter order");
RNA_def_property_range(prop, 0, 99); //MAX_RENDER_PASS-1
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "motion_blur_value", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "float_arg");
RNA_def_property_ui_text(prop, "Value", "Set motion blur value");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
prop= RNA_def_property(srna, "enable_motion_blur", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "D", "Enable/Disable Motion Blur");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_parent_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_PARENT_SET, "SETPARENT", 0, "Set Parent", ""},
{ACT_PARENT_REMOVE, "REMOVEPARENT", 0, "Remove Parent", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ParentActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Parent Actuator", "");
RNA_def_struct_sdna_from(srna, "bParentActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Scene", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent Object", "Set this object as parent");
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* booleans */
prop= RNA_def_property(srna, "compound", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PARENT_COMPOUND);
RNA_def_property_ui_text(prop, "Compound", "Add this object shape to the parent shape (only if the parent shape is already compound)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PARENT_GHOST);
RNA_def_property_ui_text(prop, "Ghost", "Make this object ghost while parented (only if not compound)");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
static void rna_def_shape_action_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
{ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
{ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""},
{ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""},
{ACT_ACTION_FROM_PROP, "PROPERTY", 0, "Property", ""},
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
{ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""},
#endif
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ShapeActionActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Shape Action Actuator", "Actuator to control shape key animations");
RNA_def_struct_sdna_from(srna, "bActionActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Action type", "Action playback type");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_struct_type(prop, "Action");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Action", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "continue_last_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "end_reset", 1);
RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sta");
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "Start frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_range(prop, 0, MAXFRAME);
RNA_def_property_ui_text(prop, "End frame", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "blendin", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 32767);
RNA_def_property_ui_text(prop, "Blendin", "Number of frames of motion blending");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "priority", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Priority", "Execution priority - lower numbers will override actions with higher numbers. With 2 or more actions at once, the overriding channels must be lower in the stack");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frame_property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "frameProp");
RNA_def_property_ui_text(prop, "Frame Property", "Assign the action's current frame number to this property");
RNA_def_property_update(prop, NC_LOGIC, NULL);
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
prop= RNA_def_property(srna, "stride_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stridelength");
RNA_def_property_range(prop, 0.0, 2500.0);
RNA_def_property_ui_text(prop, "Cycle", "Distance covered by a single cycle of the action");
RNA_def_property_update(prop, NC_LOGIC, NULL);
#endif
}
static void rna_def_state_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_STATE_SET, "SET", 0, "Set State", ""},
{ACT_STATE_ADD, "ADD", 0, "Add State", ""},
{ACT_STATE_REMOVE, "REMOVE", 0, "Remove State", ""},
{ACT_STATE_CHANGE, "CHANGE", 0, "Change State", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "StateActuator", "Actuator");
RNA_def_struct_ui_text(srna, "State Actuator", "Actuator to handle states");
RNA_def_struct_sdna_from(srna, "bStateActuator", "data");
prop= RNA_def_property(srna, "operation", 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, "Operation", "Select the bit operation on object state mask");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "mask", 1);
RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "State", "");
RNA_def_property_boolean_funcs(prop, NULL, "rna_StateActuator_state_set");
}
static void rna_def_armature_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA* prop;
static EnumPropertyItem prop_type_items[] ={
{ACT_ARM_RUN, "RUN", 0, "Run armature", ""},
{ACT_ARM_ENABLE, "ENABLE", 0, "Enable", ""},
{ACT_ARM_DISABLE, "DISABLE", 0, "Disable", ""},
{ACT_ARM_SETTARGET, "SETTARGET", 0, "Set target", ""},
{ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set weight", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ArmatureActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Armature Actuator", "Actuator to ..");
RNA_def_struct_sdna_from(srna, "bArmatureActuator", "data");
prop= RNA_def_property(srna, "mode", 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, "Constraint Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "posechannel");
RNA_def_property_ui_text(prop, "Bone", "Bone on which the constraint is defined");
RNA_def_property_update(prop, NC_LOGIC, NULL);
// XXX uiButSetFunc(but, check_armature_actuator, but, armAct); // the bone must be from the armature
/* XXX eventually move to a datablock pointer. However datablocking this may be a problem
we would need to update the value whenever the armature changes. */
prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "constraint");
RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint you want to control");
RNA_def_property_update(prop, NC_LOGIC, NULL);
// XXX uiButSetFunc(but, check_armature_actuator, but, armAct); // the constraintbone must be from the armature
/* XXX eventually move to a datablock pointer.
(more likely to work than for the Bone in my opinion) */
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Target", "Set this object as the target of the constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "secondary_target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "subtarget");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Secondary Target", "Set weight of this constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "weight");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Weight", "Set weight of this constraint");
RNA_def_property_update(prop, NC_LOGIC, NULL);
}
void RNA_def_actuator(BlenderRNA *brna)
{
rna_def_actuator(brna);
rna_def_action_actuator(brna);
rna_def_object_actuator(brna);
rna_def_ipo_actuator(brna);
rna_def_camera_actuator(brna);
rna_def_sound_actuator(brna);
rna_def_property_actuator(brna);
rna_def_constraint_actuator(brna); // to be done
rna_def_edit_object_actuator(brna);
rna_def_scene_actuator(brna);
rna_def_random_actuator(brna);
rna_def_message_actuator(brna);
rna_def_game_actuator(brna);
rna_def_visibility_actuator(brna);
rna_def_twodfilter_actuator(brna);
rna_def_parent_actuator(brna);
rna_def_shape_action_actuator(brna);
rna_def_state_actuator(brna);
rna_def_armature_actuator(brna);
}
#endif
|