Two isses: - Material assigning to MetaBalls used wrong pointer (copy paste error, casting badly). - Checking for node-material used wrong RNA pointer (confusing void stuff going on here!) The error leads to corruption in data and/or random crashes. Better update svn now!
This commit is contained in:
@@ -445,7 +445,7 @@ Material ***give_matarar_id(ID *id)
|
||||
return &(((Curve *)id)->mat);
|
||||
break;
|
||||
case ID_MB:
|
||||
return &(((Curve *)id)->mat);
|
||||
return &(((MetaBall *)id)->mat);
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
@@ -461,7 +461,7 @@ short *give_totcolp_id(ID *id)
|
||||
return &(((Curve *)id)->totcol);
|
||||
break;
|
||||
case ID_MB:
|
||||
return &(((Curve *)id)->totcol);
|
||||
return &(((MetaBall *)id)->totcol);
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
@@ -530,6 +530,10 @@ Material *give_current_material(Object *ob, int act)
|
||||
totcolp= give_totcolp(ob);
|
||||
if(totcolp==NULL || ob->totcol==0) return NULL;
|
||||
|
||||
if(act<0) {
|
||||
printf("no!\n");
|
||||
}
|
||||
|
||||
if(act>ob->totcol) act= ob->totcol;
|
||||
else if(act<=0) act= 1;
|
||||
|
||||
|
||||
@@ -2008,7 +2008,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
|
||||
/* provision to draw active node name */
|
||||
Material *ma, *manode;
|
||||
Object *ob= (Object*)ptr->id.data;
|
||||
int index= (Material**)ptr->data - ob->mat;
|
||||
int index= (Material**)itemptr->data - ob->mat;
|
||||
|
||||
/* default item with material base name */
|
||||
uiItemL(sub, name, icon);
|
||||
|
||||
Reference in New Issue
Block a user