I have defined a struct in my shader declaration:
In my shder I try to access it with the usual array approach:Code:declare shader color "colTest" ( array struct "colStruct" { color "color" } ) version 1 apply material end declare
str----------------Code:uct colStruct{ miColor color; }; struct colTest_p{ int i_color; int n_color; miTag col[1]; }; miBoolean colTest( miColor *result, miState *state, colTest_p *paras) { int n_color = *mi_eval_integer(¶s->n_color); int i_color = *mi_eval_integer(¶s->i_color); miTag *colTag = mi_eval_tag(paras->col) + i_color; int n; for (n=0; n < n_color; n++, colTag++) { mi_info("ColTagP %d colTag %d", colTag, *colTag); if(*colTag) { colStruct *colS = (colStruct *) mi_db_access( *colTag ); mi_db_unpin(*colTag); mi_info(" colS %f ", colS->color.r ); } } return miTRUE; }
Unfortunalty it doesnt work.
It seems that the pointer *colTag contains a null tag.
Any tips?


Reply With Quote