I was testing it just now and I was to post first version didn’t worked in Max2009 64bits.
This 1.1 works great!
Please post a link in Jeff shader thread to this new shader. And thanks for your effort!.
A curiosity: I was trying to create a mi file with the C code inside but it don’t loads, it gives a compiler error when max starts. If you know why I am curious, if not don’t worry it was simply a curiosity (version 1 used here but as said it don’t compiles when max starts):
Content of WireColor.mi file:
# WireColor shader for mental ray in 3ds Max
# David Baker, 25.07.2008
# What it does:
# Used in a color swatch, it uses the wire color of the objects it is applied to.
# It has no settings.
#
# Installation:
# Place it in \Max\mentalray\shaders_autoload\include
$code
#include <shader.h>
struct max_NodeData {
miColor WireColor;
miInteger NodeID;
miInteger NodeRenderID;
int i_illuminators;
int n_illuminators;
miTag illuminators[1];
int i_shadowmakers;
int n_shadowmakers;
miTag shadowmakers[1];
miBoolean useGlobalLights;
int i_materialRequirements;
int n_materialRequirements;
miInteger materialRequirements[1];
miInteger lightIncludeExcludeID;
};
DLLEXPORT int WireColor_version(void) {return 1;}
DLLEXPORT void WireColor_init(miState *state) {}
DLLEXPORT void WireColor_exit(miState *state) {}
DLLEXPORT miBoolean WireColor(miColor *out_pResult, miState *state)
{ int size;
miTag user_data_tag;
struct max_NodeData *user_data;
if (mi_query(miQ_INST_DATA, state, state->instance, &user_data_tag) &&
mi_query(miQ_DATA_PARAM_SIZE, state, user_data_tag, &size) &&
mi_query(miQ_DATA_PARAM, state, user_data_tag, &user_data) &&
size == sizeof(struct max_NodeData))
{ *out_pResult = user_data->WireColor;
}
return miTRUE;
}
$end code
declare shader miBoolean "WireColor" ()
version 1
apply texture
end declare