Revision: 18808 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18808 Author: aligorith Date: 2009-02-04 12:47:05 +0100 (Wed, 04 Feb 2009)
Log Message: ----------- Assorted fixes: * Added examples of how to patch up MTex adrcodes for Animato. It appears many of the settings there in RNA are still undefined though! * Added undo push for the Outliner tweaks I made * Removed some outdated comment Modified Paths: -------------- branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c branches/blender2.5/blender/source/blender/makesdna/DNA_action_types.h Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c =================================================================== --- branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c 2009-02-04 09:09:31 UTC (rev 18807) +++ branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c 2009-02-04 11:47:05 UTC (rev 18808) @@ -351,6 +351,76 @@ return buf; } +/* MTex (Texture Slot) types */ +static char *mtex_adrcodes_to_paths (int adrcode, int *array_index) +{ + char *base=NULL, *prop=NULL; + static char buf[128]; + + /* base part of path */ + if (adrcode & MA_MAP1) base= "textures[0]"; + else if (adrcode & MA_MAP2) base= "textures[1]"; + else if (adrcode & MA_MAP3) base= "textures[2]"; + else if (adrcode & MA_MAP4) base= "textures[3]"; + else if (adrcode & MA_MAP5) base= "textures[4]"; + else if (adrcode & MA_MAP6) base= "textures[5]"; + else if (adrcode & MA_MAP7) base= "textures[6]"; + else if (adrcode & MA_MAP8) base= "textures[7]"; + else if (adrcode & MA_MAP9) base= "textures[8]"; + else if (adrcode & MA_MAP10) base= "textures[9]"; + else if (adrcode & MA_MAP11) base= "textures[10]"; + else if (adrcode & MA_MAP12) base= "textures[11]"; + else if (adrcode & MA_MAP13) base= "textures[12]"; + else if (adrcode & MA_MAP14) base= "textures[13]"; + else if (adrcode & MA_MAP15) base= "textures[14]"; + else if (adrcode & MA_MAP16) base= "textures[15]"; + else if (adrcode & MA_MAP17) base= "textures[16]"; + else if (adrcode & MA_MAP18) base= "textures[17]"; + + /* property identifier for path */ + adrcode= (adrcode & (MA_MAP1-1)); + switch (adrcode) { +#if 0 // XXX these are not wrapped in RNA yet! + case MAP_OFS_X: + poin= &(mtex->ofs[0]); break; + case MAP_OFS_Y: + poin= &(mtex->ofs[1]); break; + case MAP_OFS_Z: + poin= &(mtex->ofs[2]); break; + case MAP_SIZE_X: + poin= &(mtex->size[0]); break; + case MAP_SIZE_Y: + poin= &(mtex->size[1]); break; + case MAP_SIZE_Z: + poin= &(mtex->size[2]); break; + case MAP_R: + poin= &(mtex->r); break; + case MAP_G: + poin= &(mtex->g); break; + case MAP_B: + poin= &(mtex->b); break; + case MAP_DVAR: + poin= &(mtex->def_var); break; + case MAP_COLF: + poin= &(mtex->colfac); break; + case MAP_NORF: + poin= &(mtex->norfac); break; + case MAP_VARF: + poin= &(mtex->varfac); break; +#endif + case MAP_DISP: + prop= "warp_factor"; break; + } + + /* only build and return path if there's a property */ + if (prop) { + BLI_snprintf(buf, 128, "%s.%s", base, prop); + return buf; + } + else + return NULL; +} + /* Texture types */ static char *texture_adrcodes_to_paths (int adrcode, int *array_index) { @@ -465,8 +535,10 @@ case MA_REF: return "diffuse_reflection"; - - // XXX add other types... + + + default: /* for now, we assume that the others were MTex channels */ + return mtex_adrcodes_to_paths(adrcode, array_index); } return NULL; @@ -500,30 +572,6 @@ poin= &(ma->fresnel_tra_i); break; case MA_ADD: poin= &(ma->add); break; - - if (poin == NULL) { - if (icu->adrcode & MA_MAP1) mtex= ma->mtex[0]; - else if (icu->adrcode & MA_MAP2) mtex= ma->mtex[1]; - else if (icu->adrcode & MA_MAP3) mtex= ma->mtex[2]; - else if (icu->adrcode & MA_MAP4) mtex= ma->mtex[3]; - else if (icu->adrcode & MA_MAP5) mtex= ma->mtex[4]; - else if (icu->adrcode & MA_MAP6) mtex= ma->mtex[5]; - else if (icu->adrcode & MA_MAP7) mtex= ma->mtex[6]; - 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))); - } #endif } @@ -600,34 +648,11 @@ case LA_HALOINT: return "halo_intensity"; + + default: /* for now, we assume that the others were MTex channels */ + return mtex_adrcodes_to_paths(adrcode, array_index); } -#if 0 // XXX to be converted - if (poin == NULL) { - if (icu->adrcode & MA_MAP1) mtex= la->mtex[0]; - else if (icu->adrcode & MA_MAP2) mtex= la->mtex[1]; - else if (icu->adrcode & MA_MAP3) mtex= la->mtex[2]; - else if (icu->adrcode & MA_MAP4) mtex= la->mtex[3]; - else if (icu->adrcode & MA_MAP5) mtex= la->mtex[4]; - else if (icu->adrcode & MA_MAP6) mtex= la->mtex[5]; - else if (icu->adrcode & MA_MAP7) mtex= la->mtex[6]; - 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))); - } -#endif // XXX to be converted - /* unrecognised adrcode, or not-yet-handled ones! */ return NULL; } @@ -1490,45 +1515,6 @@ /* --------------------- Get Pointer API ----------------------------- */ -/* get texture-slot/mapping channel */ -void *give_mtex_poin (MTex *mtex, int adrcode) -{ - void *poin= NULL; - - switch (adrcode) { - case MAP_OFS_X: - poin= &(mtex->ofs[0]); break; - case MAP_OFS_Y: - poin= &(mtex->ofs[1]); break; - case MAP_OFS_Z: - poin= &(mtex->ofs[2]); break; - case MAP_SIZE_X: - poin= &(mtex->size[0]); break; - case MAP_SIZE_Y: - poin= &(mtex->size[1]); break; - case MAP_SIZE_Z: - poin= &(mtex->size[2]); break; - case MAP_R: - poin= &(mtex->r); break; - case MAP_G: - poin= &(mtex->g); break; - case MAP_B: - poin= &(mtex->b); break; - case MAP_DVAR: - poin= &(mtex->def_var); break; - case MAP_COLF: - poin= &(mtex->colfac); break; - case MAP_NORF: - poin= &(mtex->norfac); break; - case MAP_VARF: - poin= &(mtex->varfac); break; - case MAP_DISP: - poin= &(mtex->dispfac); break; - } - - /* return pointer */ - return poin; -} /* GS reads the memory pointed at in a specific ordering. There are, * however two definitions for it. I have jotted them down here, both, Modified: branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c =================================================================== --- branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c 2009-02-04 09:09:31 UTC (rev 18807) +++ branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c 2009-02-04 11:47:05 UTC (rev 18808) @@ -2259,6 +2259,11 @@ /* select relevant row */ outliner_select(soops, &soops->tree, &row, &selecting); + + // XXX old flag found in old code, do we still use this? + //soops->storeflag |= SO_TREESTORE_REDRAW; + + BIF_undo_push("Outliner selection event"); } ED_region_tag_redraw(ar); Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_action_types.h =================================================================== --- branches/blender2.5/blender/source/blender/makesdna/DNA_action_types.h 2009-02-04 09:09:31 UTC (rev 18807) +++ branches/blender2.5/blender/source/blender/makesdna/DNA_action_types.h 2009-02-04 11:47:05 UTC (rev 18808) @@ -244,7 +244,6 @@ * It serves as a 'unit' of reusable animation information (i.e. keyframes/motion data), that * affects a group of related settings (as defined by the user). */ -// XXX use this as drop-in replacement at some point... typedef struct bAction { ID id; /* ID-serialisation for relinking */ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs