66
67
{OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
67
68
{OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""},
68
69
{OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose", ""},
69
{0, NULL, 0, NULL, NULL}};
70
{0, NULL, 0, NULL, NULL}
73
EnumPropertyItem object_empty_drawtype_items[] = {
74
{OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
75
{OB_ARROWS, "ARROWS", 0, "Arrows", ""},
76
{OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
77
{OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
78
{OB_CUBE, "CUBE", 0, "Cube", ""},
79
{OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
80
{OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
81
{OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""},
82
{0, NULL, 0, NULL, NULL}
71
86
static EnumPropertyItem parent_type_items[] = {
72
87
{PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"},
77
92
{PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"},
78
93
{PARVERT3, "VERTEX_3", 0, "3 Vertices", ""},
79
94
{PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"},
80
{0, NULL, 0, NULL, NULL}};
95
{0, NULL, 0, NULL, NULL}
99
static EnumPropertyItem dupli_items[] = {
100
{0, "NONE", 0, "None", ""},
101
{OB_DUPLIFRAMES, "FRAMES", 0, "Frames", "Make copy of object for every frame"},
102
{OB_DUPLIVERTS, "VERTS", 0, "Verts", "Duplicate child objects on all vertices"},
103
{OB_DUPLIFACES, "FACES", 0, "Faces", "Duplicate child objects on all faces"},
104
{OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing"},
105
{0, NULL, 0, NULL, NULL}
82
109
static EnumPropertyItem collision_bounds_items[] = {
83
110
{OB_BOUND_BOX, "BOX", 0, "Box", ""},
84
111
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
117
146
{OB_CAMERA, "CAMERA", 0, "Camera", ""},
118
147
{OB_LAMP, "LAMP", 0, "Lamp", ""},
119
148
{OB_SPEAKER, "SPEAKER", 0, "Speaker", ""},
120
{0, NULL, 0, NULL, NULL}};
149
{0, NULL, 0, NULL, NULL}
122
152
EnumPropertyItem object_type_curve_items[] = {
126
{0, NULL, 0, NULL, NULL}};
156
{0, NULL, 0, NULL, NULL}
159
EnumPropertyItem object_axis_items[] = {
160
{OB_POSX, "POS_X", 0, "+X", ""},
161
{OB_POSY, "POS_Y", 0, "+Y", ""},
162
{OB_POSZ, "POS_Z", 0, "+Z", ""},
163
{OB_NEGX, "NEG_X", 0, "-X", ""},
164
{OB_NEGY, "NEG_Y", 0, "-Y", ""},
165
{OB_NEGZ, "NEG_Z", 0, "-Z", ""},
166
{0, NULL, 0, NULL, NULL}
129
169
#ifdef RNA_RUNTIME
488
541
static int rna_VertexGroup_index_get(PointerRNA *ptr)
490
Object *ob = (Object*)ptr->id.data;
543
Object *ob = (Object *)ptr->id.data;
492
545
return BLI_findindex(&ob->defbase, ptr->data);
495
548
static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr)
497
Object *ob = (Object*)ptr->id.data;
498
return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef-1));
550
Object *ob = (Object *)ptr->id.data;
551
return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef - 1));
501
554
static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr)
503
Object *ob = (Object*)ptr->id.data;
556
Object *ob = (Object *)ptr->id.data;
557
return ob->actdef - 1;
507
560
static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value)
509
Object *ob = (Object*)ptr->id.data;
510
ob->actdef = value+1;
562
Object *ob = (Object *)ptr->id.data;
563
ob->actdef = value + 1;
513
566
static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
515
Object *ob = (Object*)ptr->id.data;
568
Object *ob = (Object *)ptr->id.data;
518
*max = BLI_countlist(&ob->defbase)-1;
519
*max = MAX2(0, *max);
571
*max = max_ii(0, BLI_countlist(&ob->defbase) - 1);
522
574
void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
524
Object *ob = (Object*)ptr->id.data;
576
Object *ob = (Object *)ptr->id.data;
525
577
bDeformGroup *dg;
527
dg = BLI_findlink(&ob->defbase, index-1);
579
dg = BLI_findlink(&ob->defbase, index - 1);
529
581
if (dg) BLI_strncpy(value, dg->name, sizeof(dg->name));
530
582
else value[0] = '\0';
625
677
static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
627
Object *ob = (Object*)ptr->id.data;
679
Object *ob = (Object *)ptr->id.data;
629
*max = MAX2(ob->totcol-1, 0);
681
*max = max_ii(ob->totcol - 1, 0);
632
684
/* returns active base material */
633
685
static PointerRNA rna_Object_active_material_get(PointerRNA *ptr)
635
Object *ob = (Object*)ptr->id.data;
687
Object *ob = (Object *)ptr->id.data;
638
ma = (ob->totcol)? give_current_material(ob, ob->actcol): NULL;
690
ma = (ob->totcol) ? give_current_material(ob, ob->actcol) : NULL;
639
691
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
642
694
static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value)
644
Object *ob = (Object*)ptr->id.data;
696
Object *ob = (Object *)ptr->id.data;
646
698
DAG_id_tag_update(value.data, 0);
647
assign_material(ob, value.data, ob->actcol);
699
assign_material(ob, value.data, ob->actcol, BKE_MAT_ASSIGN_USERPREF);
650
702
static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max,
651
703
int *softmin, int *softmax)
653
Object *ob = (Object*)ptr->id.data;
705
Object *ob = (Object *)ptr->id.data;
655
*max = BLI_countlist(&ob->particlesystem)-1;
656
*max = MAX2(0, *max);
707
*max = max_ii(0, BLI_countlist(&ob->particlesystem) - 1);
659
710
static int rna_Object_active_particle_system_index_get(PointerRNA *ptr)
661
Object *ob = (Object*)ptr->id.data;
712
Object *ob = (Object *)ptr->id.data;
662
713
return psys_get_current_num(ob);
665
716
static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int value)
667
Object *ob = (Object*)ptr->id.data;
718
Object *ob = (Object *)ptr->id.data;
668
719
psys_set_current_num(ob, value);
671
722
static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
673
Object *ob = (Object*)ptr->id.data;
724
Object *ob = (Object *)ptr->id.data;
675
726
PE_current_changed(scene, ob);
789
840
static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr)
791
Object *ob = (Object*)ptr->id.data;
842
Object *ob = (Object *)ptr->id.data;
793
int index = (Material**)ptr->data - ob->mat;
844
int index = (Material **)ptr->data - ob->mat;
795
ma = give_current_material(ob, index+1);
846
ma = give_current_material(ob, index + 1);
796
847
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
799
850
static void rna_MaterialSlot_material_set(PointerRNA *ptr, PointerRNA value)
801
Object *ob = (Object*)ptr->id.data;
802
int index = (Material**)ptr->data - ob->mat;
852
Object *ob = (Object *)ptr->id.data;
853
int index = (Material **)ptr->data - ob->mat;
804
assign_material(ob, value.data, index+1);
855
assign_material(ob, value.data, index + 1, BKE_MAT_ASSIGN_USERPREF);
807
858
static int rna_MaterialSlot_link_get(PointerRNA *ptr)
809
Object *ob = (Object*)ptr->id.data;
810
int index = (Material**)ptr->data - ob->mat;
860
Object *ob = (Object *)ptr->id.data;
861
int index = (Material **)ptr->data - ob->mat;
812
863
return ob->matbits[index] != 0;
815
866
static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value)
817
Object *ob = (Object*)ptr->id.data;
818
int index = (Material**)ptr->data - ob->mat;
868
Object *ob = (Object *)ptr->id.data;
869
int index = (Material **)ptr->data - ob->mat;
821
872
ob->matbits[index] = 1;
822
/* ob->colbits |= (1<<index); */ /* DEPRECATED */
873
/* ob->colbits |= (1 << index); */ /* DEPRECATED */
825
876
ob->matbits[index] = 0;
826
/* ob->colbits &= ~(1<<index); */ /* DEPRECATED */
877
/* ob->colbits &= ~(1 << index); */ /* DEPRECATED */
830
881
static int rna_MaterialSlot_name_length(PointerRNA *ptr)
832
Object *ob = (Object*)ptr->id.data;
883
Object *ob = (Object *)ptr->id.data;
834
int index = (Material**)ptr->data - ob->mat;
885
int index = (Material **)ptr->data - ob->mat;
836
ma = give_current_material(ob, index+1);
887
ma = give_current_material(ob, index + 1);
839
return strlen(ma->id.name+2);
890
return strlen(ma->id.name + 2);
844
895
static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str)
846
Object *ob = (Object*)ptr->id.data;
897
Object *ob = (Object *)ptr->id.data;
848
int index = (Material**)ptr->data - ob->mat;
899
int index = (Material **)ptr->data - ob->mat;
850
ma = give_current_material(ob, index+1);
901
ma = give_current_material(ob, index + 1);
853
strcpy(str, ma->id.name+2);
904
strcpy(str, ma->id.name + 2);
907
961
static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
909
Object *ob = (Object*)ptr->id.data;
963
Object *ob = (Object *)ptr->id.data;
910
964
const int was_navmesh = (ob->gameflag & OB_NAVMESH);
911
965
ob->body_type = value;
913
967
switch (ob->body_type) {
914
case OB_BODY_TYPE_SENSOR:
915
ob->gameflag |= OB_SENSOR|OB_COLLISION|OB_GHOST;
916
ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION
917
|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE|OB_NAVMESH);
919
case OB_BODY_TYPE_OCCLUDER:
920
ob->gameflag |= OB_OCCLUDER;
921
ob->gameflag &= ~(OB_SENSOR|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION|OB_DYNAMIC|OB_NAVMESH);
923
case OB_BODY_TYPE_NAVMESH:
924
ob->gameflag |= OB_NAVMESH;
925
ob->gameflag &= ~(OB_SENSOR|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION|OB_DYNAMIC|OB_OCCLUDER);
927
if (ob->type == OB_MESH) {
928
/* could be moved into mesh UI but for now ensure mesh data layer */
929
BKE_mesh_ensure_navmesh(ob->data);
933
case OB_BODY_TYPE_NO_COLLISION:
934
ob->gameflag &= ~(OB_SENSOR|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION|OB_OCCLUDER|OB_DYNAMIC|OB_NAVMESH);
936
case OB_BODY_TYPE_STATIC:
937
ob->gameflag |= OB_COLLISION;
938
ob->gameflag &= ~(OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
940
case OB_BODY_TYPE_DYNAMIC:
941
ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_ACTOR;
942
ob->gameflag &= ~(OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
944
case OB_BODY_TYPE_RIGID:
945
ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR;
946
ob->gameflag &= ~(OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
949
case OB_BODY_TYPE_SOFT:
950
ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_SOFT_BODY|OB_ACTOR;
951
ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
953
/* assume triangle mesh, if no bounds chosen for soft body */
954
if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_TRIANGLE_MESH)) {
955
ob->boundtype = OB_BOUND_TRIANGLE_MESH;
957
/* create a BulletSoftBody structure if not already existing */
959
ob->bsoft = bsbNew();
968
case OB_BODY_TYPE_SENSOR:
969
ob->gameflag |= OB_SENSOR | OB_COLLISION | OB_GHOST;
970
ob->gameflag &= ~(OB_OCCLUDER | OB_CHARACTER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR |
971
OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH);
973
case OB_BODY_TYPE_OCCLUDER:
974
ob->gameflag |= OB_OCCLUDER;
975
ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_DYNAMIC | OB_NAVMESH);
977
case OB_BODY_TYPE_NAVMESH:
978
ob->gameflag |= OB_NAVMESH;
979
ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_DYNAMIC | OB_OCCLUDER);
981
if (ob->type == OB_MESH) {
982
/* could be moved into mesh UI but for now ensure mesh data layer */
983
BKE_mesh_ensure_navmesh(ob->data);
987
case OB_BODY_TYPE_NO_COLLISION:
988
ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_OCCLUDER | OB_DYNAMIC | OB_NAVMESH);
990
case OB_BODY_TYPE_CHARACTER:
991
ob->gameflag |= OB_COLLISION | OB_GHOST | OB_CHARACTER;
992
ob->gameflag &= ~(OB_SENSOR | OB_OCCLUDER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR |
993
OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH);
995
case OB_BODY_TYPE_STATIC:
996
ob->gameflag |= OB_COLLISION;
997
ob->gameflag &= ~(OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH);
999
case OB_BODY_TYPE_DYNAMIC:
1000
ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_ACTOR;
1001
ob->gameflag &= ~(OB_RIGID_BODY | OB_SOFT_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH);
1003
case OB_BODY_TYPE_RIGID:
1004
ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_RIGID_BODY | OB_ACTOR;
1005
ob->gameflag &= ~(OB_SOFT_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH);
1008
case OB_BODY_TYPE_SOFT:
1009
ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_SOFT_BODY | OB_ACTOR;
1010
ob->gameflag &= ~(OB_RIGID_BODY | OB_OCCLUDER | OB_CHARACTER | OB_SENSOR | OB_NAVMESH);
1012
/* assume triangle mesh, if no bounds chosen for soft body */
1013
if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype < OB_BOUND_TRIANGLE_MESH)) {
1014
ob->boundtype = OB_BOUND_TRIANGLE_MESH;
1016
/* create a BulletSoftBody structure if not already existing */
1018
ob->bsoft = bsbNew();
963
1022
if (was_navmesh != (ob->gameflag & OB_NAVMESH)) {
1028
1087
static void rna_GameObjectSettings_state_get(PointerRNA *ptr, int *values)
1030
Object *ob = (Object*)ptr->data;
1089
Object *ob = (Object *)ptr->data;
1032
int all_states = (ob->scaflag & OB_ALLSTATE?1:0);
1091
int all_states = (ob->scaflag & OB_ALLSTATE ? 1 : 0);
1034
memset(values, 0, sizeof(int)*OB_MAX_STATES);
1035
for (i = 0; i<OB_MAX_STATES; i++)
1036
values[i] = (ob->state & (1<<i)) | all_states;
1093
memset(values, 0, sizeof(int) * OB_MAX_STATES);
1094
for (i = 0; i < OB_MAX_STATES; i++) {
1095
values[i] = (ob->state & (1 << i)) | all_states;
1039
1099
static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values)
1041
Object *ob = (Object*)ptr->data;
1101
Object *ob = (Object *)ptr->data;
1042
1102
int i, tot = 0;
1044
1104
/* ensure we always have some state selected */
1045
for (i = 0; i<OB_MAX_STATES; i++)
1105
for (i = 0; i < OB_MAX_STATES; i++)
1052
for (i = 0; i<OB_MAX_STATES; i++) {
1053
if (values[i]) ob->state |= (1<<i);
1054
else ob->state &= ~(1<<i);
1112
for (i = 0; i < OB_MAX_STATES; i++) {
1113
if (values[i]) ob->state |= (1 << i);
1114
else ob->state &= ~(1 << i);
1058
1118
static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values)
1060
Object *ob = (Object*)ptr->data;
1120
Object *ob = (Object *)ptr->data;
1061
1121
bController *cont;
1063
memset(values, 0, sizeof(int)*OB_MAX_STATES);
1123
memset(values, 0, sizeof(int) * OB_MAX_STATES);
1064
1124
for (cont = ob->controllers.first; cont; cont = cont->next) {
1067
for (i = 0; i<OB_MAX_STATES; i++) {
1068
if (cont->state_mask & (1<<i))
1127
for (i = 0; i < OB_MAX_STATES; i++) {
1128
if (cont->state_mask & (1 << i))
1134
static void rna_GameObjectSettings_col_group_get(PointerRNA *ptr, int *values)
1136
Object *ob = (Object *)ptr->data;
1139
for (i = 0; i < OB_MAX_COL_MASKS; i++) {
1140
values[i] = (ob->col_group & (1 << i));
1144
static void rna_GameObjectSettings_col_group_set(PointerRNA *ptr, const int *values)
1146
Object *ob = (Object *)ptr->data;
1149
/* ensure we always have some group selected */
1150
for (i = 0; i < OB_MAX_COL_MASKS; i++)
1157
for (i = 0; i < OB_MAX_COL_MASKS; i++) {
1158
if (values[i]) ob->col_group |= (1 << i);
1159
else ob->col_group &= ~(1 << i);
1163
static void rna_GameObjectSettings_col_mask_get(PointerRNA *ptr, int *values)
1165
Object *ob = (Object *)ptr->data;
1168
for (i = 0; i < OB_MAX_COL_MASKS; i++) {
1169
values[i] = (ob->col_mask & (1 << i));
1173
static void rna_GameObjectSettings_col_mask_set(PointerRNA *ptr, const int *values)
1175
Object *ob = (Object *)ptr->data;
1178
/* ensure we always have some mask selected */
1179
for (i = 0; i < OB_MAX_COL_MASKS; i++)
1186
for (i = 0; i < OB_MAX_COL_MASKS; i++) {
1187
if (values[i]) ob->col_mask |= (1 << i);
1188
else ob->col_mask &= ~(1 << i);
1074
1193
static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
1076
Object *ob = (Object*)ptr->id.data;
1077
Key *key = ob_get_key(ob);
1195
Object *ob = (Object *)ptr->id.data;
1196
Key *key = BKE_key_from_object(ob);
1081
*max = BLI_countlist(&key->block)-1;
1200
*max = BLI_countlist(&key->block) - 1;
1082
1201
if (*max < 0) *max = 0;
1143
1262
static PointerRNA rna_Object_active_constraint_get(PointerRNA *ptr)
1145
Object *ob = (Object*)ptr->id.data;
1146
bConstraint *con = constraints_get_active(&ob->constraints);
1264
Object *ob = (Object *)ptr->id.data;
1265
bConstraint *con = BKE_constraints_get_active(&ob->constraints);
1147
1266
return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
1150
1269
static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value)
1152
Object *ob = (Object*)ptr->id.data;
1153
constraints_set_active(&ob->constraints, (bConstraint *)value.data);
1271
Object *ob = (Object *)ptr->id.data;
1272
BKE_constraints_set_active(&ob->constraints, (bConstraint *)value.data);
1156
1275
static bConstraint *rna_Object_constraints_new(Object *object, int type)
1158
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
1159
return add_ob_constraint(object, NULL, type);
1277
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, object);
1278
return BKE_add_ob_constraint(object, NULL, type);
1162
static void rna_Object_constraints_remove(Object *object, ReportList *reports, bConstraint *con)
1281
static void rna_Object_constraints_remove(Object *object, ReportList *reports, PointerRNA *con_ptr)
1283
bConstraint *con = con_ptr->data;
1164
1284
if (BLI_findindex(&object->constraints, con) == -1) {
1165
BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'", con->name, object->id.name+2);
1285
BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'", con->name, object->id.name + 2);
1169
remove_constraint(&object->constraints, con);
1289
BKE_remove_constraint(&object->constraints, con);
1290
RNA_POINTER_INVALIDATE(con_ptr);
1170
1292
ED_object_constraint_update(object);
1171
1293
ED_object_constraint_set_active(object, NULL);
1172
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object);
1294
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, object);
1175
1297
static void rna_Object_constraints_clear(Object *object)
1177
free_constraints(&object->constraints);
1299
BKE_free_constraints(&object->constraints);
1179
1301
ED_object_constraint_update(object);
1180
1302
ED_object_constraint_set_active(object, NULL);
1182
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object);
1304
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, object);
1185
1307
static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports,
1188
1310
return ED_object_modifier_add(reports, CTX_data_main(C), CTX_data_scene(C), object, name, type);
1191
static void rna_Object_modifier_remove(Object *object, bContext *C, ReportList *reports, ModifierData *md)
1313
static void rna_Object_modifier_remove(Object *object, bContext *C, ReportList *reports, PointerRNA *md_ptr)
1193
ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md);
1195
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER|NA_REMOVED, object);
1315
ModifierData *md = md_ptr->data;
1316
if (ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md) == FALSE) {
1317
/* error is already set */
1321
RNA_POINTER_INVALIDATE(md_ptr);
1323
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER | NA_REMOVED, object);
1198
1326
static void rna_Object_modifier_clear(Object *object, bContext *C)
1200
1328
ED_object_modifier_clear(CTX_data_main(C), CTX_data_scene(C), object);
1202
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER|NA_REMOVED, object);
1330
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER | NA_REMOVED, object);
1205
1333
static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
1207
Object *ob = (Object*)ptr->id.data;
1208
BoundBox *bb = object_get_boundbox(ob);
1335
Object *ob = (Object *)ptr->id.data;
1336
BoundBox *bb = BKE_object_boundbox_get(ob);
1210
1338
memcpy(values, bb->vec, sizeof(bb->vec));
1213
fill_vn_fl(values, sizeof(bb->vec)/sizeof(float), 0.0f);
1341
fill_vn_fl(values, sizeof(bb->vec) / sizeof(float), 0.0f);
1359
1506
func = RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove");
1360
1507
RNA_def_function_ui_description(func, "Remove a vertex from the group");
1361
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
1508
RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
1362
1509
/* TODO, see how array size of 0 works, this shouldnt be used */
1363
1510
prop = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0);
1364
RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED);
1511
RNA_def_property_flag(prop, PROP_DYNAMIC | PROP_REQUIRED);
1366
1513
func = RNA_def_function(srna, "weight", "rna_VertexGroup_weight");
1367
1514
RNA_def_function_ui_description(func, "Get a vertex weight from the group");
1368
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
1515
RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
1369
1516
prop = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX);
1370
1517
RNA_def_property_flag(prop, PROP_REQUIRED);
1371
1518
prop = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
1483
1634
prop = RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
1484
1635
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST);
1485
RNA_def_property_ui_text(prop, "Ghost", "Object does not restitute collisions, like a ghost");
1636
RNA_def_property_ui_text(prop, "Ghost", "Object does not react to collisions, like a ghost");
1487
1638
prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
1488
1639
RNA_def_property_range(prop, 0.01, 10000.0);
1489
1640
RNA_def_property_ui_text(prop, "Mass", "Mass of the object");
1491
prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
1642
prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
1492
1643
RNA_def_property_float_sdna(prop, NULL, "inertia");
1493
1644
RNA_def_property_range(prop, 0.01f, FLT_MAX);
1494
1645
RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 3);
1495
1646
RNA_def_property_ui_text(prop, "Radius", "Radius of bounding sphere and material physics");
1496
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
1647
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
1498
1649
prop = RNA_def_property(srna, "use_sleep", PROP_BOOLEAN, PROP_NONE);
1499
1650
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE);
1518
1669
RNA_def_property_float_sdna(prop, NULL, "max_vel");
1519
1670
RNA_def_property_range(prop, 0.0, 1000.0);
1520
1671
RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed");
1673
/* Character physics */
1674
prop = RNA_def_property(srna, "step_height", PROP_FLOAT, PROP_NONE);
1675
RNA_def_property_float_sdna(prop, NULL, "step_height");
1676
RNA_def_property_range(prop, 0.01, 1.0);
1677
RNA_def_property_ui_text(prop, "Step Height", "Maximum height of steps the character can run over");
1679
prop = RNA_def_property(srna, "jump_speed", PROP_FLOAT, PROP_NONE);
1680
RNA_def_property_float_sdna(prop, NULL, "jump_speed");
1681
RNA_def_property_range(prop, 0.0, 1000.0);
1682
RNA_def_property_ui_text(prop, "Jump Force", "Upward velocity applied to the character when jumping");
1684
prop = RNA_def_property(srna, "fall_speed", PROP_FLOAT, PROP_NONE);
1685
RNA_def_property_float_sdna(prop, NULL, "fall_speed");
1686
RNA_def_property_range(prop, 0.0, 1000.0);
1687
RNA_def_property_ui_text(prop, "Fall Speed Max", "Maximum speed at which the character will fall");
1689
/* Collision Masks */
1690
prop = RNA_def_property(srna, "collision_group", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1691
RNA_def_property_boolean_sdna(prop, NULL, "col_group", 1);
1692
RNA_def_property_array(prop, OB_MAX_COL_MASKS);
1693
RNA_def_property_ui_text(prop, "Collision Group", "The collision group of the object");
1694
RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_col_group_get", "rna_GameObjectSettings_col_group_set");
1696
prop = RNA_def_property(srna, "collision_mask", PROP_BOOLEAN, PROP_LAYER_MEMBER);
1697
RNA_def_property_boolean_sdna(prop, NULL, "col_mask", 1);
1698
RNA_def_property_array(prop, OB_MAX_COL_MASKS);
1699
RNA_def_property_ui_text(prop, "Collision Mask", "The groups this object can collide with");
1700
RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_col_mask_get", "rna_GameObjectSettings_col_mask_set");
1522
1702
/* lock position */
1523
1703
prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
1580
1760
prop = RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
1581
1761
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS);
1582
1762
RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default");
1583
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
1763
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
1585
1765
prop = RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE);
1586
1766
RNA_def_property_enum_sdna(prop, NULL, "collision_boundtype");
1587
1767
RNA_def_property_enum_items(prop, collision_bounds_items);
1588
1768
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf");
1589
1769
RNA_def_property_ui_text(prop, "Collision Bounds", "Select the collision type");
1590
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
1770
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
1592
1772
prop = RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE);
1593
1773
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD);
1594
1774
RNA_def_property_ui_text(prop, "Collision Compound", "Add children to form a compound collision object");
1596
prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
1776
prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
1597
1777
RNA_def_property_float_sdna(prop, NULL, "margin");
1598
1778
RNA_def_property_range(prop, 0.0, 1.0);
1599
1779
RNA_def_property_ui_text(prop, "Collision Margin",
1828
2012
StructRNA *srna;
1829
2013
PropertyRNA *prop;
1831
static EnumPropertyItem empty_drawtype_items[] = {
1832
{OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
1833
{OB_ARROWS, "ARROWS", 0, "Arrows", ""},
1834
{OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
1835
{OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
1836
{OB_CUBE, "CUBE", 0, "Cube", ""},
1837
{OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
1838
{OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
1839
{OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""},
1840
{0, NULL, 0, NULL, NULL}};
1842
static EnumPropertyItem track_items[] = {
1843
{OB_POSX, "POS_X", 0, "+X", ""},
1844
{OB_POSY, "POS_Y", 0, "+Y", ""},
1845
{OB_POSZ, "POS_Z", 0, "+Z", ""},
1846
{OB_NEGX, "NEG_X", 0, "-X", ""},
1847
{OB_NEGY, "NEG_Y", 0, "-Y", ""},
1848
{OB_NEGZ, "NEG_Z", 0, "-Z", ""},
1849
{0, NULL, 0, NULL, NULL}};
1851
2015
static EnumPropertyItem up_items[] = {
1852
2016
{OB_POSX, "X", 0, "X", ""},
1853
2017
{OB_POSY, "Y", 0, "Y", ""},
1854
2018
{OB_POSZ, "Z", 0, "Z", ""},
1855
{0, NULL, 0, NULL, NULL}};
2019
{0, NULL, 0, NULL, NULL}
1857
2022
static EnumPropertyItem drawtype_items[] = {
1858
2023
{OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounds of the object"},
1860
2025
{OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (if solid drawing is enabled in the viewport)"},
1861
2026
{OB_TEXTURE, "TEXTURED", 0, "Textured",
1862
2027
"Draw the object with textures (if textures are enabled in the viewport)"},
1863
{0, NULL, 0, NULL, NULL}};
2028
{0, NULL, 0, NULL, NULL}
1865
2031
static EnumPropertyItem boundtype_items[] = {
1866
2032
{OB_BOUND_BOX, "BOX", 0, "Box", "Draw bounds as box"},
1867
2033
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"},
1868
2034
{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"},
1869
2035
{OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"},
1870
{0, NULL, 0, NULL, NULL}};
2036
{0, NULL, 0, NULL, NULL}
1872
static EnumPropertyItem dupli_items[] = {
1873
{0, "NONE", 0, "None", ""},
1874
{OB_DUPLIFRAMES, "FRAMES", 0, "Frames", "Make copy of object for every frame"},
1875
{OB_DUPLIVERTS, "VERTS", 0, "Verts", "Duplicate child objects on all vertices"},
1876
{OB_DUPLIFACES, "FACES", 0, "Faces", "Duplicate child objects on all faces"},
1877
{OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing"},
1878
{0, NULL, 0, NULL, NULL}};
1880
2040
/* XXX: this RNA enum define is currently duplicated for objects,
1881
2041
* since there is some text here which is not applicable */
1882
2042
static EnumPropertyItem prop_rotmode_items[] = {
1926
2087
RNA_def_property_ui_text(prop, "Layers", "Layers the object is on");
1927
2088
RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_layer_set");
1928
2089
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
1929
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_layer_update");
2090
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_layer_update");
2091
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2093
prop = RNA_def_property(srna, "layers_local_view", PROP_BOOLEAN, PROP_LAYER_MEMBER);
2094
RNA_def_property_boolean_sdna(prop, NULL, "lay", 0x01000000);
2095
RNA_def_property_array(prop, 8);
2096
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2097
RNA_def_property_ui_text(prop, "Local View Layers", "3D local view layers the object is on");
1931
2099
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1932
2100
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
1933
2101
RNA_def_property_ui_text(prop, "Select", "Object selection state");
1934
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_select_update");
2102
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_select_update");
1936
2104
/* for data access */
1937
2105
prop = RNA_def_property(srna, "bound_box", PROP_FLOAT, PROP_NONE);
1946
2114
prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
1947
2115
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL);
1948
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
2116
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
1949
2117
RNA_def_property_ui_text(prop, "Parent", "Parent Object");
1950
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
2118
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update");
1952
2120
prop = RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE);
1953
2121
RNA_def_property_enum_bitflag_sdna(prop, NULL, "partype");
1954
2122
RNA_def_property_enum_items(prop, parent_type_items);
1955
2123
RNA_def_property_enum_funcs(prop, NULL, "rna_Object_parent_type_set", "rna_Object_parent_type_itemf");
1956
2124
RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation");
1957
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
2125
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update");
1959
2127
prop = RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED);
1960
2128
RNA_def_property_int_sdna(prop, NULL, "par1");
1961
2129
RNA_def_property_array(prop, 3);
1962
2130
RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in case of a vertex parenting relation");
1963
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2131
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
1965
2133
prop = RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
1966
2134
RNA_def_property_string_sdna(prop, NULL, "parsubstr");
1967
2135
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Object_parent_bone_set");
1968
2136
RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation");
1969
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
2137
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update");
1971
2139
/* Track and Up flags */
1972
2140
/* XXX: these have been saved here for a bit longer (after old track was removed),
1973
2141
* since some other tools still refer to this */
1974
2142
prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
1975
2143
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
1976
RNA_def_property_enum_items(prop, track_items);
2144
RNA_def_property_enum_items(prop, object_axis_items);
1977
2145
RNA_def_property_ui_text(prop, "Track Axis",
1978
2146
"Axis that points in 'forward' direction (applies to DupliFrame when "
1979
2147
"parent 'Follow' is enabled)");
1980
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2148
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
1982
2150
prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
1983
2151
RNA_def_property_enum_sdna(prop, NULL, "upflag");
2024
2192
RNA_def_property_editable_array_func(prop, "rna_Object_location_editable");
2025
2193
RNA_def_property_ui_text(prop, "Location", "Location of the object");
2026
2194
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
2027
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2195
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2029
2197
prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
2030
2198
RNA_def_property_float_sdna(prop, NULL, "quat");
2031
2199
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
2032
2200
RNA_def_property_float_array_default(prop, default_quat);
2033
2201
RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions");
2034
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2202
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2036
/* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
2037
* having a single one is better for Keyframing and other property-management situations...
2204
/* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
2205
* having a single one is better for Keyframing and other property-management situations...
2039
2207
prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
2040
2208
RNA_def_property_array(prop, 4);
2041
2209
RNA_def_property_float_funcs(prop, "rna_Object_rotation_axis_angle_get",
2043
2211
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
2044
2212
RNA_def_property_float_array_default(prop, default_axisAngle);
2045
2213
RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
2046
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2214
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2048
2216
prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
2049
2217
RNA_def_property_float_sdna(prop, NULL, "rot");
2050
2218
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable");
2051
2219
RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
2052
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2220
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2054
2222
prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
2055
2223
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
2056
2224
RNA_def_property_enum_items(prop, prop_rotmode_items); /* XXX move to using a single define of this someday */
2057
2225
RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL);
2058
2226
RNA_def_property_ui_text(prop, "Rotation Mode", "");
2059
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2227
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2061
2229
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
2062
2230
RNA_def_property_float_sdna(prop, NULL, "size");
2079
2247
RNA_def_property_float_sdna(prop, NULL, "dloc");
2080
2248
RNA_def_property_ui_text(prop, "Delta Location", "Extra translation added to the location of the object");
2081
2249
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
2082
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2250
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2084
2252
prop = RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER);
2085
2253
RNA_def_property_float_sdna(prop, NULL, "drot");
2086
2254
RNA_def_property_ui_text(prop, "Delta Rotation (Euler)",
2087
2255
"Extra rotation added to the rotation of the object (when using Euler rotations)");
2088
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2256
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2090
2258
prop = RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
2091
2259
RNA_def_property_float_sdna(prop, NULL, "dquat");
2092
2260
RNA_def_property_float_array_default(prop, default_quat);
2093
2261
RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)",
2094
2262
"Extra rotation added to the rotation of the object (when using Quaternion rotations)");
2095
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2263
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2097
2265
#if 0 /* XXX not supported well yet... */
2098
2266
prop = RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
2099
/* FIXME: this is not a single field any more! (drotAxis and drotAngle) */
2267
/* FIXME: this is not a single field any more! (drotAxis and drotAngle) */
2100
2268
RNA_def_property_float_sdna(prop, NULL, "dquat");
2101
2269
RNA_def_property_float_array_default(prop, default_axisAngle);
2102
2270
RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)",
2103
2271
"Extra rotation added to the rotation of the object (when using Axis-Angle rotations)");
2104
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2272
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2107
2275
prop = RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ);
2117
2285
RNA_def_property_array(prop, 3);
2118
2286
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface");
2119
2287
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
2120
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2288
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2122
2290
prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
2123
2291
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
2124
2292
RNA_def_property_array(prop, 3);
2125
2293
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface");
2126
2294
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
2127
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2295
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2129
/* XXX this is sub-optimal - it really should be included above,
2130
* but due to technical reasons we can't do this! */
2297
/* XXX this is sub-optimal - it really should be included above,
2298
* but due to technical reasons we can't do this! */
2131
2299
prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
2132
2300
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
2133
2301
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
2134
2302
RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)",
2135
2303
"Lock editing of 'angle' component of four-component rotations in the interface");
2136
/* XXX this needs a better name */
2304
/* XXX this needs a better name */
2137
2305
prop = RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
2138
2306
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
2139
2307
RNA_def_property_ui_text(prop, "Lock Rotations (4D)",
2208
2376
prop = RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
2209
2377
RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype");
2210
RNA_def_property_enum_items(prop, empty_drawtype_items);
2378
RNA_def_property_enum_items(prop, object_empty_drawtype_items);
2211
2379
RNA_def_property_ui_text(prop, "Empty Display Type", "Viewport display style for empties");
2212
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2380
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2214
2382
prop = RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_DISTANCE);
2215
2383
RNA_def_property_float_sdna(prop, NULL, "empty_drawsize");
2216
2384
RNA_def_property_range(prop, 0.0001f, 1000.0f);
2217
2385
RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
2218
2386
RNA_def_property_ui_text(prop, "Empty Display Size", "Size of display for empties in the viewport");
2219
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2387
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2221
2389
prop = RNA_def_property(srna, "empty_image_offset", PROP_FLOAT, PROP_DISTANCE);
2222
2390
RNA_def_property_float_sdna(prop, NULL, "ima_ofs");
2223
2391
RNA_def_property_ui_text(prop, "Origin Offset", "Origin offset distance");
2224
2392
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1f, 2);
2225
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2393
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2228
2396
prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
2260
2428
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
2261
2429
rna_def_object_particle_systems(brna, prop);
2432
prop = RNA_def_property(srna, "rigid_body", PROP_POINTER, PROP_NONE);
2433
RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_object");
2434
RNA_def_property_struct_type(prop, "RigidBodyObject");
2435
RNA_def_property_ui_text(prop, "Rigid Body Settings", "Settings for rigid body simulation");
2437
prop = RNA_def_property(srna, "rigid_body_constraint", PROP_POINTER, PROP_NONE);
2438
RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_constraint");
2439
RNA_def_property_struct_type(prop, "RigidBodyConstraint");
2440
RNA_def_property_ui_text(prop, "Rigid Body Constraint", "Constraint constraining rigid bodies");
2264
2443
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
2265
2444
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW);
2266
2445
RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport");
2267
2446
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
2268
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2447
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
2270
2449
prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
2271
2450
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT);
2272
2451
RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport");
2273
2452
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 1);
2274
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2453
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2276
2455
prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
2277
2456
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER);
2278
2457
RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability");
2279
2458
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
2280
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2459
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
2283
2462
rna_def_animdata_common(srna);
2292
2471
RNA_def_property_ui_text(prop, "Slow Parent",
2293
2472
"Create a delay in the parent relationship (beware: this isn't renderfarm "
2294
2473
"safe and may be invalid after jumping around the timeline)");
2295
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2474
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
2297
prop = RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME);
2476
prop = RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE | PROP_UNIT_TIME);
2298
2477
RNA_def_property_float_sdna(prop, NULL, "sf");
2299
2478
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
2300
2479
RNA_def_property_ui_text(prop, "Slow Parent Offset", "Delay in the parent relationship");
2301
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
2480
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
2482
/* depsgraph hack */
2483
prop = RNA_def_property(srna, "extra_recalc_object", PROP_BOOLEAN, PROP_NONE);
2484
RNA_def_property_boolean_sdna(prop, NULL, "depsflag", OB_DEPS_EXTRA_OB_RECALC);
2485
RNA_def_property_ui_text(prop, "Extra Object Update", "Refresh this object again on frame changes, dependency graph hack");
2487
prop = RNA_def_property(srna, "extra_recalc_data", PROP_BOOLEAN, PROP_NONE);
2488
RNA_def_property_boolean_sdna(prop, NULL, "depsflag", OB_DEPS_EXTRA_DATA_RECALC);
2489
RNA_def_property_ui_text(prop, "Extra Data Update", "Refresh this object's data again on frame changes, dependency graph hack");
2303
2491
/* duplicates */
2304
2492
prop = RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE);
2305
2493
RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag");
2306
2494
RNA_def_property_enum_items(prop, dupli_items);
2307
2495
RNA_def_property_ui_text(prop, "Dupli Type", "If not None, object duplication method to use");
2308
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
2496
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update");
2310
2498
prop = RNA_def_property(srna, "use_dupli_frames_speed", PROP_BOOLEAN, PROP_NONE);
2311
2499
RNA_def_property_boolean_negative_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED);
2312
2500
RNA_def_property_ui_text(prop, "Dupli Frames Speed",
2313
2501
"Set dupliframes to use the current frame instead of parent curve's evaluation time");
2314
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2502
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
2316
2504
prop = RNA_def_property(srna, "use_dupli_vertices_rotation", PROP_BOOLEAN, PROP_NONE);
2317
2505
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
2318
2506
RNA_def_property_ui_text(prop, "Dupli Verts Rotation", "Rotate dupli according to vertex normal");
2319
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2507
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2321
2509
prop = RNA_def_property(srna, "use_dupli_faces_scale", PROP_BOOLEAN, PROP_NONE);
2322
2510
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIFACES_SCALE);
2323
2511
RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size");
2324
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2512
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
2326
2514
prop = RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
2327
2515
RNA_def_property_float_sdna(prop, NULL, "dupfacesca");
2328
2516
RNA_def_property_range(prop, 0.001f, 10000.0f);
2329
2517
RNA_def_property_ui_text(prop, "Dupli Faces Scale", "Scale the DupliFace objects");
2330
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2518
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2332
2520
prop = RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
2333
2521
RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
2334
2522
RNA_def_property_flag(prop, PROP_EDITABLE);
2335
2523
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_dup_group_set", NULL, NULL);
2336
2524
RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group");
2337
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
2525
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update");
2339
prop = RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
2527
prop = RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE | PROP_UNIT_TIME);
2340
2528
RNA_def_property_int_sdna(prop, NULL, "dupsta");
2341
2529
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
2342
2530
RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames");
2343
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2531
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
2345
prop = RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
2533
prop = RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE | PROP_UNIT_TIME);
2346
2534
RNA_def_property_int_sdna(prop, NULL, "dupend");
2347
2535
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
2348
2536
RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames");
2349
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2537
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
2351
prop = RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
2539
prop = RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE | PROP_UNIT_TIME);
2352
2540
RNA_def_property_int_sdna(prop, NULL, "dupon");
2353
2541
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
2354
2542
RNA_def_property_ui_range(prop, 1, 1500, 1, 0);
2355
2543
RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames");
2356
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2544
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
2358
prop = RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
2546
prop = RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE | PROP_UNIT_TIME);
2359
2547
RNA_def_property_int_sdna(prop, NULL, "dupoff");
2360
2548
RNA_def_property_range(prop, 0, MAXFRAME);
2361
2549
RNA_def_property_ui_range(prop, 0, 1500, 1, 0);
2362
2550
RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes");
2363
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
2551
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update");
2365
2553
prop = RNA_def_property(srna, "dupli_list", PROP_COLLECTION, PROP_NONE);
2366
2554
RNA_def_property_collection_sdna(prop, NULL, "duplilist", NULL);
2376
2564
RNA_def_property_enum_sdna(prop, NULL, "dt");
2377
2565
RNA_def_property_enum_items(prop, drawtype_items);
2378
2566
RNA_def_property_ui_text(prop, "Maximum Draw Type", "Maximum draw type to display object with in viewport");
2379
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2567
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2381
2569
prop = RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE);
2382
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX);
2570
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWBOUNDOX);
2383
2571
RNA_def_property_ui_text(prop, "Draw Bounds", "Display the object's bounds");
2384
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2572
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2386
2574
prop = RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE);
2387
2575
RNA_def_property_enum_sdna(prop, NULL, "boundtype");
2388
2576
RNA_def_property_enum_items(prop, boundtype_items);
2389
2577
RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type");
2390
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2578
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2392
2580
prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
2393
2581
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME);
2394
2582
RNA_def_property_ui_text(prop, "Draw Name", "Display the object's name");
2395
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2583
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2397
2585
prop = RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE);
2398
2586
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS);
2399
2587
RNA_def_property_ui_text(prop, "Draw Axes", "Display the object's origin and axes");
2400
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2588
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2402
2590
prop = RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE);
2403
2591
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE);
2404
2592
RNA_def_property_ui_text(prop, "Draw Texture Space", "Display the object's texture space");
2405
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2593
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2407
2595
prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
2408
2596
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE);
2409
2597
RNA_def_property_ui_text(prop, "Draw Wire", "Add the object's wireframe over solid drawing");
2410
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2598
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2600
prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
2601
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAW_ALL_EDGES);
2602
RNA_def_property_ui_text(prop, "Draw All Edges", "Display all edges for mesh objects");
2603
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2412
2605
prop = RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE);
2413
2606
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP);
2414
2607
RNA_def_property_ui_text(prop, "Draw Transparent",
2415
2608
"Display material transparency in the object (unsupported for duplicator drawing)");
2416
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2609
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2418
2611
prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
2419
2612
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY);
2420
2613
RNA_def_property_ui_text(prop, "X-Ray",
2421
2614
"Make the object draw in front of others (unsupported for duplicator drawing)");
2422
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
2615
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
2424
2617
/* Grease Pencil */
2425
2618
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
2488
2687
prop = RNA_def_property(srna, "matrix_original", PROP_FLOAT, PROP_MATRIX);
2489
2688
RNA_def_property_float_sdna(prop, NULL, "omat");
2490
2689
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
2491
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
2690
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2492
2691
RNA_def_property_ui_text(prop, "Object Matrix", "The original matrix of this object before it was duplicated");
2494
2693
prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
2495
2694
RNA_def_property_float_sdna(prop, NULL, "mat");
2496
2695
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
2497
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
2696
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2498
2697
RNA_def_property_ui_text(prop, "Object Duplicate Matrix", "Object duplicate transformation matrix");
2500
2699
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
2501
2700
RNA_def_property_boolean_sdna(prop, NULL, "no_draw", 0);
2502
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
2701
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2503
2702
RNA_def_property_ui_text(prop, "Hide", "Don't show dupli object in viewport or render");
2505
/* TODO: DupliObject has more properties that can be wrapped */
2704
prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE);
2705
RNA_def_property_int_funcs(prop, "rna_DupliObject_index_get", NULL, NULL);
2706
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2707
RNA_def_property_ui_text(prop, "Index", "Index in the lowest-level dupli list");
2709
prop = RNA_def_property(srna, "persistent_id", PROP_INT, PROP_NONE);
2710
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2711
RNA_def_property_ui_text(prop, "Persistent ID", "Persistent identifier for inter-frame matching of objects with motion blur");
2713
prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
2714
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2715
RNA_def_property_ui_text(prop, "Particle System", "Particle system that this dupli object was instanced from");
2717
prop = RNA_def_property(srna, "orco", PROP_FLOAT, PROP_TRANSLATION);
2718
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2719
RNA_def_property_ui_text(prop, "Generated Coordinates", "Generated coordinates in parent object space");
2721
prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE);
2722
RNA_def_property_array(prop, 2);
2723
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2724
RNA_def_property_ui_text(prop, "UV Coordinates", "UV coordinates in parent object space");
2726
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
2727
RNA_def_property_enum_items(prop, dupli_items);
2728
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
2729
RNA_def_property_ui_text(prop, "Dupli Type", "Duplicator type that generated this dupli object");
2508
2732
static void rna_def_object_base(BlenderRNA *brna)