zoukankan      html  css  js  c++  java
  • MaxScript获取材质缩略图的方法

    看到有人需要,简单写了一下

    Fn GetMaterialSample inputMaterial inputWidth inputHeight =
    (
        result = undefined
        with redraw off
        with undo off
        (
            tempHiddenObject = for tempObject in Objects where not tempObject.ishidden collect tempObject
            Hide tempHiddenObject
            tempCamera = Freecamera fov:45 targetDistance:50 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off pos:[0,0,40]
            tempBackground = Plane pos:[0,0,-10] Length:150 Width:150 wireColor:gray
            tempSphere = Sphere pos:[0,0,0] rotation:(quat 0.707107 0 0 0.707107) wirecolor:gray radius:10 smooth:on segs:32 chop:0 slice:off sliceFrom:0 sliceTo:0 mapcoords:on recenter:off
            tempSphere.material = inputMaterial
            for tempLight in Lights where IsProperty tempLight #excludeList do 
            (
                tempLight.excludeList = Append tempLight.excludeList tempSphere
                tempLight.excludeList = Append tempLight.excludeList tempBackground
            )
            tempLight = Omnilight multiplier:1 pos:[20,20,40]
            tempLight2 = Omnilight multiplier:0.6 pos:[-15,-20,0]
            result = render camera:tempCamera outputsize:[inputWidth,inputHeight] vfb:false
            delete #(tempCamera,tempLight,tempLight2,tempSphere,tempBackground)
            UnHide tempHiddenObject
        )
        result
    )
    
    try(DestroyDialog TestRollout)catch()
    Rollout TestRollout ""
    (
        Bitmap MaterialSampleBitMap bitmap:(GetMaterialSample MeditMaterials[1] 100 100)
    )
    
    CreateDialog TestRollout
  • 相关阅读:
    Linux防火墙配置(iptables, firewalld)
    利用RMAN恢复整个数据库
    RMAN常用命令汇总!
    Oracle RMAN 恢复数据库到不同主机(二)
    Oracle RMAN 恢复数据库到不同主机(一)
    linux sar命令详解
    Linux定时任务Crontab命令详解
    Win7 U盘安装Ubuntu16.04 双系统详细教程
    linux定时任务crontab
    linux服务器端口netstat
  • 原文地址:https://www.cnblogs.com/sitt/p/2825292.html
Copyright © 2011-2022 走看看