Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Miscellany
Thursday, May 17th, 2012 at 4:49:36pm MDT 

  1. fn replacemat mold mnew=
  2. (
  3.         for o in $objects do
  4.         (       
  5.                 if (o.material==mold) then (o.material=mnew)
  6.                 if (classof(o.material)==multimaterial) then
  7.                 (
  8.                         for submatnum=1 to o.material.materiallist.count do
  9.                         (
  10.                                 if (o.material.materiallist[submatnum]==mold) then (o.material.materiallist[submatnum]=mnew)
  11.                         )
  12.                 )
  13.         )
  14. )
  15.  
  16. fn convertstandard2vray m=
  17. (
  18.         mnew=vraymtl()
  19.  
  20.         refcol            =255-(m.opacity*2.55)
  21.         mnew.Refraction     =color refcol refcol refcol
  22.  
  23.         mnew.diffuse                    =m.diffuse
  24.         mnew.refraction_ior                    =1.0
  25.  
  26.         mnew.texmap_diffuse                    =m.Diffusemap
  27.         mnew.texmap_reflection      =m.reflectionmap
  28.         mnew.texmap_hilightGlossiness   =m.glossinessMap
  29.         --mnew.texmap_reflectionGlossiness=m.glossinessMap
  30.         --mnew.texmap_reflectionIOR
  31.         --mnew.texmap_refraction                =m.opacityMap
  32.         --mnew.opacitymap.output.invert =true
  33.         --mnew.texmap_refractionGlossiness
  34.         --mnew.texmap_refractionIOR          =m.iorMap
  35.         mnew.texmap_bump                                =m.bumpmap
  36.         mnew.texmap_displacement                =m.displacementmap
  37.         mnew.texmap_opacity                    =m.opacitymap
  38.         --mnew.texmap_environment
  39.         --mnew.texmap_translucent
  40.        
  41.         if (classof(m.reflectionmap)==raytrace) OR (classof(m.reflectionmap)==mask) then
  42.         (
  43.                 refcol            =(m.reflectionmapAmount*2.55)
  44.                 mnew.Reflection    =color refcol refcol refcol
  45.                 mnew.texmap_reflection    =undefined
  46.         )
  47.        
  48.         if (classof(m.refractionmap)==raytrace) OR (classof(m.refractionmap)==mask) then
  49.         (
  50.                 refcol            =(m.refractionmapAmount*2.55)
  51.                 mnew.Refraction    =color refcol refcol refcol
  52.                 mnew.texmap_refraction    =undefined
  53.         )
  54.        
  55.         mnew.name                                          =m.name+"_vray"
  56.         mnew.showinviewport=m.showinviewport
  57.         print "converted "+mnew.name+" from standard"
  58.         return mnew
  59. )       
  60.  
  61. fn convertraytrace2vray m=
  62. (
  63.         mnew=vraymtl()
  64.  
  65.         refcol              =(m.reflect_amount*2.55)
  66.         mnew.Reflection     =color refcol refcol refcol
  67.         refcol              =(m.Transparency_Amount*2.55)
  68.         mnew.Refraction     =color refcol refcol refcol
  69.         mnew.diffuse                    =m.diffuse
  70.         mnew.refraction_ior                    =1.0
  71.        
  72.         mnew.texmap_diffuse                    =m.diffuseMap
  73.         mnew.texmap_reflection      =m.reflectionmap
  74.         mnew.texmap_hilightGlossiness   =m.glossinessMap
  75.         --mnew.texmap_reflectionGlossiness=m.glossinessMap
  76.         mnew.texmap_reflectionIOR              =m.iorMap
  77.         --mnew.texmap_refraction                        =m.opacityMap
  78.         --      mnew.opacitymap.output.invert=true
  79.         --mnew.texmap_refractionGlossiness
  80.         mnew.texmap_refractionIOR              =m.iorMap
  81.         if (classof(m.reflectionmap)==falloff) then
  82.         ( --falloff gaat fout. Hier fresnel activeren.
  83.                 mnew.texmap_reflection    =undefined
  84.                 mnew.Reflection    =color 255 255 255
  85.                 mnew.refraction_ior               =1.6
  86.                 mnew.reflection_fresnel  =on
  87.         )
  88.         mnew.texmap_bump                                =m.bumpmap
  89.         mnew.texmap_displacement                =m.displacementmap
  90.         mnew.texmap_opacity                    =m.transparencymap
  91.         if (mnew.texmap_opacity!=undefined) then (mnew.texmap_opacity.output.invert=true)
  92.         mnew.texmap_environment   =m.environmentmap
  93.         mnew.texmap_translucent   =m.translucencymap
  94.         mnew.name                                          =m.name+"_vray"
  95.         mnew.showinviewport                    =m.showinviewport
  96.         print "converted "+mnew.name+" from raytrace"
  97.         return mnew
  98. )
  99.        
  100. fn convertarchitectural2vray m=
  101. (
  102.         mnew=vraymtl()
  103.  
  104.         refcol              =(m.shininess*2.55)
  105.         mnew.Reflection     =color refcol refcol refcol
  106.         refcol              =(m.transparency*2.55)
  107.         mnew.Refraction     =color refcol refcol refcol
  108.         mnew.diffuse                    =m.diffuse
  109.         mnew.refraction_ior                    =m.ior
  110.        
  111.         mnew.texmap_diffuse                    =m.diffuseMap
  112.         mnew.texmap_reflection      =m.shininessMap
  113.         mnew.reflection_fresnel  =on
  114.  
  115.         mnew.texmap_opacity                    =m.filterMap
  116.         if (mnew.texmap_opacity!=undefined) then (mnew.texmap_opacity.output.invert=true)
  117.         mnew.texmap_translucent   =m.translucencymap
  118.         mnew.name                                          =m.name+"_vray"
  119.         mnew.showinviewport                    =m.showinviewport
  120.         print "converted "+mnew.name+" from architectural"
  121.         return mnew
  122. )       
  123.  
  124. fn selectmats lijst=
  125. (
  126.         for m in lijst do
  127.         (
  128.                 if (classof(m)==Architectural) then
  129.                 (
  130.                         print m.name
  131.                         mnew=convertarchitectural2vray(m)
  132.                         replacemat m mnew
  133.                 )
  134.                 if (classof(m)==RaytraceMaterial) then
  135.                 (
  136.                         print m.name
  137.                         mnew=convertraytrace2vray(m)
  138.                         replacemat m mnew
  139.                 )
  140.                 if (classof(m)==standardMaterial) then
  141.                 (
  142.                         print m.name
  143.                         mnew=convertstandard2vray(m)
  144.                         replacemat m mnew
  145.                 )
  146.                 if (classof(m)==multimaterial) then
  147.                 (
  148.                         selectmats m.materiallist
  149.                 )
  150.         )
  151. )       
  152.  
  153. 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.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.

worth-right
worth-right
fantasy-obligation
fantasy-obligation