Advertising
- Miscellany
- Thursday, May 17th, 2012 at 4:49:36pm MDT
- fn replacemat mold mnew=
- (
- for o in $objects do
- (
- if (o.material==mold) then (o.material=mnew)
- if (classof(o.material)==multimaterial) then
- (
- for submatnum=1 to o.material.materiallist.count do
- (
- if (o.material.materiallist[submatnum]==mold) then (o.material.materiallist[submatnum]=mnew)
- )
- )
- )
- )
- fn convertstandard2vray m=
- (
- mnew=vraymtl()
- refcol =255-(m.opacity*2.55)
- mnew.Refraction =color refcol refcol refcol
- mnew.diffuse =m.diffuse
- mnew.refraction_ior =1.0
- mnew.texmap_diffuse =m.Diffusemap
- mnew.texmap_reflection =m.reflectionmap
- mnew.texmap_hilightGlossiness =m.glossinessMap
- --mnew.texmap_reflectionGlossiness=m.glossinessMap
- --mnew.texmap_reflectionIOR
- --mnew.texmap_refraction =m.opacityMap
- --mnew.opacitymap.output.invert =true
- --mnew.texmap_refractionGlossiness
- --mnew.texmap_refractionIOR =m.iorMap
- mnew.texmap_bump =m.bumpmap
- mnew.texmap_displacement =m.displacementmap
- mnew.texmap_opacity =m.opacitymap
- --mnew.texmap_environment
- --mnew.texmap_translucent
- if (classof(m.reflectionmap)==raytrace) OR (classof(m.reflectionmap)==mask) then
- (
- refcol =(m.reflectionmapAmount*2.55)
- mnew.Reflection =color refcol refcol refcol
- mnew.texmap_reflection =undefined
- )
- if (classof(m.refractionmap)==raytrace) OR (classof(m.refractionmap)==mask) then
- (
- refcol =(m.refractionmapAmount*2.55)
- mnew.Refraction =color refcol refcol refcol
- mnew.texmap_refraction =undefined
- )
- mnew.name =m.name+"_vray"
- mnew.showinviewport=m.showinviewport
- print "converted "+mnew.name+" from standard"
- return mnew
- )
- fn convertraytrace2vray m=
- (
- mnew=vraymtl()
- refcol =(m.reflect_amount*2.55)
- mnew.Reflection =color refcol refcol refcol
- refcol =(m.Transparency_Amount*2.55)
- mnew.Refraction =color refcol refcol refcol
- mnew.diffuse =m.diffuse
- mnew.refraction_ior =1.0
- mnew.texmap_diffuse =m.diffuseMap
- mnew.texmap_reflection =m.reflectionmap
- mnew.texmap_hilightGlossiness =m.glossinessMap
- --mnew.texmap_reflectionGlossiness=m.glossinessMap
- mnew.texmap_reflectionIOR =m.iorMap
- --mnew.texmap_refraction =m.opacityMap
- -- mnew.opacitymap.output.invert=true
- --mnew.texmap_refractionGlossiness
- mnew.texmap_refractionIOR =m.iorMap
- if (classof(m.reflectionmap)==falloff) then
- ( --falloff gaat fout. Hier fresnel activeren.
- mnew.texmap_reflection =undefined
- mnew.Reflection =color 255 255 255
- mnew.refraction_ior =1.6
- mnew.reflection_fresnel =on
- )
- mnew.texmap_bump =m.bumpmap
- mnew.texmap_displacement =m.displacementmap
- mnew.texmap_opacity =m.transparencymap
- if (mnew.texmap_opacity!=undefined) then (mnew.texmap_opacity.output.invert=true)
- mnew.texmap_environment =m.environmentmap
- mnew.texmap_translucent =m.translucencymap
- mnew.name =m.name+"_vray"
- mnew.showinviewport =m.showinviewport
- print "converted "+mnew.name+" from raytrace"
- return mnew
- )
- fn convertarchitectural2vray m=
- (
- mnew=vraymtl()
- refcol =(m.shininess*2.55)
- mnew.Reflection =color refcol refcol refcol
- refcol =(m.transparency*2.55)
- mnew.Refraction =color refcol refcol refcol
- mnew.diffuse =m.diffuse
- mnew.refraction_ior =m.ior
- mnew.texmap_diffuse =m.diffuseMap
- mnew.texmap_reflection =m.shininessMap
- mnew.reflection_fresnel =on
- mnew.texmap_opacity =m.filterMap
- if (mnew.texmap_opacity!=undefined) then (mnew.texmap_opacity.output.invert=true)
- mnew.texmap_translucent =m.translucencymap
- mnew.name =m.name+"_vray"
- mnew.showinviewport =m.showinviewport
- print "converted "+mnew.name+" from architectural"
- return mnew
- )
- fn selectmats lijst=
- (
- for m in lijst do
- (
- if (classof(m)==Architectural) then
- (
- print m.name
- mnew=convertarchitectural2vray(m)
- replacemat m mnew
- )
- if (classof(m)==RaytraceMaterial) then
- (
- print m.name
- mnew=convertraytrace2vray(m)
- replacemat m mnew
- )
- if (classof(m)==standardMaterial) then
- (
- print m.name
- mnew=convertstandard2vray(m)
- replacemat m mnew
- )
- if (classof(m)==multimaterial) then
- (
- selectmats m.materiallist
- )
- )
- )
- selectmats(scenematerials)
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.