diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-02-18 02:35:09 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-02-18 02:38:08 +0400 |
commit | 16c75cf594a92b232e46f922d644ac0a70088bad (patch) | |
tree | f50ed91fe7b7bcaa70bae7e478db35cddb12adfe /source/blender/makesrna/intern/rna_actuator.c | |
parent | 3d7e0aae52c9d30739a001826c3f6b3331270f36 (diff) |
Fix T38654: Using a non-camera object for the SetCamera Scene Actuator causes a segfault.
Non-camera objects are not supported as cameras, and trying to use them
just causes memory errors (some bad typecasts are involved). When converting
a Scene Actuator, only use the object as a camera if it is actually a camera.
Also, the logic brick UI now filters for camera objects, which should help
avoid confusion.
Diffstat (limited to 'source/blender/makesrna/intern/rna_actuator.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 7747c5e78b3..e5545f9cb95 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -1479,10 +1479,10 @@ static void rna_def_scene_actuator(BlenderRNA *brna) 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 filter only camera objects */ + prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll"); 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); |