fix bug of Arnold: missing either uvlist or uvidxs
来源:互联网 发布:js快速排序 编辑:程序博客网 时间:2024/06/05 11:48
背景
在使用Arnold渲染的时候,有时无论给渲染的物体上任何材质都会发绿色的光。在输出窗口上会输出missing either uvlist or uvidxs的字样。这种情况下,只能通过给物体重新分UV才能解决。
但是在生产过程中,到渲染环节的时候,物体贴图是已经画好的。这时候如果要重新分UV就需要跟原UV的结构一致,并且大小和范围也要吻合才好。这就大大增加了艺术家的工作量。
问题分析
分析ass格式
因为arnold的渲染过程是先把maya输出数据转换成ass文件格式,再导入渲染器中渲染。所以我们把问题物体输出成ass文件,然后比对正常物体的数据和问题物体的数据。通过比对发现确实是缺少uvlist的数据项,要修复这个问题可能需要重写输出ass文件。这样的话工作量有点大,那么就需要更深入了解问题具体出在哪里。
分析其他格式
把物体导出成ma格式,发现正常物体的数据与问题物体的数据在格式上并无任何差别。那么就说明物体本身是不缺数据的。通过abc导出再导入,最后还是提示因为缺少uvlist而渲染不出来。说明这个bug仅仅发生在物体转换到ass的过程中,那么就需要知道arnold是如何查找uvlist和转换uvlist数据的。
uvlist转换过程
arnold因为源代码不开放,数据转换过程没有任何提示,对于用户来说是一个黑匣子。我们要了解它的数据导出方法就相当于对黑匣子进行分析。是否能够分析得精准就在于手上的工具是否完备,知识是否充足。首先我们需要知道uvlist是什么?其他同类渲染器是如何获取uvlist的?具体过程我就不表了,就直接把获取模型映射的uvlist写出来了:ls(‘userShape.map[*]’, fl = 1)。
确定问题
利用[getAttr(x) for x in ls(‘userShape.map[*]’, fl = 1)]来获取数据,再根据对数据进行区域分析和排查,结果发现问题出现在某几个点的UV。这几个点的UV值都异常大,只要把它们修复到0-1范围内即可正常。
解决问题
于是我们很容易就写出如下代码:
for uv in [x for x in ls('userShape.map[*]', fl = 1) if len([y for y in getAttr(x) if y > 100 or y < 100]) > 0]: setAttr(uv, (0, 0))
利用上述代码我们就可以把缺少uvlist的问题解决了。
注:上述代码中的userShape改成对应的shape节点名称即可。
- fix bug of Arnold: missing either uvlist or uvidxs
- Fix Bug of mux_redux in ssh-rd
- Which one is waste, feature development or bug fix
- fix bug
- fix bug
- crosstool-ng 编译出错Missing: 'i686-pc-linux-gnu-gcj'or 'i686-pc-linux-gnu-gcj' or 'gcj' : either needed
- Fix bug in the notepad tutorial of Android
- apt-get --fix-missing
- [ERROR] [FATAL] InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELET ...... 5.7的bug
- Redis无法启动You may fix this problem by either reducing the size of the Redis heap with the --maxheap
- C++ debugger package is missing or incompatible - do you want to fix it?
- 解决Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
- 解决Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
- 解决Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
- SSISThe Address in the "To" line is malformed. It is either missing the "@" symbol or is not valid.
- The server has either erred or is incapable of performing the requested operation. (HTTP 500)
- Failed to connect to database. This release of the GeoDatabase is either invalid or out of date
- bug fix进行中
- 第四周——基于对象的程序设计——项目一(2)三角形类
- android 预置apk so库等
- 黑马程序员---java基础--GUI
- 程序退出时的必要处理之atexit()函数
- Ilkka Paananen谈Supercell的全球性战略
- fix bug of Arnold: missing either uvlist or uvidxs
- jQuery超酷3D翻牌式倒计数特效
- 第四周上机项目1.2三角形类的构造函数
- Understanding Workflow(From SalesForce)
- 【原创|小白教程】Git SSH Key 生成步骤...
- 第四周——基于对象的程序设计——项目一(3)三角形类
- eclipse tomat 报 sprint-servlet.xml 路径保存在
- 内存地址空间
- 第四周 课后实践:阅读程序