本文介绍了在所有指定的网格上更改着色器,而不使用 hyperShade()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将所有形状分配给 baseMaterial,选择形状,然后分配 occlusionShader.

I get all shapes assigned to baseMaterial, select the shapes and then assign the occlusionShader.

for materialClass in materialClassList:
    select(materialClass.baseMaterial)
    hyperShade(objects="")
    hyperShade(a=materialClass.occlusionShader)

工作正常,但如果我将其用作预渲染脚本:

works just fine, but if I use it as a pre render script:

  Error: line 0: hyperShade command not supported in batch mode

我可以将函数的最后两行更改为什么来使其工作?

What can I change the two last lines of my function to to make this work?

推荐答案

我得到了它:

for materialClass in materialClassList:
    sets(materialClass.occlusionShadingGroup, e = True, forceElement = materialClass.meshList)

我现在在创建 materialClass 时收集网格,这比为每个渲染层选择它们更有意义.

I collect the meshes when I create the materialClass now, which makes much more sense then selecting them for each renderlayer.

这篇关于在所有指定的网格上更改着色器,而不使用 hyperShade()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 16:03