Maya,Python,Vray灯没有出现光链接

时间:2022-09-10 19:54:40

In maya, when creating a Vray rectangle light with Python, I am using the Maya createNode(type = "VRayLightRectShape") command. I am able to create the light, but it does not show up in the defaultLightSet group, I have to manually join it to the group, and even then, the light is not seen by any relationship editors such as the light linking editor. If I create another light, using the Maya GUI, then both my script created light and the new light will appear in the editors, but upon deleting the GUI created light, my script created light will also disappear from the light linking relationship editor. I am using Maya 2015. Am I missing a connection somewhere in the creation process? Thanks for the help.

在maya中,当使用Python创建Vray矩形灯时,我使用的是Maya createNode(type =“VRayLightRectShape”)命令。我能够创建灯光,但它不会显示在defaultLightSet组中,我必须手动将它连接到组,即使这样,任何关系编辑器(如光链接编辑器)都看不到灯光。如果我使用Maya GUI创建另一个灯光,那么我的脚本都会创建灯光并且新灯光将出现在编辑器中,但是在删除GUI创建灯光时,我的脚本创建灯光也将从灯光链接关系编辑器中消失。我正在使用Maya 2015.我在创建过程中某处错过了连接吗?谢谢您的帮助。

1 个解决方案

#1


0  

I think you want to use the command :

我想你想使用这个命令:

cmds.shadingNode('VRayLightRectShape', asLight=True)

I don't have VRay so I can't test it but it should work.

我没有VRay,所以我无法测试它,但它应该工作。

#1


0  

I think you want to use the command :

我想你想使用这个命令:

cmds.shadingNode('VRayLightRectShape', asLight=True)

I don't have VRay so I can't test it but it should work.

我没有VRay,所以我无法测试它,但它应该工作。