2.5: bug fixes for some erratice materials buttons drawing.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 24 Jun 2009 18:39:00 +0000 (18:39 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 24 Jun 2009 18:39:00 +0000 (18:39 +0000)
release/ui/buttons_data_mesh.py
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_view3d/drawobject.c

index e5c1b8fc9eef37720878c716cab6a19d695556e4..6f64de312edca6bcd6b1eb703c21989321ed9a31 100644 (file)
@@ -62,7 +62,7 @@ class DATA_PT_materials(DataButtonsPanel):
 
                row = layout.row()
 
-               row.template_list(ob, "materials", "active_material_index", items=10)
+               row.template_list(ob, "materials", "active_material_index")
 
                col = row.column(align=True)
                col.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="")
index a27788530ceef9ed370152db9dd4f2816b43c721..4dcf1590a6519993e47f7ffcd85ed622ba24c1f0 100644 (file)
@@ -1617,7 +1617,8 @@ void uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *act
        uiBlockSetEmboss(block, UI_EMBOSSN);
 
        len= RNA_property_collection_length(ptr, prop);
-       CLAMP(scroll, 1, len);
+       scroll= MIN2(scroll, len-items+1);
+       scroll= MAX2(scroll, 1);
 
        RNA_BEGIN(ptr, itemptr, propname) {
                if(i >= scroll && i<scroll+items) {
index cba9a4cf8fc72606f297dbe89c1d8d94b6ddfd92..01794d1bba805f0988470f4e43797aaff9179142 100644 (file)
@@ -552,7 +552,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                if(ptr) {
                        Object *ob= ptr->data;
 
-                       if(ob && ob->type && (ob->type<OB_LAMP))
+                       if(ob && ob->type && (ob->type<OB_LAMP) && ob->totcol)
                                CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, ob->mat+ob->actcol-1);
                }
 
index 8aa955f0b349b438e07b6f8f11ad5cea97d8de02..a08a23c1263ad8eb7c9f808920c4b3b8b4f6b728 100644 (file)
@@ -383,6 +383,7 @@ static void image_editcursor_buts(const bContext *C, View2D *v2d, uiBlock *block
        }
 }
 
+#if 0
 static void image_panel_view_properties(const bContext *C, Panel *pa)
 {
        SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C);
@@ -439,6 +440,7 @@ static void image_panel_view_properties(const bContext *C, Panel *pa)
        }
        image_editcursor_buts(C, &ar->v2d, block);
 }
+#endif
 
 void brush_buttons(const bContext *C, uiBlock *block, short fromsima,
                                   int evt_nop, int evt_change,
index ea9fb66dae0d33b3f88578d0015fb95ce99f1672..05490e2fce192c1ffb539b121bc6a83df03691ee 100644 (file)
@@ -3566,7 +3566,6 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
 
 static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, ParticleSystem *psys, int dt)
 {
-       ToolSettings *ts= scene->toolsettings;
        ParticleEdit *edit = psys->edit;
        ParticleData *pa;
        ParticleCacheKey **path;