~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/makesrna/intern/rna_sensor.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include "WM_types.h"
44
44
 
45
45
/* Always keep in alphabetical order */
46
 
EnumPropertyItem sensor_type_items[] = {
 
46
static EnumPropertyItem sensor_type_items[] = {
47
47
        {SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""},
48
48
        {SENS_ALWAYS, "ALWAYS", 0, "Always", ""},
49
49
        {SENS_ARMATURE, "ARMATURE", 0, "Armature", ""},
58
58
        {SENS_RADAR, "RADAR", 0, "Radar", ""},
59
59
        {SENS_RANDOM, "RANDOM", 0, "Random", ""},
60
60
        {SENS_RAY, "RAY", 0, "Ray", ""},
61
 
        {SENS_TOUCH, "TOUCH", 0, "Touch", ""},
62
61
        {0, NULL, 0, NULL, NULL}
63
62
};
64
63
 
74
73
        switch (sensor->type) {
75
74
                case SENS_ALWAYS:
76
75
                        return &RNA_AlwaysSensor;
77
 
                case SENS_TOUCH:
78
 
                        return &RNA_TouchSensor;
79
76
                case SENS_NEAR:
80
77
                        return &RNA_NearSensor;
81
78
                case SENS_KEYBOARD:
267
264
        posechannel[0] = 0;
268
265
        constraint[0] = 0;
269
266
}
270
 
 
271
 
/* note: the following set functions exists only to avoid id refcounting */
272
 
static void rna_Sensor_touch_material_set(PointerRNA *ptr, PointerRNA value)
273
 
{
274
 
        bSensor *sens = (bSensor *)ptr->data;
275
 
        bTouchSensor *ts = (bTouchSensor *) sens->data;
276
 
 
277
 
        ts->ma = value.data;
278
 
}
279
267
#else
280
268
 
281
269
static void rna_def_sensor(BlenderRNA *brna)
427
415
        RNA_def_property_update(prop, NC_LOGIC, NULL);
428
416
}
429
417
 
430
 
static void rna_def_touch_sensor(BlenderRNA *brna)
431
 
{
432
 
        StructRNA *srna;
433
 
        PropertyRNA *prop;
434
 
 
435
 
        srna = RNA_def_struct(brna, "TouchSensor", "Sensor");
436
 
        RNA_def_struct_ui_text(srna, "Touch Sensor", "Sensor to detect objects colliding with the current object");
437
 
        RNA_def_struct_sdna_from(srna, "bTouchSensor", "data");
438
 
 
439
 
        prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
440
 
        RNA_def_property_struct_type(prop, "Material");
441
 
        RNA_def_property_pointer_sdna(prop, NULL, "ma");
442
 
        RNA_def_property_flag(prop, PROP_EDITABLE);
443
 
        RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
444
 
        /* note: custom set function is ONLY to avoid rna setting a user for this. */
445
 
        RNA_def_property_pointer_funcs(prop, NULL, "rna_Sensor_touch_material_set", NULL, NULL);
446
 
        RNA_def_property_update(prop, NC_LOGIC, NULL);
447
 
}
448
 
 
449
418
static void rna_def_keyboard_sensor(BlenderRNA *brna)
450
419
{
451
420
        StructRNA *srna;
917
886
        rna_def_always_sensor(brna);
918
887
        rna_def_near_sensor(brna);
919
888
        rna_def_mouse_sensor(brna);
920
 
        rna_def_touch_sensor(brna);
921
889
        rna_def_keyboard_sensor(brna);
922
890
        rna_def_property_sensor(brna);
923
891
        rna_def_armature_sensor(brna);