bpy fix for crash/assert on running dir() on a non collection property + some other...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 30 Jul 2011 13:18:04 +0000 (13:18 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 30 Jul 2011 13:18:04 +0000 (13:18 +0000)
source/blender/editors/transform/transform.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/python/intern/bpy_rna.c

index eea77e36f7c5dc5475d671cea8f30b694a07c241..59e9e681e2b83bca3949a83d17cc7d8d7f8ec0ff 100644 (file)
@@ -4659,7 +4659,7 @@ static int createSlideVerts(TransInfo *t)
 #define EDGE_SLIDE_MIN 30
        if (len_squared_v2v2(start, end) < (EDGE_SLIDE_MIN * EDGE_SLIDE_MIN)) {
                if(ABS(start[0]-end[0]) + ABS(start[1]-end[1]) < 4.0f) {
-                       /* even more exceptional case, points are ontop of eachother */
+                       /* even more exceptional case, points are ontop of each other */
                        end[0]= start[0];
                        end[1]= start[1] + EDGE_SLIDE_MIN;
                }
index e250cc84aa3a542cbe61ecf3d92d97175c6fe22a..d44b68950f796d16a082ee901b95b504274948d9 100644 (file)
@@ -205,7 +205,7 @@ void RNA_api_operator(StructRNA *srna)
 
        /* check */
        func= RNA_def_function(srna, "check", NULL);
-       RNA_def_function_ui_description(func, "Check the operator settings.");
+       RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw.");
        RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
        parm= RNA_def_pointer(func, "context", "Context", "", "");
        RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
index 6e1b9c807f389694e50bf39c3c29168603e303bd..2dcfe3731c78fa34487dc935db46648b29688953 100644 (file)
@@ -3262,11 +3262,15 @@ static PyObject *pyrna_prop_dir(BPy_PropertyRNA *self)
         * */
        ret= PyList_New(0);
 
-       if (!BPy_PropertyRNA_CheckExact(self))
+       if (!BPy_PropertyRNA_CheckExact(self)) {
                pyrna_dir_members_py(ret, (PyObject *)self);
+       }
 
-       if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr))
-               pyrna_dir_members_rna(ret, &r_ptr);
+       if(RNA_property_type(self->prop) == PROP_COLLECTION) {
+               if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) {
+                       pyrna_dir_members_rna(ret, &r_ptr);
+               }
+       }
 
        return ret;
 }