Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c5
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c3
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index fa5397e669e..2fa93bcecdd 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "RNA_define.h"
+#include "RNA_access.h"
#include "rna_internal.h"
#include "DNA_constraint_types.h"
@@ -360,9 +361,7 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *fre
Object *ob= NULL;
int totitem= 0;
- /* hardcoded exceptions, for these cases code below needs to find the id.data */
- /* otherwise buttons never give all options for selected */
- if (ptr->type==&RNA_Actuator || ptr->type==&RNA_ArmatureActuator || ptr->type==&RNA_ShapeActionActuator) {
+ if (ptr->type==&RNA_Actuator || RNA_struct_is_a(ptr->type, &RNA_Actuator)){
ob = (Object *)ptr->id.data;
} else {
/* can't use ob from ptr->id.data because that enum is also used by operators */
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index 8f6cc4b875e..47a619f661a 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -26,6 +26,7 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
+#include "RNA_access.h"
#include "rna_internal.h"
@@ -115,7 +116,7 @@ EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, int *free)
Object *ob=NULL;
int totitem= 0;
- if (ptr->type == &RNA_Sensor) {
+ if (ptr->type == &RNA_Sensor || RNA_struct_is_a(ptr->type, &RNA_Sensor)) {
ob = (Object *)ptr->id.data;
} else {
/* can't use ob from ptr->id.data because that enum is also used by operators */