[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14690] branches/apricot/source/blender: raised maximum texture slots to 18
Campbell Barton
ideasman42 at gmail.com
Mon May 5 17:40:16 CEST 2008
Revision: 14690
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14690
Author: campbellbarton
Date: 2008-05-05 17:40:16 +0200 (Mon, 05 May 2008)
Log Message:
-----------
raised maximum texture slots to 18
Modified Paths:
--------------
branches/apricot/source/blender/blenkernel/intern/ipo.c
branches/apricot/source/blender/makesdna/DNA_brush_types.h
branches/apricot/source/blender/makesdna/DNA_ipo_types.h
branches/apricot/source/blender/makesdna/DNA_lamp_types.h
branches/apricot/source/blender/makesdna/DNA_material_types.h
branches/apricot/source/blender/makesdna/DNA_scene_types.h
branches/apricot/source/blender/makesdna/DNA_world_types.h
branches/apricot/source/blender/python/api2_2x/Material.c
branches/apricot/source/blender/src/buttons_shading.c
branches/apricot/source/blender/src/editipo_lib.c
Modified: branches/apricot/source/blender/blenkernel/intern/ipo.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/ipo.c 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/blenkernel/intern/ipo.c 2008-05-05 15:40:16 UTC (rev 14690)
@@ -1390,6 +1390,14 @@
else if(icu->adrcode & MA_MAP8) mtex= ma->mtex[7];
else if(icu->adrcode & MA_MAP9) mtex= ma->mtex[8];
else if(icu->adrcode & MA_MAP10) mtex= ma->mtex[9];
+ else if(icu->adrcode & MA_MAP12) mtex= ma->mtex[11];
+ else if(icu->adrcode & MA_MAP11) mtex= ma->mtex[10];
+ else if(icu->adrcode & MA_MAP13) mtex= ma->mtex[12];
+ else if(icu->adrcode & MA_MAP14) mtex= ma->mtex[13];
+ else if(icu->adrcode & MA_MAP15) mtex= ma->mtex[14];
+ else if(icu->adrcode & MA_MAP16) mtex= ma->mtex[15];
+ else if(icu->adrcode & MA_MAP17) mtex= ma->mtex[16];
+ else if(icu->adrcode & MA_MAP18) mtex= ma->mtex[17];
if(mtex) {
poin= give_mtex_poin(mtex, icu->adrcode & (MA_MAP1-1) );
@@ -1479,7 +1487,14 @@
else if(icu->adrcode & MA_MAP8) mtex= wo->mtex[7];
else if(icu->adrcode & MA_MAP9) mtex= wo->mtex[8];
else if(icu->adrcode & MA_MAP10) mtex= wo->mtex[9];
-
+ else if(icu->adrcode & MA_MAP11) mtex= wo->mtex[10];
+ else if(icu->adrcode & MA_MAP12) mtex= wo->mtex[11];
+ else if(icu->adrcode & MA_MAP13) mtex= wo->mtex[12];
+ else if(icu->adrcode & MA_MAP14) mtex= wo->mtex[13];
+ else if(icu->adrcode & MA_MAP15) mtex= wo->mtex[14];
+ else if(icu->adrcode & MA_MAP16) mtex= wo->mtex[15];
+ else if(icu->adrcode & MA_MAP17) mtex= wo->mtex[16];
+ else if(icu->adrcode & MA_MAP18) mtex= wo->mtex[17];
if(mtex) {
poin= give_mtex_poin(mtex, icu->adrcode & (MA_MAP1-1) );
}
@@ -1524,6 +1539,14 @@
else if(icu->adrcode & MA_MAP8) mtex= la->mtex[7];
else if(icu->adrcode & MA_MAP9) mtex= la->mtex[8];
else if(icu->adrcode & MA_MAP10) mtex= la->mtex[9];
+ else if(icu->adrcode & MA_MAP11) mtex= la->mtex[10];
+ else if(icu->adrcode & MA_MAP12) mtex= la->mtex[11];
+ else if(icu->adrcode & MA_MAP13) mtex= la->mtex[12];
+ else if(icu->adrcode & MA_MAP14) mtex= la->mtex[13];
+ else if(icu->adrcode & MA_MAP15) mtex= la->mtex[14];
+ else if(icu->adrcode & MA_MAP16) mtex= la->mtex[15];
+ else if(icu->adrcode & MA_MAP17) mtex= la->mtex[16];
+ else if(icu->adrcode & MA_MAP18) mtex= la->mtex[17];
if(mtex) {
poin= give_mtex_poin(mtex, icu->adrcode & (MA_MAP1-1) );
Modified: branches/apricot/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_brush_types.h 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/makesdna/DNA_brush_types.h 2008-05-05 15:40:16 UTC (rev 14690)
@@ -33,7 +33,7 @@
#include "DNA_ID.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
struct MTex;
@@ -58,7 +58,7 @@
float alpha; /* opacity */
short texact, pad;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
struct BrushClone clone;
} Brush;
Modified: branches/apricot/source/blender/makesdna/DNA_ipo_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_ipo_types.h 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/makesdna/DNA_ipo_types.h 2008-05-05 15:40:16 UTC (rev 14690)
@@ -142,16 +142,24 @@
#define MA_FRESTRAI 25
#define MA_ADD 26
-#define MA_MAP1 0x20
-#define MA_MAP2 0x40
-#define MA_MAP3 0x80
-#define MA_MAP4 0x100
-#define MA_MAP5 0x200
-#define MA_MAP6 0x400
-#define MA_MAP7 0x800
-#define MA_MAP8 0x1000
-#define MA_MAP9 0x2000
-#define MA_MAP10 0x4000
+#define MA_MAP1 1<<5
+#define MA_MAP2 1<<6
+#define MA_MAP3 1<<7
+#define MA_MAP4 1<<8
+#define MA_MAP5 1<<9
+#define MA_MAP6 1<<10
+#define MA_MAP7 1<<11
+#define MA_MAP8 1<<12
+#define MA_MAP9 1<<13
+#define MA_MAP10 1<<14
+#define MA_MAP11 1<<15
+#define MA_MAP12 1<<16
+#define MA_MAP13 1<<17
+#define MA_MAP14 1<<18
+#define MA_MAP15 1<<19
+#define MA_MAP16 1<<20
+#define MA_MAP17 1<<21
+#define MA_MAP18 1<<22
#define TEX_TOTNAM 14
Modified: branches/apricot/source/blender/makesdna/DNA_lamp_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_lamp_types.h 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/makesdna/DNA_lamp_types.h 2008-05-05 15:40:16 UTC (rev 14690)
@@ -35,7 +35,7 @@
#include "DNA_scriptlink_types.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
struct MTex;
@@ -84,7 +84,7 @@
float YF_glowint, YF_glowofs;
short YF_glowtype, YF_pad2;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
struct Ipo *ipo;
/* preview */
Modified: branches/apricot/source/blender/makesdna/DNA_material_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_material_types.h 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/makesdna/DNA_material_types.h 2008-05-05 15:40:16 UTC (rev 14690)
@@ -36,7 +36,7 @@
#include "DNA_listBase.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
struct MTex;
@@ -89,11 +89,11 @@
float sbias; /* shadow bias to prevent terminator prob */
float lbias; /* factor to multiply lampbias with (0.0 = no mult) */
float shad_alpha; /* in use for irregular shadowbuffer */
- float padf; /* free padding, take me! */
+ int septex;
/* for buttons and render*/
char rgbsel, texact, pr_type, use_nodes;
- short pr_back, pr_lamp, septex, ml_flag; /* ml_flag is for disable base material */
+ short pr_back, pr_lamp, pad4, ml_flag; /* ml_flag is for disable base material */
/* shaders */
short diff_shader, spec_shader;
@@ -111,7 +111,7 @@
short ramp_show, pad3;
float rampfac_col, rampfac_spec;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
struct bNodeTree *nodetree;
struct Ipo *ipo;
struct Group *group; /* light group */
Modified: branches/apricot/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_scene_types.h 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/makesdna/DNA_scene_types.h 2008-05-05 15:40:16 UTC (rev 14690)
@@ -461,7 +461,7 @@
struct SculptSession *session;
/* Pointers to all of sculptmodes's textures */
- struct MTex *mtex[10];
+ struct MTex *mtex[18];
/* Editable brush shape */
struct CurveMapping *cumap;
Modified: branches/apricot/source/blender/makesdna/DNA_world_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_world_types.h 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/makesdna/DNA_world_types.h 2008-05-05 15:40:16 UTC (rev 14690)
@@ -38,7 +38,7 @@
struct MTex;
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
@@ -108,7 +108,7 @@
struct Ipo *ipo;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
/* previews */
struct PreviewImage *preview;
Modified: branches/apricot/source/blender/python/api2_2x/Material.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Material.c 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/python/api2_2x/Material.c 2008-05-05 15:40:16 UTC (rev 14690)
@@ -1654,8 +1654,7 @@
}
/* turn the array into a tuple */
- tuple = Py_BuildValue( "NNNNNNNNNN", t[0], t[1], t[2], t[3],
- t[4], t[5], t[6], t[7], t[8], t[9] );
+ tuple = Py_BuildValue( "NNNNNNNNNNNNNNNNNN", t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9], t[10], t[11], t[11], t[12], t[13], t[14], t[15], t[16], t[17] );
if( !tuple )
return EXPP_ReturnPyObjError( PyExc_MemoryError,
"Material_getTextures: couldn't create PyTuple" );
Modified: branches/apricot/source/blender/src/buttons_shading.c
===================================================================
--- branches/apricot/source/blender/src/buttons_shading.c 2008-05-05 13:35:12 UTC (rev 14689)
+++ branches/apricot/source/blender/src/buttons_shading.c 2008-05-05 15:40:16 UTC (rev 14690)
@@ -1597,9 +1597,27 @@
/* CHANNELS */
if(node==NULL) {
+ int max_mtex = 0;
uiBlockBeginAlign(block);
yco= 150;
- for(a= 0; a<MAX_MTEX; a++) {
+
+ /* APRICOT HACK */
+ for(a=MAX_MTEX; a>0; a--) {
+ if (ma->mtex[a]) {
+ max_mtex = a;
+ break;
+ }
+ }
+ max_mtex++;
+ if (max_mtex < 10) {
+ max_mtex = 10;
+ } else {
+ if (max_mtex < MAX_MTEX)
+ max_mtex++;
+ }
+ /* END APRICOT HACK */
+
+ for(a= 0; a<max_mtex; a++) {
if(ma) mt= ma->mtex[a];
else if(wrld) mt= wrld->mtex[a];
@@ -3491,6 +3509,24 @@
int a;
char str[64], *strp;
+
+ /* APRICOT HACK */
+ int max_mtex = 0;
+ for(a=MAX_MTEX; a>0; a--) {
+ if (ma->mtex[a]) {
+ max_mtex = a;
+ break;
+ }
+ }
+ max_mtex++;
+ if (max_mtex < 10) {
+ max_mtex = 10;
+ } else {
+ if (max_mtex < MAX_MTEX)
+ max_mtex++;
+ }
+ /* END APRICOT HACK */
+
block= uiNewBlock(&curarea->uiblocks, "material_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
if(uiNewPanel(curarea, block, "Texture", "Material", 960, 0, 318, 204)==0) return;
uiClearButLock();
@@ -3504,7 +3540,7 @@
uiBlockSetCol(block, TH_BUT_NEUTRAL);
uiBlockBeginAlign(block);
- for(a= 0; a<MAX_MTEX; a++) {
+ for(a= 0; a<max_mtex; a++) {
mtex= ma->mtex[a];
if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
else strcpy(str, "");
@@ -3518,10 +3554,10 @@
/* SEPTEX */
uiBlockSetCol(block, TH_AUTO);
- for(a= 0; a<MAX_MTEX; a++) {
+ for(a= 0; a<max_mtex; a++) {
mtex= ma->mtex[a];
if(mtex && mtex->tex) {
- but=uiDefIconButBitS(block, ICONTOGN, 1<<a, B_MATPRV, ICON_CHECKBOX_HLT-1, -20, 180-18*a, 28, 20, &ma->septex, 0.0, 0.0, 0, 0, "Click to disable or enable this texture channel");
+ but=uiDefIconButBitI(block, ICONTOGN, 1<<a, B_MATPRV, ICON_CHECKBOX_HLT-1, -20, 180-18*a, 28, 20, &ma->septex, 0.0, 0.0, 0, 0, "Click to disable or enable this texture channel");
if(psys_mapto && ma->mtex[a]->mapto & MAP_PA_IVEL)
uiButSetFunc(but, particle_recalc_material, ma, NULL);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list