[Closed] MR renderer Properties
Hi I am writing a lil script to help import in zbrush displacement maps and I ran into a small prob.
I am trying to access the the edge length and the max displacement properties but everytime I evaluate mental_ray_renderer.Edge_length or mental_ray_renderer.Max_displace I get
– Unknown property: “Edge_Length” in mental_ray_renderer
– Unknown property: “Max_Displace” in mental_ray_renderer
I cant quite figure out what I am doing wrong. I have been able to get the other properties but I cant seem to get this figured out. If somebody could point me in the right direction I would be very thankfull.
Probably you are trying to access to those properties directly through the mental_ray_renderer structure. The correct way shoud be:
renderers.current.Edge_Length
renderers.current.Max_Displace
This should work if the current renderer is Mental Ray:
if classOf renderers.current == mental_ray_renderer do (
-- Yeah, the current renderer is Mental Ray!
)
Greets.
I almost have this script done but I have run into a small prob. I am trying to change the “.coord.V-tiling” value for the a mental ray custom attribute. This is the line the macro recorder gives me when I change it.
meditMaterials[1].mental_ray__material_custom_attribute[#Displacement][#map].coords.V_Tiling = -1.0
When I try to change the value by evaluating this line I get
“– Unknown property: “coords” in undefined”.
I cant find the property name for this. I was able to find it on the regular displacement but not for the mentalray custom attribute. I was looking in the maxscript help but I cant find it for the life of me.
I appreciate any help that anybody could give me on this.
yeah I tried that one and I got
– Unknown property: “coords” in Map #1:3D Displacement (3dsmax)
I am not sure if I can change coords on mental_ray_custom_attributes.displacement
I had no probs with regular displacement but this one is not working.
Ok, you applied a “3D Displacement” to the displacement map. And this kind of map doesn’t have a property called “coords”. That property is for 2D maps.
So what if you want is access to the coords property for the “Extrusion Map” (being this a 2D map), it should be:
mEditMaterials[1].displacement.map.coords.v_tiling
Anyway, you can use the function show to list the properties for MAX objects. For example:
show mEditMaterials[1].displacement
will output:
.objectIndependent ((null)) : boolean
.fullDisplaceLength ((null)) : worldUnits
.mapAmount ((null)) : float
.map ((null)) : texturemap
.directionStrength ((null)) : float
.direction ((null)) : texturemap
.mapAmount.connected ((null)) : boolean
.mapAmount.shader ((null)) : texturemap
.mapAmount.paramName ((null)) : string
.directionStrength.connected ((null)) : boolean
.directionStrength.shader ((null)) : texturemap
.directionStrength.paramName ((null)) : string
.TheList ((null)) : maxObject array
.Shader Version ((null)) : integer
and then:
show mEditMaterials[1].displacement.map
will output:
.soften : float
.color1 (Color_1) : RGB color
.color2 (Color_2) : RGB color
.map1 (Map_1) : texturemap
.map2 (Map_2) : texturemap
.map1Enabled (Map_1_Enable) : boolean
.map2Enabled (Map_2_Enable) : boolean
.coords (Coordinates) : maxObject
and so on…
The show function is very valuable.
Hope that helps.
That got it. I appreciate you showing me how to find it so that in the future I am more self sufficient
I am also going to credit you for the help since I would not have been able to finish this thing with out your help