Why in Gods name would Autodesk make RGB curves for a BitmapTex exposed to maxscript, but then cleverly neglect to expose the checkbox and radio buttons you must set in order to access those functions?
Some days…
Why in Gods name would Autodesk make RGB curves for a BitmapTex exposed to maxscript, but then cleverly neglect to expose the checkbox and radio buttons you must set in order to access those functions?
Some days…
Are there any workarounds for this (or the gradient ramp) issue? It’s pretty absurd that we can’t edit this kind of thing directly from maxscript…
Yes there are work arounds for these limitations. Make a matlib with a collection of gradient ramps, each ramp has a different number of flags, then just pull the appropriate ramp with your script and set the flag attributes as needed. Same for the bitmap settings, make one with just R checked, one with just G, etc… and pull the one you need. There are other ways to be slightly more clever but the same technique is used by predefining the parts that script can not access and grabbing the version needed.
There are other ways to be slightly more clever
Can you share these ways?
Talking about sharing:
I almost finished a library holding linear gradients with 3 to 100 flags … could I share it?
Georg
/lament
Dang. Yah, I stumbled on this paradox while trying to find an easy way to manipulate RGB values of a bitmap without going pixel by pixel. 
I went ahead and created a map,
with an RGB color map,
with animated points,
and yet the …curve_1.point1 call won’t work. Could someone give this a try and see what happens?
EDIT Scratch that. Looks like the helpfile is wrong (surprise!). It’s not curve_1.point_1, it’s curve_1[1]…
Now keep in mind I did say slightly more clever. You could make a mesh (single tri) named “ramps” or whatever you like and assign it a 100 sub material multisub material that had a ramp in each diffuse slot with a number of flags settings equal to the multisub ID, save the file as “resource.max” or what ever you like, merge that one mesh into your working scene grab the ramp with the appropriate number of flags, knowing that the flag count = the matSubID. Being a max file allows you to include other types of “inaccessable by script” nodes. For example you could make a model that has a bevel profile modifier on it with the spline already assigned to it and its knots deleted, so if you ever need to bevel profile something you can via script by merging in this model, copying the modifier from it to your target and then adding knots to the pre defined spline, I’ve done this, works well enough. Ultimately you would only have a single max file with your mat settings and modifier settings, etc… You could rename the max file to .src or .dat , max will merge it in requardless of the extension.
So, to lay this problem to rest, what’s the real way of accessing the points in the RGB curves assuming I have access to them? I tried the …curve_1.point_1.<???> but I can’t seem to get anywhere.
“[size=1]The curve_1, curve_2, and curve_3 SubAnims contains the R, G, and B color mapping curve, respectively. You cannot create or access points in these curves unless the point is animated. If a point is animated, you can access the point position using the .Point_X property of the curve, where X in the point number.”
Once you have animated the the curves you can access them with:
<material>.<mapChannel>.output.rgb_color_map.curve_1[1].value[/size]
I may not be doing this right, but something’s not working. You’ll have to hold my hand through this process. =(
Like Blue said, the point needs to be animated before it can be accessed/changed through maxscript.
Cheers,
Martijn
You have to animate the first key, (the left key) curve_1[1], if you expect it to accessable via script. Animating one key does not give you access to both.
The value is not a float, it is a point3 [1,1,0], the first is the position on the curve, and the second is its value.
If you want to querry the value of a key:
<material>.<mapChannel>.output.rgb_color_map.curve_1[2].value.y
or
<material>.<mapChannel>.output.rgb_color_map.curve_1[2].value[2]
If you want to querry the position of a key:
<material>.<mapChannel>.output.rgb_color_map.curve_1[2].value.x
or
<material>.<mapChannel>.output.rgb_color_map.curve_1[2].value[1]
oddly enough setting has to be done as a point3 value, or atleast I could not set the sub values specifically. So to set the value of a key try:
<material>.<mapChannel>.output.rgb_color_map.curve_1[1].value = [0,.5,0]
(
newVal = [0,.5,0]
newVal2 = [1,1,0]
with animate on
(
at time currenttime meditmaterials[1].diffusemap.output.rgb_color_map.curve_1[1].value = newVal
at time currenttime meditmaterials[1].diffusemap.output.rgb_color_map.curve_2[1].value = newVal
at time currenttime meditmaterials[1].diffusemap.output.rgb_color_map.curve_3[1].value = newVal
at time currenttime meditmaterials[1].diffusemap.output.rgb_color_map.curve_1[2].value = newVal2
at time currenttime meditmaterials[1].diffusemap.output.rgb_color_map.curve_2[2].value = newVal2
at time currenttime meditmaterials[1].diffusemap.output.rgb_color_map.curve_3[2].value = newVal2
)
)
I understand now. You must animate the point you want to address! What a silly thing- it seems so simple in retrospect. Thanks again for your help, it’s working wonderfully!
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.