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

 

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

 

 

 

相关文章:

  • 2021-10-19
  • 2021-12-31
  • 2021-04-08
  • 2021-06-18
  • 2021-06-22
  • 2021-09-01
  • 2021-08-24
  • 2021-11-19
猜你喜欢
  • 2021-10-19
  • 2021-12-28
  • 2021-12-07
  • 2021-11-27
  • 2021-12-07
  • 2021-11-17
  • 2021-11-07
  • 2021-12-28
相关资源
相似解决方案