def draw_header(self, context):
world = context.world
- self.layout.prop(world.mist, "use_mist", text="")
+ self.layout.prop(world.mist_settings, "use_mist", text="")
def draw(self, context):
layout = self.layout
world = context.world
- layout.active = world.mist.use_mist
+ layout.active = world.mist_settings.use_mist
split = layout.split()
col = split.column()
- col.prop(world.mist, "start")
+ col.prop(world.mist_settings, "start")
col = split.column()
- col.prop(world.mist, "depth")
+ col.prop(world.mist_settings, "depth")
class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr)) {
return pyrna_struct_CreatePyObject(&newptr);
}
- PyErr_Format(PyExc_IndexError, "bpy_prop_collection[index]: index %d could not be found", keynum);
- return NULL;
+ else { /* fail's if ptr.data == NULL, valid for mesh.materials */
+ Py_RETURN_NONE;
+ }
}
- PyErr_Format(PyExc_IndexError, "bpy_prop_collection[index]: index %d out of range", keynum);
+ PyErr_Format(PyExc_IndexError, "bpy_prop_collection[index]: index %d out of range, size %d", keynum, len);
return NULL;
}