提取 Blender 原始坐标 (ORCO)
我已经制作了一个从 Blender (2.5+) 到自定义格式的导出器(用 Python)。令我困扰的是,我下载的大多数模型不包含 UV 层,而是使用自动生成的纹理坐标。
问题是:如何从 Python 访问 Blender 生成的坐标 (ORCO)?
编辑2:示例文件: http://dl.dropbox.com/u/16317117/orco.blend
通过加载带有立方体的默认场景并将其纹理单元类型更改为“木材”来创建。默认映射已生成:平坦。如果渲染场景,您可以看到木材纹理已正确应用,就好像立方体进行了正确的 UV 展开一样。
编辑3:答案。
我在 Yafaray 搅拌机出口商来源中找到了答案。谢谢你们,伙计们!如果您看到此帖子 - 请回复,以便我可以奖励您。
生成坐标 (ORCO) 是顶点的“标准化”局部坐标。基本上,给定对象的局部边界框:Orco(v) = 2*(v-center)/size
。
I've made an exporter (in Python) from Blender (2.5+) to a custom format. What bothers me is that most models I download contain no UV layers but instead are using auto-generated texture coordinates.
The question is: how can I access Blender-generated coordinates (ORCO) from Python?
Edit-2: Example file:
http://dl.dropbox.com/u/16317117/orco.blend
Created by loading the default scene with a cube and changing its texture unit type to 'Wood'. The default mapping is already Generated:Flat. If you render the scene, you can see that wood texture is applied correctly, as if the cube had a proper UV unwrap.
Edit-3: The Answer.
I've found an answer in the Yafaray blender exporter source. Thank you, guys! If you see this thread - please, respond, so that I can award you a bounty.
Generated coordinate (ORCO) is a 'normalized' local coordinate of the vertex. Basically, given the local bounding box of the object: Orco(v) = 2*(v-center)/size
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
生成坐标 (ORCO) 是顶点的“标准化”局部坐标。基本上,给定对象的局部边界框:Orco(v) = 2*(v-center)/size。
Generated coordinate (ORCO) is a 'normalized' local coordinate of the vertex. Basically, given the local bounding box of the object: Orco(v) = 2*(v-center)/size.